From 677c8e7e1b0f5fed95c76ef756dda37fdc660d33 Mon Sep 17 00:00:00 2001 From: "Robert L. Bocchino Jr" Date: Tue, 5 Mar 2024 11:09:13 -0800 Subject: [PATCH 1/3] Fix dp array record size Use FwStoreType to store the size --- FppTest/dp/test/ut/Tester.cpp | 12 ++++++------ Fw/Dp/docs/sdd.md | 2 +- requirements.txt | 22 +++++++++++----------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/FppTest/dp/test/ut/Tester.cpp b/FppTest/dp/test/ut/Tester.cpp index 5cdeb609bf..9973b8ff02 100644 --- a/FppTest/dp/test/ut/Tester.cpp +++ b/FppTest/dp/test/ut/Tester.cpp @@ -129,7 +129,7 @@ void Tester::productRecvIn_Container2_FAILURE() { void Tester::productRecvIn_Container3_SUCCESS() { Fw::Buffer buffer; FwSizeType expectedNumElts; - const FwSizeType dataEltSize = sizeof(FwSizeType) + this->u8ArrayRecordData.size(); + const FwSizeType dataEltSize = sizeof(FwSizeStoreType) + this->u8ArrayRecordData.size(); // Invoke the port and check the header this->productRecvIn_InvokeAndCheckHeader(DpTest::ContainerId::Container3, dataEltSize, DpTest::ContainerPriority::Container3, this->container3Buffer, buffer, @@ -145,7 +145,7 @@ void Tester::productRecvIn_Container3_SUCCESS() { const FwDpIdType expectedId = this->component.getIdBase() + DpTest::RecordId::U8ArrayRecord; ASSERT_EQ(id, expectedId); FwSizeType size; - status = serialRepr.deserialize(size); + status = serialRepr.deserializeSize(size); ASSERT_EQ(status, Fw::FW_SERIALIZE_OK); ASSERT_EQ(size, this->u8ArrayRecordData.size()); const U8* const buffAddr = serialRepr.getBuffAddr(); @@ -165,7 +165,7 @@ void Tester::productRecvIn_Container3_FAILURE() { void Tester::productRecvIn_Container4_SUCCESS() { Fw::Buffer buffer; FwSizeType expectedNumElts; - const FwSizeType dataEltSize = sizeof(FwSizeType) + this->u32ArrayRecordData.size() * sizeof(U32); + const FwSizeType dataEltSize = sizeof(FwSizeStoreType) + this->u32ArrayRecordData.size() * sizeof(U32); // Invoke the port and check the header this->productRecvIn_InvokeAndCheckHeader(DpTest::ContainerId::Container4, dataEltSize, DpTest::ContainerPriority::Container4, this->container4Buffer, buffer, @@ -181,7 +181,7 @@ void Tester::productRecvIn_Container4_SUCCESS() { const FwDpIdType expectedId = this->component.getIdBase() + DpTest::RecordId::U32ArrayRecord; ASSERT_EQ(id, expectedId); FwSizeType size; - status = serialRepr.deserialize(size); + status = serialRepr.deserializeSize(size); ASSERT_EQ(status, Fw::FW_SERIALIZE_OK); ASSERT_EQ(size, this->u32ArrayRecordData.size()); const U8* const buffAddr = serialRepr.getBuffAddr(); @@ -201,7 +201,7 @@ void Tester::productRecvIn_Container4_FAILURE() { void Tester::productRecvIn_Container5_SUCCESS() { Fw::Buffer buffer; FwSizeType expectedNumElts; - const FwSizeType dataEltSize = sizeof(FwSizeType) + this->dataArrayRecordData.size() * DpTest_Data::SERIALIZED_SIZE; + const FwSizeType dataEltSize = sizeof(FwSizeStoreType) + this->dataArrayRecordData.size() * DpTest_Data::SERIALIZED_SIZE; // Invoke the port and check the header this->productRecvIn_InvokeAndCheckHeader(DpTest::ContainerId::Container5, dataEltSize, DpTest::ContainerPriority::Container5, this->container5Buffer, buffer, @@ -217,7 +217,7 @@ void Tester::productRecvIn_Container5_SUCCESS() { const FwDpIdType expectedId = this->component.getIdBase() + DpTest::RecordId::DataArrayRecord; ASSERT_EQ(id, expectedId); FwSizeType size; - status = serialRepr.deserialize(size); + status = serialRepr.deserializeSize(size); ASSERT_EQ(status, Fw::FW_SERIALIZE_OK); ASSERT_EQ(size, this->dataArrayRecordData.size()); const U8* const buffAddr = serialRepr.getBuffAddr(); diff --git a/Fw/Dp/docs/sdd.md b/Fw/Dp/docs/sdd.md index 2ad6cdfdc7..75cf5fb14c 100644 --- a/Fw/Dp/docs/sdd.md +++ b/Fw/Dp/docs/sdd.md @@ -110,7 +110,7 @@ Array records with _type = T_ have the following format: |Field Name|Data Type|Serialized Size|Description| |----------|---------|---------------|-----------| |`Id`|`FwDpIdType`|`sizeof(FwDpIdType)`|The record ID| -|`Size`|`FwSizeType`|`sizeof(FwSizeType)`|The number _n_ of elements in the record| +|`Size`|`FwSizeType`|`sizeof(FwSizeStoreType)`|The number _n_ of elements in the record| |`Data`|Array of _n_ _T_|_n_ * [`sizeof(`_T_`)` if _T_ is a primitive type; otherwise _T_`::SERIALIZED_SIZE`]|_n_ elements, each of type _T_| _TODO: The array size should be serialized as `FwSizeStoreType`. diff --git a/requirements.txt b/requirements.txt index 7efca76fcd..ab6b2257cd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,17 +18,17 @@ fprime-fpl-convert-xml==1.0.3 fprime-fpl-extract-xml==1.0.3 fprime-fpl-layout==1.0.3 fprime-fpl-write-pic==1.0.3 -fprime-fpp-check==2.1.0a4 -fprime-fpp-depend==2.1.0a4 -fprime-fpp-filenames==2.1.0a4 -fprime-fpp-format==2.1.0a4 -fprime-fpp-from-xml==2.1.0a4 -fprime-fpp-locate-defs==2.1.0a4 -fprime-fpp-locate-uses==2.1.0a4 -fprime-fpp-syntax==2.1.0a4 -fprime-fpp-to-cpp==2.1.0a4 -fprime-fpp-to-json==2.1.0a4 -fprime-fpp-to-xml==2.1.0a4 +fprime-fpp-check==2.1.0a4-1-ga1011e18 +fprime-fpp-depend==2.1.0a4-1-ga1011e18 +fprime-fpp-filenames==2.1.0a4-1-ga1011e18 +fprime-fpp-format==2.1.0a4-1-ga1011e18 +fprime-fpp-from-xml==2.1.0a4-1-ga1011e18 +fprime-fpp-locate-defs==2.1.0a4-1-ga1011e18 +fprime-fpp-locate-uses==2.1.0a4-1-ga1011e18 +fprime-fpp-syntax==2.1.0a4-1-ga1011e18 +fprime-fpp-to-cpp==2.1.0a4-1-ga1011e18 +fprime-fpp-to-json==2.1.0a4-1-ga1011e18 +fprime-fpp-to-xml==2.1.0a4-1-ga1011e18 fprime-gds==3.4.3 fprime-tools==3.4.4 fprime-visual==1.0.2 From c4147c195ea3f0ca769defd7e6287107f38d84a3 Mon Sep 17 00:00:00 2001 From: "Robert L. Bocchino Jr" Date: Tue, 5 Mar 2024 13:52:33 -0800 Subject: [PATCH 2/3] Remove todo comment --- Fw/Dp/docs/sdd.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Fw/Dp/docs/sdd.md b/Fw/Dp/docs/sdd.md index 75cf5fb14c..cb596f0e56 100644 --- a/Fw/Dp/docs/sdd.md +++ b/Fw/Dp/docs/sdd.md @@ -113,10 +113,6 @@ Array records with _type = T_ have the following format: |`Size`|`FwSizeType`|`sizeof(FwSizeStoreType)`|The number _n_ of elements in the record| |`Data`|Array of _n_ _T_|_n_ * [`sizeof(`_T_`)` if _T_ is a primitive type; otherwise _T_`::SERIALIZED_SIZE`]|_n_ elements, each of type _T_| -_TODO: The array size should be serialized as `FwSizeStoreType`. -This requires a change to the FPP code generation. -See https://github.com/fprime-community/fpp/issues/393._ - #### 5.1.4. Data Hash The data hash has the following format. From 2f9cf601c5147a84490764c014b64fb1498e7e21 Mon Sep 17 00:00:00 2001 From: "Robert L. Bocchino Jr" Date: Wed, 6 Mar 2024 08:20:58 -0800 Subject: [PATCH 3/3] Revise requirements.txt --- requirements.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/requirements.txt b/requirements.txt index ab6b2257cd..371b0eddf8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,17 +18,17 @@ fprime-fpl-convert-xml==1.0.3 fprime-fpl-extract-xml==1.0.3 fprime-fpl-layout==1.0.3 fprime-fpl-write-pic==1.0.3 -fprime-fpp-check==2.1.0a4-1-ga1011e18 -fprime-fpp-depend==2.1.0a4-1-ga1011e18 -fprime-fpp-filenames==2.1.0a4-1-ga1011e18 -fprime-fpp-format==2.1.0a4-1-ga1011e18 -fprime-fpp-from-xml==2.1.0a4-1-ga1011e18 -fprime-fpp-locate-defs==2.1.0a4-1-ga1011e18 -fprime-fpp-locate-uses==2.1.0a4-1-ga1011e18 -fprime-fpp-syntax==2.1.0a4-1-ga1011e18 -fprime-fpp-to-cpp==2.1.0a4-1-ga1011e18 -fprime-fpp-to-json==2.1.0a4-1-ga1011e18 -fprime-fpp-to-xml==2.1.0a4-1-ga1011e18 +fprime-fpp-check==2.1.0a5 +fprime-fpp-depend==2.1.0a5 +fprime-fpp-filenames==2.1.0a5 +fprime-fpp-format==2.1.0a5 +fprime-fpp-from-xml==2.1.0a5 +fprime-fpp-locate-defs==2.1.0a5 +fprime-fpp-locate-uses==2.1.0a5 +fprime-fpp-syntax==2.1.0a5 +fprime-fpp-to-cpp==2.1.0a5 +fprime-fpp-to-json==2.1.0a5 +fprime-fpp-to-xml==2.1.0a5 fprime-gds==3.4.3 fprime-tools==3.4.4 fprime-visual==1.0.2