Comments (3)
Hi Ahmed,
I think the tutorial17 is what you need.
Regards,
Alex
from commsdsl.
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.
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)
- Need Help HOT 21
- 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
- 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
- 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
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.