add dtc codes, wip
This commit is contained in:
+15
@@ -95,6 +95,21 @@ def obd_rpm():
|
||||
socketio.emit('obd_speed', response.value.to("kph"))
|
||||
finally:
|
||||
obd_rpm_lock.release()
|
||||
|
||||
def obd_dtc():
|
||||
obd_speed_lock.acquire()
|
||||
cmd = obd.commands.GET_DTC # select an OBD command (sensor)
|
||||
response = connection.query(cmd) # send the command and parse the response
|
||||
try:
|
||||
if response.is_null():
|
||||
error_txt = "No data received."
|
||||
print(error_txt)
|
||||
socketio.emit('obd_dtc', error_txt)
|
||||
else:
|
||||
print(response.value)
|
||||
socketio.emit('obd_dtc', response.value)
|
||||
finally:
|
||||
obd_rpm_lock.release()
|
||||
|
||||
def kill_obd(obd_type):
|
||||
if obd_type == "speed":
|
||||
|
||||
Reference in New Issue
Block a user