File: can_viewer.1

package info (click to toggle)
python-can 4.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,372 kB
  • sloc: python: 25,840; makefile: 38; sh: 20
file content (142 lines) | stat: -rw-r--r-- 4,873 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.49.3.
.TH CAN_VIEWER "1" "December 2023" "can_viewer 4.3.1" "User Commands"
.SH NAME
can_viewer \- CAN data viewer
.SH SYNOPSIS
.B python3
\fI\,-m can.viewer \/\fR[\fI\,-c CHANNEL\/\fR]
.SH DESCRIPTION
.TP
[\-i {canalystii,cantact,etas,gs_usb,iscan,ixxat,kvaser,neousys,neovi,nican,nixnet,pcan,robotell,seeedstudio,serial,slcan,socketcan,socketcand,systec,udp_multicast,usb2can,vector,virtual}]
[\-b BITRATE] [\-\-fd] [\-\-data_bitrate DATA_BITRATE]
[\-h] [\-\-version]
[\-d ('{<id>:<format>,<id>:<format>:<scaling1>:...:<scalingN>,file.txt}',)]
[\-f ('{<can_id>:<can_mask>,<can_id>~<can_mask>}',)]
[\-v]
('extra_args',)
.PP
A simple CAN viewer terminal application written in Python
.SS "positional arguments:"
.TP
extra_args
The remaining arguments will be used for the interface
and logger/player initialisation. For example, `\-i
vector \fB\-c\fR 1 \fB\-\-app\-name\fR=\fI\,MyCanApp\/\fR` is the equivalent to
opening the bus with `Bus('vector', channel=1,
app_name='MyCanApp')
.SS "options:"
.TP
\fB\-c\fR, \fB\-\-channel\fR CHANNEL
Most backend interfaces require some sort of channel.
For example with the serial interface the channel
might be a rfcomm device: "/dev/rfcomm0". With the
socketcan interface valid channel examples include:
"can0", "vcan0".
.TP
\fB\-i\fR, \fB\-\-interface\fR {canalystii,cantact,etas,gs_usb,iscan,ixxat,kvaser,neousys,neovi,nican,nixnet,pcan,robotell,seeedstudio,serial,slcan,socketcan,socketcand,systec,udp_multicast,usb2can,vector,virtual}
Specify the backend CAN interface to use. If left
blank, fall back to reading from configuration files.
.TP
\fB\-b\fR, \fB\-\-bitrate\fR BITRATE
Bitrate to use for the CAN bus.
.TP
\fB\-\-fd\fR
Activate CAN\-FD support
.TP
\fB\-\-data_bitrate\fR DATA_BITRATE
Bitrate to use for the data phase in case of CAN\-FD.
.SS "Optional arguments:"
.TP
\fB\-h\fR, \fB\-\-help\fR
Show this help message and exit
.TP
\fB\-\-version\fR
Show program's version number and exit
.TP
\fB\-d\fR, \fB\-\-decode\fR ('{<id>:<format>,<id>:<format>:<scaling1>:...:<scalingN>,file.txt}',)
Specify how to convert the raw bytes into real values.
The ID of the frame is given as the first argument and the format as the second.
The Python struct package is used to unpack the received data
where the format characters have the following meaning:
.TP
< = little\-endian, > = big\-endian
x = pad byte
c = char
? = bool
b = int8_t, B = uint8_t
h = int16, H = uint16
l = int32_t, L = uint32_t
q = int64_t, Q = uint64_t
f = float (32\-bits), d = double (64\-bits)
.TP
Fx to convert six bytes with ID 0x100 into uint8_t, uint16 and uint32_t:
$ python3 \fB\-m\fR can.viewer \fB\-d\fR "100:<BHL"
.TP
Note that the IDs are always interpreted as hex values.
An optional conversion from integers to real units can be given
as additional arguments. In order to convert from raw integer
values the values are divided with the corresponding scaling value,
similarly the values are multiplied by the scaling value in order
to convert from real units to raw integer values.
Fx lets say the uint8_t needs no conversion, but the uint16 and the uint32_t
needs to be divided by 10 and 100 respectively:
.IP
\f(CW$ python3 -m can.viewer -d "101:<BHL:1:10.0:100.0"\fR
.TP
Be aware that integer division is performed if the scaling value is an integer.
Multiple arguments are separated by spaces:
.IP
\f(CW$ python3 -m can.viewer -d "100:<BHL" "101:<BHL:1:10.0:100.0"\fR
.TP
Alternatively a file containing the conversion strings separated by new lines
can be given as input:
.IP
\f(CW$ cat file.txt\fR
.TP
100:<BHL
101:<BHL:1:10.0:100.0
.IP
\f(CW$ python3 -m can.viewer -d file.txt\fR
.TP
\fB\-f\fR, \fB\-\-filter\fR ('{<can_id>:<can_mask>,<can_id>~<can_mask>}',)
Space separated CAN filters for the given CAN interface:
.TP
<can_id>:<can_mask> (matches when <received_can_id> & mask == can_id & mask)
<can_id>~<can_mask> (matches when <received_can_id> & mask != can_id & mask)
.TP
Fx to show only frames with ID 0x100 to 0x103 and 0x200 to 0x20F:
python3 \fB\-m\fR can.viewer \fB\-f\fR 100:7FC 200:7F0
.IP
Note that the ID and mask are always interpreted as hex values
.TP
\fB\-v\fR
How much information do you want to see at the command
line? You can add several of these e.g., \fB\-vv\fR is DEBUG
.SS "Shortcuts:"
.HP
+\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
.TP
|
Key   |       Description             |
.HP
+\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
.TP
| ESQ/q
| Exit the viewer               |
.TP
| c
| Clear the stored frames       |
.TP
| s
| Sort the stored frames        |
.TP
| h
| Toggle highlight byte changes |
.TP
| SPACE
| Pause the viewer              |
.TP
| UP/DOWN | Scroll the viewer
|
.HP
+\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+