Comments (8)
Unfortunately RTCM protocol is too exotic for both "commsdsl" protocol generator and "COMMS" library. It specifies fields in bits (not bytes) and any message and/or field can end up in the middle of the byte. My work supports combining several bit-length fields into a single field, called "bitfield", but the total length of its inner members mustn't exceed 64 bits and must be dividable by 8, i.e. to end in the boundaries of bytes. You don't have any other choice but to manually implement RTCM protocol if you need one. There should be plenty third party libraries that do it for you.
from commsdsl.
Thanks for the report, I'll try to evaluate it and introduce a fix during the weekend
from commsdsl.
The problem is reproduced and acknowledged. I'll try to introduce a fix during the next week. In the meantime I recommend using a workaround with reuse property. It will just duplicate the code of the field definition instead of creating alias to it.
<message ...>
<set reuse="InfoTypes" />
...
</message>
As the side note, the length of the <set>
field is in bytes not in bits. I don't know whether it is your intention, but it's worth mentioning that usage of length="8" property on the set with create a set of 64 bits (8 bytes).
Also note, that the default construction of your InfoTypes bitset should correspond to the default existence mode of your optional field. If you want the optional field to exist by default, then your TransponderPosition bit should be default constructed to be true.
from commsdsl.
Thanks for the info. I also noticed the length attribute.
Just to clarify the second part: What are you meaning by the terms of
default construction of your InfoTypes
If I have the following consturcts:
<set name="InfoTypes" length="1">
<bit name="Bit1" idx="0" />
<bit name="Bit2" idx="1" />
</set>
<optional name="OptField1" defaultMode="exists" cond="$InfoTypes.Bit1">
<int name="WrappedField1" type="uint8" />
</optional>
<optional name="OptField2" defaultMode="missing" cond="$InfoTypes.Bit2">
<int name="WrappedField2" type="uint8" />
</optional>
Then OptField1 with defaultMode="exists"
exists always?
and OptField2 with defaultMode="missing" cond="$InfoTypes.Bit2"
exists only if the cond is true?
from commsdsl.
If I understand your definition correctly you want InfoTypes.Bit1
to be an indication of whether OptField1
field exists (being serialized) and InfoTypes.Bit2
is an indicator of whether OptField2
field exists.
The way you defined it, the values of your InfoTypes
bitset is all zeroes (when default constructed), which indicates that all the subsequent optional fields are missing, but you defined OptField1
to be existing by default.
In other words, when you default construct your message object the values of your fields are in an inconsistent state, and if you send it like this over the I/O link, the other end will read the value of InfoTypes
and discard subsequent value of OptField1
because it is marked as missing.
What I'm saying is that if you want the OptField1
to really exist when message object is default constructed, you should have InfoTypes.Bit1
to be initialized to true
when constructed.
<set name="InfoTypes" length="1">
<bit name="Bit1" idx="0" defaultValue="true" />
<bit name="Bit2" idx="1" />
</set>
from commsdsl.
The fix was introduced to "develop" branch, will be merged to "master" in upcoming release.
from commsdsl.
Thanks for this clarification.
One more thing: How do i specify the some fields in only bits? Especially the size layer?
Is it valid to take a set and specify the size in the inner fields?
The RCTM Protocol got some odd design.
from commsdsl.
Fixed in v2.2.
from commsdsl.
Related Issues (20)
- Question: List without length and message size HOT 2
- ICD generation HOT 7
- Missing copyright holder in license HOT 5
- ASN.1 Parsing/Serialization HOT 2
- Adding constexpr to static const functions HOT 2
- Bit Order in `<bitfield>` and `<set>` HOT 4
- `optional` field with `cond` depending on another `optional` field. HOT 7
- Field Extension Support in Lists with termSuffix HOT 4
- Need Help HOT 21
- Creating Frame with `id` that is less than one byte HOT 3
- Can a (serial) protocol with character escaping be realized using the custom code feature? HOT 2
- Schema name cannot start with a capital HOT 4
- Select variant based on value in the transport frame HOT 1
- noexcept error with gcc 9 HOT 5
- Unexpected max serialisation length HOT 4
- Dead links in the Readme HOT 1
- vcpkg integration HOT 16
- error when using COMMSDSL_NO_TESTS HOT 2
- Undefined behaviour on "out of range" values of ID layer. HOT 4
- "Unexpected max serialisation length" on variable length field inside variant HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from commsdsl.