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: cangen/README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,9 +65,9 @@ Occassionally you may want Calypso to also send a message on the CAN network. Us
65
65
-`key`, string representing the key to index the Encodable Message to, e.g. it would be sent to Calypso on `"Calypso/Bidir/Command/{key}"`
66
66
-`is_ext`, boolean representing whether the CAN ID is extended or standard (`false` by default)
67
67
It is recommended that the decoding of the message be done to the topic `"Calypso/Bidir/State/{key}/{field_name}"`. Note decoding works exactly the same with these messages, so serves as an accurate representation of what Calypso is current sending out to the car.
68
-
69
-
Also, you should allow for simulation of the data point whenever possible.
70
-
-`sim_freq`, integer frequency of which this message is usually emitted, in ms
68
+
-`bidir_mode`, string specifying which bidirectionality functional profile the message uses (`broadcast` by default). Options:
69
+
-`broadcast`: The message is sent on a loop of about one second with the most recent value, or the default value (see below). Default value is required.
70
+
-`oneshot`: The message is sent once instantaneously upon reception of a setting. There are no default values used.
71
71
72
72
You may want to publish the fields of a message to additional MQTT clients. Add the following optional field to specify which additional client ports the fields should be published on.
73
73
-`clients`, (optional) list of u16s representing the ports of additional MQTT clients to publish to. Currently supported additional ports are: 1882
@@ -90,7 +90,7 @@ Within the `points` member of a NetField object, there is a list of Point object
90
90
-`endianness` (optional), string representing the byte endianness of the bits being read, either `"big"` or `"little"` (`"big"` by default)
91
91
-`format` (optional), string representing the format of the bits (e.g. `divide100`) (blank by default)
92
92
- Use an existing formatter if possible. To create a new one, add it to the `impl FormatData` block in `Calypso/src/data.rs`. Name it what it does if it could be reused by unrelated functions (ex. divide by 100 --> `divide100`) or if its very obscure use whats its used for (ex. multiply by 0029 in IMU datasheet --> `acceleration`). Include `_d` and `_e` implementations for decoding and encoding, respectively
93
-
-`default_value` (optional, only for Encodable Messages), float representing the default value to be sent before a command is received or when an empty command is received. This is ignored when decoding the Point (`0` by default)
93
+
-`default_value` (optional, only for Encodable Messages), float representing the default value to be sent before a command is received or when an empty command is received. This is ignored when decoding the Point, and ignored if using bidirectionality profile `oneshot` (`0` by default)
94
94
-`ieee754_f32` (optional), boolean indicating if the bits in the Point should be interpreted as an IEEE754 32-bit float. **Be sure to endian swap the float before sending!!** (`false` by default)
95
95
-`sim` (optional), the simulation mode for the Point. See below
96
96
@@ -102,9 +102,9 @@ Within the `sim` member of a CANPoint object, there is a single sim object. Thi
102
102
-`max`, float, the maximum value to emit
103
103
-`inc_min`, float, the minimum increment
104
104
-`inc_max`, float, the maximum increment
105
-
-`round`, bool, whether to round values to a whole number (more precise rounding is not supported)
105
+
-`round`, bool, whether to round values to a whole number (more precise rounding is not supported) (default: false)
106
106
107
-
or
107
+
**or**
108
108
`enum`: choose from a certain list of values
109
109
-`options`, list[[`value`, `freq`]...], a list containing lists of length two. Each inner list's first item is the value to be emitted, and the second item is the probability the item should be emitted. **These probabilities must add to 1, or they won't be obeyed.**
0 commit comments