From 446387a3a0fd05f4be40ce7f0675069c824eb1db Mon Sep 17 00:00:00 2001 From: QuantumEntangledAndy Date: Mon, 23 Oct 2023 08:58:06 +0700 Subject: [PATCH] Fix action parsing --- crates/core/src/bc/xml.rs | 1 + dissector/baichuan.lua | 2 ++ dissector/messages.md | 25 +++++++++++++++++++++++++ src/pir/cmdline.rs | 2 +- src/statusled/cmdline.rs | 2 +- 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/crates/core/src/bc/xml.rs b/crates/core/src/bc/xml.rs index a8655c2..c4144ca 100644 --- a/crates/core/src/bc/xml.rs +++ b/crates/core/src/bc/xml.rs @@ -109,6 +109,7 @@ pub struct BcXml { /// Thre list of streams and their configuration #[yaserde(rename = "Uid")] pub uid: Option, + /// The floodlight settings for automatically turning on/off on schedule/motion #[yaserde(rename = "FloodlightTask")] pub floodlight_task: Option, } diff --git a/dissector/baichuan.lua b/dissector/baichuan.lua index edac8b9..7409f3b 100644 --- a/dissector/baichuan.lua +++ b/dissector/baichuan.lua @@ -188,6 +188,8 @@ local message_types = { [272]="", [273]="", [274]="", + [299]="", + [299]="", [319]="", [342]="", } diff --git a/dissector/messages.md b/dissector/messages.md index 1789c25..4ca9243 100644 --- a/dissector/messages.md +++ b/dissector/messages.md @@ -2831,6 +2831,31 @@ Message have zero to two payloads. ``` +- 299: `` (read) + + - Client: Standard payload with extension xml of the channel + + - Camera + + - Payload + + ```xml + + + + 0 + 0 + 2 + 14 + people,vehicle,dog_cat + people + 1 + 20 + 10 + + + ``` + - 438: `` (read) - Camera diff --git a/src/pir/cmdline.rs b/src/pir/cmdline.rs index 508b606..6bc32ef 100644 --- a/src/pir/cmdline.rs +++ b/src/pir/cmdline.rs @@ -18,6 +18,6 @@ pub struct Opt { /// The name of the camera. Must be a name in the config pub camera: String, /// Whether to turn the PIR ON or OFF - #[arg(value_parser = onoff_parse, name = "on|off")] + #[arg(value_parser = onoff_parse, action = clap::ArgAction::Set, name = "on|off")] pub on: Option, } diff --git a/src/statusled/cmdline.rs b/src/statusled/cmdline.rs index aca3606..09df843 100644 --- a/src/statusled/cmdline.rs +++ b/src/statusled/cmdline.rs @@ -18,6 +18,6 @@ pub struct Opt { /// The name of the camera to change the lights of. Must be a name in the config pub camera: String, /// Whether to turn the light on or off - #[arg(value_parser = onoff_parse, name = "on|off")] + #[arg(value_parser = onoff_parse, action = clap::ArgAction::Set, name = "on|off")] pub on: bool, }