diff --git a/src/bc/xml.rs b/src/bc/xml.rs index fc58068..5f34261 100644 --- a/src/bc/xml.rs +++ b/src/bc/xml.rs @@ -53,6 +53,15 @@ impl BcXml { } } +impl Extension { + pub fn try_parse(s: impl Read) -> Result { + yaserde::de::from_reader(s) + } + pub fn serialize(&self, w: W) -> Result { + yaserde::ser::serialize_with_writer(self, w, &Config::default()) + } +} + #[derive(PartialEq, Eq, Default, Debug, YaDeserialize, YaSerialize)] pub struct Encryption { #[yaserde(attribute)] @@ -123,7 +132,12 @@ pub struct Extension { #[yaserde(attribute)] pub version: String, #[yaserde(rename = "binaryData")] - pub binary_data: u32, + pub binary_data: Option, + #[yaserde(rename = "userName")] + pub user_name: Option, + pub token: Option, + #[yaserde(rename = "channelId")] + pub channel_id: Option, } #[derive(PartialEq, Eq, Default, Debug, YaDeserialize, YaSerialize)] diff --git a/src/bc_protocol.rs b/src/bc_protocol.rs index d33c4e9..c945d72 100644 --- a/src/bc_protocol.rs +++ b/src/bc_protocol.rs @@ -147,7 +147,7 @@ impl BcCamera { Some(BcPayloads::BcXml(BcXml { encryption: Some(encryption), .. - }), + })), .. }) => { nonce = encryption.nonce; @@ -207,7 +207,7 @@ impl BcCamera { Some(BcPayloads::BcXml(BcXml { device_info: Some(info), .. - }), + })), .. }) => { // Login succeeded! diff --git a/src/bc_protocol/time.rs b/src/bc_protocol/time.rs index f4f43c2..61d5548 100644 --- a/src/bc_protocol/time.rs +++ b/src/bc_protocol/time.rs @@ -42,7 +42,7 @@ impl BcCamera { .. }), .. - }), + })), .. }) = msg.body {