OBDCommands are objects 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.
import obd c = obd.commands.RPM # OR c = obd.commands['RPM'] # OR c = obd.commands # mode 1, PID 12 (RPM)
commands table also has a few helper methods for determining if a particular name or PID is present.
Checks the internal command tables for the existance of the given
OBDCommand object. Commands are compared by mode and PID value.
import obd obd.commands.has_command(obd.commands.RPM) # True
Checks the internal command tables for a command with the given name. This is also the function of the
import obd obd.commands.has_name('RPM') # True # OR 'RPM' in obd.commands # True
Checks the internal command tables for a command with the given mode and PID.
import obd obd.commands.has_pid(1, 12) # True