Comments (7)
Hi Mathis,
I don't exactly understand what you mean by ICD, but I have had a long term plan to implement automatic protocol specification generated out of schema files. Unfortunately I didn't come around to actually design and implement such tool. You're more than welcome to do it yourself. However, there are a few things I want you to consider.
- Please don't try to integrate the new functionality to the existing
commsdsl2comms
application, even though it contains a convenient functionality of using template strings and substituting parts of it. The documentation generation functionality is really an iceberg, the hidden part of which is very easy to underestimate. For example, you'll probably eventually need an extra documentation snippets injection functionality, similar to what I did with the code. - I'd prefer you implement it as a separate tool, that's why I split the existing functionality to
libcommsdsl
library (which allows easy navigation through the parsed schema files) and the code generation app likecommsdsl2comms
which uses the library. - The library interface to the parsed schema files can be found here. Sorry, I didn't come around to actually documenting the interface, but it should be self explanatory in many ways. You can use parseSchemaFiles function for reference of how and where to start.
- I also suggest that at first you implement it as completely separate project, no need to fork the commsdsl repository. You can attach the commsdsl as git submodule or use it as externa project in your cmake file. Another option is to build it externally and use
find_package(LibCommsdsl)
in yours. - Once you have the "production ready" version of your code you are proud of, we can consider an option to put it next to the
commsdsl2comms
application of this project in order to make it easily accessible to other people. - If you really want to have the existing template portions replacement code to your disposal, we can consider moving it to the
commsdsl
library and make it common for all applications. As the short term solution just copy-paste it to your application. It can be cleaned later.
Hope it helps.
from commsdsl.
https://github.com/mathisloge/protocol-doc-generation
So I've worked a bit on it. But it is far away from testable. Just wanted to let you know, that there is some progress. Using https://github.com/pantor/inja to generate text from templates. In the end all structures has to be converted to an internal json structure. But, which i do like quite a lot, it is possibile to override text etc. by appying a json merge.
from commsdsl.
Hi Mathis,
When I introduced the relevant code, the intention was to put the string encoding information (like ascii, utf-8, etc...) into the schema. The libcommsdsl parses and exposes its information in the API. However, the COMMS library and comms_champion project doesn't have any use for this information, and consequently commsdsl2comms code generator. At least for now. As the result I also decided not to document it in the spec and leave it as undocumented feature for the future. Besides, I still haven't decided for the range of valid values. Potentially it should become an enum instead of the string in the StringField API.
Please disregard it for now unless you really need to specify it as part of the schema, not just comment.
from commsdsl.
It might be also an option to specify eg. --icd latex
or --icd asciidoc
etc. to get a different output format. (or --icd custom
which should be a path to a file which contains a template.)
All outputs will be templates where defined keywords will be replaced with the protocol definitions
from commsdsl.
Hi Alex,
thanks for the feedback.
An ICD generally describes way more than just the protocol, also the electrical and mechanical aspects of an interface. But this auto generation will focus only on the protocol description.
Because the description is often part of a bigger document, it should only generate the files. The user should include these into the actual document.
I'll implement it first as a standalone tool.
from commsdsl.
Hi Alex,
quick question:
The StringField has a encoding state which will default to the common::encoding. (
commsdsl/lib/src/StringFieldImpl.cpp
Line 219 in ba636a9
But I couldn't find any info about it in https://commschamp.github.io/commsdsl_spec/#appendix-string
Do I have to take the encoding into account or can I ignore it (treat it just a internal code gen thing)?
from commsdsl.
Hi Alex,
thanks for the explanation!
Then I will ignore the field for now.
from commsdsl.
Related Issues (20)
- Question: List without length and message size HOT 2
- 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.