@@ -8,81 +8,17 @@ They can be called for example by ``python -m can.logger`` or ``can_logger.py``
88can.logger
99----------
1010
11- Command line help, called with ``--help ``::
12-
13- usage: python -m can.logger [-h] [-f LOG_FILE] [-v] [-c CHANNEL]
14- [-i {pcan,ixxat,socketcan_ctypes,kvaser,virtual,usb2can,vector,slcan,nican,socketcan,iscan,neovi,serial,socketcan_native}]
15- [--filter ...] [-b BITRATE]
16- [--active | --passive]
17-
18- Log CAN traffic, printing messages to stdout or to a given file.
19-
20- optional arguments:
21- -h, --help show this help message and exit
22- -f LOG_FILE, --file_name LOG_FILE
23- Path and base log filename, for supported types see
24- can.Logger.
25- -v How much information do you want to see at the command
26- line? You can add several of these e.g., -vv is DEBUG
27- -c CHANNEL, --channel CHANNEL
28- Most backend interfaces require some sort of channel.
29- For example with the serial interface the channel
30- might be a rfcomm device: "/dev/rfcomm0" With the
31- socketcan interfaces valid channel examples include:
32- "can0", "vcan0"
33- -i {pcan,ixxat,socketcan_ctypes,kvaser,virtual,usb2can,vector,slcan,nican,socketcan,iscan,neovi,serial,socketcan_native}, --interface {pcan,ixxat,socketcan_ctypes,kvaser,virtual,usb2can,vector,slcan,nican,socketcan,iscan,neovi,serial,socketcan_native}
34- Specify the backend CAN interface to use. If left
35- blank, fall back to reading from configuration files.
36- --filter ... Comma separated filters can be specified for the given
37- CAN interface: <can_id>:<can_mask> (matches when
38- <received_can_id> & mask == can_id & mask)
39- <can_id>~<can_mask> (matches when <received_can_id> &
40- mask != can_id & mask)
41- -b BITRATE, --bitrate BITRATE
42- Bitrate to use for the CAN bus.
43- --active Start the bus as active, this is applied the default.
44- --passive Start the bus as passive.
11+ Command line help, called with ``--help ``:
12+
13+
14+ .. command-output :: python -m can.logger -h
4515
4616
4717can.player
4818----------
4919
50- Command line help, called with ``--help ``::
51-
52- usage: python -m can.player [-h] [-f LOG_FILE] [-v] [-c CHANNEL]
53- [-i {pcan,ixxat,socketcan_ctypes,kvaser,virtual,usb2can,vector,slcan,nican,socketcan,iscan,neovi,serial,socketcan_native}]
54- [-b BITRATE] [--ignore-timestamps]
55- [-g GAP] [-s SKIP]
56- input-file
57-
58- Replay CAN traffic.
59-
60- positional arguments:
61- input-file The file to replay. For supported types see
62- can.LogReader.
63-
64- optional arguments:
65- -h, --help show this help message and exit
66- -f LOG_FILE, --file_name LOG_FILE
67- Path and base log filename, for supported types see
68- can.LogReader.
69- -v Also print can frames to stdout. You can add several
70- of these to enable debugging
71- -c CHANNEL, --channel CHANNEL
72- Most backend interfaces require some sort of channel.
73- For example with the serial interface the channel
74- might be a rfcomm device: "/dev/rfcomm0" With the
75- socketcan interfaces valid channel examples include:
76- "can0", "vcan0"
77- -i {pcan,ixxat,socketcan_ctypes,kvaser,virtual,usb2can,vector,slcan,nican,socketcan,iscan,neovi,serial,socketcan_native}, --interface {pcan,ixxat,socketcan_ctypes,kvaser,virtual,usb2can,vector,slcan,nican,socketcan,iscan,neovi,serial,socketcan_native}
78- Specify the backend CAN interface to use. If left
79- blank, fall back to reading from configuration files.
80- -b BITRATE, --bitrate BITRATE
81- Bitrate to use for the CAN bus.
82- --ignore-timestamps Ignore timestamps (send all frames immediately with
83- minimum gap between frames)
84- -g GAP, --gap GAP <s> minimum time between replayed frames
85- -s SKIP, --skip SKIP <s> skip gaps greater than 's' seconds
20+ .. command-output :: python -m can.player -h
21+
8622
8723can.viewer
8824----------
@@ -97,80 +33,9 @@ The first column is the number of times a frame with the particular ID that has
9733Command line arguments
9834^^^^^^^^^^^^^^^^^^^^^^
9935
100- By default it will be using the :doc: `/interfaces/socketcan ` interface. All interfaces supported are supported and can be specified using the ``-i `` argument.
101-
102- The full usage page can be seen below::
103-
104- Usage: python -m can.viewer [-h] [--version] [-b BITRATE] [-c CHANNEL]
105- [-d {<id>:<format>,<id>:<format>:<scaling1>:...:<scalingN>,file.txt}]
106- [-f {<can_id>:<can_mask>,<can_id>~<can_mask>}]
107- [-i {iscan,ixxat,kvaser,neovi,nican,pcan,serial,slcan,socketcan,socketcan_ctypes,socketcan_native,usb2can,vector,virtual}]
108-
109- A simple CAN viewer terminal application written in Python
110-
111- Optional arguments:
112- -h, --help Show this help message and exit
113- --version Show program's version number and exit
114- -b, --bitrate BITRATE
115- Bitrate to use for the given CAN interface
116- -c, --channel CHANNEL
117- Most backend interfaces require some sort of channel.
118- For example with the serial interface the channel
119- might be a rfcomm device: "/dev/rfcomm0" with the
120- socketcan interfaces valid channel examples include:
121- "can0", "vcan0". (default: use default for the
122- specified interface)
123- -d, --decode {<id>:<format>,<id>:<format>:<scaling1>:...:<scalingN>,file.txt}
124- Specify how to convert the raw bytes into real values.
125- The ID of the frame is given as the first argument and the format as the second.
126- The Python struct package is used to unpack the received data
127- where the format characters have the following meaning:
128- < = little-endian, > = big-endian
129- x = pad byte
130- c = char
131- ? = bool
132- b = int8_t, B = uint8_t
133- h = int16, H = uint16
134- l = int32_t, L = uint32_t
135- q = int64_t, Q = uint64_t
136- f = float (32-bits), d = double (64-bits)
137- Fx to convert six bytes with ID 0x100 into uint8_t, uint16 and uint32_t:
138- $ python -m can.viewer -d "100:<BHL"
139- Note that the IDs are always interpreted as hex values.
140- An optional conversion from integers to real units can be given
141- as additional arguments. In order to convert from raw integer
142- values the values are multiplied with the corresponding scaling value,
143- similarly the values are divided by the scaling value in order
144- to convert from real units to raw integer values.
145- Fx lets say the uint8_t needs no conversion, but the uint16 and the uint32_t
146- needs to be divided by 10 and 100 respectively:
147- $ python -m can.viewer -d "101:<BHL:1:10.0:100.0"
148- Be aware that integer division is performed if the scaling value is an integer.
149- Multiple arguments are separated by spaces:
150- $ python -m can.viewer -d "100:<BHL" "101:<BHL:1:10.0:100.0"
151- Alternatively a file containing the conversion strings separated by new lines
152- can be given as input:
153- $ cat file.txt
154- 100:<BHL
155- 101:<BHL:1:10.0:100.0
156- $ python -m can.viewer -d file.txt
157- -f, --filter {<can_id>:<can_mask>,<can_id>~<can_mask>}
158- Comma separated CAN filters for the given CAN interface:
159- <can_id>:<can_mask> (matches when <received_can_id> & mask == can_id & mask)
160- <can_id>~<can_mask> (matches when <received_can_id> & mask != can_id & mask)
161- Fx to show only frames with ID 0x100 to 0x103:
162- python -m can.viewer -f 100:7FC
163- Note that the ID and mask are alway interpreted as hex values
164- -i, --interface {iscan,ixxat,kvaser,neovi,nican,pcan,serial,slcan,socketcan,socketcan_ctypes,socketcan_native,usb2can,vector,virtual}
165- Specify the backend CAN interface to use.
166-
167- Shortcuts:
168- +---------+-------------------------+
169- | Key | Description |
170- +---------+-------------------------+
171- | ESQ/q | Exit the viewer |
172- | c | Clear the stored frames |
173- | s | Sort the stored frames |
174- | SPACE | Pause the viewer |
175- | UP/DOWN | Scroll the viewer |
176- +---------+-------------------------+
36+ By default the ``can.viewer `` uses the :doc: `/interfaces/socketcan ` interface. All interfaces are supported and can be specified using the ``-i `` argument or configured following :doc: `/configuration `.
37+
38+ The full usage page can be seen below:
39+
40+ .. command-output :: python -m can.viewer -h
41+
0 commit comments