Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/next' into protobufStreamFix
Browse files Browse the repository at this point in the history
  • Loading branch information
GenoJAFord committed Mar 24, 2020
2 parents 079c580 + 533d8a2 commit a89828b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions openxc/controllers/usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def _send_complex_request(self, request):
"""Send a request via the USB control request endpoint, rather than as a
bulk transfer.
"""
# LOG.warn("DEBUG STUFF ________________ " + str(self.streamer.serialize_for_stream(request)))
self.device.ctrl_transfer(0x40, self.COMPLEX_CONTROL_COMMAND, 0, 0,
self.streamer.serialize_for_stream(request))

Expand Down
6 changes: 4 additions & 2 deletions openxc/tools/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def parse_options():
dest="unix_time")
parser.add_argument("--host", action="store", default=None,
dest="host")
parser.add_argument("--network-host", action="store", default=None,
dest="network_host")
parser.add_argument("--port", action="store", default=80,
dest="port")
parser.set_defaults(format="json")
Expand All @@ -143,8 +145,8 @@ def handle_set_command(arguments, interface):
set_payload_format(interface, arguments.new_payload_format)
if arguments.unix_time is not None:
set_rtc_time(interface, int(arguments.unix_time))
if arguments.host is not None:
modem_configuration(interface, arguments.host, arguments.port)
if arguments.network_host is not None:
modem_configuration(interface, arguments.network_host, arguments.port)

def handle_write_command(arguments, interface):
if arguments.write_name:
Expand Down
3 changes: 3 additions & 0 deletions openxc/tools/dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
from openxc.formats.json import JsonFormatter
from .common import device_options, configure_logging, select_device

import functools
print = functools.partial(print, flush=True)

def receive(message, **kwargs):
message['timestamp'] = time.time()
print((JsonFormatter.serialize(message)))
Expand Down
4 changes: 3 additions & 1 deletion openxc/tools/obd2scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
from .common import device_options, configure_logging, select_device
import json

import functools
print = functools.partial(print, flush=True)

def scan(controller, bus=None):

# TODO could read the response from the "PIDs supported" requests to see
Expand All @@ -28,7 +31,6 @@ def scan(controller, bus=None):

if (no_response == True):
print("PID 0x%x did not respond" % pid)
sys.stdout.flush()

def parse_options():
parser = argparse.ArgumentParser(description="Send requests for all "
Expand Down
3 changes: 3 additions & 0 deletions openxc/tools/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

from .common import device_options, configure_logging, select_device

import functools
print = functools.partial(print, flush=True)

TESTER_PRESENT_MODE = 0x3e
TESTER_PRESENT_PAYLOAD = bytearray([0])

Expand Down

0 comments on commit a89828b

Please sign in to comment.