Giter Club home page Giter Club logo

Comments (8)

arobenko avatar arobenko commented on June 21, 2024 1

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.

arobenko avatar arobenko commented on June 21, 2024

Thanks for the report, I'll try to evaluate it and introduce a fix during the weekend

from commsdsl.

arobenko avatar arobenko commented on June 21, 2024

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.

mathisloge avatar mathisloge commented on June 21, 2024

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.

arobenko avatar arobenko commented on June 21, 2024

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.

arobenko avatar arobenko commented on June 21, 2024

The fix was introduced to "develop" branch, will be merged to "master" in upcoming release.

from commsdsl.

mathisloge avatar mathisloge commented on June 21, 2024

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.

grafik

from commsdsl.

arobenko avatar arobenko commented on June 21, 2024

Fixed in v2.2.

from commsdsl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.