diff --git a/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentDataProducts.scala b/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentDataProducts.scala index 666d4d9d8..15961c81d 100644 --- a/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentDataProducts.scala +++ b/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentDataProducts.scala @@ -39,10 +39,10 @@ case class ComponentDataProducts ( |//! Get a buffer and use it to initialize container $name |//! \\return The status of the buffer request |Fw::Success::T dpGet_$name( - | FwSizeType size, //!< The buffer size (input) + | FwSizeType dataSize, //!< The data size (input) | DpContainer& container //!< The container (output) |) { - | return this->dpGet(ContainerId::$name, size, container); + | return this->dpGet(ContainerId::$name, dataSize, container); |}""" ) ) @@ -88,8 +88,9 @@ case class ComponentDataProducts ( |} |container.setTimeTag(timeTag); |// Serialize the header into the packet - |Fw::SerializeStatus status = container.serializeHeader(); - |FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + |container.serializeHeader(); + |// Update the data hash + |container.updateDataHash(); |// Update the size of the buffer according to the data size |const FwSizeType packetSize = container.getPacketSize(); |Fw::Buffer buffer = container.getBuffer(); @@ -126,8 +127,8 @@ case class ComponentDataProducts ( ), CppDoc.Function.Param( CppDoc.Type("FwSizeType"), - "size", - Some("The buffer size (input)") + "dataSize", + Some("The data size (input)") ), CppDoc.Function.Param( CppDoc.Type("DpContainer&"), @@ -140,6 +141,7 @@ case class ComponentDataProducts ( val invokeProductGet = outputPortInvokerName(productGetPort.get) lines(s"""|const FwDpIdType baseId = this->getIdBase(); |const FwDpIdType globalId = baseId + containerId; + |const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize); |Fw::Buffer buffer; |const Fw::Success::T status = this->$invokeProductGet(0, globalId, size, buffer); |if (status == Fw::Success::SUCCESS) { @@ -161,8 +163,8 @@ case class ComponentDataProducts ( ), CppDoc.Function.Param( CppDoc.Type("FwSizeType"), - "size", - Some("The buffer size") + "dataSize", + Some("The data size") ) ), CppDoc.Type("void"), @@ -170,6 +172,7 @@ case class ComponentDataProducts ( val invokeProductRequest = outputPortInvokerName(productRequestPort.get) lines( s"""|const FwDpIdType globalId = this->getIdBase() + containerId; + |const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize); |this->$invokeProductRequest(0, globalId, size);""" ) } @@ -375,16 +378,15 @@ case class ComponentDataProducts ( ), CppDoc.Type("Fw::SerializeStatus"), lines( - s"""|Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); - |const FwSizeType sizeDelta = + s"""|const FwSizeType sizeDelta = | sizeof(FwDpIdType) + | $typeSize; |Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - |if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + |if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { | const FwDpIdType id = this->baseId + RecordId::$name; - | status = serializeRepr.serialize(id); + | status = this->dataBuffer.serialize(id); | FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - | status = serializeRepr.serialize(elt); + | status = this->dataBuffer.serialize(elt); | FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); | this->dataSize += sizeDelta; |} @@ -423,27 +425,26 @@ case class ComponentDataProducts ( // Optimize the U8 case case Type.U8 => """| const bool omitSerializedLength = true; - | status = serializeRepr.serialize(array, size, omitSerializedLength); + | status = this->dataBuffer.serialize(array, size, omitSerializedLength); | FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);""" case _ => """| for (FwSizeType i = 0; i < size; i++) { - | status = serializeRepr.serialize(array[i]); + | status = this->dataBuffer.serialize(array[i]); | FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); | }""" }).stripMargin lines( s"""|FW_ASSERT(array != nullptr); - |Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); |const FwSizeType sizeDelta = | sizeof(FwDpIdType) + | sizeof(FwSizeType) + | size * $eltSize; |Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - |if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + |if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { | const FwDpIdType id = this->baseId + RecordId::$name; - | status = serializeRepr.serialize(id); + | status = this->dataBuffer.serialize(id); | FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - | status = serializeRepr.serialize(size); + | status = this->dataBuffer.serialize(size); | FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); |$serializeElts | this->dataSize += sizeDelta; diff --git a/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/TestWriter/ComponentGTestBaseWriter.scala b/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/TestWriter/ComponentGTestBaseWriter.scala index 57bf2b76e..ed4d89927 100644 --- a/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/TestWriter/ComponentGTestBaseWriter.scala +++ b/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/TestWriter/ComponentGTestBaseWriter.scala @@ -289,8 +289,8 @@ case class ComponentGTestBaseWriter( """#define ASSERT_PRODUCT_SEND_SIZE(size) \ | this->assertProductSend_size(__FILE__, __LINE__, size) | - |#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procType, userData, dataSize, buffer) \ - | assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procType, userData, dataSize, buffer) + |#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) \ + | assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) |""" ) ) @@ -829,15 +829,20 @@ case class ComponentGTestBaseWriter( Some("The expected time tag (input)") ), CppDoc.Function.Param( - CppDoc.Type("Fw::DpCfg::ProcType"), - "procType", - Some("The expected processing type (input)") + CppDoc.Type("Fw::DpCfg::ProcType::SerialType"), + "procTypes", + Some("The expected processing types (input)") ), CppDoc.Function.Param( CppDoc.Type("const Fw::DpContainer::Header::UserData&"), "userData", Some("The expected user data (input)") ), + CppDoc.Function.Param( + CppDoc.Type("Fw::DpState"), + "dpState", + Some("The expected data product state (input)") + ), CppDoc.Function.Param( CppDoc.Type("FwSizeType"), "dataSize", @@ -878,8 +883,9 @@ case class ComponentGTestBaseWriter( | id, | priority, | timeTag, - | procType, + | procTypes, | userData, + | dpState, | dataSize |); |""" diff --git a/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/TestWriter/ComponentTesterBaseWriter.scala b/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/TestWriter/ComponentTesterBaseWriter.scala index 2e34a5cde..d6728ac94 100644 --- a/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/TestWriter/ComponentTesterBaseWriter.scala +++ b/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/TestWriter/ComponentTesterBaseWriter.scala @@ -479,7 +479,7 @@ case class ComponentTesterBaseWriter( getPortFunctionParams(productGetPort.get).take(2), CppDoc.Type("void"), lines( - """|DpGet e = { id, size }; + """|DpGet e = { id, dataSize }; |this->productGetHistory->push_back(e);""" ) ) @@ -496,7 +496,7 @@ case class ComponentTesterBaseWriter( CppDoc.Type("Fw::Success::T"), lines( """|(void) buffer; - |this->pushProductGetEntry(id, size); + |this->pushProductGetEntry(id, dataSize); |return Fw::Success::FAILURE; |""" ), @@ -508,7 +508,7 @@ case class ComponentTesterBaseWriter( getPortFunctionParams(productRequestPort.get), CppDoc.Type("void"), lines( - """|DpRequest e = { id, size }; + """|DpRequest e = { id, dataSize }; |this->productRequestHistory->push_back(e);""" ) ) @@ -522,7 +522,7 @@ case class ComponentTesterBaseWriter( "productRequest_handler", getPortFunctionParams(productRequestPort.get), CppDoc.Type("void"), - lines("this->pushProductRequestEntry(id, size);"), + lines("this->pushProductRequestEntry(id, dataSize);"), CppDoc.Function.Virtual ) lazy val sendProductResponse = functionClassMember( diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductPortsOnlyComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductPortsOnlyComponentAc.ref.cpp index dde695b88..c38914db0 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductPortsOnlyComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductPortsOnlyComponentAc.ref.cpp @@ -406,7 +406,7 @@ void ActiveAsyncProductPortsOnlyComponentBase :: productRequestOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { FW_ASSERT( @@ -415,7 +415,7 @@ void ActiveAsyncProductPortsOnlyComponentBase :: ); this->m_productRequestOut_OutputPort[portNum].invoke( id, - size + dataSize ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductPortsOnlyComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductPortsOnlyComponentAc.ref.hpp index 2c8e1f051..a18bef1e4 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductPortsOnlyComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductPortsOnlyComponentAc.ref.hpp @@ -217,7 +217,7 @@ class ActiveAsyncProductPortsOnlyComponentBase : void productRequestOut_out( NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Invoke output port productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductsComponentAc.ref.cpp index 0f9357ca0..92660d72c 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductsComponentAc.ref.cpp @@ -101,20 +101,19 @@ Fw::SerializeStatus ActiveAsyncProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * ActiveAsyncProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -128,16 +127,15 @@ Fw::SerializeStatus ActiveAsyncProductsComponentBase::DpContainer :: Fw::SerializeStatus ActiveAsyncProductsComponentBase::DpContainer :: serializeRecord_DataRecord(const ActiveAsyncProducts_Data& elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + ActiveAsyncProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -154,20 +152,19 @@ Fw::SerializeStatus ActiveAsyncProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -181,16 +178,15 @@ Fw::SerializeStatus ActiveAsyncProductsComponentBase::DpContainer :: Fw::SerializeStatus ActiveAsyncProductsComponentBase::DpContainer :: serializeRecord_U32Record(U32 elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32Record; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -207,20 +203,19 @@ Fw::SerializeStatus ActiveAsyncProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U8); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U8ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); const bool omitSerializedLength = true; - status = serializeRepr.serialize(array, size, omitSerializedLength); + status = this->dataBuffer.serialize(array, size, omitSerializedLength); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -2744,7 +2739,7 @@ void ActiveAsyncProductsComponentBase :: productRequestOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { FW_ASSERT( @@ -2753,7 +2748,7 @@ void ActiveAsyncProductsComponentBase :: ); this->m_productRequestOut_OutputPort[portNum].invoke( id, - size + dataSize ); } @@ -2869,8 +2864,9 @@ void ActiveAsyncProductsComponentBase :: } container.setTimeTag(timeTag); // Serialize the header into the packet - Fw::SerializeStatus status = container.serializeHeader(); - FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + container.serializeHeader(); + // Update the data hash + container.updateDataHash(); // Update the size of the buffer according to the data size const FwSizeType packetSize = container.getPacketSize(); Fw::Buffer buffer = container.getBuffer(); @@ -3619,10 +3615,11 @@ void ActiveAsyncProductsComponentBase :: void ActiveAsyncProductsComponentBase :: dpRequest( ContainerId::T containerId, - FwSizeType size + FwSizeType dataSize ) { const FwDpIdType globalId = this->getIdBase() + containerId; + const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize); this->productRequestOut_out(0, globalId, size); } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductsComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductsComponentAc.ref.hpp index 00bfe1fb4..2be194891 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductsComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductsComponentAc.ref.hpp @@ -1184,7 +1184,7 @@ class ActiveAsyncProductsComponentBase : void productRequestOut_out( NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Invoke output port productSendOut @@ -1525,7 +1525,7 @@ class ActiveAsyncProductsComponentBase : //! Request a data product container void dpRequest( ContainerId::T containerId, //!< The component-local container id - FwSizeType size //!< The buffer size + FwSizeType dataSize //!< The data size ); //! Handler implementation for productRecvIn diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveGetProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveGetProductsComponentAc.ref.cpp index 66ea3fc2f..f8abafe14 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveGetProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveGetProductsComponentAc.ref.cpp @@ -99,20 +99,19 @@ Fw::SerializeStatus ActiveGetProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * ActiveGetProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -126,16 +125,15 @@ Fw::SerializeStatus ActiveGetProductsComponentBase::DpContainer :: Fw::SerializeStatus ActiveGetProductsComponentBase::DpContainer :: serializeRecord_DataRecord(const ActiveGetProducts_Data& elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + ActiveGetProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -152,20 +150,19 @@ Fw::SerializeStatus ActiveGetProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -179,16 +176,15 @@ Fw::SerializeStatus ActiveGetProductsComponentBase::DpContainer :: Fw::SerializeStatus ActiveGetProductsComponentBase::DpContainer :: serializeRecord_U32Record(U32 elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32Record; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -205,20 +201,19 @@ Fw::SerializeStatus ActiveGetProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U8); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U8ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); const bool omitSerializedLength = true; - status = serializeRepr.serialize(array, size, omitSerializedLength); + status = this->dataBuffer.serialize(array, size, omitSerializedLength); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -2589,7 +2584,7 @@ Fw::Success ActiveGetProductsComponentBase :: productGetOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size, + FwSizeType dataSize, Fw::Buffer& buffer ) { @@ -2599,7 +2594,7 @@ Fw::Success ActiveGetProductsComponentBase :: ); return this->m_productGetOut_OutputPort[portNum].invoke( id, - size, + dataSize, buffer ); } @@ -2716,8 +2711,9 @@ void ActiveGetProductsComponentBase :: } container.setTimeTag(timeTag); // Serialize the header into the packet - Fw::SerializeStatus status = container.serializeHeader(); - FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + container.serializeHeader(); + // Update the data hash + container.updateDataHash(); // Update the size of the buffer according to the data size const FwSizeType packetSize = container.getPacketSize(); Fw::Buffer buffer = container.getBuffer(); @@ -3411,12 +3407,13 @@ void ActiveGetProductsComponentBase :: Fw::Success::T ActiveGetProductsComponentBase :: dpGet( ContainerId::T containerId, - FwSizeType size, + FwSizeType dataSize, DpContainer& container ) { const FwDpIdType baseId = this->getIdBase(); const FwDpIdType globalId = baseId + containerId; + const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize); Fw::Buffer buffer; const Fw::Success::T status = this->productGetOut_out(0, globalId, size, buffer); if (status == Fw::Success::SUCCESS) { diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveGetProductsComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveGetProductsComponentAc.ref.hpp index 2d132291a..f05daa32a 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveGetProductsComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveGetProductsComponentAc.ref.hpp @@ -1129,9 +1129,9 @@ class ActiveGetProductsComponentBase : //! Invoke output port productGetOut Fw::Success productGetOut_out( NATIVE_INT_TYPE portNum, //!< The port number - FwDpIdType id, //!< The container ID - FwSizeType size, //!< The size of the requested buffer - Fw::Buffer& buffer //!< The buffer + FwDpIdType id, //!< The container ID (input) + FwSizeType dataSize, //!< The data size of the requested buffer (input) + Fw::Buffer& buffer //!< The buffer (output) ); //! Invoke output port productSendOut @@ -1190,46 +1190,46 @@ class ActiveGetProductsComponentBase : //! Get a buffer and use it to initialize container Container1 //! \return The status of the buffer request Fw::Success::T dpGet_Container1( - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ) { - return this->dpGet(ContainerId::Container1, size, container); + return this->dpGet(ContainerId::Container1, dataSize, container); } //! Get a buffer and use it to initialize container Container2 //! \return The status of the buffer request Fw::Success::T dpGet_Container2( - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ) { - return this->dpGet(ContainerId::Container2, size, container); + return this->dpGet(ContainerId::Container2, dataSize, container); } //! Get a buffer and use it to initialize container Container3 //! \return The status of the buffer request Fw::Success::T dpGet_Container3( - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ) { - return this->dpGet(ContainerId::Container3, size, container); + return this->dpGet(ContainerId::Container3, dataSize, container); } //! Get a buffer and use it to initialize container Container4 //! \return The status of the buffer request Fw::Success::T dpGet_Container4( - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ) { - return this->dpGet(ContainerId::Container4, size, container); + return this->dpGet(ContainerId::Container4, dataSize, container); } //! Get a buffer and use it to initialize container Container5 //! \return The status of the buffer request Fw::Success::T dpGet_Container5( - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ) { - return this->dpGet(ContainerId::Container5, size, container); + return this->dpGet(ContainerId::Container5, dataSize, container); } //! Send a data product @@ -1474,7 +1474,7 @@ class ActiveGetProductsComponentBase : //! \return The status of the buffer request Fw::Success::T dpGet( ContainerId::T containerId, //!< The component-local container id (input) - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ); diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveGuardedProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveGuardedProductsComponentAc.ref.cpp index 56b17240b..c92792378 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveGuardedProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveGuardedProductsComponentAc.ref.cpp @@ -99,20 +99,19 @@ Fw::SerializeStatus ActiveGuardedProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * ActiveGuardedProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -126,16 +125,15 @@ Fw::SerializeStatus ActiveGuardedProductsComponentBase::DpContainer :: Fw::SerializeStatus ActiveGuardedProductsComponentBase::DpContainer :: serializeRecord_DataRecord(const ActiveGuardedProducts_Data& elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + ActiveGuardedProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -152,20 +150,19 @@ Fw::SerializeStatus ActiveGuardedProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -179,16 +176,15 @@ Fw::SerializeStatus ActiveGuardedProductsComponentBase::DpContainer :: Fw::SerializeStatus ActiveGuardedProductsComponentBase::DpContainer :: serializeRecord_U32Record(U32 elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32Record; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -205,20 +201,19 @@ Fw::SerializeStatus ActiveGuardedProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U8); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U8ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); const bool omitSerializedLength = true; - status = serializeRepr.serialize(array, size, omitSerializedLength); + status = this->dataBuffer.serialize(array, size, omitSerializedLength); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -2700,7 +2695,7 @@ void ActiveGuardedProductsComponentBase :: productRequestOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { FW_ASSERT( @@ -2709,7 +2704,7 @@ void ActiveGuardedProductsComponentBase :: ); this->m_productRequestOut_OutputPort[portNum].invoke( id, - size + dataSize ); } @@ -2825,8 +2820,9 @@ void ActiveGuardedProductsComponentBase :: } container.setTimeTag(timeTag); // Serialize the header into the packet - Fw::SerializeStatus status = container.serializeHeader(); - FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + container.serializeHeader(); + // Update the data hash + container.updateDataHash(); // Update the size of the buffer according to the data size const FwSizeType packetSize = container.getPacketSize(); Fw::Buffer buffer = container.getBuffer(); @@ -3539,10 +3535,11 @@ void ActiveGuardedProductsComponentBase :: void ActiveGuardedProductsComponentBase :: dpRequest( ContainerId::T containerId, - FwSizeType size + FwSizeType dataSize ) { const FwDpIdType globalId = this->getIdBase() + containerId; + const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize); this->productRequestOut_out(0, globalId, size); } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveGuardedProductsComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveGuardedProductsComponentAc.ref.hpp index fecc20334..bbc9c7498 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveGuardedProductsComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveGuardedProductsComponentAc.ref.hpp @@ -1184,7 +1184,7 @@ class ActiveGuardedProductsComponentBase : void productRequestOut_out( NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Invoke output port productSendOut @@ -1525,7 +1525,7 @@ class ActiveGuardedProductsComponentBase : //! Request a data product container void dpRequest( ContainerId::T containerId, //!< The component-local container id - FwSizeType size //!< The buffer size + FwSizeType dataSize //!< The data size ); //! Handler implementation for productRecvIn diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveSyncProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveSyncProductsComponentAc.ref.cpp index f584d82a9..67444d385 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveSyncProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveSyncProductsComponentAc.ref.cpp @@ -99,20 +99,19 @@ Fw::SerializeStatus ActiveSyncProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * ActiveSyncProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -126,16 +125,15 @@ Fw::SerializeStatus ActiveSyncProductsComponentBase::DpContainer :: Fw::SerializeStatus ActiveSyncProductsComponentBase::DpContainer :: serializeRecord_DataRecord(const ActiveSyncProducts_Data& elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + ActiveSyncProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -152,20 +150,19 @@ Fw::SerializeStatus ActiveSyncProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -179,16 +176,15 @@ Fw::SerializeStatus ActiveSyncProductsComponentBase::DpContainer :: Fw::SerializeStatus ActiveSyncProductsComponentBase::DpContainer :: serializeRecord_U32Record(U32 elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32Record; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -205,20 +201,19 @@ Fw::SerializeStatus ActiveSyncProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U8); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U8ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); const bool omitSerializedLength = true; - status = serializeRepr.serialize(array, size, omitSerializedLength); + status = this->dataBuffer.serialize(array, size, omitSerializedLength); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -2694,7 +2689,7 @@ void ActiveSyncProductsComponentBase :: productRequestOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { FW_ASSERT( @@ -2703,7 +2698,7 @@ void ActiveSyncProductsComponentBase :: ); this->m_productRequestOut_OutputPort[portNum].invoke( id, - size + dataSize ); } @@ -2819,8 +2814,9 @@ void ActiveSyncProductsComponentBase :: } container.setTimeTag(timeTag); // Serialize the header into the packet - Fw::SerializeStatus status = container.serializeHeader(); - FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + container.serializeHeader(); + // Update the data hash + container.updateDataHash(); // Update the size of the buffer according to the data size const FwSizeType packetSize = container.getPacketSize(); Fw::Buffer buffer = container.getBuffer(); @@ -3533,10 +3529,11 @@ void ActiveSyncProductsComponentBase :: void ActiveSyncProductsComponentBase :: dpRequest( ContainerId::T containerId, - FwSizeType size + FwSizeType dataSize ) { const FwDpIdType globalId = this->getIdBase() + containerId; + const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize); this->productRequestOut_out(0, globalId, size); } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveSyncProductsComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveSyncProductsComponentAc.ref.hpp index 018e4acc0..7a478ed8c 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveSyncProductsComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveSyncProductsComponentAc.ref.hpp @@ -1184,7 +1184,7 @@ class ActiveSyncProductsComponentBase : void productRequestOut_out( NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Invoke output port productSendOut @@ -1525,7 +1525,7 @@ class ActiveSyncProductsComponentBase : //! Request a data product container void dpRequest( ContainerId::T containerId, //!< The component-local container id - FwSizeType size //!< The buffer size + FwSizeType dataSize //!< The data size ); //! Handler implementation for productRecvIn diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.cpp index 9f16c57bc..cd2a4532c 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.cpp @@ -139,20 +139,19 @@ namespace M { ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * M::ActiveTest_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -166,16 +165,15 @@ namespace M { Fw::SerializeStatus ActiveTestComponentBase::DpContainer :: serializeRecord_DataRecord(const M::ActiveTest_Data& elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + M::ActiveTest_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -192,20 +190,19 @@ namespace M { ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -219,16 +216,15 @@ namespace M { Fw::SerializeStatus ActiveTestComponentBase::DpContainer :: serializeRecord_U32Record(U32 elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32Record; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -245,20 +241,19 @@ namespace M { ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U8); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U8ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); const bool omitSerializedLength = true; - status = serializeRepr.serialize(array, size, omitSerializedLength); + status = this->dataBuffer.serialize(array, size, omitSerializedLength); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -3099,7 +3094,7 @@ namespace M { productRequestOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { FW_ASSERT( @@ -3108,7 +3103,7 @@ namespace M { ); this->m_productRequestOut_OutputPort[portNum].invoke( id, - size + dataSize ); } @@ -5658,8 +5653,9 @@ namespace M { } container.setTimeTag(timeTag); // Serialize the header into the packet - Fw::SerializeStatus status = container.serializeHeader(); - FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + container.serializeHeader(); + // Update the data hash + container.updateDataHash(); // Update the size of the buffer according to the data size const FwSizeType packetSize = container.getPacketSize(); Fw::Buffer buffer = container.getBuffer(); @@ -7433,10 +7429,11 @@ namespace M { void ActiveTestComponentBase :: dpRequest( ContainerId::T containerId, - FwSizeType size + FwSizeType dataSize ) { const FwDpIdType globalId = this->getIdBase() + containerId; + const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize); this->productRequestOut_out(0, globalId, size); } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.hpp index 6594d772a..c12f2a86d 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.hpp @@ -1293,7 +1293,7 @@ namespace M { void productRequestOut_out( NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Invoke output port productSendOut @@ -2412,7 +2412,7 @@ namespace M { //! Request a data product container void dpRequest( ContainerId::T containerId, //!< The component-local container id - FwSizeType size //!< The buffer size + FwSizeType dataSize //!< The data size ); //! Handler implementation for productRecvIn diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductPortsOnlyComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductPortsOnlyComponentAc.ref.cpp index 24954730e..44aec71ce 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductPortsOnlyComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductPortsOnlyComponentAc.ref.cpp @@ -186,7 +186,7 @@ Fw::Success PassiveGetProductPortsOnlyComponentBase :: productGetOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size, + FwSizeType dataSize, Fw::Buffer& buffer ) { @@ -196,7 +196,7 @@ Fw::Success PassiveGetProductPortsOnlyComponentBase :: ); return this->m_productGetOut_OutputPort[portNum].invoke( id, - size, + dataSize, buffer ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductPortsOnlyComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductPortsOnlyComponentAc.ref.hpp index 8e1cf9508..b055475f7 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductPortsOnlyComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductPortsOnlyComponentAc.ref.hpp @@ -145,9 +145,9 @@ class PassiveGetProductPortsOnlyComponentBase : //! Invoke output port productGetOut Fw::Success productGetOut_out( NATIVE_INT_TYPE portNum, //!< The port number - FwDpIdType id, //!< The container ID - FwSizeType size, //!< The size of the requested buffer - Fw::Buffer& buffer //!< The buffer + FwDpIdType id, //!< The container ID (input) + FwSizeType dataSize, //!< The data size of the requested buffer (input) + Fw::Buffer& buffer //!< The buffer (output) ); //! Invoke output port productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductsComponentAc.ref.cpp index 3895bce37..854828ef3 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductsComponentAc.ref.cpp @@ -43,20 +43,19 @@ Fw::SerializeStatus PassiveGetProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * PassiveGetProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -70,16 +69,15 @@ Fw::SerializeStatus PassiveGetProductsComponentBase::DpContainer :: Fw::SerializeStatus PassiveGetProductsComponentBase::DpContainer :: serializeRecord_DataRecord(const PassiveGetProducts_Data& elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + PassiveGetProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -96,20 +94,19 @@ Fw::SerializeStatus PassiveGetProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -123,16 +120,15 @@ Fw::SerializeStatus PassiveGetProductsComponentBase::DpContainer :: Fw::SerializeStatus PassiveGetProductsComponentBase::DpContainer :: serializeRecord_U32Record(U32 elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32Record; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -149,20 +145,19 @@ Fw::SerializeStatus PassiveGetProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U8); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U8ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); const bool omitSerializedLength = true; - status = serializeRepr.serialize(array, size, omitSerializedLength); + status = this->dataBuffer.serialize(array, size, omitSerializedLength); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -1759,7 +1754,7 @@ Fw::Success PassiveGetProductsComponentBase :: productGetOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size, + FwSizeType dataSize, Fw::Buffer& buffer ) { @@ -1769,7 +1764,7 @@ Fw::Success PassiveGetProductsComponentBase :: ); return this->m_productGetOut_OutputPort[portNum].invoke( id, - size, + dataSize, buffer ); } @@ -1886,8 +1881,9 @@ void PassiveGetProductsComponentBase :: } container.setTimeTag(timeTag); // Serialize the header into the packet - Fw::SerializeStatus status = container.serializeHeader(); - FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + container.serializeHeader(); + // Update the data hash + container.updateDataHash(); // Update the size of the buffer according to the data size const FwSizeType packetSize = container.getPacketSize(); Fw::Buffer buffer = container.getBuffer(); @@ -2115,12 +2111,13 @@ void PassiveGetProductsComponentBase :: Fw::Success::T PassiveGetProductsComponentBase :: dpGet( ContainerId::T containerId, - FwSizeType size, + FwSizeType dataSize, DpContainer& container ) { const FwDpIdType baseId = this->getIdBase(); const FwDpIdType globalId = baseId + containerId; + const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize); Fw::Buffer buffer; const Fw::Success::T status = this->productGetOut_out(0, globalId, size, buffer); if (status == Fw::Success::SUCCESS) { diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductsComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductsComponentAc.ref.hpp index 903ed0a46..31492d572 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductsComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductsComponentAc.ref.hpp @@ -894,9 +894,9 @@ class PassiveGetProductsComponentBase : //! Invoke output port productGetOut Fw::Success productGetOut_out( NATIVE_INT_TYPE portNum, //!< The port number - FwDpIdType id, //!< The container ID - FwSizeType size, //!< The size of the requested buffer - Fw::Buffer& buffer //!< The buffer + FwDpIdType id, //!< The container ID (input) + FwSizeType dataSize, //!< The data size of the requested buffer (input) + Fw::Buffer& buffer //!< The buffer (output) ); //! Invoke output port productSendOut @@ -955,46 +955,46 @@ class PassiveGetProductsComponentBase : //! Get a buffer and use it to initialize container Container1 //! \return The status of the buffer request Fw::Success::T dpGet_Container1( - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ) { - return this->dpGet(ContainerId::Container1, size, container); + return this->dpGet(ContainerId::Container1, dataSize, container); } //! Get a buffer and use it to initialize container Container2 //! \return The status of the buffer request Fw::Success::T dpGet_Container2( - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ) { - return this->dpGet(ContainerId::Container2, size, container); + return this->dpGet(ContainerId::Container2, dataSize, container); } //! Get a buffer and use it to initialize container Container3 //! \return The status of the buffer request Fw::Success::T dpGet_Container3( - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ) { - return this->dpGet(ContainerId::Container3, size, container); + return this->dpGet(ContainerId::Container3, dataSize, container); } //! Get a buffer and use it to initialize container Container4 //! \return The status of the buffer request Fw::Success::T dpGet_Container4( - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ) { - return this->dpGet(ContainerId::Container4, size, container); + return this->dpGet(ContainerId::Container4, dataSize, container); } //! Get a buffer and use it to initialize container Container5 //! \return The status of the buffer request Fw::Success::T dpGet_Container5( - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ) { - return this->dpGet(ContainerId::Container5, size, container); + return this->dpGet(ContainerId::Container5, dataSize, container); } //! Send a data product @@ -1172,7 +1172,7 @@ class PassiveGetProductsComponentBase : //! \return The status of the buffer request Fw::Success::T dpGet( ContainerId::T containerId, //!< The component-local container id (input) - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ); diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGuardedProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGuardedProductsComponentAc.ref.cpp index 32b76a8be..e74066a61 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGuardedProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGuardedProductsComponentAc.ref.cpp @@ -43,20 +43,19 @@ Fw::SerializeStatus PassiveGuardedProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * PassiveGuardedProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -70,16 +69,15 @@ Fw::SerializeStatus PassiveGuardedProductsComponentBase::DpContainer :: Fw::SerializeStatus PassiveGuardedProductsComponentBase::DpContainer :: serializeRecord_DataRecord(const PassiveGuardedProducts_Data& elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + PassiveGuardedProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -96,20 +94,19 @@ Fw::SerializeStatus PassiveGuardedProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -123,16 +120,15 @@ Fw::SerializeStatus PassiveGuardedProductsComponentBase::DpContainer :: Fw::SerializeStatus PassiveGuardedProductsComponentBase::DpContainer :: serializeRecord_U32Record(U32 elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32Record; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -149,20 +145,19 @@ Fw::SerializeStatus PassiveGuardedProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U8); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U8ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); const bool omitSerializedLength = true; - status = serializeRepr.serialize(array, size, omitSerializedLength); + status = this->dataBuffer.serialize(array, size, omitSerializedLength); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -1870,7 +1865,7 @@ void PassiveGuardedProductsComponentBase :: productRequestOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { FW_ASSERT( @@ -1879,7 +1874,7 @@ void PassiveGuardedProductsComponentBase :: ); this->m_productRequestOut_OutputPort[portNum].invoke( id, - size + dataSize ); } @@ -1995,8 +1990,9 @@ void PassiveGuardedProductsComponentBase :: } container.setTimeTag(timeTag); // Serialize the header into the packet - Fw::SerializeStatus status = container.serializeHeader(); - FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + container.serializeHeader(); + // Update the data hash + container.updateDataHash(); // Update the size of the buffer according to the data size const FwSizeType packetSize = container.getPacketSize(); Fw::Buffer buffer = container.getBuffer(); @@ -2243,10 +2239,11 @@ void PassiveGuardedProductsComponentBase :: void PassiveGuardedProductsComponentBase :: dpRequest( ContainerId::T containerId, - FwSizeType size + FwSizeType dataSize ) { const FwDpIdType globalId = this->getIdBase() + containerId; + const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize); this->productRequestOut_out(0, globalId, size); } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGuardedProductsComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGuardedProductsComponentAc.ref.hpp index e41ab3ac0..0260818b4 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGuardedProductsComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGuardedProductsComponentAc.ref.hpp @@ -949,7 +949,7 @@ class PassiveGuardedProductsComponentBase : void productRequestOut_out( NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Invoke output port productSendOut @@ -1223,7 +1223,7 @@ class PassiveGuardedProductsComponentBase : //! Request a data product container void dpRequest( ContainerId::T containerId, //!< The component-local container id - FwSizeType size //!< The buffer size + FwSizeType dataSize //!< The data size ); //! Handler implementation for productRecvIn diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductPortsOnlyComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductPortsOnlyComponentAc.ref.cpp index 117f2fc41..3ee52d800 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductPortsOnlyComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductPortsOnlyComponentAc.ref.cpp @@ -299,7 +299,7 @@ void PassiveSyncProductPortsOnlyComponentBase :: productRequestOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { FW_ASSERT( @@ -308,7 +308,7 @@ void PassiveSyncProductPortsOnlyComponentBase :: ); this->m_productRequestOut_OutputPort[portNum].invoke( id, - size + dataSize ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductPortsOnlyComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductPortsOnlyComponentAc.ref.hpp index 5ffc39e26..bb7e827ce 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductPortsOnlyComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductPortsOnlyComponentAc.ref.hpp @@ -216,7 +216,7 @@ class PassiveSyncProductPortsOnlyComponentBase : void productRequestOut_out( NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Invoke output port productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductsComponentAc.ref.cpp index c03ad1000..7aab9e0df 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductsComponentAc.ref.cpp @@ -43,20 +43,19 @@ Fw::SerializeStatus PassiveSyncProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * PassiveSyncProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -70,16 +69,15 @@ Fw::SerializeStatus PassiveSyncProductsComponentBase::DpContainer :: Fw::SerializeStatus PassiveSyncProductsComponentBase::DpContainer :: serializeRecord_DataRecord(const PassiveSyncProducts_Data& elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + PassiveSyncProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -96,20 +94,19 @@ Fw::SerializeStatus PassiveSyncProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -123,16 +120,15 @@ Fw::SerializeStatus PassiveSyncProductsComponentBase::DpContainer :: Fw::SerializeStatus PassiveSyncProductsComponentBase::DpContainer :: serializeRecord_U32Record(U32 elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32Record; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -149,20 +145,19 @@ Fw::SerializeStatus PassiveSyncProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U8); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U8ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); const bool omitSerializedLength = true; - status = serializeRepr.serialize(array, size, omitSerializedLength); + status = this->dataBuffer.serialize(array, size, omitSerializedLength); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -1864,7 +1859,7 @@ void PassiveSyncProductsComponentBase :: productRequestOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { FW_ASSERT( @@ -1873,7 +1868,7 @@ void PassiveSyncProductsComponentBase :: ); this->m_productRequestOut_OutputPort[portNum].invoke( id, - size + dataSize ); } @@ -1989,8 +1984,9 @@ void PassiveSyncProductsComponentBase :: } container.setTimeTag(timeTag); // Serialize the header into the packet - Fw::SerializeStatus status = container.serializeHeader(); - FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + container.serializeHeader(); + // Update the data hash + container.updateDataHash(); // Update the size of the buffer according to the data size const FwSizeType packetSize = container.getPacketSize(); Fw::Buffer buffer = container.getBuffer(); @@ -2237,10 +2233,11 @@ void PassiveSyncProductsComponentBase :: void PassiveSyncProductsComponentBase :: dpRequest( ContainerId::T containerId, - FwSizeType size + FwSizeType dataSize ) { const FwDpIdType globalId = this->getIdBase() + containerId; + const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize); this->productRequestOut_out(0, globalId, size); } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductsComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductsComponentAc.ref.hpp index 5906da79d..6a4b5181f 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductsComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductsComponentAc.ref.hpp @@ -949,7 +949,7 @@ class PassiveSyncProductsComponentBase : void productRequestOut_out( NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Invoke output port productSendOut @@ -1223,7 +1223,7 @@ class PassiveSyncProductsComponentBase : //! Request a data product container void dpRequest( ContainerId::T containerId, //!< The component-local container id - FwSizeType size //!< The buffer size + FwSizeType dataSize //!< The data size ); //! Handler implementation for productRecvIn diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.cpp index 327646509..2e98dca2c 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.cpp @@ -43,20 +43,19 @@ Fw::SerializeStatus PassiveTestComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * PassiveTest_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -70,16 +69,15 @@ Fw::SerializeStatus PassiveTestComponentBase::DpContainer :: Fw::SerializeStatus PassiveTestComponentBase::DpContainer :: serializeRecord_DataRecord(const PassiveTest_Data& elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + PassiveTest_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -96,20 +94,19 @@ Fw::SerializeStatus PassiveTestComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -123,16 +120,15 @@ Fw::SerializeStatus PassiveTestComponentBase::DpContainer :: Fw::SerializeStatus PassiveTestComponentBase::DpContainer :: serializeRecord_U32Record(U32 elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32Record; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -149,20 +145,19 @@ Fw::SerializeStatus PassiveTestComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U8); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U8ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); const bool omitSerializedLength = true; - status = serializeRepr.serialize(array, size, omitSerializedLength); + status = this->dataBuffer.serialize(array, size, omitSerializedLength); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -2161,7 +2156,7 @@ void PassiveTestComponentBase :: productRequestOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { FW_ASSERT( @@ -2170,7 +2165,7 @@ void PassiveTestComponentBase :: ); this->m_productRequestOut_OutputPort[portNum].invoke( id, - size + dataSize ); } @@ -4113,8 +4108,9 @@ void PassiveTestComponentBase :: } container.setTimeTag(timeTag); // Serialize the header into the packet - Fw::SerializeStatus status = container.serializeHeader(); - FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + container.serializeHeader(); + // Update the data hash + container.updateDataHash(); // Update the size of the buffer according to the data size const FwSizeType packetSize = container.getPacketSize(); Fw::Buffer buffer = container.getBuffer(); @@ -4895,10 +4891,11 @@ Fw::CmdResponse PassiveTestComponentBase :: void PassiveTestComponentBase :: dpRequest( ContainerId::T containerId, - FwSizeType size + FwSizeType dataSize ) { const FwDpIdType globalId = this->getIdBase() + containerId; + const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize); this->productRequestOut_out(0, globalId, size); } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.hpp index e744a7a88..afdebf884 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.hpp @@ -1050,7 +1050,7 @@ class PassiveTestComponentBase : void productRequestOut_out( NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Invoke output port productSendOut @@ -1901,7 +1901,7 @@ class PassiveTestComponentBase : //! Request a data product container void dpRequest( ContainerId::T containerId, //!< The component-local container id - FwSizeType size //!< The buffer size + FwSizeType dataSize //!< The data size ); //! Handler implementation for productRecvIn diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductPortsOnlyComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductPortsOnlyComponentAc.ref.cpp index 417e6e1fa..c71f4acc2 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductPortsOnlyComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductPortsOnlyComponentAc.ref.cpp @@ -406,7 +406,7 @@ void QueuedAsyncProductPortsOnlyComponentBase :: productRequestOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { FW_ASSERT( @@ -415,7 +415,7 @@ void QueuedAsyncProductPortsOnlyComponentBase :: ); this->m_productRequestOut_OutputPort[portNum].invoke( id, - size + dataSize ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductPortsOnlyComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductPortsOnlyComponentAc.ref.hpp index 7a3946d5e..9bfb054c0 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductPortsOnlyComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductPortsOnlyComponentAc.ref.hpp @@ -217,7 +217,7 @@ class QueuedAsyncProductPortsOnlyComponentBase : void productRequestOut_out( NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Invoke output port productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductsComponentAc.ref.cpp index f5c9ce6b0..50207414e 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductsComponentAc.ref.cpp @@ -101,20 +101,19 @@ Fw::SerializeStatus QueuedAsyncProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * QueuedAsyncProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -128,16 +127,15 @@ Fw::SerializeStatus QueuedAsyncProductsComponentBase::DpContainer :: Fw::SerializeStatus QueuedAsyncProductsComponentBase::DpContainer :: serializeRecord_DataRecord(const QueuedAsyncProducts_Data& elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + QueuedAsyncProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -154,20 +152,19 @@ Fw::SerializeStatus QueuedAsyncProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -181,16 +178,15 @@ Fw::SerializeStatus QueuedAsyncProductsComponentBase::DpContainer :: Fw::SerializeStatus QueuedAsyncProductsComponentBase::DpContainer :: serializeRecord_U32Record(U32 elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32Record; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -207,20 +203,19 @@ Fw::SerializeStatus QueuedAsyncProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U8); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U8ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); const bool omitSerializedLength = true; - status = serializeRepr.serialize(array, size, omitSerializedLength); + status = this->dataBuffer.serialize(array, size, omitSerializedLength); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -2744,7 +2739,7 @@ void QueuedAsyncProductsComponentBase :: productRequestOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { FW_ASSERT( @@ -2753,7 +2748,7 @@ void QueuedAsyncProductsComponentBase :: ); this->m_productRequestOut_OutputPort[portNum].invoke( id, - size + dataSize ); } @@ -2869,8 +2864,9 @@ void QueuedAsyncProductsComponentBase :: } container.setTimeTag(timeTag); // Serialize the header into the packet - Fw::SerializeStatus status = container.serializeHeader(); - FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + container.serializeHeader(); + // Update the data hash + container.updateDataHash(); // Update the size of the buffer according to the data size const FwSizeType packetSize = container.getPacketSize(); Fw::Buffer buffer = container.getBuffer(); @@ -3619,10 +3615,11 @@ void QueuedAsyncProductsComponentBase :: void QueuedAsyncProductsComponentBase :: dpRequest( ContainerId::T containerId, - FwSizeType size + FwSizeType dataSize ) { const FwDpIdType globalId = this->getIdBase() + containerId; + const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize); this->productRequestOut_out(0, globalId, size); } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductsComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductsComponentAc.ref.hpp index 2fcb1a61a..0eb80747b 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductsComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductsComponentAc.ref.hpp @@ -1184,7 +1184,7 @@ class QueuedAsyncProductsComponentBase : void productRequestOut_out( NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Invoke output port productSendOut @@ -1525,7 +1525,7 @@ class QueuedAsyncProductsComponentBase : //! Request a data product container void dpRequest( ContainerId::T containerId, //!< The component-local container id - FwSizeType size //!< The buffer size + FwSizeType dataSize //!< The data size ); //! Handler implementation for productRecvIn diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedGetProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedGetProductsComponentAc.ref.cpp index df03b367d..d4f15980a 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedGetProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedGetProductsComponentAc.ref.cpp @@ -99,20 +99,19 @@ Fw::SerializeStatus QueuedGetProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * QueuedGetProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -126,16 +125,15 @@ Fw::SerializeStatus QueuedGetProductsComponentBase::DpContainer :: Fw::SerializeStatus QueuedGetProductsComponentBase::DpContainer :: serializeRecord_DataRecord(const QueuedGetProducts_Data& elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + QueuedGetProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -152,20 +150,19 @@ Fw::SerializeStatus QueuedGetProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -179,16 +176,15 @@ Fw::SerializeStatus QueuedGetProductsComponentBase::DpContainer :: Fw::SerializeStatus QueuedGetProductsComponentBase::DpContainer :: serializeRecord_U32Record(U32 elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32Record; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -205,20 +201,19 @@ Fw::SerializeStatus QueuedGetProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U8); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U8ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); const bool omitSerializedLength = true; - status = serializeRepr.serialize(array, size, omitSerializedLength); + status = this->dataBuffer.serialize(array, size, omitSerializedLength); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -2589,7 +2584,7 @@ Fw::Success QueuedGetProductsComponentBase :: productGetOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size, + FwSizeType dataSize, Fw::Buffer& buffer ) { @@ -2599,7 +2594,7 @@ Fw::Success QueuedGetProductsComponentBase :: ); return this->m_productGetOut_OutputPort[portNum].invoke( id, - size, + dataSize, buffer ); } @@ -2716,8 +2711,9 @@ void QueuedGetProductsComponentBase :: } container.setTimeTag(timeTag); // Serialize the header into the packet - Fw::SerializeStatus status = container.serializeHeader(); - FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + container.serializeHeader(); + // Update the data hash + container.updateDataHash(); // Update the size of the buffer according to the data size const FwSizeType packetSize = container.getPacketSize(); Fw::Buffer buffer = container.getBuffer(); @@ -3411,12 +3407,13 @@ void QueuedGetProductsComponentBase :: Fw::Success::T QueuedGetProductsComponentBase :: dpGet( ContainerId::T containerId, - FwSizeType size, + FwSizeType dataSize, DpContainer& container ) { const FwDpIdType baseId = this->getIdBase(); const FwDpIdType globalId = baseId + containerId; + const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize); Fw::Buffer buffer; const Fw::Success::T status = this->productGetOut_out(0, globalId, size, buffer); if (status == Fw::Success::SUCCESS) { diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedGetProductsComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedGetProductsComponentAc.ref.hpp index 59265c2d7..24efdd711 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedGetProductsComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedGetProductsComponentAc.ref.hpp @@ -1129,9 +1129,9 @@ class QueuedGetProductsComponentBase : //! Invoke output port productGetOut Fw::Success productGetOut_out( NATIVE_INT_TYPE portNum, //!< The port number - FwDpIdType id, //!< The container ID - FwSizeType size, //!< The size of the requested buffer - Fw::Buffer& buffer //!< The buffer + FwDpIdType id, //!< The container ID (input) + FwSizeType dataSize, //!< The data size of the requested buffer (input) + Fw::Buffer& buffer //!< The buffer (output) ); //! Invoke output port productSendOut @@ -1190,46 +1190,46 @@ class QueuedGetProductsComponentBase : //! Get a buffer and use it to initialize container Container1 //! \return The status of the buffer request Fw::Success::T dpGet_Container1( - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ) { - return this->dpGet(ContainerId::Container1, size, container); + return this->dpGet(ContainerId::Container1, dataSize, container); } //! Get a buffer and use it to initialize container Container2 //! \return The status of the buffer request Fw::Success::T dpGet_Container2( - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ) { - return this->dpGet(ContainerId::Container2, size, container); + return this->dpGet(ContainerId::Container2, dataSize, container); } //! Get a buffer and use it to initialize container Container3 //! \return The status of the buffer request Fw::Success::T dpGet_Container3( - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ) { - return this->dpGet(ContainerId::Container3, size, container); + return this->dpGet(ContainerId::Container3, dataSize, container); } //! Get a buffer and use it to initialize container Container4 //! \return The status of the buffer request Fw::Success::T dpGet_Container4( - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ) { - return this->dpGet(ContainerId::Container4, size, container); + return this->dpGet(ContainerId::Container4, dataSize, container); } //! Get a buffer and use it to initialize container Container5 //! \return The status of the buffer request Fw::Success::T dpGet_Container5( - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ) { - return this->dpGet(ContainerId::Container5, size, container); + return this->dpGet(ContainerId::Container5, dataSize, container); } //! Send a data product @@ -1474,7 +1474,7 @@ class QueuedGetProductsComponentBase : //! \return The status of the buffer request Fw::Success::T dpGet( ContainerId::T containerId, //!< The component-local container id (input) - FwSizeType size, //!< The buffer size (input) + FwSizeType dataSize, //!< The data size (input) DpContainer& container //!< The container (output) ); diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedGuardedProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedGuardedProductsComponentAc.ref.cpp index 499a245f3..aedd5e02a 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedGuardedProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedGuardedProductsComponentAc.ref.cpp @@ -99,20 +99,19 @@ Fw::SerializeStatus QueuedGuardedProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * QueuedGuardedProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -126,16 +125,15 @@ Fw::SerializeStatus QueuedGuardedProductsComponentBase::DpContainer :: Fw::SerializeStatus QueuedGuardedProductsComponentBase::DpContainer :: serializeRecord_DataRecord(const QueuedGuardedProducts_Data& elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + QueuedGuardedProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -152,20 +150,19 @@ Fw::SerializeStatus QueuedGuardedProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -179,16 +176,15 @@ Fw::SerializeStatus QueuedGuardedProductsComponentBase::DpContainer :: Fw::SerializeStatus QueuedGuardedProductsComponentBase::DpContainer :: serializeRecord_U32Record(U32 elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32Record; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -205,20 +201,19 @@ Fw::SerializeStatus QueuedGuardedProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U8); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U8ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); const bool omitSerializedLength = true; - status = serializeRepr.serialize(array, size, omitSerializedLength); + status = this->dataBuffer.serialize(array, size, omitSerializedLength); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -2700,7 +2695,7 @@ void QueuedGuardedProductsComponentBase :: productRequestOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { FW_ASSERT( @@ -2709,7 +2704,7 @@ void QueuedGuardedProductsComponentBase :: ); this->m_productRequestOut_OutputPort[portNum].invoke( id, - size + dataSize ); } @@ -2825,8 +2820,9 @@ void QueuedGuardedProductsComponentBase :: } container.setTimeTag(timeTag); // Serialize the header into the packet - Fw::SerializeStatus status = container.serializeHeader(); - FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + container.serializeHeader(); + // Update the data hash + container.updateDataHash(); // Update the size of the buffer according to the data size const FwSizeType packetSize = container.getPacketSize(); Fw::Buffer buffer = container.getBuffer(); @@ -3539,10 +3535,11 @@ void QueuedGuardedProductsComponentBase :: void QueuedGuardedProductsComponentBase :: dpRequest( ContainerId::T containerId, - FwSizeType size + FwSizeType dataSize ) { const FwDpIdType globalId = this->getIdBase() + containerId; + const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize); this->productRequestOut_out(0, globalId, size); } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedGuardedProductsComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedGuardedProductsComponentAc.ref.hpp index 79382d0bb..14e153f1d 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedGuardedProductsComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedGuardedProductsComponentAc.ref.hpp @@ -1184,7 +1184,7 @@ class QueuedGuardedProductsComponentBase : void productRequestOut_out( NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Invoke output port productSendOut @@ -1525,7 +1525,7 @@ class QueuedGuardedProductsComponentBase : //! Request a data product container void dpRequest( ContainerId::T containerId, //!< The component-local container id - FwSizeType size //!< The buffer size + FwSizeType dataSize //!< The data size ); //! Handler implementation for productRecvIn diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedSyncProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedSyncProductsComponentAc.ref.cpp index a6b097f80..fd40022e9 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedSyncProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedSyncProductsComponentAc.ref.cpp @@ -99,20 +99,19 @@ Fw::SerializeStatus QueuedSyncProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * QueuedSyncProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -126,16 +125,15 @@ Fw::SerializeStatus QueuedSyncProductsComponentBase::DpContainer :: Fw::SerializeStatus QueuedSyncProductsComponentBase::DpContainer :: serializeRecord_DataRecord(const QueuedSyncProducts_Data& elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + QueuedSyncProducts_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -152,20 +150,19 @@ Fw::SerializeStatus QueuedSyncProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -179,16 +176,15 @@ Fw::SerializeStatus QueuedSyncProductsComponentBase::DpContainer :: Fw::SerializeStatus QueuedSyncProductsComponentBase::DpContainer :: serializeRecord_U32Record(U32 elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32Record; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -205,20 +201,19 @@ Fw::SerializeStatus QueuedSyncProductsComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U8); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U8ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); const bool omitSerializedLength = true; - status = serializeRepr.serialize(array, size, omitSerializedLength); + status = this->dataBuffer.serialize(array, size, omitSerializedLength); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -2694,7 +2689,7 @@ void QueuedSyncProductsComponentBase :: productRequestOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { FW_ASSERT( @@ -2703,7 +2698,7 @@ void QueuedSyncProductsComponentBase :: ); this->m_productRequestOut_OutputPort[portNum].invoke( id, - size + dataSize ); } @@ -2819,8 +2814,9 @@ void QueuedSyncProductsComponentBase :: } container.setTimeTag(timeTag); // Serialize the header into the packet - Fw::SerializeStatus status = container.serializeHeader(); - FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + container.serializeHeader(); + // Update the data hash + container.updateDataHash(); // Update the size of the buffer according to the data size const FwSizeType packetSize = container.getPacketSize(); Fw::Buffer buffer = container.getBuffer(); @@ -3533,10 +3529,11 @@ void QueuedSyncProductsComponentBase :: void QueuedSyncProductsComponentBase :: dpRequest( ContainerId::T containerId, - FwSizeType size + FwSizeType dataSize ) { const FwDpIdType globalId = this->getIdBase() + containerId; + const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize); this->productRequestOut_out(0, globalId, size); } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedSyncProductsComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedSyncProductsComponentAc.ref.hpp index c66973280..9df2783f1 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedSyncProductsComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedSyncProductsComponentAc.ref.hpp @@ -1184,7 +1184,7 @@ class QueuedSyncProductsComponentBase : void productRequestOut_out( NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Invoke output port productSendOut @@ -1525,7 +1525,7 @@ class QueuedSyncProductsComponentBase : //! Request a data product container void dpRequest( ContainerId::T containerId, //!< The component-local container id - FwSizeType size //!< The buffer size + FwSizeType dataSize //!< The data size ); //! Handler implementation for productRecvIn diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.cpp index c0508a414..b150ece9a 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.cpp @@ -137,20 +137,19 @@ Fw::SerializeStatus QueuedTestComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * QueuedTest_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -164,16 +163,15 @@ Fw::SerializeStatus QueuedTestComponentBase::DpContainer :: Fw::SerializeStatus QueuedTestComponentBase::DpContainer :: serializeRecord_DataRecord(const QueuedTest_Data& elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + QueuedTest_Data::SERIALIZED_SIZE; Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::DataRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -190,20 +188,19 @@ Fw::SerializeStatus QueuedTestComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); for (FwSizeType i = 0; i < size; i++) { - status = serializeRepr.serialize(array[i]); + status = this->dataBuffer.serialize(array[i]); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } this->dataSize += sizeDelta; @@ -217,16 +214,15 @@ Fw::SerializeStatus QueuedTestComponentBase::DpContainer :: Fw::SerializeStatus QueuedTestComponentBase::DpContainer :: serializeRecord_U32Record(U32 elt) { - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(U32); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U32Record; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(elt); + status = this->dataBuffer.serialize(elt); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -243,20 +239,19 @@ Fw::SerializeStatus QueuedTestComponentBase::DpContainer :: ) { FW_ASSERT(array != nullptr); - Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); const FwSizeType sizeDelta = sizeof(FwDpIdType) + sizeof(FwSizeType) + size * sizeof(U8); Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK; - if (serializeRepr.getBuffLength() + sizeDelta <= serializeRepr.getBuffCapacity()) { + if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) { const FwDpIdType id = this->baseId + RecordId::U8ArrayRecord; - status = serializeRepr.serialize(id); + status = this->dataBuffer.serialize(id); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); - status = serializeRepr.serialize(size); + status = this->dataBuffer.serialize(size); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); const bool omitSerializedLength = true; - status = serializeRepr.serialize(array, size, omitSerializedLength); + status = this->dataBuffer.serialize(array, size, omitSerializedLength); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); this->dataSize += sizeDelta; } @@ -3097,7 +3092,7 @@ void QueuedTestComponentBase :: productRequestOut_out( NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { FW_ASSERT( @@ -3106,7 +3101,7 @@ void QueuedTestComponentBase :: ); this->m_productRequestOut_OutputPort[portNum].invoke( id, - size + dataSize ); } @@ -5656,8 +5651,9 @@ void QueuedTestComponentBase :: } container.setTimeTag(timeTag); // Serialize the header into the packet - Fw::SerializeStatus status = container.serializeHeader(); - FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + container.serializeHeader(); + // Update the data hash + container.updateDataHash(); // Update the size of the buffer according to the data size const FwSizeType packetSize = container.getPacketSize(); Fw::Buffer buffer = container.getBuffer(); @@ -7436,10 +7432,11 @@ Fw::CmdResponse QueuedTestComponentBase :: void QueuedTestComponentBase :: dpRequest( ContainerId::T containerId, - FwSizeType size + FwSizeType dataSize ) { const FwDpIdType globalId = this->getIdBase() + containerId; + const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize); this->productRequestOut_out(0, globalId, size); } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.hpp index ddc6202b0..ef7686e69 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.hpp @@ -1291,7 +1291,7 @@ class QueuedTestComponentBase : void productRequestOut_out( NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Invoke output port productSendOut @@ -2410,7 +2410,7 @@ class QueuedTestComponentBase : //! Request a data product container void dpRequest( ContainerId::T containerId, //!< The component-local container id - FwSizeType size //!< The buffer size + FwSizeType dataSize //!< The data size ); //! Handler implementation for productRecvIn diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsGTestBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsGTestBase.ref.cpp index ea69dc71a..54f53f235 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsGTestBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsGTestBase.ref.cpp @@ -186,8 +186,9 @@ void ActiveAsyncProductsGTestBase :: FwDpIdType id, FwDpPriorityType priority, const Fw::Time& timeTag, - Fw::DpCfg::ProcType procType, + Fw::DpCfg::ProcType::SerialType procTypes, const Fw::DpContainer::Header::UserData& userData, + Fw::DpState dpState, FwSizeType dataSize, Fw::Buffer& historyBuffer ) const @@ -219,8 +220,9 @@ void ActiveAsyncProductsGTestBase :: id, priority, timeTag, - procType, + procTypes, userData, + dpState, dataSize ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsGTestBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsGTestBase.ref.hpp index a2a89a64c..c393c572b 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsGTestBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsGTestBase.ref.hpp @@ -210,8 +210,8 @@ #define ASSERT_PRODUCT_SEND_SIZE(size) \ this->assertProductSend_size(__FILE__, __LINE__, size) -#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procType, userData, dataSize, buffer) \ - assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procType, userData, dataSize, buffer) +#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) \ + assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) //! \class ActiveAsyncProductsGTestBase //! \brief Auto-generated base for ActiveAsyncProducts component Google Test harness @@ -322,8 +322,9 @@ class ActiveAsyncProductsGTestBase : FwDpIdType id, //!< The expected container ID (input) FwDpPriorityType priority, //!< The expected priority (input) const Fw::Time& timeTag, //!< The expected time tag (input) - Fw::DpCfg::ProcType procType, //!< The expected processing type (input) + Fw::DpCfg::ProcType::SerialType procTypes, //!< The expected processing types (input) const Fw::DpContainer::Header::UserData& userData, //!< The expected user data (input) + Fw::DpState dpState, //!< The expected data product state (input) FwSizeType dataSize, //!< The expected data size (input) Fw::Buffer& historyBuffer //!< The buffer from the history (output) ) const; diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsTesterBase.ref.cpp index d32bf463a..3e1d1f4de 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsTesterBase.ref.cpp @@ -1643,20 +1643,20 @@ void ActiveAsyncProductsTesterBase :: void ActiveAsyncProductsTesterBase :: pushProductRequestEntry( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - DpRequest e = { id, size }; + DpRequest e = { id, dataSize }; this->productRequestHistory->push_back(e); } void ActiveAsyncProductsTesterBase :: productRequest_handler( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - this->pushProductRequestEntry(id, size); + this->pushProductRequestEntry(id, dataSize); } void ActiveAsyncProductsTesterBase :: @@ -1783,11 +1783,11 @@ void ActiveAsyncProductsTesterBase :: Fw::PassiveComponentBase* const callComp, NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { ActiveAsyncProductsTesterBase* _testerBase = static_cast(callComp); - _testerBase->productRequest_handler(id, size); + _testerBase->productRequest_handler(id, dataSize); } void ActiveAsyncProductsTesterBase :: diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsTesterBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsTesterBase.ref.hpp index 295893e2f..095ee522c 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsTesterBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsTesterBase.ref.hpp @@ -864,7 +864,7 @@ class ActiveAsyncProductsTesterBase : //! Push an entry on the product request history void pushProductRequestEntry( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Handle a data product request from the component under test @@ -873,7 +873,7 @@ class ActiveAsyncProductsTesterBase : //! this behavior. virtual void productRequest_handler( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Send a data product response to the component under test @@ -949,7 +949,7 @@ class ActiveAsyncProductsTesterBase : Fw::PassiveComponentBase* const callComp, //!< The component instance NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Static function for port from_productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsGTestBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsGTestBase.ref.cpp index b97bbb851..c0f2effbf 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsGTestBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsGTestBase.ref.cpp @@ -186,8 +186,9 @@ void ActiveGetProductsGTestBase :: FwDpIdType id, FwDpPriorityType priority, const Fw::Time& timeTag, - Fw::DpCfg::ProcType procType, + Fw::DpCfg::ProcType::SerialType procTypes, const Fw::DpContainer::Header::UserData& userData, + Fw::DpState dpState, FwSizeType dataSize, Fw::Buffer& historyBuffer ) const @@ -219,8 +220,9 @@ void ActiveGetProductsGTestBase :: id, priority, timeTag, - procType, + procTypes, userData, + dpState, dataSize ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsGTestBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsGTestBase.ref.hpp index 271e942ce..18fadd1c6 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsGTestBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsGTestBase.ref.hpp @@ -210,8 +210,8 @@ #define ASSERT_PRODUCT_SEND_SIZE(size) \ this->assertProductSend_size(__FILE__, __LINE__, size) -#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procType, userData, dataSize, buffer) \ - assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procType, userData, dataSize, buffer) +#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) \ + assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) //! \class ActiveGetProductsGTestBase //! \brief Auto-generated base for ActiveGetProducts component Google Test harness @@ -322,8 +322,9 @@ class ActiveGetProductsGTestBase : FwDpIdType id, //!< The expected container ID (input) FwDpPriorityType priority, //!< The expected priority (input) const Fw::Time& timeTag, //!< The expected time tag (input) - Fw::DpCfg::ProcType procType, //!< The expected processing type (input) + Fw::DpCfg::ProcType::SerialType procTypes, //!< The expected processing types (input) const Fw::DpContainer::Header::UserData& userData, //!< The expected user data (input) + Fw::DpState dpState, //!< The expected data product state (input) FwSizeType dataSize, //!< The expected data size (input) Fw::Buffer& historyBuffer //!< The buffer from the history (output) ) const; diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsTesterBase.ref.cpp index 7ecf6271f..4697d2274 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsTesterBase.ref.cpp @@ -1589,22 +1589,22 @@ void ActiveGetProductsTesterBase :: void ActiveGetProductsTesterBase :: pushProductGetEntry( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - DpGet e = { id, size }; + DpGet e = { id, dataSize }; this->productGetHistory->push_back(e); } Fw::Success::T ActiveGetProductsTesterBase :: productGet_handler( FwDpIdType id, - FwSizeType size, + FwSizeType dataSize, Fw::Buffer& buffer ) { (void) buffer; - this->pushProductGetEntry(id, size); + this->pushProductGetEntry(id, dataSize); return Fw::Success::FAILURE; } @@ -1720,12 +1720,12 @@ Fw::Success ActiveGetProductsTesterBase :: Fw::PassiveComponentBase* const callComp, NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size, + FwSizeType dataSize, Fw::Buffer& buffer ) { ActiveGetProductsTesterBase* _testerBase = static_cast(callComp); - return _testerBase->productGet_handler(id, size, buffer); + return _testerBase->productGet_handler(id, dataSize, buffer); } void ActiveGetProductsTesterBase :: diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsTesterBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsTesterBase.ref.hpp index a7289591f..97e6b70b2 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsTesterBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsTesterBase.ref.hpp @@ -845,8 +845,8 @@ class ActiveGetProductsTesterBase : //! Push an entry on the product get history void pushProductGetEntry( - FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwDpIdType id, //!< The container ID (input) + FwSizeType dataSize //!< The data size of the requested buffer (input) ); //! Handle a data product get from the component under test @@ -855,9 +855,9 @@ class ActiveGetProductsTesterBase : //! and return FAILURE. You can override this behavior, e.g., to call //! pushProductGetEntry, allocate a buffer and return SUCCESS. virtual Fw::Success::T productGet_handler( - FwDpIdType id, //!< The container ID - FwSizeType size, //!< The size of the requested buffer - Fw::Buffer& buffer //!< The buffer + FwDpIdType id, //!< The container ID (input) + FwSizeType dataSize, //!< The data size of the requested buffer (input) + Fw::Buffer& buffer //!< The buffer (output) ); //! Push an entry on the product send history @@ -925,9 +925,9 @@ class ActiveGetProductsTesterBase : static Fw::Success from_productGetOut_static( Fw::PassiveComponentBase* const callComp, //!< The component instance NATIVE_INT_TYPE portNum, //!< The port number - FwDpIdType id, //!< The container ID - FwSizeType size, //!< The size of the requested buffer - Fw::Buffer& buffer //!< The buffer + FwDpIdType id, //!< The container ID (input) + FwSizeType dataSize, //!< The data size of the requested buffer (input) + Fw::Buffer& buffer //!< The buffer (output) ); //! Static function for port from_productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsGTestBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsGTestBase.ref.cpp index e682561b4..29976b071 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsGTestBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsGTestBase.ref.cpp @@ -186,8 +186,9 @@ void ActiveGuardedProductsGTestBase :: FwDpIdType id, FwDpPriorityType priority, const Fw::Time& timeTag, - Fw::DpCfg::ProcType procType, + Fw::DpCfg::ProcType::SerialType procTypes, const Fw::DpContainer::Header::UserData& userData, + Fw::DpState dpState, FwSizeType dataSize, Fw::Buffer& historyBuffer ) const @@ -219,8 +220,9 @@ void ActiveGuardedProductsGTestBase :: id, priority, timeTag, - procType, + procTypes, userData, + dpState, dataSize ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsGTestBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsGTestBase.ref.hpp index dc2c40d60..2a73caf4e 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsGTestBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsGTestBase.ref.hpp @@ -210,8 +210,8 @@ #define ASSERT_PRODUCT_SEND_SIZE(size) \ this->assertProductSend_size(__FILE__, __LINE__, size) -#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procType, userData, dataSize, buffer) \ - assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procType, userData, dataSize, buffer) +#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) \ + assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) //! \class ActiveGuardedProductsGTestBase //! \brief Auto-generated base for ActiveGuardedProducts component Google Test harness @@ -322,8 +322,9 @@ class ActiveGuardedProductsGTestBase : FwDpIdType id, //!< The expected container ID (input) FwDpPriorityType priority, //!< The expected priority (input) const Fw::Time& timeTag, //!< The expected time tag (input) - Fw::DpCfg::ProcType procType, //!< The expected processing type (input) + Fw::DpCfg::ProcType::SerialType procTypes, //!< The expected processing types (input) const Fw::DpContainer::Header::UserData& userData, //!< The expected user data (input) + Fw::DpState dpState, //!< The expected data product state (input) FwSizeType dataSize, //!< The expected data size (input) Fw::Buffer& historyBuffer //!< The buffer from the history (output) ) const; diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsTesterBase.ref.cpp index 96447d497..8f89927ed 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsTesterBase.ref.cpp @@ -1643,20 +1643,20 @@ void ActiveGuardedProductsTesterBase :: void ActiveGuardedProductsTesterBase :: pushProductRequestEntry( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - DpRequest e = { id, size }; + DpRequest e = { id, dataSize }; this->productRequestHistory->push_back(e); } void ActiveGuardedProductsTesterBase :: productRequest_handler( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - this->pushProductRequestEntry(id, size); + this->pushProductRequestEntry(id, dataSize); } void ActiveGuardedProductsTesterBase :: @@ -1783,11 +1783,11 @@ void ActiveGuardedProductsTesterBase :: Fw::PassiveComponentBase* const callComp, NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { ActiveGuardedProductsTesterBase* _testerBase = static_cast(callComp); - _testerBase->productRequest_handler(id, size); + _testerBase->productRequest_handler(id, dataSize); } void ActiveGuardedProductsTesterBase :: diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsTesterBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsTesterBase.ref.hpp index 45dac5078..8de2331aa 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsTesterBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsTesterBase.ref.hpp @@ -864,7 +864,7 @@ class ActiveGuardedProductsTesterBase : //! Push an entry on the product request history void pushProductRequestEntry( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Handle a data product request from the component under test @@ -873,7 +873,7 @@ class ActiveGuardedProductsTesterBase : //! this behavior. virtual void productRequest_handler( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Send a data product response to the component under test @@ -949,7 +949,7 @@ class ActiveGuardedProductsTesterBase : Fw::PassiveComponentBase* const callComp, //!< The component instance NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Static function for port from_productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsGTestBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsGTestBase.ref.cpp index badb232c8..3534f6db3 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsGTestBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsGTestBase.ref.cpp @@ -186,8 +186,9 @@ void ActiveSyncProductsGTestBase :: FwDpIdType id, FwDpPriorityType priority, const Fw::Time& timeTag, - Fw::DpCfg::ProcType procType, + Fw::DpCfg::ProcType::SerialType procTypes, const Fw::DpContainer::Header::UserData& userData, + Fw::DpState dpState, FwSizeType dataSize, Fw::Buffer& historyBuffer ) const @@ -219,8 +220,9 @@ void ActiveSyncProductsGTestBase :: id, priority, timeTag, - procType, + procTypes, userData, + dpState, dataSize ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsGTestBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsGTestBase.ref.hpp index 0b2f1c17c..3aa714ec4 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsGTestBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsGTestBase.ref.hpp @@ -210,8 +210,8 @@ #define ASSERT_PRODUCT_SEND_SIZE(size) \ this->assertProductSend_size(__FILE__, __LINE__, size) -#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procType, userData, dataSize, buffer) \ - assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procType, userData, dataSize, buffer) +#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) \ + assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) //! \class ActiveSyncProductsGTestBase //! \brief Auto-generated base for ActiveSyncProducts component Google Test harness @@ -322,8 +322,9 @@ class ActiveSyncProductsGTestBase : FwDpIdType id, //!< The expected container ID (input) FwDpPriorityType priority, //!< The expected priority (input) const Fw::Time& timeTag, //!< The expected time tag (input) - Fw::DpCfg::ProcType procType, //!< The expected processing type (input) + Fw::DpCfg::ProcType::SerialType procTypes, //!< The expected processing types (input) const Fw::DpContainer::Header::UserData& userData, //!< The expected user data (input) + Fw::DpState dpState, //!< The expected data product state (input) FwSizeType dataSize, //!< The expected data size (input) Fw::Buffer& historyBuffer //!< The buffer from the history (output) ) const; diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsTesterBase.ref.cpp index 4fc566993..40462863a 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsTesterBase.ref.cpp @@ -1643,20 +1643,20 @@ void ActiveSyncProductsTesterBase :: void ActiveSyncProductsTesterBase :: pushProductRequestEntry( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - DpRequest e = { id, size }; + DpRequest e = { id, dataSize }; this->productRequestHistory->push_back(e); } void ActiveSyncProductsTesterBase :: productRequest_handler( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - this->pushProductRequestEntry(id, size); + this->pushProductRequestEntry(id, dataSize); } void ActiveSyncProductsTesterBase :: @@ -1783,11 +1783,11 @@ void ActiveSyncProductsTesterBase :: Fw::PassiveComponentBase* const callComp, NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { ActiveSyncProductsTesterBase* _testerBase = static_cast(callComp); - _testerBase->productRequest_handler(id, size); + _testerBase->productRequest_handler(id, dataSize); } void ActiveSyncProductsTesterBase :: diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsTesterBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsTesterBase.ref.hpp index b4ece2925..96be68ba1 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsTesterBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsTesterBase.ref.hpp @@ -864,7 +864,7 @@ class ActiveSyncProductsTesterBase : //! Push an entry on the product request history void pushProductRequestEntry( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Handle a data product request from the component under test @@ -873,7 +873,7 @@ class ActiveSyncProductsTesterBase : //! this behavior. virtual void productRequest_handler( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Send a data product response to the component under test @@ -949,7 +949,7 @@ class ActiveSyncProductsTesterBase : Fw::PassiveComponentBase* const callComp, //!< The component instance NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Static function for port from_productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestGTestBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestGTestBase.ref.cpp index 1d6c95409..4ab17a02e 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestGTestBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestGTestBase.ref.cpp @@ -1018,8 +1018,9 @@ namespace M { FwDpIdType id, FwDpPriorityType priority, const Fw::Time& timeTag, - Fw::DpCfg::ProcType procType, + Fw::DpCfg::ProcType::SerialType procTypes, const Fw::DpContainer::Header::UserData& userData, + Fw::DpState dpState, FwSizeType dataSize, Fw::Buffer& historyBuffer ) const @@ -1051,8 +1052,9 @@ namespace M { id, priority, timeTag, - procType, + procTypes, userData, + dpState, dataSize ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestGTestBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestGTestBase.ref.hpp index a43e3ccdf..775b49075 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestGTestBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestGTestBase.ref.hpp @@ -336,8 +336,8 @@ #define ASSERT_PRODUCT_SEND_SIZE(size) \ this->assertProductSend_size(__FILE__, __LINE__, size) -#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procType, userData, dataSize, buffer) \ - assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procType, userData, dataSize, buffer) +#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) \ + assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) namespace M { @@ -756,8 +756,9 @@ namespace M { FwDpIdType id, //!< The expected container ID (input) FwDpPriorityType priority, //!< The expected priority (input) const Fw::Time& timeTag, //!< The expected time tag (input) - Fw::DpCfg::ProcType procType, //!< The expected processing type (input) + Fw::DpCfg::ProcType::SerialType procTypes, //!< The expected processing types (input) const Fw::DpContainer::Header::UserData& userData, //!< The expected user data (input) + Fw::DpState dpState, //!< The expected data product state (input) FwSizeType dataSize, //!< The expected data size (input) Fw::Buffer& historyBuffer //!< The buffer from the history (output) ) const; diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestTesterBase.ref.cpp index dc4ed624e..5f8e5431a 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestTesterBase.ref.cpp @@ -3569,20 +3569,20 @@ namespace M { void ActiveTestTesterBase :: pushProductRequestEntry( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - DpRequest e = { id, size }; + DpRequest e = { id, dataSize }; this->productRequestHistory->push_back(e); } void ActiveTestTesterBase :: productRequest_handler( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - this->pushProductRequestEntry(id, size); + this->pushProductRequestEntry(id, dataSize); } void ActiveTestTesterBase :: @@ -4037,11 +4037,11 @@ namespace M { Fw::PassiveComponentBase* const callComp, NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { ActiveTestTesterBase* _testerBase = static_cast(callComp); - _testerBase->productRequest_handler(id, size); + _testerBase->productRequest_handler(id, dataSize); } void ActiveTestTesterBase :: diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestTesterBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestTesterBase.ref.hpp index c7b93f3cb..5a0dbdca9 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestTesterBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestTesterBase.ref.hpp @@ -1372,7 +1372,7 @@ namespace M { //! Push an entry on the product request history void pushProductRequestEntry( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Handle a data product request from the component under test @@ -1381,7 +1381,7 @@ namespace M { //! this behavior. virtual void productRequest_handler( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Send a data product response to the component under test @@ -1518,7 +1518,7 @@ namespace M { Fw::PassiveComponentBase* const callComp, //!< The component instance NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Static function for port from_productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsGTestBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsGTestBase.ref.cpp index ae3cc1771..1f0d5734a 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsGTestBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsGTestBase.ref.cpp @@ -186,8 +186,9 @@ void PassiveGetProductsGTestBase :: FwDpIdType id, FwDpPriorityType priority, const Fw::Time& timeTag, - Fw::DpCfg::ProcType procType, + Fw::DpCfg::ProcType::SerialType procTypes, const Fw::DpContainer::Header::UserData& userData, + Fw::DpState dpState, FwSizeType dataSize, Fw::Buffer& historyBuffer ) const @@ -219,8 +220,9 @@ void PassiveGetProductsGTestBase :: id, priority, timeTag, - procType, + procTypes, userData, + dpState, dataSize ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsGTestBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsGTestBase.ref.hpp index d41902ef3..8d5709d3a 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsGTestBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsGTestBase.ref.hpp @@ -210,8 +210,8 @@ #define ASSERT_PRODUCT_SEND_SIZE(size) \ this->assertProductSend_size(__FILE__, __LINE__, size) -#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procType, userData, dataSize, buffer) \ - assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procType, userData, dataSize, buffer) +#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) \ + assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) //! \class PassiveGetProductsGTestBase //! \brief Auto-generated base for PassiveGetProducts component Google Test harness @@ -322,8 +322,9 @@ class PassiveGetProductsGTestBase : FwDpIdType id, //!< The expected container ID (input) FwDpPriorityType priority, //!< The expected priority (input) const Fw::Time& timeTag, //!< The expected time tag (input) - Fw::DpCfg::ProcType procType, //!< The expected processing type (input) + Fw::DpCfg::ProcType::SerialType procTypes, //!< The expected processing types (input) const Fw::DpContainer::Header::UserData& userData, //!< The expected user data (input) + Fw::DpState dpState, //!< The expected data product state (input) FwSizeType dataSize, //!< The expected data size (input) Fw::Buffer& historyBuffer //!< The buffer from the history (output) ) const; diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsTesterBase.ref.cpp index f3e302572..dbfb18511 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsTesterBase.ref.cpp @@ -1206,22 +1206,22 @@ void PassiveGetProductsTesterBase :: void PassiveGetProductsTesterBase :: pushProductGetEntry( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - DpGet e = { id, size }; + DpGet e = { id, dataSize }; this->productGetHistory->push_back(e); } Fw::Success::T PassiveGetProductsTesterBase :: productGet_handler( FwDpIdType id, - FwSizeType size, + FwSizeType dataSize, Fw::Buffer& buffer ) { (void) buffer; - this->pushProductGetEntry(id, size); + this->pushProductGetEntry(id, dataSize); return Fw::Success::FAILURE; } @@ -1337,12 +1337,12 @@ Fw::Success PassiveGetProductsTesterBase :: Fw::PassiveComponentBase* const callComp, NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size, + FwSizeType dataSize, Fw::Buffer& buffer ) { PassiveGetProductsTesterBase* _testerBase = static_cast(callComp); - return _testerBase->productGet_handler(id, size, buffer); + return _testerBase->productGet_handler(id, dataSize, buffer); } void PassiveGetProductsTesterBase :: diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsTesterBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsTesterBase.ref.hpp index 01d49b464..198a548c3 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsTesterBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsTesterBase.ref.hpp @@ -702,8 +702,8 @@ class PassiveGetProductsTesterBase : //! Push an entry on the product get history void pushProductGetEntry( - FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwDpIdType id, //!< The container ID (input) + FwSizeType dataSize //!< The data size of the requested buffer (input) ); //! Handle a data product get from the component under test @@ -712,9 +712,9 @@ class PassiveGetProductsTesterBase : //! and return FAILURE. You can override this behavior, e.g., to call //! pushProductGetEntry, allocate a buffer and return SUCCESS. virtual Fw::Success::T productGet_handler( - FwDpIdType id, //!< The container ID - FwSizeType size, //!< The size of the requested buffer - Fw::Buffer& buffer //!< The buffer + FwDpIdType id, //!< The container ID (input) + FwSizeType dataSize, //!< The data size of the requested buffer (input) + Fw::Buffer& buffer //!< The buffer (output) ); //! Push an entry on the product send history @@ -782,9 +782,9 @@ class PassiveGetProductsTesterBase : static Fw::Success from_productGetOut_static( Fw::PassiveComponentBase* const callComp, //!< The component instance NATIVE_INT_TYPE portNum, //!< The port number - FwDpIdType id, //!< The container ID - FwSizeType size, //!< The size of the requested buffer - Fw::Buffer& buffer //!< The buffer + FwDpIdType id, //!< The container ID (input) + FwSizeType dataSize, //!< The data size of the requested buffer (input) + Fw::Buffer& buffer //!< The buffer (output) ); //! Static function for port from_productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsGTestBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsGTestBase.ref.cpp index cc99791e0..8acab9efd 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsGTestBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsGTestBase.ref.cpp @@ -186,8 +186,9 @@ void PassiveGuardedProductsGTestBase :: FwDpIdType id, FwDpPriorityType priority, const Fw::Time& timeTag, - Fw::DpCfg::ProcType procType, + Fw::DpCfg::ProcType::SerialType procTypes, const Fw::DpContainer::Header::UserData& userData, + Fw::DpState dpState, FwSizeType dataSize, Fw::Buffer& historyBuffer ) const @@ -219,8 +220,9 @@ void PassiveGuardedProductsGTestBase :: id, priority, timeTag, - procType, + procTypes, userData, + dpState, dataSize ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsGTestBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsGTestBase.ref.hpp index 7e1778b15..5a2025193 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsGTestBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsGTestBase.ref.hpp @@ -210,8 +210,8 @@ #define ASSERT_PRODUCT_SEND_SIZE(size) \ this->assertProductSend_size(__FILE__, __LINE__, size) -#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procType, userData, dataSize, buffer) \ - assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procType, userData, dataSize, buffer) +#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) \ + assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) //! \class PassiveGuardedProductsGTestBase //! \brief Auto-generated base for PassiveGuardedProducts component Google Test harness @@ -322,8 +322,9 @@ class PassiveGuardedProductsGTestBase : FwDpIdType id, //!< The expected container ID (input) FwDpPriorityType priority, //!< The expected priority (input) const Fw::Time& timeTag, //!< The expected time tag (input) - Fw::DpCfg::ProcType procType, //!< The expected processing type (input) + Fw::DpCfg::ProcType::SerialType procTypes, //!< The expected processing types (input) const Fw::DpContainer::Header::UserData& userData, //!< The expected user data (input) + Fw::DpState dpState, //!< The expected data product state (input) FwSizeType dataSize, //!< The expected data size (input) Fw::Buffer& historyBuffer //!< The buffer from the history (output) ) const; diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsTesterBase.ref.cpp index 1b0f460fb..cd0bfdc14 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsTesterBase.ref.cpp @@ -1260,20 +1260,20 @@ void PassiveGuardedProductsTesterBase :: void PassiveGuardedProductsTesterBase :: pushProductRequestEntry( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - DpRequest e = { id, size }; + DpRequest e = { id, dataSize }; this->productRequestHistory->push_back(e); } void PassiveGuardedProductsTesterBase :: productRequest_handler( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - this->pushProductRequestEntry(id, size); + this->pushProductRequestEntry(id, dataSize); } void PassiveGuardedProductsTesterBase :: @@ -1400,11 +1400,11 @@ void PassiveGuardedProductsTesterBase :: Fw::PassiveComponentBase* const callComp, NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { PassiveGuardedProductsTesterBase* _testerBase = static_cast(callComp); - _testerBase->productRequest_handler(id, size); + _testerBase->productRequest_handler(id, dataSize); } void PassiveGuardedProductsTesterBase :: diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsTesterBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsTesterBase.ref.hpp index 197ee18d5..bd48bf7bb 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsTesterBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsTesterBase.ref.hpp @@ -721,7 +721,7 @@ class PassiveGuardedProductsTesterBase : //! Push an entry on the product request history void pushProductRequestEntry( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Handle a data product request from the component under test @@ -730,7 +730,7 @@ class PassiveGuardedProductsTesterBase : //! this behavior. virtual void productRequest_handler( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Send a data product response to the component under test @@ -806,7 +806,7 @@ class PassiveGuardedProductsTesterBase : Fw::PassiveComponentBase* const callComp, //!< The component instance NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Static function for port from_productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsGTestBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsGTestBase.ref.cpp index 1b960fa8f..a2f9ffc17 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsGTestBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsGTestBase.ref.cpp @@ -186,8 +186,9 @@ void PassiveSyncProductsGTestBase :: FwDpIdType id, FwDpPriorityType priority, const Fw::Time& timeTag, - Fw::DpCfg::ProcType procType, + Fw::DpCfg::ProcType::SerialType procTypes, const Fw::DpContainer::Header::UserData& userData, + Fw::DpState dpState, FwSizeType dataSize, Fw::Buffer& historyBuffer ) const @@ -219,8 +220,9 @@ void PassiveSyncProductsGTestBase :: id, priority, timeTag, - procType, + procTypes, userData, + dpState, dataSize ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsGTestBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsGTestBase.ref.hpp index 946f19fa2..1b8c98ce3 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsGTestBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsGTestBase.ref.hpp @@ -210,8 +210,8 @@ #define ASSERT_PRODUCT_SEND_SIZE(size) \ this->assertProductSend_size(__FILE__, __LINE__, size) -#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procType, userData, dataSize, buffer) \ - assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procType, userData, dataSize, buffer) +#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) \ + assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) //! \class PassiveSyncProductsGTestBase //! \brief Auto-generated base for PassiveSyncProducts component Google Test harness @@ -322,8 +322,9 @@ class PassiveSyncProductsGTestBase : FwDpIdType id, //!< The expected container ID (input) FwDpPriorityType priority, //!< The expected priority (input) const Fw::Time& timeTag, //!< The expected time tag (input) - Fw::DpCfg::ProcType procType, //!< The expected processing type (input) + Fw::DpCfg::ProcType::SerialType procTypes, //!< The expected processing types (input) const Fw::DpContainer::Header::UserData& userData, //!< The expected user data (input) + Fw::DpState dpState, //!< The expected data product state (input) FwSizeType dataSize, //!< The expected data size (input) Fw::Buffer& historyBuffer //!< The buffer from the history (output) ) const; diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsTesterBase.ref.cpp index 4460fd9cc..93831599e 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsTesterBase.ref.cpp @@ -1260,20 +1260,20 @@ void PassiveSyncProductsTesterBase :: void PassiveSyncProductsTesterBase :: pushProductRequestEntry( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - DpRequest e = { id, size }; + DpRequest e = { id, dataSize }; this->productRequestHistory->push_back(e); } void PassiveSyncProductsTesterBase :: productRequest_handler( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - this->pushProductRequestEntry(id, size); + this->pushProductRequestEntry(id, dataSize); } void PassiveSyncProductsTesterBase :: @@ -1400,11 +1400,11 @@ void PassiveSyncProductsTesterBase :: Fw::PassiveComponentBase* const callComp, NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { PassiveSyncProductsTesterBase* _testerBase = static_cast(callComp); - _testerBase->productRequest_handler(id, size); + _testerBase->productRequest_handler(id, dataSize); } void PassiveSyncProductsTesterBase :: diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsTesterBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsTesterBase.ref.hpp index ef3818955..272fc9d05 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsTesterBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsTesterBase.ref.hpp @@ -721,7 +721,7 @@ class PassiveSyncProductsTesterBase : //! Push an entry on the product request history void pushProductRequestEntry( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Handle a data product request from the component under test @@ -730,7 +730,7 @@ class PassiveSyncProductsTesterBase : //! this behavior. virtual void productRequest_handler( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Send a data product response to the component under test @@ -806,7 +806,7 @@ class PassiveSyncProductsTesterBase : Fw::PassiveComponentBase* const callComp, //!< The component instance NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Static function for port from_productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestGTestBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestGTestBase.ref.cpp index bbca1d795..872db2f92 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestGTestBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestGTestBase.ref.cpp @@ -1016,8 +1016,9 @@ void PassiveTestGTestBase :: FwDpIdType id, FwDpPriorityType priority, const Fw::Time& timeTag, - Fw::DpCfg::ProcType procType, + Fw::DpCfg::ProcType::SerialType procTypes, const Fw::DpContainer::Header::UserData& userData, + Fw::DpState dpState, FwSizeType dataSize, Fw::Buffer& historyBuffer ) const @@ -1049,8 +1050,9 @@ void PassiveTestGTestBase :: id, priority, timeTag, - procType, + procTypes, userData, + dpState, dataSize ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestGTestBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestGTestBase.ref.hpp index eda9db33f..2c7cd55f1 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestGTestBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestGTestBase.ref.hpp @@ -336,8 +336,8 @@ #define ASSERT_PRODUCT_SEND_SIZE(size) \ this->assertProductSend_size(__FILE__, __LINE__, size) -#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procType, userData, dataSize, buffer) \ - assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procType, userData, dataSize, buffer) +#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) \ + assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) //! \class PassiveTestGTestBase //! \brief Auto-generated base for PassiveTest component Google Test harness @@ -754,8 +754,9 @@ class PassiveTestGTestBase : FwDpIdType id, //!< The expected container ID (input) FwDpPriorityType priority, //!< The expected priority (input) const Fw::Time& timeTag, //!< The expected time tag (input) - Fw::DpCfg::ProcType procType, //!< The expected processing type (input) + Fw::DpCfg::ProcType::SerialType procTypes, //!< The expected processing types (input) const Fw::DpContainer::Header::UserData& userData, //!< The expected user data (input) + Fw::DpState dpState, //!< The expected data product state (input) FwSizeType dataSize, //!< The expected data size (input) Fw::Buffer& historyBuffer //!< The buffer from the history (output) ) const; diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestTesterBase.ref.cpp index ad6b2db92..73b5ef361 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestTesterBase.ref.cpp @@ -3041,20 +3041,20 @@ void PassiveTestTesterBase :: void PassiveTestTesterBase :: pushProductRequestEntry( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - DpRequest e = { id, size }; + DpRequest e = { id, dataSize }; this->productRequestHistory->push_back(e); } void PassiveTestTesterBase :: productRequest_handler( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - this->pushProductRequestEntry(id, size); + this->pushProductRequestEntry(id, dataSize); } void PassiveTestTesterBase :: @@ -3509,11 +3509,11 @@ void PassiveTestTesterBase :: Fw::PassiveComponentBase* const callComp, NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { PassiveTestTesterBase* _testerBase = static_cast(callComp); - _testerBase->productRequest_handler(id, size); + _testerBase->productRequest_handler(id, dataSize); } void PassiveTestTesterBase :: diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestTesterBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestTesterBase.ref.hpp index 359fd29e9..3e8eb3124 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestTesterBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestTesterBase.ref.hpp @@ -1195,7 +1195,7 @@ class PassiveTestTesterBase : //! Push an entry on the product request history void pushProductRequestEntry( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Handle a data product request from the component under test @@ -1204,7 +1204,7 @@ class PassiveTestTesterBase : //! this behavior. virtual void productRequest_handler( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Send a data product response to the component under test @@ -1341,7 +1341,7 @@ class PassiveTestTesterBase : Fw::PassiveComponentBase* const callComp, //!< The component instance NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Static function for port from_productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsGTestBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsGTestBase.ref.cpp index 8e47a55c0..aff326e89 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsGTestBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsGTestBase.ref.cpp @@ -186,8 +186,9 @@ void QueuedAsyncProductsGTestBase :: FwDpIdType id, FwDpPriorityType priority, const Fw::Time& timeTag, - Fw::DpCfg::ProcType procType, + Fw::DpCfg::ProcType::SerialType procTypes, const Fw::DpContainer::Header::UserData& userData, + Fw::DpState dpState, FwSizeType dataSize, Fw::Buffer& historyBuffer ) const @@ -219,8 +220,9 @@ void QueuedAsyncProductsGTestBase :: id, priority, timeTag, - procType, + procTypes, userData, + dpState, dataSize ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsGTestBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsGTestBase.ref.hpp index 3150ff35b..c651078f6 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsGTestBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsGTestBase.ref.hpp @@ -210,8 +210,8 @@ #define ASSERT_PRODUCT_SEND_SIZE(size) \ this->assertProductSend_size(__FILE__, __LINE__, size) -#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procType, userData, dataSize, buffer) \ - assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procType, userData, dataSize, buffer) +#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) \ + assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) //! \class QueuedAsyncProductsGTestBase //! \brief Auto-generated base for QueuedAsyncProducts component Google Test harness @@ -322,8 +322,9 @@ class QueuedAsyncProductsGTestBase : FwDpIdType id, //!< The expected container ID (input) FwDpPriorityType priority, //!< The expected priority (input) const Fw::Time& timeTag, //!< The expected time tag (input) - Fw::DpCfg::ProcType procType, //!< The expected processing type (input) + Fw::DpCfg::ProcType::SerialType procTypes, //!< The expected processing types (input) const Fw::DpContainer::Header::UserData& userData, //!< The expected user data (input) + Fw::DpState dpState, //!< The expected data product state (input) FwSizeType dataSize, //!< The expected data size (input) Fw::Buffer& historyBuffer //!< The buffer from the history (output) ) const; diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsTesterBase.ref.cpp index b54d08764..2e6056ee4 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsTesterBase.ref.cpp @@ -1643,20 +1643,20 @@ void QueuedAsyncProductsTesterBase :: void QueuedAsyncProductsTesterBase :: pushProductRequestEntry( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - DpRequest e = { id, size }; + DpRequest e = { id, dataSize }; this->productRequestHistory->push_back(e); } void QueuedAsyncProductsTesterBase :: productRequest_handler( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - this->pushProductRequestEntry(id, size); + this->pushProductRequestEntry(id, dataSize); } void QueuedAsyncProductsTesterBase :: @@ -1783,11 +1783,11 @@ void QueuedAsyncProductsTesterBase :: Fw::PassiveComponentBase* const callComp, NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { QueuedAsyncProductsTesterBase* _testerBase = static_cast(callComp); - _testerBase->productRequest_handler(id, size); + _testerBase->productRequest_handler(id, dataSize); } void QueuedAsyncProductsTesterBase :: diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsTesterBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsTesterBase.ref.hpp index 904dc4a22..02e19549a 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsTesterBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsTesterBase.ref.hpp @@ -864,7 +864,7 @@ class QueuedAsyncProductsTesterBase : //! Push an entry on the product request history void pushProductRequestEntry( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Handle a data product request from the component under test @@ -873,7 +873,7 @@ class QueuedAsyncProductsTesterBase : //! this behavior. virtual void productRequest_handler( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Send a data product response to the component under test @@ -949,7 +949,7 @@ class QueuedAsyncProductsTesterBase : Fw::PassiveComponentBase* const callComp, //!< The component instance NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Static function for port from_productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsGTestBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsGTestBase.ref.cpp index a82652684..51f23ed21 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsGTestBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsGTestBase.ref.cpp @@ -186,8 +186,9 @@ void QueuedGetProductsGTestBase :: FwDpIdType id, FwDpPriorityType priority, const Fw::Time& timeTag, - Fw::DpCfg::ProcType procType, + Fw::DpCfg::ProcType::SerialType procTypes, const Fw::DpContainer::Header::UserData& userData, + Fw::DpState dpState, FwSizeType dataSize, Fw::Buffer& historyBuffer ) const @@ -219,8 +220,9 @@ void QueuedGetProductsGTestBase :: id, priority, timeTag, - procType, + procTypes, userData, + dpState, dataSize ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsGTestBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsGTestBase.ref.hpp index 75ea3145f..0e5182784 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsGTestBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsGTestBase.ref.hpp @@ -210,8 +210,8 @@ #define ASSERT_PRODUCT_SEND_SIZE(size) \ this->assertProductSend_size(__FILE__, __LINE__, size) -#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procType, userData, dataSize, buffer) \ - assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procType, userData, dataSize, buffer) +#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) \ + assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) //! \class QueuedGetProductsGTestBase //! \brief Auto-generated base for QueuedGetProducts component Google Test harness @@ -322,8 +322,9 @@ class QueuedGetProductsGTestBase : FwDpIdType id, //!< The expected container ID (input) FwDpPriorityType priority, //!< The expected priority (input) const Fw::Time& timeTag, //!< The expected time tag (input) - Fw::DpCfg::ProcType procType, //!< The expected processing type (input) + Fw::DpCfg::ProcType::SerialType procTypes, //!< The expected processing types (input) const Fw::DpContainer::Header::UserData& userData, //!< The expected user data (input) + Fw::DpState dpState, //!< The expected data product state (input) FwSizeType dataSize, //!< The expected data size (input) Fw::Buffer& historyBuffer //!< The buffer from the history (output) ) const; diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsTesterBase.ref.cpp index 358b07840..055213cf9 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsTesterBase.ref.cpp @@ -1589,22 +1589,22 @@ void QueuedGetProductsTesterBase :: void QueuedGetProductsTesterBase :: pushProductGetEntry( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - DpGet e = { id, size }; + DpGet e = { id, dataSize }; this->productGetHistory->push_back(e); } Fw::Success::T QueuedGetProductsTesterBase :: productGet_handler( FwDpIdType id, - FwSizeType size, + FwSizeType dataSize, Fw::Buffer& buffer ) { (void) buffer; - this->pushProductGetEntry(id, size); + this->pushProductGetEntry(id, dataSize); return Fw::Success::FAILURE; } @@ -1720,12 +1720,12 @@ Fw::Success QueuedGetProductsTesterBase :: Fw::PassiveComponentBase* const callComp, NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size, + FwSizeType dataSize, Fw::Buffer& buffer ) { QueuedGetProductsTesterBase* _testerBase = static_cast(callComp); - return _testerBase->productGet_handler(id, size, buffer); + return _testerBase->productGet_handler(id, dataSize, buffer); } void QueuedGetProductsTesterBase :: diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsTesterBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsTesterBase.ref.hpp index f83529e13..4a993382c 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsTesterBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsTesterBase.ref.hpp @@ -845,8 +845,8 @@ class QueuedGetProductsTesterBase : //! Push an entry on the product get history void pushProductGetEntry( - FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwDpIdType id, //!< The container ID (input) + FwSizeType dataSize //!< The data size of the requested buffer (input) ); //! Handle a data product get from the component under test @@ -855,9 +855,9 @@ class QueuedGetProductsTesterBase : //! and return FAILURE. You can override this behavior, e.g., to call //! pushProductGetEntry, allocate a buffer and return SUCCESS. virtual Fw::Success::T productGet_handler( - FwDpIdType id, //!< The container ID - FwSizeType size, //!< The size of the requested buffer - Fw::Buffer& buffer //!< The buffer + FwDpIdType id, //!< The container ID (input) + FwSizeType dataSize, //!< The data size of the requested buffer (input) + Fw::Buffer& buffer //!< The buffer (output) ); //! Push an entry on the product send history @@ -925,9 +925,9 @@ class QueuedGetProductsTesterBase : static Fw::Success from_productGetOut_static( Fw::PassiveComponentBase* const callComp, //!< The component instance NATIVE_INT_TYPE portNum, //!< The port number - FwDpIdType id, //!< The container ID - FwSizeType size, //!< The size of the requested buffer - Fw::Buffer& buffer //!< The buffer + FwDpIdType id, //!< The container ID (input) + FwSizeType dataSize, //!< The data size of the requested buffer (input) + Fw::Buffer& buffer //!< The buffer (output) ); //! Static function for port from_productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsGTestBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsGTestBase.ref.cpp index 5cdbea27c..1323b48bc 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsGTestBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsGTestBase.ref.cpp @@ -186,8 +186,9 @@ void QueuedGuardedProductsGTestBase :: FwDpIdType id, FwDpPriorityType priority, const Fw::Time& timeTag, - Fw::DpCfg::ProcType procType, + Fw::DpCfg::ProcType::SerialType procTypes, const Fw::DpContainer::Header::UserData& userData, + Fw::DpState dpState, FwSizeType dataSize, Fw::Buffer& historyBuffer ) const @@ -219,8 +220,9 @@ void QueuedGuardedProductsGTestBase :: id, priority, timeTag, - procType, + procTypes, userData, + dpState, dataSize ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsGTestBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsGTestBase.ref.hpp index bfac9faeb..0610e0b2e 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsGTestBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsGTestBase.ref.hpp @@ -210,8 +210,8 @@ #define ASSERT_PRODUCT_SEND_SIZE(size) \ this->assertProductSend_size(__FILE__, __LINE__, size) -#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procType, userData, dataSize, buffer) \ - assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procType, userData, dataSize, buffer) +#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) \ + assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) //! \class QueuedGuardedProductsGTestBase //! \brief Auto-generated base for QueuedGuardedProducts component Google Test harness @@ -322,8 +322,9 @@ class QueuedGuardedProductsGTestBase : FwDpIdType id, //!< The expected container ID (input) FwDpPriorityType priority, //!< The expected priority (input) const Fw::Time& timeTag, //!< The expected time tag (input) - Fw::DpCfg::ProcType procType, //!< The expected processing type (input) + Fw::DpCfg::ProcType::SerialType procTypes, //!< The expected processing types (input) const Fw::DpContainer::Header::UserData& userData, //!< The expected user data (input) + Fw::DpState dpState, //!< The expected data product state (input) FwSizeType dataSize, //!< The expected data size (input) Fw::Buffer& historyBuffer //!< The buffer from the history (output) ) const; diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsTesterBase.ref.cpp index 817f1767f..709cbe683 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsTesterBase.ref.cpp @@ -1643,20 +1643,20 @@ void QueuedGuardedProductsTesterBase :: void QueuedGuardedProductsTesterBase :: pushProductRequestEntry( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - DpRequest e = { id, size }; + DpRequest e = { id, dataSize }; this->productRequestHistory->push_back(e); } void QueuedGuardedProductsTesterBase :: productRequest_handler( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - this->pushProductRequestEntry(id, size); + this->pushProductRequestEntry(id, dataSize); } void QueuedGuardedProductsTesterBase :: @@ -1783,11 +1783,11 @@ void QueuedGuardedProductsTesterBase :: Fw::PassiveComponentBase* const callComp, NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { QueuedGuardedProductsTesterBase* _testerBase = static_cast(callComp); - _testerBase->productRequest_handler(id, size); + _testerBase->productRequest_handler(id, dataSize); } void QueuedGuardedProductsTesterBase :: diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsTesterBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsTesterBase.ref.hpp index 211c237ea..9d6223e46 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsTesterBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsTesterBase.ref.hpp @@ -864,7 +864,7 @@ class QueuedGuardedProductsTesterBase : //! Push an entry on the product request history void pushProductRequestEntry( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Handle a data product request from the component under test @@ -873,7 +873,7 @@ class QueuedGuardedProductsTesterBase : //! this behavior. virtual void productRequest_handler( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Send a data product response to the component under test @@ -949,7 +949,7 @@ class QueuedGuardedProductsTesterBase : Fw::PassiveComponentBase* const callComp, //!< The component instance NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Static function for port from_productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsGTestBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsGTestBase.ref.cpp index dd7a51103..8c99f9a91 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsGTestBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsGTestBase.ref.cpp @@ -186,8 +186,9 @@ void QueuedSyncProductsGTestBase :: FwDpIdType id, FwDpPriorityType priority, const Fw::Time& timeTag, - Fw::DpCfg::ProcType procType, + Fw::DpCfg::ProcType::SerialType procTypes, const Fw::DpContainer::Header::UserData& userData, + Fw::DpState dpState, FwSizeType dataSize, Fw::Buffer& historyBuffer ) const @@ -219,8 +220,9 @@ void QueuedSyncProductsGTestBase :: id, priority, timeTag, - procType, + procTypes, userData, + dpState, dataSize ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsGTestBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsGTestBase.ref.hpp index feccb50fe..849319267 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsGTestBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsGTestBase.ref.hpp @@ -210,8 +210,8 @@ #define ASSERT_PRODUCT_SEND_SIZE(size) \ this->assertProductSend_size(__FILE__, __LINE__, size) -#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procType, userData, dataSize, buffer) \ - assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procType, userData, dataSize, buffer) +#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) \ + assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) //! \class QueuedSyncProductsGTestBase //! \brief Auto-generated base for QueuedSyncProducts component Google Test harness @@ -322,8 +322,9 @@ class QueuedSyncProductsGTestBase : FwDpIdType id, //!< The expected container ID (input) FwDpPriorityType priority, //!< The expected priority (input) const Fw::Time& timeTag, //!< The expected time tag (input) - Fw::DpCfg::ProcType procType, //!< The expected processing type (input) + Fw::DpCfg::ProcType::SerialType procTypes, //!< The expected processing types (input) const Fw::DpContainer::Header::UserData& userData, //!< The expected user data (input) + Fw::DpState dpState, //!< The expected data product state (input) FwSizeType dataSize, //!< The expected data size (input) Fw::Buffer& historyBuffer //!< The buffer from the history (output) ) const; diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsTesterBase.ref.cpp index c2fb1c366..b915df908 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsTesterBase.ref.cpp @@ -1643,20 +1643,20 @@ void QueuedSyncProductsTesterBase :: void QueuedSyncProductsTesterBase :: pushProductRequestEntry( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - DpRequest e = { id, size }; + DpRequest e = { id, dataSize }; this->productRequestHistory->push_back(e); } void QueuedSyncProductsTesterBase :: productRequest_handler( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - this->pushProductRequestEntry(id, size); + this->pushProductRequestEntry(id, dataSize); } void QueuedSyncProductsTesterBase :: @@ -1783,11 +1783,11 @@ void QueuedSyncProductsTesterBase :: Fw::PassiveComponentBase* const callComp, NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { QueuedSyncProductsTesterBase* _testerBase = static_cast(callComp); - _testerBase->productRequest_handler(id, size); + _testerBase->productRequest_handler(id, dataSize); } void QueuedSyncProductsTesterBase :: diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsTesterBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsTesterBase.ref.hpp index 84fc5f83f..642c3f36d 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsTesterBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsTesterBase.ref.hpp @@ -864,7 +864,7 @@ class QueuedSyncProductsTesterBase : //! Push an entry on the product request history void pushProductRequestEntry( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Handle a data product request from the component under test @@ -873,7 +873,7 @@ class QueuedSyncProductsTesterBase : //! this behavior. virtual void productRequest_handler( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Send a data product response to the component under test @@ -949,7 +949,7 @@ class QueuedSyncProductsTesterBase : Fw::PassiveComponentBase* const callComp, //!< The component instance NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Static function for port from_productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestGTestBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestGTestBase.ref.cpp index 8c74c9ecf..073a18a9b 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestGTestBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestGTestBase.ref.cpp @@ -1016,8 +1016,9 @@ void QueuedTestGTestBase :: FwDpIdType id, FwDpPriorityType priority, const Fw::Time& timeTag, - Fw::DpCfg::ProcType procType, + Fw::DpCfg::ProcType::SerialType procTypes, const Fw::DpContainer::Header::UserData& userData, + Fw::DpState dpState, FwSizeType dataSize, Fw::Buffer& historyBuffer ) const @@ -1049,8 +1050,9 @@ void QueuedTestGTestBase :: id, priority, timeTag, - procType, + procTypes, userData, + dpState, dataSize ); } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestGTestBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestGTestBase.ref.hpp index 1d56decf2..8172a3aaf 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestGTestBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestGTestBase.ref.hpp @@ -336,8 +336,8 @@ #define ASSERT_PRODUCT_SEND_SIZE(size) \ this->assertProductSend_size(__FILE__, __LINE__, size) -#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procType, userData, dataSize, buffer) \ - assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procType, userData, dataSize, buffer) +#define ASSERT_PRODUCT_SEND(index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) \ + assertProductSend(__FILE__, __LINE__, index, id, priority, timeTag, procTypes, userData, dpState, dataSize, buffer) //! \class QueuedTestGTestBase //! \brief Auto-generated base for QueuedTest component Google Test harness @@ -754,8 +754,9 @@ class QueuedTestGTestBase : FwDpIdType id, //!< The expected container ID (input) FwDpPriorityType priority, //!< The expected priority (input) const Fw::Time& timeTag, //!< The expected time tag (input) - Fw::DpCfg::ProcType procType, //!< The expected processing type (input) + Fw::DpCfg::ProcType::SerialType procTypes, //!< The expected processing types (input) const Fw::DpContainer::Header::UserData& userData, //!< The expected user data (input) + Fw::DpState dpState, //!< The expected data product state (input) FwSizeType dataSize, //!< The expected data size (input) Fw::Buffer& historyBuffer //!< The buffer from the history (output) ) const; diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestTesterBase.ref.cpp index aca5150fd..cdaa6d660 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestTesterBase.ref.cpp @@ -3567,20 +3567,20 @@ void QueuedTestTesterBase :: void QueuedTestTesterBase :: pushProductRequestEntry( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - DpRequest e = { id, size }; + DpRequest e = { id, dataSize }; this->productRequestHistory->push_back(e); } void QueuedTestTesterBase :: productRequest_handler( FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { - this->pushProductRequestEntry(id, size); + this->pushProductRequestEntry(id, dataSize); } void QueuedTestTesterBase :: @@ -4035,11 +4035,11 @@ void QueuedTestTesterBase :: Fw::PassiveComponentBase* const callComp, NATIVE_INT_TYPE portNum, FwDpIdType id, - FwSizeType size + FwSizeType dataSize ) { QueuedTestTesterBase* _testerBase = static_cast(callComp); - _testerBase->productRequest_handler(id, size); + _testerBase->productRequest_handler(id, dataSize); } void QueuedTestTesterBase :: diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestTesterBase.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestTesterBase.ref.hpp index 8b2eefbf0..99ab7197b 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestTesterBase.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestTesterBase.ref.hpp @@ -1370,7 +1370,7 @@ class QueuedTestTesterBase : //! Push an entry on the product request history void pushProductRequestEntry( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Handle a data product request from the component under test @@ -1379,7 +1379,7 @@ class QueuedTestTesterBase : //! this behavior. virtual void productRequest_handler( FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Send a data product response to the component under test @@ -1516,7 +1516,7 @@ class QueuedTestTesterBase : Fw::PassiveComponentBase* const callComp, //!< The component instance NATIVE_INT_TYPE portNum, //!< The port number FwDpIdType id, //!< The container ID - FwSizeType size //!< The size of the requested buffer + FwSizeType dataSize //!< The data size of the requested buffer ); //! Static function for port from_productSendOut diff --git a/compiler/tools/fpp-to-cpp/test/fprime/Fw/Dp/Dp.fpp b/compiler/tools/fpp-to-cpp/test/fprime/Fw/Dp/Dp.fpp index bf23f801f..8f564c34b 100644 --- a/compiler/tools/fpp-to-cpp/test/fprime/Fw/Dp/Dp.fpp +++ b/compiler/tools/fpp-to-cpp/test/fprime/Fw/Dp/Dp.fpp @@ -1,23 +1,44 @@ module Fw { + # ---------------------------------------------------------------------- + # Types + # ---------------------------------------------------------------------- + + enum DpState: U8 { + @ The untransmitted state + UNTRANSMITTED + @ The transmitted state + TRANSMITTED + } default UNTRANSMITTED + + # ---------------------------------------------------------------------- + # Ports + # ---------------------------------------------------------------------- + @ Port for synchronously getting a data product buffer @ Returns the status + @ + @ On return, buffer should be set to a valid buffer large enough + @ to hold a data product packet with the requested data size (if + @ status is SUCCESS) or an invalid buffer (if status is FAILURE). port DpGet( - @ The container ID + @ The container ID (input) $id: FwDpIdType - @ The size of the requested buffer - $size: FwSizeType - @ The buffer + @ The data size of the requested buffer (input) + dataSize: FwSizeType + @ The buffer (output) ref buffer: Fw.Buffer ) -> Fw.Success @ Port for sending a request for a data product buffer to - @ back a data product container + @ back a data product container. The request is for a buffer + @ large enough to hold a data product packet with the requested + @ data size. port DpRequest( @ The container ID $id: FwDpIdType - @ The size of the requested buffer - $size: FwSizeType + @ The data size of the requested buffer + dataSize: FwSizeType ) @ Port for receiving a response to a buffer request diff --git a/compiler/tools/fpp-to-cpp/test/fprime/Fw/Dp/DpContainer.cpp b/compiler/tools/fpp-to-cpp/test/fprime/Fw/Dp/DpContainer.cpp index c6a32091b..2b4baa53f 100644 --- a/compiler/tools/fpp-to-cpp/test/fprime/Fw/Dp/DpContainer.cpp +++ b/compiler/tools/fpp-to-cpp/test/fprime/Fw/Dp/DpContainer.cpp @@ -17,15 +17,15 @@ namespace Fw { // ---------------------------------------------------------------------- DpContainer::DpContainer(FwDpIdType id, const Fw::Buffer& buffer) - : id(id), priority(0), procType(DpCfg::ProcType::NONE), dataSize(0), buffer() { + : id(id), priority(0), procTypes(0), dpState(), dataSize(0), buffer(), dataBuffer() { // Initialize the user data field this->initUserDataField(); - // Set the buffer + // Set the packet buffer + // This action also updates the data buffer this->setBuffer(buffer); } -DpContainer::DpContainer() - : id(0), priority(0), procType(DpCfg::ProcType::NONE), dataSize(0), buffer() { +DpContainer::DpContainer() : id(0), priority(0), procTypes(0), dataSize(0), buffer(), dataBuffer() { // Initialize the user data field this->initUserDataField(); } @@ -36,48 +36,80 @@ DpContainer::DpContainer() Fw::SerializeStatus DpContainer::moveSerToOffset(FwSizeType offset //!< The offset ) { - auto& serializeRepr = this->buffer.getSerializeRepr(); + Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); return serializeRepr.moveSerToOffset(offset); } -Fw::SerializeStatus DpContainer::serializeHeader() { - auto& serializeRepr = this->buffer.getSerializeRepr(); +void DpContainer::serializeHeader() { + Fw::SerializeBufferBase& serializeRepr = this->buffer.getSerializeRepr(); // Reset serialization serializeRepr.resetSer(); // Serialize the packet type - auto status = serializeRepr.serialize(static_cast(Fw::ComPacket::FW_PACKET_DP)); + Fw::SerializeStatus status = + serializeRepr.serialize(static_cast(Fw::ComPacket::FW_PACKET_DP)); + FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); // Serialize the container id - if (status == Fw::FW_SERIALIZE_OK) { - status = serializeRepr.serialize(this->id); - } + status = serializeRepr.serialize(this->id); + FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); // Serialize the priority - if (status == Fw::FW_SERIALIZE_OK) { - status = serializeRepr.serialize(this->priority); - } + status = serializeRepr.serialize(this->priority); + FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); // Serialize the time tag - if (status == Fw::FW_SERIALIZE_OK) { - status = serializeRepr.serialize(this->timeTag); - } - // Serialize the processing type - if (status == Fw::FW_SERIALIZE_OK) { - status = serializeRepr.serialize(this->procType); - } + status = serializeRepr.serialize(this->timeTag); + FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + // Serialize the processing types + status = serializeRepr.serialize(this->procTypes); + FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); // Serialize the user data - if (status == Fw::FW_SERIALIZE_OK) { - const bool omitLength = true; - status = serializeRepr.serialize(this->userData, sizeof userData, omitLength); - } + const bool omitLength = true; + status = serializeRepr.serialize(this->userData, sizeof userData, omitLength); + FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + // Serialize the data product state + status = serializeRepr.serialize(this->dpState); + FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); // Serialize the data size - if (status == Fw::FW_SERIALIZE_OK) { - status = serializeRepr.serialize(this->dataSize); - } - return status; + status = serializeRepr.serialize(this->dataSize); + FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); + // Update the header hash + this->updateHeaderHash(); } void DpContainer::setBuffer(const Buffer& buffer) { + // Set the buffer this->buffer = buffer; - // Move the serialization index to the end of the header - const auto status = this->moveSerToOffset(Header::SIZE); + // Check that the buffer is large enough to hold a data product packet + FW_ASSERT(buffer.getSize() >= MIN_PACKET_SIZE, buffer.getSize(), MIN_PACKET_SIZE); + // Initialize the data buffer + U8* const buffAddr = buffer.getData(); + const FwSizeType dataCapacity = buffer.getSize() - MIN_PACKET_SIZE; + // Check that data buffer is in bounds for packet buffer + FW_ASSERT(DATA_OFFSET + dataCapacity <= buffer.getSize()); + U8* const dataAddr = &buffAddr[DATA_OFFSET]; + this->dataBuffer.setExtBuffer(dataAddr, dataCapacity); +} + +void DpContainer::updateHeaderHash() { + Utils::HashBuffer hashBuffer; + U8* const buffAddr = this->buffer.getData(); + Utils::Hash::hash(buffAddr, Header::SIZE, hashBuffer); + ExternalSerializeBuffer serialBuffer(&buffAddr[HEADER_HASH_OFFSET], HASH_DIGEST_LENGTH); + const Fw::SerializeStatus status = hashBuffer.copyRaw(serialBuffer, HASH_DIGEST_LENGTH); + FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); +} + +void DpContainer::updateDataHash() { + Utils::HashBuffer hashBuffer; + U8* const buffAddrBase = this->buffer.getData(); + const U8* const dataAddr = &buffAddrBase[DATA_OFFSET]; + const FwSizeType dataSize = this->getDataSize(); + const FwSizeType bufferSize = buffer.getSize(); + FW_ASSERT(DATA_OFFSET + dataSize <= bufferSize, DATA_OFFSET + dataSize, bufferSize); + Utils::Hash::hash(dataAddr, dataSize, hashBuffer); + const FwSizeType dataHashOffset = this->getDataHashOffset(); + U8* const dataHashAddr = &buffAddrBase[dataHashOffset]; + FW_ASSERT(dataHashOffset + HASH_DIGEST_LENGTH <= bufferSize, dataHashOffset + HASH_DIGEST_LENGTH, bufferSize); + ExternalSerializeBuffer serialBuffer(dataHashAddr, HASH_DIGEST_LENGTH); + const Fw::SerializeStatus status = hashBuffer.copyRaw(serialBuffer, HASH_DIGEST_LENGTH); FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status); } diff --git a/compiler/tools/fpp-to-cpp/test/fprime/Fw/Dp/DpContainer.hpp b/compiler/tools/fpp-to-cpp/test/fprime/Fw/Dp/DpContainer.hpp index 0fc8aa902..7a5a8f4b8 100644 --- a/compiler/tools/fpp-to-cpp/test/fprime/Fw/Dp/DpContainer.hpp +++ b/compiler/tools/fpp-to-cpp/test/fprime/Fw/Dp/DpContainer.hpp @@ -8,7 +8,9 @@ #define Fw_DpContainer_HPP #include "Fw/Buffer/Buffer.hpp" +#include "Fw/Dp/DpStateEnumAc.hpp" #include "Fw/Time/Time.hpp" +#include "Utils/Hash/Hash.hpp" #include "config/FppConstantsAc.hpp" #include "config/ProcTypeEnumAc.hpp" @@ -18,11 +20,13 @@ namespace Fw { class DpContainer { public: // ---------------------------------------------------------------------- - // Types + // Constants and Types // ---------------------------------------------------------------------- //! A DpContainer packet header struct Header { + //! The type of user data + using UserData = U8[DpCfg::CONTAINER_USER_DATA_SIZE]; //! The offset for the packet descriptor field static constexpr FwSizeType PACKET_DESCRIPTOR_OFFSET = 0; //! The offset for the id field @@ -31,16 +35,27 @@ class DpContainer { static constexpr FwDpPriorityType PRIORITY_OFFSET = ID_OFFSET + sizeof(FwDpIdType); //! The offset for the time tag field static constexpr FwSizeType TIME_TAG_OFFSET = PRIORITY_OFFSET + sizeof(FwDpPriorityType); - //! The offset for the processing ID field - static constexpr FwSizeType PROC_ID_OFFSET = TIME_TAG_OFFSET + Time::SERIALIZED_SIZE; + //! The offset for the processing types field + static constexpr FwSizeType PROC_TYPES_OFFSET = TIME_TAG_OFFSET + Time::SERIALIZED_SIZE; //! The offset for the user data field - static constexpr FwSizeType USER_DATA_OFFSET = PROC_ID_OFFSET + sizeof(DpCfg::ProcType::SerialType); + static constexpr FwSizeType USER_DATA_OFFSET = PROC_TYPES_OFFSET + sizeof(DpCfg::ProcType::SerialType); + //! The offset of the data product state field + static constexpr FwSizeType DP_STATE_OFFSET = USER_DATA_OFFSET + DpCfg::CONTAINER_USER_DATA_SIZE; //! The offset for the data size field - static constexpr FwSizeType DATA_SIZE_OFFSET = USER_DATA_OFFSET + DpCfg::CONTAINER_USER_DATA_SIZE; + static constexpr FwSizeType DATA_SIZE_OFFSET = DP_STATE_OFFSET + DpState::SERIALIZED_SIZE; //! The header size static constexpr FwSizeType SIZE = DATA_SIZE_OFFSET + sizeof(FwSizeType); }; + //! The header hash offset + static constexpr FwSizeType HEADER_HASH_OFFSET = Header::SIZE; + //! The data offset + static constexpr FwSizeType DATA_OFFSET = HEADER_HASH_OFFSET + HASH_DIGEST_LENGTH; + //! The minimum packet size + //! Reserve space for the header, the header hash, and the data hash + //! This is also the number of non-data bytes in the packet + static constexpr FwSizeType MIN_PACKET_SIZE = Header::SIZE + 2 * HASH_DIGEST_LENGTH; + public: // ---------------------------------------------------------------------- // Constructor @@ -72,7 +87,7 @@ class DpContainer { Fw::Buffer getBuffer() const { return this->buffer; } //! Get the packet size corresponding to the data size - FwSizeType getPacketSize() const { return Header::SIZE + this->dataSize; } + FwSizeType getPacketSize() const { return getPacketSizeForDataSize(this->dataSize); } //! Get the priority //! \return The priority @@ -82,18 +97,17 @@ class DpContainer { //! \return The time tag Fw::Time getTimeTag() const { return this->timeTag; } - //! Get the processing type - //! \return The processing type - DpCfg::ProcType getProcType() const { return this->procType; } + //! Get the processing types + //! \return The processing types + DpCfg::ProcType::SerialType getProcTypes() const { return this->procTypes; } //! Move the packet serialization to the specified offset //! \return The serialize status Fw::SerializeStatus moveSerToOffset(FwSizeType offset //!< The offset ); - //! Serialize the header into the packet buffer - //! \return The serialize status - Fw::SerializeStatus serializeHeader(); + //! Serialize the header into the packet buffer and update the header hash + void serializeHeader(); //! Set the id void setId(FwDpIdType id //!< The id @@ -113,16 +127,51 @@ class DpContainer { this->timeTag = timeTag; } - //! Set the processing type - void setProcType(DpCfg::ProcType procType //!< The processing type + //! Set the processing types bit mask + void setProcTypes(DpCfg::ProcType::SerialType procTypes //!< The processing types + ) { + this->procTypes = procTypes; + } + + //! Set the data product state + void setDpState(DpState dpState //!< The data product state ) { - this->procType = procType; + this->dpState = dpState; + } + + //! Set the data size + void setDataSize(FwSizeType dataSize //!< The data size + ) { + this->dataSize = dataSize; } //! Set the packet buffer - void setBuffer(const Buffer& buffer //!< The buffer + void setBuffer(const Buffer& buffer //!< The packet buffer ); + //! Update the header hash + void updateHeaderHash(); + + //! Get the data hash offset + FwSizeType getDataHashOffset() const { + // Data hash goes after the header, the header hash, and the data + return Header::SIZE + HASH_DIGEST_LENGTH + this->dataSize; + } + + //! Update the data hash + void updateDataHash(); + + public: + // ---------------------------------------------------------------------- + // Public static functions + // ---------------------------------------------------------------------- + + //! Get the packet size for a given data size + static constexpr FwSizeType getPacketSizeForDataSize(FwSizeType dataSize //!< The data size + ) { + return Header::SIZE + dataSize + 2 * HASH_DIGEST_LENGTH; + } + PRIVATE: // ---------------------------------------------------------------------- // Private member functions @@ -137,7 +186,7 @@ class DpContainer { // ---------------------------------------------------------------------- //! The user data - U8 userData[DpCfg::CONTAINER_USER_DATA_SIZE]; + Header::UserData userData; PROTECTED: // ---------------------------------------------------------------------- @@ -154,14 +203,20 @@ class DpContainer { //! The time tag Time timeTag; - //! The processing type - DpCfg::ProcType procType; + //! The processing types + DpCfg::ProcType::SerialType procTypes; + + //! The data product state + DpState dpState; //! The data size FwSizeType dataSize; //! The packet buffer Buffer buffer; + + //! The data buffer + Fw::ExternalSerializeBuffer dataBuffer; }; } // end namespace Fw diff --git a/compiler/tools/fpp-to-cpp/test/fprime/config/DpCfg.fpp b/compiler/tools/fpp-to-cpp/test/fprime/config/DpCfg.fpp index 9961c3c3e..0d04662c9 100644 --- a/compiler/tools/fpp-to-cpp/test/fprime/config/DpCfg.fpp +++ b/compiler/tools/fpp-to-cpp/test/fprime/config/DpCfg.fpp @@ -10,11 +10,15 @@ module Fw { @ packet header constant CONTAINER_USER_DATA_SIZE = 32; - @ The type of the identifier for the type of processing to perform on + @ A bit mask for selecting the type of processing to perform on @ a container before writing it to disk. - enum ProcType : U8 { - @ No processing - NONE + enum ProcType: U8 { + @ Processing type 0 + PROC_TYPE_ZERO = 0x01 + @ Processing type 1 + PROC_TYPE_ONE = 0x02 + @ Processing type 2 + PROC_TYPE_TWO = 0x04 } } diff --git a/compiler/tools/fpp-to-json/test/run b/compiler/tools/fpp-to-json/test/run index f1564af06..b0088aa05 100755 --- a/compiler/tools/fpp-to-json/test/run +++ b/compiler/tools/fpp-to-json/test/run @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -e . ../../../scripts/test-utils.sh @@ -17,28 +17,36 @@ run_test() fi - # Run fpp_to_json and concatenate the output files - $fpp_to_json $infile.fpp $args 2>&1 | remove_path_prefix > $outfile.out.txt - - remove_path_prefix < fpp-ast.json >> $outfile.out.txt - remove_path_prefix < fpp-loc-map.json >> $outfile.out.txt - - locationMapValidator "$outfile" - exit_status=$? - if [ $exit_status -eq 1 ]; then - return 1 - fi - - if [ "$args" = "-s" ]; then - rm fpp-ast.json fpp-loc-map.json - - else - remove_path_prefix < fpp-analysis.json >> $outfile.out.txt - # Delete the JSON files - rm fpp-ast.json fpp-loc-map.json fpp-analysis.json - fi - - diff -u $outfile.ref.txt $outfile.out.txt > $outfile.diff.txt 2>&1 + { + # Run fpp_to_json and concatenate the output files + $fpp_to_json $infile.fpp $args 2>&1 | remove_path_prefix > $outfile.out.txt && \ + remove_path_prefix < fpp-ast.json >> $outfile.out.txt && \ + remove_path_prefix < fpp-loc-map.json >> $outfile.out.txt + } && \ + { + # Validate the location map + if which python3 > /dev/null 2>&1 + then + python3 python/locationMapValidator.py fpp-ast.json fpp-loc-map.json + else + # Work around an issue in CI + echo "python3 is not available; skipping map validation" 1>&2 + fi + } && \ + { + # Clean up + if [ "$args" = "-s" ]; then + rm fpp-ast.json fpp-loc-map.json + else + remove_path_prefix < fpp-analysis.json >> $outfile.out.txt + # Delete the JSON files + rm fpp-ast.json fpp-loc-map.json fpp-analysis.json + fi + } && \ + { + # Compare the output + diff -u $outfile.ref.txt $outfile.out.txt > $outfile.diff.txt 2>&1 + } } @@ -130,20 +138,6 @@ syntaxOnly(){ run_test "-s" syntaxOnly } -locationMapValidator(){ - outfile=$1 - - # Run locationMapValidator.py and capture its output - output=$(python3 python/locationMapValidator.py fpp-ast.json fpp-loc-map.json) - exit_status=$? - if [ $exit_status -eq 1 ]; then - echo "$output" >&2 - return 1 - fi - return 0 -} - - tests=" activeComponents commands