refactor tester bin, configurable client id, sdcard root

This commit is contained in:
Evan Feenstra
2022-09-27 12:49:41 -07:00
parent 0002374a7f
commit 7c886b0f15
5 changed files with 127 additions and 106 deletions

View File

@@ -53,6 +53,7 @@ pub struct ChannelReply {
pub reply: Vec<u8>,
}
const CLIENT_ID: &str = "sphinx-1";
const BROKER_CONFIG_PATH: &str = "../broker.conf";
#[rocket::launch]
@@ -97,7 +98,7 @@ async fn run_main(parent_fd: i32) -> rocket::Rocket<rocket::Build> {
let (status_tx, mut status_rx) = mpsc::channel(1000);
let (error_tx, _) = broadcast::channel(1000);
log::info!("=> start broker on network: {}", settings.network);
start_broker(rx, status_tx, error_tx.clone(), "sphinx-1", &settings).await;
start_broker(rx, status_tx, error_tx.clone(),CLIENT_ID, &settings).await;
log::info!("=> wait for connected status");
// wait for connection = true
let status = status_rx.recv().await.expect("couldnt receive");