RAW coder and arrays in records [message #1782722] |
Wed, 28 February 2018 13:12 |
|
I'm a bit puzzled on how to use an array of one record in another record without loosing the ability to use the RAW codec:
module PCUIF_Proto {
type record PCUIF_InfoTrx {
uint16_t arfcn,
BIT8 pdch_mask,
OCT1 spare,
OCT8 tsc,
uint32_t hLayer1
} with { variant "" };
type record PCUIF_info_ind {
uint32_t version,
PCUIF_Flags flags,
PCUIF_InfoTrx trx[8],
} with { variant "" };
} with { encode "RAW" };
will fail to compile with titan 6.3.0, while titan claiming that PCUIF_info_ind cannot be encoded as RAW. However, when removing the array it can.
What am I missing here? If the size / encoding of an array element is known, why is the size/encoding of an array of those elements not known? What should I do to make the RAW codec understand this? Thanks!
|
|
|
|
Re: RAW coder and arrays in records [message #1782725 is a reply to message #1782722] |
Wed, 28 February 2018 13:44 |
|
Hi Harald,
the RAW codec was not extended to arrays, see refguide
4.34 4.23 RAW Encoder and Decoder
:
You can use the encoding rules defined in this section to encode and decode the following TTCN3 types:
• bitstring
• boolean
• charstring
• enumerated
• float
• hexstring
• integer
• octetstring
• record
• record of, set of
• set
• union
• universal charstring
:
(no array here)
The why is lost in the depths of time, but I suspect it has to do with the fact
that arrays are not so much useful and they can be replaced with "record of" structures.
So I suggest you try the same:
module PCUIF_Proto {
type record PCUIF_InfoTrx {
uint16_t arfcn,
BIT8 pdch_mask,
OCT1 spare,
OCT8 tsc,
uint32_t hLayer1
} with { variant "" };
type record length(8) of PCUIF_InfoTrx RecOfPCUIF_InfoTrx ;
type record PCUIF_info_ind {
uint32_t version,
PCUIF_Flags flags,
// PCUIF_InfoTrx trx[8]
RecOfPCUIF_InfoTrx trx
} with { variant "" };
} with { encode "RAW" };
should give you the desired encoding.
I hope this helps
BR
Elemer
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02196 seconds