|
|
|
Re: Cannot Compile LTE Testsuite with Titan 6.1.0 [message #1764960 is a reply to message #1764956] |
Mon, 05 June 2017 06:23 |
|
Hi MeGo,
The EUTRA_EncDec.cc is not generated manually, it's handwritten.
The reason for this is that Titan does not support PER encoding, so a 3rd party codec has to be used. The only open source option we could find is asn1c by Lev Walkin
(not to be confused with asn1c by Objective Systems). There's a detailed description in yet another previous post see:
Eclipse Titan and the dilemma of PER-encoding
https://www.eclipse.org/forums/index.php/t/1070344/
with an attached example
Attachment: CAM_CNL_113_xxx.tgz
Coco adapted this example to his/her environment and so should you.
XXX_EncDec.cc will encode messages first in BER , which is natively supported by Titan , then transcodes them to PER with an external codec (asn1c or some other, commercial codec generated by a commercial ASN.1 compiler) .
I hope this helps
Best regards
Elemer
|
|
|
|
Re: Cannot Compile LTE Testsuite with Titan 6.1.0 [message #1765047 is a reply to message #1765041] |
Tue, 06 June 2017 07:04 |
|
Hi MeGo,
I'm afraid it does not add PER ; this is what it does:
-before this change it was not possible to invoke encvalue/decvalue for ASN.1 types at all; this change makes that possible under the following conditions:
An encoder external function must be declared for an ASN.1 type for encvalue to work on its values. This function only serves to identify which codec to use when encoding values of the ASN.1 type.
This encoder function can use any prototype, and uses the regular stream type associated with the codec (octetstring or charstring), even though the resulting encvalue call uses the prototype 'convert' and bitstring as stream.
When encvalue/decvalue/decmatch/@decoded is called for an ASN.1 instance, Titan will call the auto-generated BER encoder or decoder function with the type of coding specified in an external function
declaration for the type. The return value of the encoding and the inout parameter of the decoding function shall be octetstring; e.g.:
ASN.1 definition:
CAM ::= SEQUENCE {
header ItsPduHeader,
cam CoopAwareness
}
External function declarations:
external function fx_enc_CAM (in CAM pdu) return octetstring
with {extension "prototype(convert) encode(BER:BER_ENCODE_DER)"}
external function fx_dec_CAM (inout octetstring stream, out CAM pdu) return integer with {extension "prototype(sliding) decode(BER:BER_ACCEPT_ALL)"}
-In Titan 6.2 (to be released soon, source code already available in github, so one can build from source) the following connected new features have been added:
1) In the external function declarations it is also allowed to use bitstring as return value and inout parameter; this will change the runtime behaviour only, i.e. add implicit octetstring/bitstring conversion if the function is called directly as it is done already in case of encvalue/decvalue .
2) If the encode and decode attribute value of the external function is "PER" for an ASN.1 type, there shall be a manually implemented C++ function for each such external function declaration.
One ASN.1 type shall have at most one external function declaration with an encode and one with a decode attribute. No other attribute values than "BER:..." or "PER" shall be allowed.
Example:
external function fx_enc_CAM (in CAM pdu) return bitstring
with {extension "prototype(convert) encode(PER)"}
external function fx_dec_CAM (inout bitstring stream, out CAM pdu) return integer with {extension "prototype(sliding) decode(PER)"}
When an instance of an ASN.1 type is used in encvalue/decvalue/decmatch/@decoded, and the type has an
external function declaration with the encode/decode attribute PER, the manually implemented external function shall be called implicitly, in the same way it is done for TTCN-3 types with user defined TTCN-3 encode attribute strings.
All these changes will only make easier to use external PER codecs.
I hope this clarifies the issue
Best regards
Elemer
|
|
|
Powered by
FUDForum. Page generated in 0.04492 seconds