-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Describe the bug
The SOIS spec allows for an Entry in an EntryList to have an arbitrary number of ArrayDimension components for inline array definitions. When adding an ArrayDimension component to an Entry, the structure generated by sedstool does not appear as I would expect. The structure created is a typedef of the Entry's type, instead of an array of the type
A similar problem is observed when trying to use a ListEntry field instead of an ArrayDimension component.
Using this Container as a basic example
<ContainerDataType name="thing" baseType="CFE_HDR/TelemetryHeader">
<EntryList>
<Entry type="BASE_TYPES/uint8" name="nested_array">
<ArrayDimensions>
<Dimension size="100" indexTypeRef="BASE_TYPES/uint16"/>
</ArrayDimensions>
</Entry>
<Entry type="BASE_TYPES/uint16" name="i1"></Entry>
<Entry type="BASE_TYPES/uint16" name="i2"></Entry>
</EntryList>
</ContainerDataType>
yields the below set of structures (note the first typedef):
/**
* @brief Implicitly created type based on INTEGER_DATATYPE name=uint8
*/
typedef EdsDataType_BASE_TYPES_uint8_t EdsImplicit_ARRAY_MyEDS_thing_nested_array_t;
/**
* @brief Structure definition for CONTAINER_DATATYPE 'MyEDS/thing'
*
* Data definition signature 9127b9d403aec1d8
*/
struct EdsContainer_MyEDS_thing /* checksum=9127b9d403aec1d8 */
{
EdsDataType_CFE_HDR_TelemetryHeader_t TelemetryHeader; /* 96 bits/20 bytes */
EdsImplicit_ARRAY_MyEDS_thing_nested_array_t nested_array; /* 800 bits/100 bytes */
EdsDataType_BASE_TYPES_uint16_t i1; /* 16 bits/2 bytes */
EdsDataType_BASE_TYPES_uint16_t i2; /* 16 bits/2 bytes */
};
/**
*
*/
typedef struct EdsContainer_MyEDS_thing EdsDataType_MyEDS_thing_t;
/* bits= 928 bytes= 124/124 align=0x3 checksum=9127b9d403aec1d8 */
typedef uint8_t EdsPackedBuffer_MyEDS_thing_t[116];
To Reproduce
Steps to reproduce the behavior:
- Add the previous
ContainerDataTypeto any EDS XML - Run sedstool to generate the structures
Expected behavior
Generated implicit array structures should appear as follows
/**
* @brief Implicitly created type based on INTEGER_DATATYPE name=uint8
*/
typedef EdsDataType_BASE_TYPES_uint8_t EdsImplicit_ARRAY_MyEDS_thing_nested_array_t[100];
System observed on:
- OS: Ubuntu 22.04
- Versions v7.0.0
Additional context
The obvious workaround to this problem is to define an ArrayDataType and use that newly defined object inside the container. However, the SOIS spec specifically makes mention of allowing anonymous subdeclarations here:
3.11 Fields
...
2. The concept of ‘field’ permits the definition of parameter, arguments, or container entries that are a subrange, encoding, or array of the referenced type; this definition of an anonymous type avoids the need to define artificial explicit named types.
Reporter Info
Chris Fallon | ispace-US