-
Notifications
You must be signed in to change notification settings - Fork 0
3. Reporting Mechanism
This repository supports the reporting of transmitted frames in addition to notifications of received frames similar to CAN232 and CANUSB.
When the device receives a CAN frame, it is notified in the same format as the transmission command: r
, R
, t
, T
, d
, D
, b
and B
.
This function is enabled by default and can be disabled by z
command.
If disabled, the device will not send any data to the host even if it receives CAN frames.
The Rx frame reporting is summarized in the table bellow.
See the "Contents in a report" section for the details of <Rx frame>
.
Rx frame reporting | Timing | Message |
---|---|---|
Disabled | Receive a frame | - |
Enabled | Receive a frame | <Rx frame> |
Note:
- Rx frames are subject to the acceptance filter. A Rx frame will not be reported if it's not accepted by the filter. See the "Acceptance filter" page for details.
Example:
t10020011[CR]
This message will be sent from the device when a classical CAN data frame with ID = 0x100 and 2 data bytes with the valued 0x00 and 0x11 is received.
When the device transmits a CAN frame and it's acknowledged by another node, it is notified in a format that is the transmission command plus a z
or Z
at the beginning.
This function is disabled by default and can be enabled by z
command.
If disabled, the device responds with z[CR]
or Z[CR]
when the transmission command is in the correct format and successfully saved in the buffer without any reporting for a successful transmission.
The Tx event reporting is summarized in the table bellow.
See the "Contents in a report" section for the details of <Tx event>
.
Tx event reporting | Timing | Message |
---|---|---|
Disabled | Save the Tx frame in the buffer |
z[CR] or Z[CR]
|
Disabled | Discard the transmission command | [BELL] |
Disabled | Successfully transmit the Tx frame | - |
Enabled | Save the Tx frame in the buffer | [CR] |
Enabled | Discard the transmission command | [BELL] |
Enabled | Successfully transmit the Tx frame | <Tx event> |
Note:
- If Tx event reporting is enabled and the frame transmission fails, the device will repeatedly attempt to send the frame until it is acknowledged, and then report the successful transmission.
Example:
zt10020011[CR]
This message will be sent from the device when a classical CAN data frame with ID = 0x100 and 2 data bytes with the valued 0x00 and 0x11 is transmitted.
The <Rx frame>
and <Tx event>
always contain the type of frame, CAN ID, DLC and Data bytes (for data frames).
The following items can be added to them:
- Timestamp : Milli/micro second timestamp in hex, configurable with
Z
orz
commands. - Error state indicator : ESI flag (0: Error active, 1: Error passive), configurable with
z
commands.
Format:
-
<z>riiil<tt...><e>[CR]
(Base remote frame) -
<Z>Riiiiiiiil<tt...><e>[CR]
(Extended remote frame) -
<z>xiiildd...<tt...><e>[CR]
(Base data frame) -
<Z>Xiiiiiiiildd...<tt...><e>[CR]
(Extended data frame)
Where <z>
or <Z>
is used for <Tx event>
, x
= t
/ d
/ b
, X
= T
/ D
/ B
, <tt...>
is timestamp and <e>
is ESI.
Example 1:
t10020011000A0[CR]
Denotes an incoming classical CAN data frame with ID = 0x100 and 2 data bytes with the valued 0x00 and 0x11. Additionally, milli second time stamp is activated and is 10 ms and ESI is 0 = error active.
Example 2:
zr20030000000F[CR]
Denotes a successful transmission of classical CAN remote frame with ID = 0x200 and DLC = 3. Additionally, micro second time stamp is activated and is 15 us.