|
| 1 | +@startuml |
| 2 | + |
| 3 | +Title FreeRTOS Cellular Library interaction with com interface |
| 4 | + |
| 5 | +participant Application |
| 6 | +participant "FreeRTOS Cellular Library" |
| 7 | +participant cellular_comm_interface |
| 8 | +participant cellular_modem |
| 9 | + |
| 10 | +note over Application : Application needs cellular connecitvity.\nCellular_Init() is called to open FreeRTOS \nCellular Library. Communication interface\n, pCommInterface, is provided by\napplication to "FreeRTOS Cellular Library". |
| 11 | + |
| 12 | +Application -> "FreeRTOS Cellular Library" : Cellular_Init( pCommInterface ) |
| 13 | + |
| 14 | +activate Application |
| 15 | + |
| 16 | +"FreeRTOS Cellular Library" ->cellular_comm_interface : pCommInterface->Open( receiveCallback ) |
| 17 | + |
| 18 | +cellular_comm_interface->cellular_modem : Register receive callback\nOpen and setup communication device driver\nPower on and enable device |
| 19 | + |
| 20 | +cellular_comm_interface-->"FreeRTOS Cellular Library": |
| 21 | + |
| 22 | +"FreeRTOS Cellular Library"-->Application: |
| 23 | + |
| 24 | +deactivate Application |
| 25 | + |
| 26 | +note over Application : "FreeRTOS Cellular Library" APIs ready.\nApplication get network time with\nCellular_GetNetworkTime() function |
| 27 | + |
| 28 | +Application -> "FreeRTOS Cellular Library" : Cellular_GetNetworkTime() |
| 29 | + |
| 30 | +activate Application |
| 31 | + |
| 32 | +"FreeRTOS Cellular Library"->cellular_comm_interface : pCommInterface->Send() |
| 33 | + |
| 34 | +cellular_comm_interface->cellular_modem : AT+CCLK? |
| 35 | + |
| 36 | +cellular_modem->cellular_comm_interface : +CCLK: "20/06/09,12:06:33+32" |
| 37 | + |
| 38 | +cellular_comm_interface->cellular_comm_interface : Store `+CCLK: "20/06/09,12:06:33+32"` in buffer |
| 39 | + |
| 40 | +cellular_comm_interface->"FreeRTOS Cellular Library" : receiveCallback |
| 41 | + |
| 42 | +"FreeRTOS Cellular Library"->cellular_comm_interface : pCommInterface->recv() |
| 43 | + |
| 44 | +cellular_comm_interface-->"FreeRTOS Cellular Library" : Return data in buffer |
| 45 | + |
| 46 | +cellular_modem->cellular_comm_interface : OK |
| 47 | + |
| 48 | +cellular_comm_interface->cellular_comm_interface : Store `OK` in buffer |
| 49 | + |
| 50 | +cellular_comm_interface->"FreeRTOS Cellular Library" : receiveCallback |
| 51 | + |
| 52 | +cellular_comm_interface-->"FreeRTOS Cellular Library" : Return data in buffer |
| 53 | + |
| 54 | +"FreeRTOS Cellular Library"->Application : Return network time |
| 55 | + |
| 56 | +deactivate Application |
| 57 | + |
| 58 | +note over Application : Applicaton no longer need cellular\nconnectivity. Cellular_Cleanup() is \ncalled to close FreeRTOS Cellular Library. |
| 59 | + |
| 60 | +Application -> "FreeRTOS Cellular Library" : Cellular_Cleanup() |
| 61 | + |
| 62 | +activate Application |
| 63 | + |
| 64 | +"FreeRTOS Cellular Library"->cellular_comm_interface : pCommInterface->Close() |
| 65 | + |
| 66 | +cellular_comm_interface->cellular_modem : Power off device\nClose communication device driver\n |
| 67 | + |
| 68 | +cellular_comm_interface-->"FreeRTOS Cellular Library": |
| 69 | + |
| 70 | +"FreeRTOS Cellular Library"-->Application: |
| 71 | + |
| 72 | +deactivate Application |
| 73 | + |
| 74 | +@enduml |
0 commit comments