Command ‘j’ – get obd-ii connection status – Innovate Motorsports OT-2 SDK User Manual
Page 24
24
Command ‘j’ – Get OBD-II Connection Status
Sent:
1 byte
{
U8 Cmd;
// ‘j’
}
Responds:
33 bytes
{
U8 Status;
// Connection Status
// 0 = Not Connected
// 1 = Connected CAN
// 2 = Connected J1850 PWM
// 3 = Connected J1850 VPW
// 4 = Connected KWP2000
// 5 = Connected ISO
// 0xFF = Powerdown mode
U32 PidMasks[8]; // These 8 32 bit values represent
// responses to the standard
// 00, 20, 40, etc. mode 1 PID
// requests
}
Notes:
This is a case where the abstraction level in the firmware
is not complete. The unit does not directly poll PIDs.
Instead, you designated one of about 100 ‘normalized PIDs’
(see the ‘c’ command and the separate section). But, in
terms of availability of normalized PIDs, the host has to
check for the associated ECU pid in the table returned by
this command (see Appendix B), or ask about a given
‘normalized PID’ using the ‘a’ command below.
Command ‘a’ – Check availability of a ‘normalized’ PID
Sent:
3 bytes
{
U8 Cmd;
// ‘a’
U16 Pid;
// Normalized PID to check
}
Responds:
1 byte
{
U8 Status;
// PID Status
// 0 = Not Currently Available
// 1 = Available
}
Notes:
Although this command is here for completeness, it is not a
very efficient way to see if a particular normalized PID is
available. It is generally faster to check for the
associated ECU pid against the PID masks returned by the
‘j’ command (see above). See Appendix B for an example of
how to do this.