Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ build/
dist/
.tox/
.python-version
.vscode/
2 changes: 1 addition & 1 deletion python_can_viewer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
# Web : http://www.lauszus.com
# e-mail : lauszus@gmail.com

__version__ = '0.2.0'
__version__ = '0.3.0'

from .python_can_viewer import *
5 changes: 4 additions & 1 deletion python_can_viewer/python_can_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ def parse_args(args):
for example with the serial interface the channel might be a rfcomm device: "/dev/rfcomm0"
with the socketcan interfaces valid channel examples include: "can0", "vcan0".
(default: use default for the specified interface)''', default=None)

optional.add_argument('-s', '--serial_number', help='''specify SN''', default=None)

optional.add_argument('-d', '--decode', dest='decode',
help='''R|Specify how to convert the raw bytes into real values. \
Expand Down Expand Up @@ -576,14 +578,15 @@ def parse_args(args):

def main(): # pragma: no cover
parsed_args, can_filters, data_structs, ignore_canopen = parse_args(sys.argv[1:])

config = {}
if can_filters:
config['can_filters'] = can_filters
if parsed_args.interface:
config['interface'] = parsed_args.interface
if parsed_args.bitrate:
config['bitrate'] = parsed_args.bitrate
if parsed_args.serial_number:
config['unique_hardware_id'] = parsed_args.serial_number

# Create a CAN-Bus interface
bus = can.interface.Bus(parsed_args.channel, **config)
Expand Down