at_socket
is processed differently. The application layer needs to periodically call IOT_MQTT_Yield
to receive the server's downstream data. If the receipt window is missed, there will be data loss. Therefore, in scenarios with complex business logic, we recommended you use RTOS and select the nonOS mode by configuring FEATURE_AT_OS_USED = OFF
.Name | Configuration | Description |
BUILD_TYPE | debug/release | Set as needed |
EXTRACT_SRC | ON | Enable code extraction |
COMPILE_TOOLS | gcc/MSVC | Set as needed and ignore in case of IDE |
PLATFORM | Linux/Windows | Set as needed and ignore in case of IDE |
FEATURE_OTA_COMM_ENABLED | ON/OFF | Set as needed |
FEATURE_AUTH_MODE | KEY | Key authentication is recommended for resource-constrained devices |
FEATURE_AUTH_WITH_NOTLS | ON/OFF | Enable TLS as needed |
FEATURE_EVENT_POST_ENABLED | ON/OFF | Enable event reporting as needed |
FEATURE_AT_TCP_ENABLED | ON | Enable at_socket component |
FEATURE_AT_UART_RECV_IRQ | ON | Enable AT serial port receipt interruption |
FEATURE_AT_OS_USED | OFF | Use at_socket component in environment without RTOS |
FEATURE_AT_DEBUG | OFF | The AT module debugging feature is disabled by default, and it needs to be enabled during debugging |
mkdir buildcd buildcmake ..
output/qcloud_iot_c_sdk
with the following directory hierarchy:qcloud_iot_c_sdk├── include│ ├── config.h│ ├── exports├── platform└── sdk_src└── internal_inc
include
directory: contains the SDK APIs and variable parameters, where config.h
is the compilation macros generated according to the compilation options.platform
directory: contains platform-related code, which can be modified and adapted according to the specific conditions of the device.sdk_src
directory: contains the SDK core logic and protocol-related code, which generally don't need to be modified, where internal_inc
is the header file used internally by the SDK.qcloud_iot_c_sdk
to the compilation and development environment of your target platform and then modify the compilation options as needed.AT_Socket
framework provided by the SDK has been selected through the above compilation options. The SDK will call the at_socket
API of network_at_tcp.c
. You don't need to port the at_socket
layer, but you need to implement the AT serial port driver and AT module driver. For the AT module driver, you only need to implement the driver API of the driver structure at_device_op_t
in at_device
of the AT framework. You can refer to the supported modules in the at_device
directory. For the AT serial port driver, you need to implement serial port receipt interruption and then call the callback function at_client_uart_rx_isr_cb
in the interruption service program. You can refer to HAL_OS_nonos.c
to port for the target platform.samples
directory for development.