def do_test(filename=None):
    elm = create_test_elm(filename)
    try:
        elm.open()
        elm.set_protocol(None)
        elm.connect_to_vehicle()
    except Exception as e:
        unexpected_error(e)
        # if the connection fails, everything else will too
        return

    global dtc_count
    dtc_count = 0

    read_all_supported_pids(elm, 0x01)

    if dtc_count:
        try:
            responses = elm.send_request(OBDRequest(sid=0x03))
            for r in responses:
                print "%s: %s" % (r.bus_message.header, str(r))
        except obd.exception.DataError:
            pass
        except Exception as e:
            unexpected_error(e)

    read_all_supported_pids(elm, 0x09)

    return
def do_test(filename=None):
    elm = create_test_elm(filename)
    try:
        elm.open()
        elm.set_protocol(None)
        elm.connect_to_vehicle()
    except Exception as e:
        unexpected_error(e)
        # if the connection fails, everything else will too
        return

    global dtc_count
    dtc_count = 0

    read_all_supported_pids(elm, 0x01)

    if dtc_count:
        try:
            responses = elm.send_request(OBDRequest(sid=0x03))
            for r in responses:
                print "%s: %s" % (r.bus_message.header, str(r))
        except obd.exception.DataError:
            pass
        except Exception as e:
            unexpected_error(e)

    read_all_supported_pids(elm, 0x09)

    return
示例#3
0
def do_test(filename=None):
    elm = create_test_elm(filename)
    try:
        elm.open()
        elm.set_protocol(None)
        elm.connect_to_vehicle()
    except Exception as e:
        unexpected_error(e)
        # if the connection fails, everything else will too
        return

    read_all_supported_pids(elm, 0x01)

    # Awaiting implementation of Service $02
    # frames = elm.get_frame_count()
    # for f in range(0, frames):
    #     elm.get_data(all_values, frame=f)

    read_dtcs(elm, 0x03)

    # skip Service $04 (resets DTCs)

    # Awaiting implementation of Service $05
    # O2 sensor locations appended to request
    # (legacy protocols only; not supported by ISO 15765)

    # Awaiting implementation of Service $06
    # legacy responses have a filler byte before the pid-supported
    # data
    read_all_supported_tests(elm, 0x06)

    read_dtcs(elm, 0x07)

    # Skip Service $08 (controls a physical test)

    read_all_supported_pids(elm, 0x09)

    read_dtcs(elm, 0x0A)
    return
示例#4
0
def do_test(filename=None):
    elm = create_test_elm(filename)
    try:
        elm.open()
        elm.set_protocol(None)
        elm.connect_to_vehicle()
    except Exception as e:
        unexpected_error(e)
        # if the connection fails, everything else will too
        return

    read_all_supported_pids(elm, 0x01)

    # Awaiting implementation of Service $02
    # frames = elm.get_frame_count()
    # for f in range(0, frames):
    #     elm.get_data(all_values, frame=f)

    read_dtcs(elm, 0x03)

    # skip Service $04 (resets DTCs)

    # Awaiting implementation of Service $05
    # O2 sensor locations appended to request
    # (legacy protocols only; not supported by ISO 15765)

    # Awaiting implementation of Service $06
    # legacy responses have a filler byte before the pid-supported
    # data
    read_all_supported_tests(elm, 0x06)

    read_dtcs(elm, 0x07)

    # Skip Service $08 (controls a physical test)

    read_all_supported_pids(elm, 0x09)

    read_dtcs(elm, 0x0A)
    return