PROPHET/OS
NAME
can: the field bus
SYNOPSIS
can [--tui]
DESCRIPTION
The field bus: the frames that went over the wire, the error state of every wire and its counters.
Each row is one frame. Wire is the controller it passed, Dir says whether this machine sent it (tx, in cyan) or heard it (rx), Id is the identifier in hex and Kind says how wide that identifier is (std for eleven bits, ext for twenty-nine) plus what the frame carries beyond a classic data frame: -fd for CAN-FD, -fd+ when its data phase ran at the faster rate, -rtr for a remote request and -esi when the sender said it is error passive. Len is the number of bytes and not the DLC code: above eight byte the code is no longer a count, and a frame of nine byte does not exist. Data is cut at the width of its column and marked with two dots. Time is the machine's own clock in milliseconds at the moment the frame passed.
The identifier is also the priority. Two nodes that start at once both drive the wire, and the one whose identifier carries the earlier dominant bit wins while the other backs off, so the lower identifier is the higher priority.
The line under the table is the one the rows cannot carry: per wire its error state, its two error counters, its books and its bit rate. The state is the one thing a field bus has to report, because a node counts its own errors and steps down: at 128 it is passive and sends only recessive error flags, at 256 transmit errors it is bus-off and drives nothing at all. A node in bus off is silent and looks exactly like a healthy one with nothing to say, so every state but active stands out. tec and rec are the transmit and the receive error counter the controller keeps, lost are frames its receive memory had no room for, off is how often this node took itself off the bus, and the last words say whether the controller carries CAN-FD and whether an interrupt brings the frames or they get asked for.
The rate is computed out of the controller's own timing register, which the driver writes at bring-up and reads back. 0 kbit/s means that register does not read back: then the rate on the wire is not knowable from the chip, and a number here would be the one the driver wrote and not the one the wire runs.
The rows come out of /state/can, which the service builds out of its own ring and out of the controller's registers. How many rows it keeps follows from the size of that file: more than fit into it could never be read. Nothing is set here; a bus is written to by whoever has something to say on it.
--tui takes the whole screen and keeps the rows live; the arrows and the two page keys move, q leaves.
EXAMPLE
$ can --help can [--tui] the field bus: the frames that went over the wire, the error state of every wire and its counters --tui live on the whole screen, q leaves