Number of bytes required to encode F32
#243
-
Hi, I am structuring my messages in If I define a message containing only one Is this normal? I use the default encoding What is the procedure to get only |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Assuming your type is defined with this range (corresponding to a 32bits float):
For the binary encoding you can choose between various schemes when you invoke the compiler: either uPER (ASN.1's unaligned Packed Encoding Rules) with the For real numbers, PER is not an optimal choice because it needs at least 13 bytes whatever precision you need. In fact it theoretically provides "infinite precision" which your do not need most of the time. So to solve your issue, first create an ACN file for your grammar (
Edit the file that was generated (
... and check the resulting encoding layout:
The resulting file ( In order to generate automatic encoders and decoders for this scheme in C, use the The complete user manual detailing all ACN directives is here: |
Beta Was this translation helpful? Give feedback.
Assuming your type is defined with this range (corresponding to a 32bits float):
For the binary encoding you can choose between various schemes when you invoke the compiler: either uPER (ASN.1's unaligned Packed Encoding Rules) with the
-uPER
flag or ACN with-ACN
.For real numbers, PER is not an optimal choice because it needs at least 13 bytes whatever precision you need. In fact it theoretically provides "infinite precision" which your do not need most of the time.
So to solve your issue, first create an ACN file for your grammar (
f32.asn
) like this:Edit the file that was generated (
f32.acn
) and add the following directive t…