Skip to content

Commit 6a1456d

Browse files
committed
testing code changes to add get_vin as a openxc control command.
1 parent e1a2cc8 commit 6a1456d

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

openxc/controllers/base.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,14 @@ def device_id(self):
427427
}
428428
return self._check_command_response_message(request)
429429

430+
def get_vin(self):
431+
"""Request vehicle VIN
432+
"""
433+
request = {
434+
"command": "get_vin"
435+
}
436+
return self._check_command_response_message(request)
437+
430438
def write(self, **kwargs):
431439
"""Serialize a raw or translated write request and send it to the VI,
432440
following the OpenXC message format.

openxc/tools/control.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ def sd_mount_status(interface):
3131
def device_id(interface):
3232
print(("Device ID is %s" % interface.device_id()))
3333

34+
def get_vin(interface):
35+
print(("Vehicle VIN is %s" % interface.get_vin()))
36+
3437
def passthrough(interface, bus, passthrough_enabled):
3538
if interface.set_passthrough(bus, passthrough_enabled):
3639
print(("Bus %u passthrough set to %s" % (bus, passthrough_enabled)))

0 commit comments

Comments
 (0)