beautypg.com

Innovate Motorsports OT-2 SDK User Manual

Page 52

background image

52

Command ‘O’ – Output Data and (optionally) look for input

Sent:

Variable
{

U8 Cmd;

// ‘O’

U8 Timeout;

// Timeout (in mS) for responses
// (P2)

U8 Replies;

// Expected number of replies

U8 DataLen;

// Expected Data length of replies

// 1-7 (0 will be treated as 7)

U8 ByteDelay;

// Time to delay (in mS) between

// each byte sent

U8 Len;

// Data length (32 Max)

// If len & 0x80, a checksum is

// added for you

U8 Data[Len];

// Data Bytes to Send

}


Responds:

Variable (1 byte minimum)
{

// Optional

{

U8 Len;

// Data length of data received

// Bit 7 set = checksum failure

U8 Data[Len];

// Received Data

}
U8 End;

// Always 0xFF

}


Notes:

If replies is set to 0, the message will be sent, but the
0xFF will immediately be returned, regardless of ‘Timeout’.

Timeout is basically “P2”. If replies is set, the 0xFF will
be returned after either a) the desired number of bytes is
received or b) this time is reached without a received
packet.

Timeout cannot be set to 0, doing do will default to a
timeout of 150 mS.

DataLen is the expected number of J1979 data bytes in
responses (1-7). You really want to set this. If you do
not, then the unit has to wait for timers to expire,
because ISO protocols do not nec. have packet length
fields. If you set it to 0, then, depending on the
protocol, you may have to wait for full timeout per
response (slooow).

ByteDelay can be set to zero, but the ISO 9141 and KWP 2000
protocols require 5 (we’ve found that 6 helps with older
Japanese vehicles). This is the transmit spacing for bytes.