Giter Club home page Giter Club logo

Comments (3)

arobenko avatar arobenko commented on June 21, 2024

Hi Ahmed,
I think the tutorial17 is what you need.

Regards,
Alex

from commsdsl.

ahmed192a avatar ahmed192a commented on June 21, 2024

tutorial17 does't describe my case.

Assume i have a message something like this | id 6 bits | name 7 bits | status 3 bits |
so the id of the message in that case is less than one byte.

is there a way to make the frame less than one byte?

from commsdsl.

arobenko avatar arobenko commented on June 21, 2024

Unfortunately the CommsChampion Ecosystem is a poor fit for the bit based protocols. It was designed to handle byte based ones. There is a limited support for bit based fields when they are bundled together in the <bitfield> field, which has its limitations. It requires total number of bits to be divisible by 8 (i.e. have a byte-based total length) and cannot exceed 64 bit altogether to be able to fit into 64 bit of underlying type, such as std::uint64_t.

If the fields listed above (| id 6 bits | name 7 bits | status 3 bits |) are the same for all the messages, i.e. can be considered to be part of the message framing, then you can solve it by defining a <custom> framing layer with the <bitfield> field combining these fields:

      <custom name="IdWithExtras" semanticLayerType="id"> 
          <bitfield name="Field" endian="big">
              <int name="Status" type="uint8" bitLength="3">
              <int name="Name" type="uint8" bitLength="7" />
              <int name="Id" type="uint8" bitLength="6" />
          </bitfield>
      </custom>

Then you can use tutorial17 for the guidance of how to implement such custom layer extending the comms::protocol::MsgIdLayer.

If this is not your case, then I'm afraid you should look for other solutions instead of (or in addition to) the CommsChampion Ecosystem.

I have some thoughts and ideas of how I can support the bit based protocols in the CommsChampion Ecosystem, but I'm not planning to work on it in the near future.

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.