From 9ace435f5f894b0216d62bf8caac7f8827975768 Mon Sep 17 00:00:00 2001 From: Kevin David Date: Sun, 21 Jul 2024 15:49:41 -0400 Subject: [PATCH] Make `resolution` optional in `DeviceInfo` `resolution` is not specified for devices without cameras (i.e. the floodlight). Without this change, an error like ``` [2024-07-21T19:26:18Z ERROR neolink_core::bc::de] e: Custom("missing field `resolution`") [2024-07-21T19:26:18Z WARN neolink::common::camthread] backyard_floodlight: Connection Lost: Nom Parsing error: Nom Error: VerboseError { errors: [([], Nom(MapRes)), ([], Context("Unable to parse Payload XML"))] } ``` occurs on startup/connection. --- crates/core/src/bc/xml.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/core/src/bc/xml.rs b/crates/core/src/bc/xml.rs index 73aae6b..762b8d6 100644 --- a/crates/core/src/bc/xml.rs +++ b/crates/core/src/bc/xml.rs @@ -228,7 +228,8 @@ pub struct DeviceInfo { #[serde(rename = "@version")] pub version: Option, /// The resolution xml block - pub resolution: Resolution, + /// Does not exist for floodlights + pub resolution: Option, } /// VersionInfo xml