Crosslink TG Software and Programming Manual
Total Page:16
File Type:pdf, Size:1020Kb
Product revision: 1.4 2021-03-12 CrossLink TG Software and Programming Manual www.crosscontrol.com CrossLink TG Product revision: 1.4 Software and Programming Manual 2021-03-12 Contents Revision history ......................................................................................................................... 4 1. Introduction .......................................................................................................................... 5 1.1. How to access functionality .......................................................................................... 5 2. RTUControl API ..................................................................................................................... 7 2.1. Introduction ..................................................................................................................... 7 2.2. Starting and finalizing RTUControl module .................................................................. 7 2.3. RTC time ........................................................................................................................... 8 2.4. Sleep and usecsleep ...................................................................................................... 9 2.5. Power Management ...................................................................................................... 9 2.6. Hardware RTC ............................................................................................................... 12 2.7. Default Movement Sensor ........................................................................................... 13 2.8. Optional 9 axis Movement sensor ............................................................................... 15 2.9. Analog internal inputs .................................................................................................. 16 2.10. Timers ...................................................................................................................... 16 3. IO Module API .................................................................................................................... 20 3.1. Introduction ................................................................................................................... 20 3.2. LEDs control ................................................................................................................... 20 3.3. Handling analog inputs and digital inputs/outputs .................................................. 22 4. GSM API .............................................................................................................................. 25 4.1. Introduction ................................................................................................................... 25 4.2. Starting GSM .................................................................................................................. 25 4.3. Handling GSM Events ................................................................................................... 26 4.4. Making Voice/Data Calls ............................................................................................ 29 4.5. Subscription to a New SMS Arrival .............................................................................. 31 4.6. Finishing GSM ................................................................................................................. 32 4.7. Audio parameters configuration ................................................................................ 32 5. iNet API ............................................................................................................................... 35 5.1. Introduction ................................................................................................................... 35 5.2. Starting an Internet connection .................................................................................. 35 5.3. Closing the Internet Connection ................................................................................ 36 5.4. Out of GSM Coverage ................................................................................................. 37 5.5. GSM functionality in an active INET Session .............................................................. 37 6. Power Optimization ........................................................................................................... 38 6.1. Reducing consumption by switching off devices .................................................... 38 6.2. How to get the lowest consumption in low power mode ....................................... 39 6.3. Monitoring Power Sources ........................................................................................... 40 7. GPS API ............................................................................................................................... 41 7.1. Introduction ................................................................................................................... 41 7.2. Starting GPS ................................................................................................................... 41 7.3. Finishing GPS .................................................................................................................. 42 7.4. Example of getting GPS position ................................................................................ 43 7.5. Change Sensitivity mode ............................................................................................. 44 7.6. Change Dynamic Platform Model ............................................................................. 45 7.7. Change Static Hold Mode .......................................................................................... 46 2 CrossLink TG Product revision: 1.4 Software and Programming Manual 2021-03-12 7.8. Navigation output ........................................................................................................ 46 8. CAN .................................................................................................................................... 49 8.1. Creating a socket ......................................................................................................... 49 8.2. Configuring CAN ........................................................................................................... 50 8.3. Receiving CAN frames ................................................................................................. 50 8.4. Writing CAN frames ...................................................................................................... 50 8.5. Closing a CAN channel ............................................................................................... 51 8.6. CAN-utils ......................................................................................................................... 51 9. FMS API ............................................................................................................................... 51 9.1. Starting and finalizing FMS library ................................................................................ 52 9.2. Retrieving FMS data ..................................................................................................... 52 9.3. Retrieving TPMS data .................................................................................................... 53 9.4. Remove TPMS data ...................................................................................................... 53 9.5. Retrieving EBS data ....................................................................................................... 53 10. RS232 .................................................................................................................................. 53 10.1. Enabling serial interfaces ..................................................................................... 54 10.2. Working with RS232 ............................................................................................... 54 11. RS485 .................................................................................................................................. 54 11.1. Enabling RS485....................................................................................................... 54 11.2. Working with RS485 .............................................................................................. 55 11.3. OPTIONAL STEPS ..................................................................................................... 56 12. KLINE ................................................................................................................................... 56 12.1. Enabling the Kline .................................................................................................. 56 12.2. Configuring the Kline ............................................................................................ 56 13. BLUETOOTH ......................................................................................................................... 57 13.1. BT stack ................................................................................................................... 57 13.2. BT profiles ................................................................................................................ 58 13.3. Bluetooth programming ......................................................................................