Adapt hardware links and operating systems
The AT module driver framework handles only the logic for interacting with the module. You must also adapt the hardware links, operating system interfaces, and module features. This topic describes how to adapt hardware links and operating system interfaces.
Background information
Adapting hardware links and operating systems is an important part of developing an AT module driver. This process lets you connect devices that use AT modules to IoT Platform. For more information, see Cloud connection with the AT module driver framework.
Hardware link adaptation
Select a suitable communication link, such as a Universal Asynchronous Receiver-Transmitter (UART). The selection depends on the link types that the module supports and the processor you use. When adapting the hardware link, set the output and input interfaces for communication between the AT module driver framework and the module.
| Interface type | Interface description | Adaptation example |
| Output interface | The interface that sends data from the processor to the module. Set this interface only once. | |
| Input interface | The interface that receives data from the module at the processor. Call this interface each time data is received. | |
For an example of hardware link adaptation that uses STM32, see the portfiles/aiot_port/project/stm32l476-at/Core/hal_adapter.c file in the Link software development kit (SDK).
Operating system adaptation
- The AT module driver framework depends on the abstract operating system interface al_os_net.h::aiot_os_al_t to support various operating systems.
- Link SDK provides adaptations for dependent interfaces on devices that run the Linux and FreeRTOS operating systems. You can also create custom adaptations for other real-time operating systems (RTOS).
For an example of operating system adaptation for FreeRTOS, see the ./portfiles/aiot_port/project/stm32l476-at/Core/os_freertos_impl.c file.
- After the adaptation is complete, modify the ./hal_adapter.c file to set the device's operating system in Link SDK.
Use the following sample code to set the operating system to FreeRTOS.
aiot_install_os_api(&g_aiot_freertos_api);