The Matlab/SIMULINK mapper is stored inside file simulink_A_mapper.py
.
The logic behind this mapper was built in close co-ordination with ESA Simulink experts.
- BOOLEANs are directly mapped to
boolean
s, inside AliasType
s.
- Simulink offers 6 distinct target types for INTEGERs:
int8
, uint8
, int16
, uint16
, int32
, uint32
.
They constitute the different combinations of signed and unsigned integers of
8, 16 and 32 bits - and the mapper takes the ASN.1 constraints of INTEGERs into
account when creating the appropriate target SIMULINK type (AliasType
).
The Description
attribute also offers the exact range constraint used.
- REALs are mapped to
double
s (inside AliasType
s).
The Description
attribute also offers the exact range constraint used.
- Any ENUMERATED is mapped to an
int32
. The originating ASN.1 type is
specified in a special comment accompagnying the new type ("values of ENUMERATED
EnumTypeName"). The values themselves are available as Simulink values, named
EnumTypeName_value_OptionName
, where EnumTypeName is the ASN.1 type name
and OptionName is the name of the enumerant option.
- SEQUENCEs are mapped to Simulink
Bus
es. The Elements
attribute
is used to enumerate all the comprising types, so the necessary types are defined
by the mapper before the actual Bus
definition. Fields using standard
types get "temporary" types: For example, any ASN.1 string field gets a corresponding
"octet_string_X
" pseudo-type, with X being an increasing number (per string),
and each temporary type reflecting any possible string specific size constraint.
- CHOICEs are mapped just like SEQUENCEs, but with an extra
choiceIdx
of type uint8
. This index will point to which option is actually used in the
Choice (the index starts at 1 for the first option).
- SEQUENCE OFs are represented with a number of individual elements of the
contained type, named
TypeName_member_X
.
- SETs and SET OFs are handled just as SEQUENCE and SEQUENCE OFs.