User guide

6 / 13
Flashing iSense Devices Wirelessly User Guide
coalesenses
research to innovate
* devices.
*
*/
virtual uint16 application_id (void);
//----------------------------------------------------------------------------
/** This method can be used to differentiate between different versions of
* the application. The number is also (in addition to the application id)
* shown in the OTAP-Plugin, so that the desired devices can be selected.
*
*/
virtual uint8 software_revision (void);
This information is taken up by the OTAP protocol, and will be displayed on the iShell user interface.
Hence, your application is recommend to implement these methods and return characteristic values
here. In case you do not implement (i.e. overwrite) the above functions, their default implementations
(returning 0 for both) will be used.
You should also keep in mind that you will only be able to flash you devices wirelessly if they wake
up and have the radio turned on every once in a while. As a rule of thumb, devices should remain
awake and listening for at least 300ms to be catchable by the OTAP protocol. Once your devices
noticed that an OTAP session is going on, they will stay awake automatically if they are to be flashed
wirelessly, and will go back to their particular sleep and wake cycle in case they are not selected for
reprogramming. For details on how to control whether devices are awake or not, please refer to the
Writing iSense Applications User Guide [3].
You can additionally protect your devices from unauthorized wireless reprogramming by setting a
128bit AES key:
// define a sample key
uint8 key[16] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF };
bool result = os().otap().enable_security(true, key);
if (result == true)
os().debug("OTAP key set successfully");
else
os().debug("Failed to set otap key.");
Devices with a set OTAP key will not be detectable by the OTAP protocol if it is run without a key or
with a different key.