Skip to content

Commit a7d6478

Browse files
committed
gs_usb, interface: support this interface on command-line with e.g. can.logger by treating channel like index when all other arguments are missing
1 parent 07150fa commit a7d6478

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

doc/interfaces/gs_usb.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ and candleLight USB CAN interfaces.
88

99
Install: ``pip install "python-can[gs_usb]"``
1010

11-
Usage: pass device ``index`` (starting from 0) if using automatic device detection:
11+
Usage: pass device ``index`` or ``channel`` (starting from 0) if using automatic device detection:
1212

1313
::
1414

1515
import can
1616

1717
bus = can.Bus(interface="gs_usb", channel=dev.product, index=0, bitrate=250000)
18+
bus = can.Bus(interface="gs_usb", channel=0, bitrate=250000) # same
1819

1920
Alternatively, pass ``bus`` and ``address`` to open a specific device. The parameters can be got by ``pyusb`` as shown below:
2021

0 commit comments

Comments
 (0)