|[Solved] Incorrect bit order Bitstring [message #1772971]
||Tue, 19 September 2017 15:17
|| Kevin Thomas
Registered: June 2017
I work on ITS project (European project on connected cars), and we want to run ITS test on Titan. To do this, I develop a System Adapter.
In this SA, I have a message (a CAM) which contain a exteriorLights set to 20.
When I print the message value I have :
This exteriorLight is define in a ASN.1 (from asn1c), so we have a Bit_string which is a structure which contain :
- uint8_t *buf; /* BIT STRING body */
- int size; /* Size of the above buffer (number of bytes)*/
- int bits_unused;/* Unused trailing bits in the last octet (0..7) */
- asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */
but when I want to put this value in the test structure, in a Titan BITSTRING. I obtain this error :
Matching on port camPort .msgIn.cam.camParameters.lowFrequencyContainer.basicVehicleContainerLowFrequency.exteriorLights := '00000100'B with '??1*'B length (8) unmatched: Fi
Because, in the BITSTRING corresponding to Titan exteriorLight I have :
exteriorLights := '00000100'B
To obtain this, I used the BITSTRING constructor like this :
cam.cam().camParameters().lowFrequencyContainer()().basicVehicleContainerLowFrequency().exteriorLights()=BITSTRING(tmpLights.size * 8 - tmpLights.bits_unused, tmpLights.buf)
So I think that the Titan BITSTRING contructor swap a half of the buffer with the other.
Do you think that it's a problem with my code ? Or with the Titan BITSTRING Constructor ?
[Updated on: Wed, 20 September 2017 08:19]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02362 seconds