You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ JSON files should be structured according to a strict hierarchy of:
59
59
60
60
At the root of any spec-compliant JSON file is a list of Message objects. Each Message object has the following members:
61
61
-`id`, a hexadecimal string of the CAN ID (extended CAN supported and default)
62
-
-`desc`, string representing a quick descroption of the CAN message
62
+
-`desc`, string representing a quick descroption of the CAN message. Note that if it contains the word "overflow", it will be used as the overflow detection broadcast for said node. See the code-gen folder for details.
63
63
-`points`, a list of CAN Points being sent from the Message
64
64
-`fields`, a list of MQTT messages being sent from the Message
65
65
@@ -77,7 +77,7 @@ You may want to publish the fields of a message to additional MQTT clients. Add
77
77
#### NetField
78
78
79
79
Within the `fields` member of a Message object, there is a list of NetField objects. Think 1 MQTT Topic per NetField. Each NetField has the following members:
80
-
-`name`, string of the message topic name, e.g. `The/Topic/Name`. Going 3 levels of slashes is usually preferred, don't put trailing slashes.
80
+
-`name`, string of the message topic name, e.g. `The/Topic/Name`. Going 3 levels of slashes is usually preferred, don't put trailing slashes. The first level (in the above case `The`, is the name of the node sending the can message).
81
81
- To embed live Point values in `name`, include point indices (from 1) in the name. Ex. `"Hello/{1}/World/{2}/Status"`
82
82
-`unit`, string of the unit of the data, e.g. `mph`
83
83
-`doc`, a short string with a human readable info about the topic
@@ -161,5 +161,12 @@ The script format.sh will format the files in place. It requires moreutils and
161
161
162
162
Work must be done in both Calypso and here.
163
163
164
-
1. In Calypso, edit the can_types.rs file to reflect your change
164
+
1. In Calypso, edit the can_types.rs and nerdbc.rs file to reflect your change
165
165
2. In here, migrate the JSON files to suite your needs.
166
+
3. Optionally, migrate the code-gen files appropriately
167
+
168
+
## Code gen
169
+
170
+
This generates C code for CAN bus nodes.
171
+
172
+
To generate code, use the NER environment from Embedded-Base. The Jinja2 templates allow us to create .c and .h files by reading in the JSON specification files. In each compliant repository, there is a cangen.sh file which triggers this repository script under the submodule.
0 commit comments