nasa / EdsLib

CCSDS SOIS Electronic Data Sheet Tool and Library
Apache License 2.0
31 stars 12 forks source link

Container fields not set correctly until after encode #90

Closed jphickey closed 3 months ago

jphickey commented 3 months ago

Describe the bug Container fields such as LengthEntry and FixedValueEntry are not set correctly after call to EdsLib_DataTypeDB_InitializeNativeObject().

They are set in the packed/encoded object after encoding, and they are verified/reset after decoding. But if only a native object is created and passed along, the field is not set.

To Reproduce Create a buffer, for example CFE_ES/NoopCmd, and call EdsLib_DataTypeDB_InitializeNativeObject() on it.

In my test, the content (via hexdump) is CFE_ES/NoopCmd(96: 00 03 06 00 00 00 00 00 00 00 00 00)

Expected behavior With 12 bytes of actual length the field should be set to 5 (using CCSDS spacepacket length encoding)

So it should be CFE_ES/NoopCmd(96: 00 03 06 00 00 00 00 00 05 00 00 00)

System observed on: Debian

Reporter Info Joseph Hickey, Vantage Systems, Inc.