4
4.1.5. File system management ........................................................................................................................... 23
4.1.6. Firmware update ........................................................................................................................................ 23
4.1.6.1. Firmware files and partitions ............................................................................................................. 24
4.1.7. Securing the connection ............................................................................................................................. 25
4.1.8. Validation of server SSL certificate ............................................................................................................. 26
4.2. Device application (iDigiLED) ....................................................................................................................... 27
4.2.1. Building the application .............................................................................................................................. 28
4.2.2. Transferring the application to the device ................................................................................................. 28
4.2.3. Launching the application .......................................................................................................................... 28
4.2.4. Testing the buttons and LEDs thread ......................................................................................................... 28
4.3. Client application (iDigiLedDEMO.jar) ......................................................................................................... 28
5. Data storage example ................................................................................................................ 31
5.1. Device application (iDigiStorage) ................................................................................................................. 31
5.1.1.1. Building the application ...................................................................................................................... 32
5.1.1.2. Transferring the application to the device ......................................................................................... 32
5.1.1.3. Launching the application .................................................................................................................. 32
5.1.1.4. Retrieving the data from iDigi ............................................................................................................ 33
5.2. Client application (iDigiTankDemo.jar) ........................................................................................................ 34
6. Application development ......................................................................................................... 36
6.1. iDigi API functions ....................................................................................................................................... 36
6.1.1. Functions for remote control ..................................................................................................................... 36
6.1.1.1. idigi_start ............................................................................................................................................ 36
6.1.1.2. idigi_register_usercmd ....................................................................................................................... 36
6.1.1.3. idigi_query_attribute ......................................................................................................................... 36
6.1.2. Functions for data storage ......................................................................................................................... 37
6.1.2.1. idigi_putfile ......................................................................................................................................... 37
6.2. The iDigiLED sample application in detail .................................................................................................... 37
6.2.1. Source tree ................................................................................................................................................. 37
6.2.2. RCI requests and replies ............................................................................................................................. 38
6.2.2.1. Commands .......................................................................................................................................... 38
6.2.3. Defining custom commands ....................................................................................................................... 39
6.2.4. Implementing the custom commands callbacks ........................................................................................ 39
6.2.4.1. Process callback .................................................................................................................................. 40
6.2.4.2. Response callback............................................................................................................................... 41
6.2.5. Custom commands descriptors and registration ....................................................................................... 42
6.2.5.1. Descriptor ........................................................................................................................................... 42
6.2.5.2. Descriptor errors ................................................................................................................................ 42
6.2.5.3. Registration ........................................................................................................................................ 43
6.2.6. Rest of code ................................................................................................................................................ 43
6.2.7. Connecting to iDigi ..................................................................................................................................... 44
6.2.8. Adding the libraries and header search folder to the source file ............................................................... 44
6.2.9. Building the application .............................................................................................................................. 44
6.2.10. Transferring the application to the device ................................................................................................. 44
6.2.11. Launching the application and checking the connection to iDigi ............................................................... 44
6.3. The iDigiLedDEMO client application in detail ............................................................................................. 45
6.4. The iDigiStorage sample application in detail .............................................................................................. 46
6.4.1. Source tree ................................................................................................................................................. 46
6.4.2. Definition of the application ...................................................................................................................... 46
6.4.3. Putting the file into iDigi ............................................................................................................................. 46
6.4.4. Adding the libraries and header search folder to the source file ............................................................... 47
6.4.5. Building the application .............................................................................................................................. 47
6.4.6. Transferring the application to the device ................................................................................................. 47