summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2022-06-07 16:25:40 -0400
committerScott Murray <scott.murray@konsulko.com>2022-07-06 14:32:43 -0400
commit98596c38c74586f97e1c808c923c6064755086dc (patch)
treea1b0ffca4250e4f959b23d3cdffd1f471e6c2c39
parent8eee52427d4e7bbd060f5537a19042cebb78af3a (diff)
simple_can_simulator: support different interface for LIN messages
Add a "--lin-interface" option to simple_can_simulator.py to allow specifying a different CAN interface for the cruise control LIN messages from the steering wheel in the demo setup. This allows pointing at the sllin0 interface in the full demo setup that is configured with the agl-demo-preload feature. Previously the CAN messages for the LIN events were bridged to the primary CAN interface, but this has proven unreliable in practice. Bug-AGL: SPEC-4431 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I1bb0e429b849ed1e25cbd9ee8fb887e973d33081
-rwxr-xr-xrecipes-demo/simple-can-simulator/files/simple_can_simulator.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/recipes-demo/simple-can-simulator/files/simple_can_simulator.py b/recipes-demo/simple-can-simulator/files/simple_can_simulator.py
index 83f88706..3d6c85d5 100755
--- a/recipes-demo/simple-can-simulator/files/simple_can_simulator.py
+++ b/recipes-demo/simple-can-simulator/files/simple_can_simulator.py
@@ -350,13 +350,18 @@ class StatusMessageSender(object):
def main():
parser = argparse.ArgumentParser(description='Simple CAN vehicle simulator.')
parser.add_argument('interface', type=str, help='interface name (e.g. vcan0)')
+ parser.add_argument('--lin-interface', help='Separate LIN interface name (e.g. sllin0)')
parser.add_argument('-v', '--verbose', help='increase output verbosity', action='store_true')
args = parser.parse_args()
+ lin_interface = args.lin_interface
+ if lin_interface == None:
+ lin_interface = args.interface
+
try:
can_sock = CANSocket(args.interface)
diag_can_sock = CANSocket(args.interface)
- steeringwheel_can_sock = CANSocket(args.interface)
+ steeringwheel_can_sock = CANSocket(lin_interface)
except OSError as e:
sys.stderr.write('Could not listen on interface {0}\n'.format(args.interface))
sys.exit(e.errno)