-
Notifications
You must be signed in to change notification settings - Fork 424
OBD Commands
A Command in python-OBD is an object used to query information from the vehicle. They contain all of the information neccessary to perform the query, and decode the cars response. Python-OBD has built in tables for the most common commands. They can be looked up by name, or by mode/PID (for a full list, see Command Tables).
import obd
c = obd.commands.RPM
# OR
c = obd.commands['RPM']
# OR
c = obd.commands[1][12] # mode 1, PID 12 (RPM)Once a connection is made, python-OBD will determine which commands your car supports. The has_command() function can be used check support for any given command.
import obd
connection = obd.OBD()
if connection.has_command(obd.commands.RPM):
...A list of all supported commands is stored in the supported_commands property of the connection object.
Checks the internal command tables for the existance of the given OBDCommand object.
Checks the internal command tables for a command with the given name. This is also the function of the in operator.
Checks the internal command tables for a command with the given mode and PID.