From 8656bb04b19d86aec0972b492549e634c7f24901 Mon Sep 17 00:00:00 2001 From: abrehman94 <138540640+abrehman94@users.noreply.github.com> Date: Mon, 9 Sep 2024 05:00:39 -0400 Subject: [PATCH] [Bug-Fix][Data Deserialization] (#1) * bitmap is a vec * field is a vec * some fields numeric types were incorrect Co-authored-by: Abdul Rehman --- src/dataformats/mod.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/dataformats/mod.rs b/src/dataformats/mod.rs index 4a003d3..3f89351 100644 --- a/src/dataformats/mod.rs +++ b/src/dataformats/mod.rs @@ -7,8 +7,8 @@ pub struct Range { #[serde(rename = "@Order")] order: i8, - bit_count: i8, - bit_offset: i8, + bit_count: i16, + bit_offset: u8, } #[derive(Debug, PartialEq, Deserialize)] @@ -35,7 +35,13 @@ pub struct BitMap { #[serde(rename = "@Order")] order: Option, - field: Option, + field: Option>, +} + +#[derive(Debug, PartialEq, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct DataAttributes { + pub bit_map: Vec } #[derive(Debug, PartialEq, Deserialize)] @@ -46,7 +52,7 @@ pub struct DataFormat { pub data_type: String, pub bit_count: i16, pub component_count: i8, - pub data_attributes: BitMap, + pub data_attributes: DataAttributes, } #[derive(Debug, PartialEq, Deserialize)]