blob: e73d64425d632e493512e785126e4dc603984828 [file] [log] [blame]
The CoAP protocol module was written initially with an external codec (see http://git.eclipse.org/c/titan/titan.ProtocolModules.CoAP.git/)
The reason for this was that the variable length encoding of some fields and the handling of the option fields cannot be directly handled by RAW alone; some external assistance is needed;
A new protocol module has been written (based on the RAW codec), which can handle encoding directions. But for the decoding the external codec should be used.
To enable more throughout fuzzing (negative testing) the TTCN-3 types were extended with fields that stores the length of fields of the length of payload, based on the CoAP standard.
The CoAP standard indicates that the sender should encode without leading zero bytes, but the recipient must handle leading zero bytes. The RAW encoder will produce theese leading zero bytes when the value of an option is zero. For example when the content_format is 0 then zero byte will be sent.
The num field of the block1 and block2 options is a 'union' implemented as a record, because the RAW encoder cannot handle unions correctly in this case. The fields of the record are optional and only one field should be filled with value and the other fields must be set to omit.