Skip to content

Commit fefee7e

Browse files
Default TCP/IP Host+Port[CPP-581] (#382)
1 parent 4e234a0 commit fefee7e

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

console_backend/src/constants.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ pub(crate) const BASELINE_TIME_STR_FILEPATH: &str = "baseline_log_%Y%m%d-%H%M%S.
2020
pub(crate) const SBP_FILEPATH: &str = "swift-gnss-%Y%m%d-%H%M%S.sbp";
2121
pub(crate) const SBP_JSON_FILEPATH: &str = "swift-gnss-%Y%m%d-%H%M%S.sbp.json";
2222
pub(crate) const DEFAULT_LOG_DIRECTORY: &str = "SwiftNav";
23+
pub(crate) const DEFAULT_IP_ADDRESS: &str = "192.168.0.222";
24+
pub(crate) const DEFAULT_PORT: u16 = 55555;
2325

2426
// Common constants.
2527
pub(crate) const NUM_POINTS: usize = 200;

console_backend/src/shared_state.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use serialport::FlowControl;
2424

2525
use crate::constants::{
2626
APPLICATION_NAME, APPLICATION_ORGANIZATION, APPLICATION_QUALIFIER, CONNECTION_HISTORY_FILENAME,
27-
DEFAULT_LOG_DIRECTORY, MAX_CONNECTION_HISTORY, MPS,
27+
DEFAULT_IP_ADDRESS, DEFAULT_LOG_DIRECTORY, DEFAULT_PORT, MAX_CONNECTION_HISTORY, MPS,
2828
};
2929
use crate::errors::CONVERT_TO_STR_FAILURE;
3030
use crate::log_panel::LogLevel;
@@ -758,8 +758,13 @@ impl ConnectionHistory {
758758
if let Ok(default_path) = LOG_DIRECTORY.path().into_os_string().into_string() {
759759
folders.insert(default_path);
760760
}
761+
let mut addresses = IndexSet::new();
762+
addresses.insert(Address {
763+
host: DEFAULT_IP_ADDRESS.to_string(),
764+
port: DEFAULT_PORT,
765+
});
761766
ConnectionHistory {
762-
addresses: IndexSet::new(),
767+
addresses,
763768
files: IndexSet::new(),
764769
folders,
765770
serial_configs: IndexMap::new(),
@@ -961,9 +966,9 @@ mod tests {
961966
backup_file(bfilename.clone());
962967

963968
let mut conn_history = ConnectionHistory::new();
964-
let host1 = String::from("host1");
969+
let host1 = String::from(DEFAULT_IP_ADDRESS);
965970
let host2 = String::from("host2");
966-
let port = 100;
971+
let port = DEFAULT_PORT;
967972

968973
conn_history.record_address(host1.clone(), port);
969974
let addresses = conn_history.addresses();

swiftnav_console/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154

155155
CONSOLE_BACKEND_CAPNP_PATH = "console_backend.capnp"
156156

157-
PIKSI_HOST = "piksi-relay-bb9f2b10e53143f4a816a11884e679cf.ce.swiftnav.com"
157+
PIKSI_HOST = "192.168.0.222"
158158
PIKSI_PORT = 55555
159159

160160

0 commit comments

Comments
 (0)