update hardware signer for new topics

This commit is contained in:
Evan Feenstra
2023-06-22 12:28:40 -07:00
parent 3cf8c8f22b
commit c9f5876d6b
3 changed files with 10 additions and 3 deletions

View File

@@ -112,7 +112,9 @@ pub fn make_client(
if topic.ends_with(topics::VLS) {
tx.send(CoreEvent::VlsMessage(data))
.expect("couldnt send Event::VlsMessage");
} else if topic.ends_with(topics::LSS_MSG) {
} else if topic.ends_with(topics::LSS_MSG)
|| topic.ends_with(topics::INIT_MSG)
{
log::debug!("received data len {}", data.len());
tx.send(CoreEvent::LssMessage(data))
.expect("couldnt send Event::LssMessage");

View File

@@ -35,7 +35,12 @@ pub enum Event {
pub const ROOT_STORE: &str = "/sdcard/store";
pub const SUB_TOPICS: &[&str] = &[topics::VLS, topics::LSS_MSG, topics::CONTROL];
pub const SUB_TOPICS: &[&str] = &[
topics::INIT_MSG,
topics::LSS_MSG,
topics::VLS,
topics::CONTROL,
];
fn mqtt_sub(
mqtt: &mut EspMqttClient<ConnState<MessageImpl, EspError>>,

View File

@@ -26,7 +26,7 @@ pub fn init_lss(
let server_pubkey = PublicKey::from_slice(&init.server_pubkey)?;
let (lss_signer, res1) = LssSigner::new(&handler_builder, &server_pubkey);
let lss_res_topic = format!("{}/{}", client_id, topics::LSS_RES);
let lss_res_topic = format!("{}/{}", client_id, topics::INIT_RES);
mqtt.publish(&lss_res_topic, QOS, false, &res1)
.expect("could not publish LSS response");