beautypg.com

Innovate Motorsports OT-2 SDK User Manual

Page 21

background image

21

This means that we are no longer receiving packets from the LC-1s in the example above.
In addition, the gauge is no longer receiving information. So, unless you have a
compelling reason to do so, or you know that no other devices are attached to the OT-2,
you do not want to linger in Setup Mode. This relates to the next thing that happens…

2. The OT-1b/2 starts a ‘Watchdog’ timer


Because the units are designed to be setup and left in a vehicle, and because Setup Mode
potentially stops expected behavior with other devices (see #1 above), the firmware takes
steps to insure that you are in Setup Mode on purpose. Namely, it times out and exits
after 10 seconds of inactivity (or more than 2 seconds of delay between bytes on a multi-
byte command see below).

Setup mode is also exited automatically if the firmware detects that the connection (USB
or Wi-Fi) has been severed. The point behind this is that even if the host software crashes
(or is rudely and suddenly terminated by the operating system, as sometimes occurs on
handheld platforms like Android and the iPhone), the unit will restore itself to a normal
state after a reasonable delay and without user intervention.

It is mentioned here because it can be a gotcha when debugging. You might be single
step debugging, become briefly distracted by the sheer elegance of your code, and then
suddenly find yourself receiving wholly unexpected responses. You look down, and find
that the MTS light on the device itself has started blinking again…

Seriously, as long as we remain aware of it, we have not found this to be much of a
problem in our own debugging. But some platforms can take more than 10 seconds just to
transition from a break point to single step debugging (especially in some embedded
development). So, if you find yourself stumped, and unable to debug your problem
because of the watch dog timer, please let us know and we will help you work around it.

If you simply must stay in Setup Mode, even though you have gaps in needed commands
of 10 seconds or more, you can periodically send the dummy command 0xFF (no
response) to reset the watchdog timer.

3. The OT-1b/2 sends a ‘welcome to setup mode’ message


This message is 15 bytes long and, frankly, the last 9 bytes are essentially gibberish for.
They contain a lot of conditional information that LM Programmer uses for options
presentation and firmware updates. So, for the purposes of this SDK, let’s call them
reserved for Innovate use. This makes our 15 byte message as follows:

Byte

0-1

2-5

6-14

Description

Firmware

Version

Identifier

Bytes you do not need to know about and

which I do not want to document