1. General description
1.1. Introduction
X-CUBE-ST67W61 is a set of software components implementing host applications driving a Wi-Fi and Bluetooth® LE coprocessor (ST67W611M). The coprocessor is controlled through an AT command over an SPI interface.
The figure below depicts the architecture of the solution.
1.2. ST67W611M features
The ST67W611M features the following:
- 2.4 GHz RF transceiver
- Integrated RF balun, PA/LNA
- External PA/LNA support
- Wi-Fi 6 (IEEE 802.11 b/g/n/ax)
- Wi-Fi/Bluetooth coexistence
- Wi-Fi security WPS/WEP/WPA/WPA2/WPA3
- Wi-Fi 20/40 MHz bandwidth, 1T1R, up to 229.4 Mbps
- IEEE 802.11e QoS WMM (Wi-Fi multi-media)
- IEEE 802.11w PMF (Protected Management Frames)
- STA, SoftAP, STA + SoftAP
- LDPC, STBC, beamformee, DL/UL OFDMA, MU-MIMO, Target Wake Time (TWT), Spatial Reuse
- (SR), Dual Carrier Modulation (DCM), Extended Range (ER)
- A-MPDU, A-MSDU, immediate block ACK, fragmentation, and defragmentation
- Rx diversity
- Bluetooth 5.3 (BLE)
1.3. Overview
1.3.1. SW top view
The X-CUBE-ST67W61 is composed of a set of applications, ST67W6X_Network_Driver middleware, and ST67W61 drivers. In particular, it:
- Exposes the generic API to applications offering:
- System and OTA services
- Bluetooth® LE services
- Wi‑Fi® API services
- Net module is aligned on BSD socket (blocking socket)
- MQTT and HTTP services
- Encompasses ST67W61 AT driver which:
- Exposes basic AT command API
- Parses SPI recv message to detect boundaries of AT messages.
- Detects out of band message (nonsolicited messages, asynchronous event) and executes associated callback
- Requires SPI sync module:
- For sending and receiving messages to/from SPI link
- Does not have a callback mechanism to be informed that some data are ready to be read; the dedicated Rx thread at higher level handles the received data and messages
Eight applications are delivered as part of the X-CUBE-ST67W61:
- ST67W6X_Echo
- ST67W6X_CLI
- ST67W6X BLE Commissioning
- ST67W6X BLE p2pClient and ST67W6X BLE p2pServer
- ST67W6X HTTP Server
- ST67W6X HTTPS Client
- ST67W6X FOTA
- ST67W6X Wi-Fi Commissioning Application
Additionally, one demonstration is provided:
1.3.2. FreeRTOS implementation view
Spi_iface runs within a FreeRTOS thread which wakes up any time a DMA from SPI Rx or SPI Tx is triggered. The Spi_iface embeds two buffer queues which contain data to be sent to the ST67W611M NCP and data to be received from the ST67W611M NCP. The Spi_iface module implements the frame protocol between the host and the ST67W611M NCP. This frame protocol features a synchronization word, sequence number, length, the buffer, and a crc32 protecting the frame.
The scope of the AT driver is to format the AT messages on the Tx path (host to ST67W611M coprocessor) and parse the AT messages on the Rx path (ST67W611M coprocessor to host). Its sits on top of the Spi_iface.
The AT driver is constituted of two units:
- One AT command unit handles the AT commands and responses. After sending a command through
ATsend
, the caller waits until the response is available onATrecv
.
- Another unit retrieves the message, parses, and dispatches it to the upper layer. AT driver runs a thread (
ATD_RxPooling_task
) to extract received data. This thread parses the received data to find AT message separators. The extracted message is stored in a local bufferATD_RecvBuf
. The message is analyzed to detect if it is an asynchronous event (unsolicited), a synchronous response, or data-payload.- Synchronous responses are pushed in the
ATD_Resp_Queue
. Such a queue serves to sync theATD_RxPooling_task
with the application tasks. The response is then extracted from theATD_Resp_Queue
when theATrecv
is executed by the task that has sent the command. Actually, after sending a command throughATsend
such tasks callATrecv
which waits until the response is available in theATD_Resp_Queue
, unless the timeout expires. - Asynchronous (unsolicited) event messages are pushed in dedicated
ATD_Evt_Queue
. The AT driver runs a second thread (ATD_EventsPooling_task
) which pulls the messages fromATD_Evt_Queue
; depending on the event “type” (Wi-Fi, Bluetooth® LE, Net, etc.) dedicated functions (AT_xx_Event
) are executed to fully decode the event (pointer to theATD_Evt_xMessageBuffer
is passed as a parameter) and it sends the extracted parameters to the upper layer through callbacks. - Data-payload also arrives from SPI through
ATD_RecvBuf.
It has a specific treatment: it is copied to buffers allocated directly by the application which provides the pointer whereATD_RxPooling_task
has to copy the data-payload. The application has also the responsibility to consume it in due time, for this, different strategies can be adopted.
- Synchronous responses are pushed in the
Services APIs are the application APIs provided to the customers to build their application. The services APIs feature:
- System services manage the central system functions of the network control processor (NCP). Key functionalities include:
- Power management: Controls power modes, sleep states, and energy-saving features
- System information: Provides access to system status, diagnostics, and hardware information
- Over-the-Air (OTA) updates manage firmware updates and system upgrades remotely.
- Bluetooth® LE services manage Bluetooth connections and data exchange. Key functionalities include:
- Connection management: Establishes and maintains Bluetooth® LE connections with other devices
- Data transmission: Sends data packets over Bluetooth® LE connections
- Notifications: Receives and processes Bluetooth® LE notifications from connected devices
- Security: Establishes secure Bluetooth® LE connections
- Wi-Fi services handle Wi-Fi network control and management. Key functionalities include:
- Network scanning: Searches for available Wi-Fi networks
- Connection management: Connects to and disconnects from Wi-Fi networks
- Signal strength monitoring: Monitors and reports the strength of Wi-Fi signals
- Net services manage the TCP/IP stack and routes data across the network. Key functionalities include:
- TCP/IP stack management: Handles the core TCP/IP protocols for data communication
- Data routing: Routes TCP/IP data packets to and from the network
- Network configuration: Manages IP addresses, subnets, and other network settings
- MQTT (message queuing telemetry transport) services:
- Publish/subscribe: Manages MQTT topics and message exchanges
- Broker communication: Connects to and communicates with MQTT brokers
- HTTP (HyperText transfer protocol) services:
- Request handling: Manages HTTP HEAD, GET, POST, and PUT requests
- Response processing: Processes and interprets HTTP responses from servers
Further details and technical specifications are provided in section Services API of the documentation.
1.3.3. General requirement
- All applications are based on the embedded system RTOS FreeRTOS.
- Each protocol module API has a CLI command (See CLI/Shell).
- Each module uses the logging mechanism from FreeRTOS (see Logging).
- The application must be easily portable across different STM32s.
- No secure channel (for example, safelink) is implemented.
1.4. Framework
1.4.1. FreeRTOS
The projects and the middleware are based on the FreeRTOS.
For ThreadX porting, ThreadX to FreeRtos port is available. You can refer to threadx/utility/rtos_compatibility_layers/FreeRTOS
Please Note that stack Size in ThreadX is defined in Bytes while the stack size in FreeRtos is in words.
1.4.2. CLI from shell
The shell features:
- Autocompletion
- Command history (down/up key)
- Right/left key
- Backspace functionality
- Help and command-specific help
- Decentralized command implementation
- Colorized CLI
1.4.3. Logging
The logging component provides 4 logging macros listed in increasing order of verbosity:
- LogError()
- LogWarn()
- LogInfo()
- LogDebug()
The logging component features:
- Differed logging: Message is built within the calling function and sent to a log queue. The log queue is consumed by an output task. This limits the real-time impact of logging.
- Standard log levels: See FreeRtos website [1]
- Add metadata to the log message such as timestamp, filename and line number, task name. Metadata inclusion is configurable.
- Memory consumption scales with needs (dynamic allocation of log buffer). Maximum size is configurable.
- Thread safe
- Output hardware choice is left to the application writer.
For example, LogError() is only called when there is an error, so it is the least verbose, whereas LogDebug() is called more frequently to provide debug level information.
The application can output the logs on:
- UART hardware (same or other UART than CLI)
- ITM (dedicated ARM debug port on SWO)
1.4.4. FreeRTOS low power application
- The low power host supports FreeRTOS™ tickless idle mode to allow the STM32 to enter low power mode anytime FreeRTOS is idle. LPTIM1 is used as a low power timer while the system is in low power mode to maintain the time. Minimum low power mode is configurable in app_conf.h
- The ST67W611M1 power save depends on the connection of the ST67W611M1:
- When unconnected, the power save mode is activated by setting
W6X_SetPowerMode
to 1. This sets the ST67W611M1 in standby low power mode after each command sent to the ST67W611M1 . - If the ST67W611M1 device is connected to an access point, the device does not enter in standby power-save mode unless DTIM (using
W6X_WiFi_SetDTIM
) is activated. - If the ST67W611M1 device is connected to a Wi-Fi®-6 access point, the individual TWT power save can be entered.
W6X_SetPowerMode
andW6X_WiFi_SetDTIM
must be set to 0 before configuring TWT (TWT W6X_WiFi_SetupTWT
) and starting TWT (W6X_WiFi_SetTWT
).
- When unconnected, the power save mode is activated by setting
1.4.5. FOTA support
There are two types of FOTA available:
- The FOTA application that updates the NUCLEO-U575ZI-Q and the ST67W611M1 using a FOTA header descriptor in JSON format
- The FOTA application that only updates the ST67W611M1, that does not use a FOTA header descriptor
When the FOTA option is enabled, a low-priority task is initiated and waits for an event to start the FOTA update process (timer, button push, or CLI command for example). Then it fetches all the necessary resources to proceed with the update.
For the NUCLEO-U575ZI-Q FOTA variant, the header descriptor contains information such as the versions of the binaries and values for a binary integrity check. The NUCLEO-U575ZI-Q binary is stored in flash and if the integrity verification passes, it boots on the binary stored in flash on next reboot.
For the ST67W611M1 update, during download of the binary, the data is transferred to the ST67W611M1. When the transfer is done, the ST67W611M1 performs the necessary check and reboots on the new binary.
Pythons scripts are provided to help with FOTA header descriptor generation and run server hosting files needed by the FOTA in a local environment.
2. Services API
2.1. System services
2.1.1. System API functions
The system module proposes an API set of functions needed to control the chip. Below is a list of the available main functions:
Function | Description |
---|---|
W6X_Init | Initialize the LL part of the W6X core. |
W6X_DeInit | De-Initialize the LL part of the W6X core. |
W6X_RegisterAppCb | Register Upper Layer callbacks. |
W6X_GetCbHandler | Get the W6X Callback handler. |
W6X_GetModuleInfo | Get the W6X module info. |
W6X_ModuleInfoDisplay | Display the module information. |
W6X_SetPowerMode | Configure Power mode. |
W6X_GetPowerMode | Get Power mode. |
W6X_FS_WriteFile | Write a file to the NCP file system. |
W6X_FS_ReadFile | Read a file from the NCP file system. |
W6X_FS_DeleteFile | Delete a file from the NCP file system. |
W6X_FS_GetSizeFile | Get the size of a file in the NCP file system. |
W6X_FS_ListFiles | List files in the file system (NCP and Host if LFS is enabled) |
W6X_RestoreDefaultConfig | Restore module default configuration. |
W6X_ExeATCommand | Send an AT command to the NCP |
2.2. FOTA services
The FOTA module manages ST67W611M1 firmware updates remotely.
2.2.1. FOTA APIs functions
The FOTA (firmware update Over-The-Air) module proposes an API set of functions needed to update the ST67W611M1. Below is a list of the available main functions:
Function | Description |
---|---|
W6X_OTA_Starts | Starts the ST67W611M1 OTA process. |
W6X_OTA_Finish | Finish the ST67W611M1 OTA process which reboots the module to apply the new firmware. |
W6X_OTA_Send | Send the firmware binary to the module. |
2.3. Wi-Fi services
2.3.1. Wi-Fi APIs functions
The Wi-Fi module proposes an API set of functions needed to control the chip. Below is a list of the available main functions:
Function | Description |
---|---|
W6X_WiFi_Init | Init the Wi-Fi module. |
W6X_WiFi_DeInit | De-Init the Wi-Fi module. |
W6X_WiFi_StartSta | Set the module in station mode. |
W6X_WiFi_Scan | List a defined number of available access points. |
W6X_WiFi_PrintScan | Print the scan results. |
W6X_WiFi_Connect | Join an Access Point. |
W6X_WiFi_GetStaMode | Get the Wi-Fi station mode. |
W6X_WiFi_SetStaMode | Set the Wi-Fi station mode. |
W6X_WiFi_GetAutoConnect | Retrieve autoconnect state. |
W6X_WiFi_SetHostname | This function set the Wi-Fi STA host name. |
W6X_WiFi_GetHostname | This function retrieves the Wi-Fi STA host name. |
W6X_WiFi_GetStaIpAddress | This function retrieves the Wi-Fi interface's IP address. |
W6X_WiFi_GetStaMacAddress | This function retrieves the Wi-Fi station MAC address. |
W6X_WiFi_SetStaIpAddress | This function set the Wi-Fi interface's IP address. |
W6X_WiFi_GetDnsAddress | This function retrieves the Wi-Fi DNS addresses. |
W6X_WiFi_SetDnsAddress | This function set the Wi-Fi DNS addresses. |
W6X_WiFi_GetStaState | This function retrieves the Wi-Fi station state. |
W6X_WiFi_GetCountryCode | This function retrieves the country code configuration. |
W6X_WiFi_SetCountryCode | This function set the country code configuration. |
W6X_WiFi_Disconnect | Disconnect from a Wi-Fi Network. |
W6X_WiFi_StartAp | Configure a Soft-AP. |
W6X_WiFi_StopAp | Stop the Soft-AP. |
W6X_WiFi_GetApConfig | Get the Soft-AP configuration. |
W6X_WiFi_ListConnectedSta | List the connected stations. |
W6X_WiFi_DisconnectSta | Disconnect station from the Soft-AP. |
W6X_WiFi_GetApMode | Get the Wi-Fi Soft-AP mode. |
W6X_WiFi_SetApMode | Set the Wi-Fi Soft-AP mode. |
W6X_WiFi_GetApIpAddress | Get the Soft-AP IP addresses. |
W6X_WiFi_GetDhcp | Get the DHCP configuration. |
W6X_WiFi_SetDhcp | Set the DHCP configuration. |
W6X_WiFi_GetApMacAddress | This function retrieves the Wi-Fi Soft-AP MAC address. |
W6X_WiFi_StateToStr | Convert the Wi-Fi state to a string. |
W6X_WiFi_SecurityToStr | Convert the Wi-Fi security type to a string. |
W6X_WiFi_ReasonToStr | Convert the Wi-Fi error reason to a string. |
W6X_WiFi_SetDTIM | Set Low Power Wi-Fi DTIM (Delivery Traffic Indication Message) |
W6X_WiFi_GetDTIM | Get Low Power Wi-Fi DTIM (Delivery Traffic Indication Message) |
W6X_WiFi_SetupTWT | Setup Target Wake Time (TWT) for the Wi-Fi station. |
W6X_WiFi_SetTWT | Set Target Wake Time (TWT) for the Wi-Fi station. |
W6X_WiFi_TeardownTWT | Teardown Target Wake Time (TWT) for the Wi-Fi station. |
2.3.2. Wi-Fi events
The following events are sent back to the application layer:
Event | Description |
---|---|
STA events | |
W6X_WIFI_EVT_CONNECTED_ID | Event received when the station is connected to an access point. |
W6X_WIFI_EVT_DISCONNECTED_ID | Event received when the station is disconnected to an access point. |
W6X_WIFI_EVT_GOT_IP_ID | Event received when the station receives an IP address after a successful connection to an access point. |
W6X_WIFI_EVT_CONNECTING_ID | Event received when the station is in the connection process to an access point. |
W6X_WIFI_EVT_REASON_ID | Event received when the device encouters an issue in the connection process or at disconnection. |
soft-AP events | |
W6X_WIFI_EVT_STA_CONNECTED_ID | Event received when a station is connected to the soft-AP. |
W6X_WIFI_EVT_STA_DISCONNECTED_ID | Event received when a station is disconnected from the soft-AP. |
W6X_WIFI_EVT_DIST_STA_IP_ID | Event received when a station, connected to the soft-AP, receives an IP address. |
2.3.3. Wi-Fi FSM
Shown below is the Wi-Fi FSM for the station mode only that describes the different states of the system.
The second chart below shows the behavior of the system when the station and the soft access point modes are enabled (station mode is active by default and cannot be deactivated).
When both interfaces are enabled, some verifications must be done to ensure they are operating on the same channel and do not use the same subnet IP address to avoid unexpected behaviors.
The system behavior is the same if the soft-AP is on, the station is not connected, and it tries to connect to an AP. The same sequence is performed to verify channel and subnet compatibility.
When the soft-AP is stopped, all connected stations are disconnected from the soft-AP.
2.4. Net services
The net module implements all the API functions related to the internet protocol. It supports the BSD socket API and some specific services that are commonly used, like ping or SNTP services.
Up to five sockets can be managed in parallel.
2.4.1. NET APIs functions
The NET module proposes an API set of functions needed to control TCP/IP stack features. Below is a list of the available main functions:
Function | Description |
---|---|
W6X_Net_Init | Init the Net module. |
W6X_Net_DeInit | De-Init the Net module. |
W6X_Net_Ping | Ping an IP address in the network. |
W6X_Net_GetHostAddress | Get IP address from URL using DNS. |
W6X_Net_GetTime | Query date string from SNTP, the used format is asctime style time. |
W6X_Net_GetSNTPConfiguration | Get current SNTP status, timezone and servers. |
W6X_Net_SetSNTPConfiguration | Set SNTP status, timezone and servers. |
W6X_Net_GetSNTPInterval | Get SNTP Synchronization interval. |
W6X_Net_SetSNTPInterval | Set SNTP Synchronization interval. |
W6X_Net_GetConnectionStatus | Get information for an opened socket. |
W6X_Net_Socket | Get a socket instance is available. |
W6X_Net_Close | Close a socket instance and release the associated resources. |
W6X_Net_Shutdown | Shut down a server socket instance. |
W6X_Net_Bind | Bind a socket instance to a specific address. |
W6X_Net_Connect | Connect a socket instance to a specific address. |
W6X_Net_Listen | Listen for incoming connections on a socket. |
W6X_Net_Accept | Accept an incoming connection on a socket. |
W6X_Net_Send | Send data on a socket. |
W6X_Net_Recv | Receive data from a socket. |
W6X_Net_Getsockopt | Get a socket option. |
W6X_Net_Setsockopt | Set a socket option. |
W6X_Net_Sendto | Send data on a socket to a specific address. |
W6X_Net_Recvfrom | Receive data from a socket from a specific address. |
W6X_Net_Tls_Credential_Add | Add the credential to the TLS context. |
W6X_Net_Tls_Credential_Delete | Delete the credential from the TLS context. |
W6X_Net_Inet_ntop | Convert an IP address from uint32_t format to text. |
W6X_Net_Inet_pton | Convert an IP address from text format to uint32_t. |
2.4.2. NET events
The following net events are sent back to the application layer:
Event | Description |
---|---|
W6X_NET_EVT_SOCK_DATA_ID | Event sent when data is received on a socket |
2.4.3. NET FSM
The following figure shows the FSM for both TCP client and server socket.
There are six possible states:
- RESET: Default state
- ALLOCATED: An available socket has been reserved.
- CONNECTED: Connection is established; socket is ready to exchange data. It can be either a client or a server (for incoming connections).
- BIND: Socket is set to server mode and port and protocol are set, but the server is not running yet.
- LISTENING: Server is running, ready to accept incoming connections.
- CLOSING: Temporary state, when close or shutdown operations are being performed, after that, state is set to RESET again.
Since UDP is a connectionless protocol, UDP sockets use a slightly different state machine. State 'CONNECTED' is used here after the first call to 'sendto()' to signal that incoming data can be expected since communication with a server has been initiated:
2.5. Bluetooth® LE services
2.5.1. Bluetooth® LE APIs functions
The Bluetooth® LE module proposes an API set of functions needed to control the chip. Below is a list of the available main functions:
Function | Description |
---|---|
W6X_Ble_Init | Initialize Bluetooth® LE Server/Client. |
W6X_Ble_DeInit | De-Initialize Bluetooth® LE Server/Client. |
W6X_Ble_GetInitMode | Get Bluetooth® LE initialization mode. |
W6X_Ble_SetBdAddress | Set Bluetooth® LE BD Address. |
W6X_Ble_GetBDAddress | Retrieve the Bluetooth® LE BD address. |
W6X_Ble_SetDeviceName | Set Bluetooth® LE device Name. |
W6X_Ble_GetDeviceName | Retrieve the Bluetooth® LE device name. |
W6X_Ble_SetTxPower | Bluetooth® LE Set TX Power. |
W6X_Ble_GetTxPower | Bluetooth® LE Get TX Power. |
W6X_Ble_SetAdvData | Set Bluetooth® LE Advertising Data. |
W6X_Ble_SetAdvParam | Set Bluetooth® LE Advertising Parameters. |
W6X_Ble_GetAdvParam | Get Bluetooth® LE Advertising Parameters. |
W6X_Ble_AdvStart | Bluetooth® LE Server Start Advertising. |
W6X_Ble_AdvStop | Bluetooth® LE Server Stop Advertising. |
W6X_Ble_SetScanRespData | Set Bluetooth® LE scan response Data. |
W6X_Ble_SetScanParam | Set the Bluetooth® LE scan parameters. |
W6X_Ble_GetScanParam | Get the Scan parameters. |
W6X_Ble_StartScan | Start Bluetooth® LE Device scan. |
W6X_Ble_StopScan | Stop Bluetooth® LE Device scan. |
W6X_Ble_Print_Scan | Print Bluetooth® LE scan results. |
W6X_Ble_SetConnParam | Set Bluetooth® LE Connection Parameters. |
W6X_Ble_GetConnParam | Get the connection parameters. |
W6X_Ble_Connect | Create connection to a remote device. |
W6X_Ble_Disconnect | Disconnect from a Bluetooth® LE remote device. |
W6X_Ble_GetConn | Get the connection information. |
W6X_Ble_ExchangeMTU | Exchange Bluetooth® LE MTU length. |
W6X_Ble_SetDataLength | Set the Bluetooth® LE Data length. |
W6X_Ble_CreateService | Create Bluetooth® LE Service. |
W6X_Ble_DeleteService | Delete Bluetooth® LE Service. |
W6X_Ble_CreateCharacteristic | Create Bluetooth® LE Characteristic. |
W6X_Ble_GetServicesAndCharacteristics | List Bluetooth® LE Services and their Characteristics. |
W6X_Ble_RegisterCharacteristics | Register Bluetooth® LE characteristics. |
W6X_Ble_RemoteServiceDiscovery | Discover Bluetooth® LE services of remote device. |
W6X_Ble_RemoteCharDiscovery | Discover Bluetooth® LE Characteristics of a service remote device. |
W6X_Ble_ServerSendNotification | Notify the Characteristic Value from the Server to a Client. |
W6X_Ble_ServerSendIndication | Indicate the Characteristic Value from the Server to a Client. |
W6X_Ble_ServerSetReadData | Set the data when Client read characteristic from the Server. |
W6X_Ble_ClientWriteData | Write data to a Server characteristic. |
W6X_Ble_ClientReadData | Read data from a Server characteristic. |
W6X_Ble_ClientSubscribeChar | Subscribe to notifications or indications from a Server characteristic. |
W6X_Ble_ClientUnsubscribeChar | Unsubscribe to notifications or indications from a Server characteristic. |
W6X_Ble_SetSecurityParam | Set Bluetooth® LE security parameters. |
W6X_Ble_GetSecurityParam | Get Bluetooth® LE security parameters. |
W6X_Ble_SecurityStart | Start Bluetooth® LE security. |
W6X_Ble_SecurityPassKeyConfirm | Bluetooth® LE security pass key confirm. |
W6X_Ble_SecurityPairingConfirm | Bluetooth® LE pairing confirm. |
W6X_Ble_SecuritySetPassKey | Bluetooth® LE set passkey. |
W6X_Ble_SecurityPairingCancel | Bluetooth® LE pairing cancel. |
W6X_Ble_SecurityUnpair | Bluetooth® LE unpair. |
W6X_Ble_SecurityGetBondedDeviceList | Bluetooth® LE get paired device list. |
2.5.2. Bluetooth® LE events
The following Bluetooth® LE events are sent back to the application layer:
Event | Description |
---|---|
W6X_BLE_EVT_CONNECTED_ID | Bluetooth® LE connection established. |
W6X_BLE_EVT_DISCONNECTED_ID | Bluetooth® LE connection ends. |
W6X_BLE_EVT_CONNECTION_PARAM_ID | Bluetooth® LE connection parameters update. |
W6X_BLE_EVT_READ_ID | Read operation from Bluetooth® LE remote device. |
W6X_BLE_EVT_WRITE_ID | Write operation from Bluetooth® LE remote device. |
W6X_BLE_EVT_SERVICE_FOUND_ID | Bluetooth® LE service discovered on remote device. |
W6X_BLE_EVT_CHAR_FOUND_ID | Bluetooth® LE characteristic discovered on remote device. |
W6X_BLE_EVT_INDICATION_STATUS_ENABLED_ID | Bluetooth® LE indication enabled. |
W6X_BLE_EVT_INDICATION_STATUS_DISABLED_ID | Bluetooth® LE indication disabled. |
W6X_BLE_EVT_NOTIFICATION_STATUS_ENABLED_ID | Bluetooth® LE notification enabled. |
W6X_BLE_EVT_NOTIFICATION_STATUS_DISABLED_ID | Bluetooth® LE notification disabled. |
W6X_BLE_EVT_INDICATION_ACK_ID | Bluetooth® LE Indication acknowledged. |
W6X_BLE_EVT_INDICATION_NACK_ID | Bluetooth® LE Indication unacknowledged. |
W6X_BLE_EVT_NOTIFICATION_DATA_ID | Bluetooth® LE service receives notification/indication data. |
W6X_BLE_EVT_MTU_SIZE_ID | Bluetooth® LE MTU size update. |
W6X_BLE_EVT_PAIRING_FAILED_ID | Bluetooth® LE pairing failed. |
W6X_BLE_EVT_PAIRING_COMPLETED_ID | Bluetooth® LE pairing completed. |
W6X_BLE_EVT_PAIRING_CONFIRM_ID | Bluetooth® LE pairing confirm notification. |
W6X_BLE_EVT_PASSKEY_ENTRY_ID | Bluetooth® LE pairing passkey entry notification. |
W6X_BLE_EVT_PASSKEY_DISPLAY_ID | Bluetooth® LE pairing passkey display notification. |
W6X_BLE_EVT_PASSKEY_CONFIRM_ID | Bluetooth® LE pairing passkey confirm notification. |
2.6. HTTP Services
The HTTP module offers HTTP requests and processes and interprets HTTP responses from servers.
It supports both HTTP and HTTPS with HEAD, GET, PUT and POST methods.
For POST and PUT requests, the following content types can be used:
- Text/plain : Regular text without any formatting
- Application/x-www-form-urlencoded : Data is given as key value pairs (key1=value1&key2=value2...)
- Application/json : JSON format
- Application/xml : XML format
- Application/octet-stream : Binary data
2.6.1. HTTP APIs function
The HTTP module proposes an API function to create HTTP client requests.
Function | Description |
---|---|
W6X_HTTP_Client_Request | HTTP Client request based on BSD socket. |
2.7. MQTT services
2.7.1. MQTT APIs functions
The MQTT module proposes an API set of functions needed to control the chip. Below is a list of the available main functions:
Function | Description |
---|---|
W6X_MQTT_Init | Init the MQTT module. |
W6X_MQTT_DeInit | De-Init the MQTT module. |
W6X_MQTT_SetRecvDataPtr | Set/change the pointer where to copy the Recv Data. |
W6X_MQTT_Configure | MQTT Set user configuration. |
W6X_MQTT_Connect | MQTT Connect to broker. |
W6X_MQTT_GetConnectionStatus | MQTT Get connection status. |
W6X_MQTT_Disconnect | MQTT Disconnect from broker. |
W6X_MQTT_Subscribe | MQTT Subscribe to a topic. |
W6X_MQTT_GetSubscribedTopics | MQTT Get subscribed topics. |
W6X_MQTT_Unsubscribe | MQTT Unsubscribe from a topic. |
W6X_MQTT_Publish | MQTT Publish a message to a topic. |
W6X_MQTT_StateToStr | Convert the MQTT state to a string. |
2.7.2. MQTT events
The following MQTT events are sent back to the application layer:
Event | Description |
---|---|
W6X_MQTT_EVT_CONNECTED_ID | Event received when the MQTT client is connected to the broker. |
W6X_MQTT_EVT_DISCONNECTED_ID | Event received when the MQTT client is disconnected from the broker. |
W6X_MQTT_EVT_SUBSCRIPTION_RECEIVED_ID | Event received when the MQTT client receives data from a topic it subscribed to. |
3. References