Analog Devices Wi-Fi Software Reference Manual
Release 1.0.0
|
Radio Module. More...
Functions | |
ADI_WIFI_RESULT | adi_wifi_radio_Init (ADI_CALLBACK pCallbackFunc) |
Initialize Wi-Fi module. More... | |
ADI_WIFI_RESULT | adi_wifi_radio_GetConnectionStatus (uint8_t *const pStatus) |
Get information about the connection. More... | |
ADI_WIFI_RESULT | adi_wifi_radio_GetAP (uint8_t *const pAPInfo, uint32_t nBufSize) |
Get information on the access point the Wi-Fi module is connected to. More... | |
ADI_WIFI_RESULT | adi_wifi_radio_TestAT () |
Test AT command. More... | |
ADI_WIFI_RESULT | adi_wifi_radio_Restart () |
Restart Wi-Fi module. More... | |
ADI_WIFI_RESULT | adi_wifi_radio_GetVersionInfo (uint8_t *const pVersionInfoBuf, uint32_t nBufSize) |
Get the AT command version and SDK version info. More... | |
ADI_WIFI_RESULT | adi_wifi_radio_SetWiFiMode (uint32_t nMode) |
Set the Wi-Fi mode. More... | |
ADI_WIFI_RESULT | adi_wifi_radio_ConnectToAP (const uint8_t *const pSSID, const uint8_t *const pPassword, const uint8_t *const pBSSID) |
Connect to the access point. More... | |
ADI_WIFI_RESULT | adi_wifi_radio_DisconnectFromAP () |
Disconnect from the access point. More... | |
ADI_WIFI_RESULT | adi_wifi_radio_EstablishTCPConnection (ADI_WIFI_TCP_CONNECT_CONFIG *const pTCPConnect) |
Establish TCP connection. More... | |
ADI_WIFI_RESULT | adi_wifi_radio_SendData (ADI_WIFI_SEND_DATA_CONFIG *const pSendDataConfig, ADI_WIFI_AT_CMDCODE eCipSendCmd) |
Send data to server. More... | |
ADI_WIFI_RESULT | adi_wifi_radio_EnableMultipleConnections (uint8_t nEnable) |
Enable/disable multiple connections. More... | |
ADI_WIFI_RESULT | adi_wifi_radio_MQTTConnect (ADI_WIFI_MQTT_CONNECT_CONFIG *const pMQTTConnect) |
Connect to a MQTT broker. More... | |
ADI_WIFI_RESULT | adi_wifi_radio_MQTTPublish (ADI_WIFI_PUBLISH_CONFIG *const pPublishConfig) |
Publish MQTT data. More... | |
ADI_WIFI_RESULT | adi_wifi_radio_MQTTDisconnect (uint32_t nLinkID) |
Disconnect from the MQTT broker. More... | |
ADI_WIFI_RESULT | adi_wifi_radio_MQTTPing (uint32_t nLinkID) |
Ping the MQTT broker. More... | |
ADI_WIFI_RESULT | adi_wifi_radio_MQTTSubscribe (ADI_WIFI_SUBSCRIBE_CONFIG *const pSubscribeConfig) |
Subscribe to a topic. More... | |
ADI_WIFI_RESULT | adi_wifi_GetEvent (ADI_WIFI_AT_CMDCODE eCommandType) |
Application event interface. More... | |
ADI_WIFI_RESULT | adi_wifi_ParseSubscriberData () |
Parse the +IPD messages received when the Wi-Fi module is acting as an MQTT subscriber. More... | |
void | adi_wifi_GetData (uint8_t *const pPacket, uint32_t *nValidBytes) |
Get data packet. More... | |
Radio Module.
The set of functions in this module provide an interface for applications to interact with the radio. This module provides encoding and decoding of of radio packets and calls into the Transport Abstraction Layer for physical layer communication.
void adi_wifi_GetData | ( | uint8_t *const | pPacket, |
uint32_t * | nValidBytes | ||
) |
Get data packet.
[out] | pPacket | : Data received by the Wi-Fi module. Must be ADI_WIFI_MAX_DATA_SIZE bytes. |
[out] | nValidBytes | : Number of valid bytes in pPacket. |
ADI_WIFI_RESULT adi_wifi_GetEvent | ( | ADI_WIFI_AT_CMDCODE | eCommandType | ) |
Application event interface.
[in] | eCommandType | : Type of command that is being processed. |
ADI_WIFI_RESULT adi_wifi_ParseSubscriberData | ( | ) |
Parse the +IPD messages received when the Wi-Fi module is acting as an MQTT subscriber.
ADI_WIFI_RESULT adi_wifi_radio_ConnectToAP | ( | const uint8_t *const | pSSID, |
const uint8_t *const | pPassword, | ||
const uint8_t *const | pBSSID | ||
) |
Connect to the access point.
[in] | pSSID | : Access point's SSID. |
[in] | pPassword | : Access point's password. |
[in] | pBSSID | : (optional) Access point's MAC address. Used when there are access points with the same SSID. Set as NULL to ignore. |
ADI_WIFI_RESULT adi_wifi_radio_DisconnectFromAP | ( | ) |
Disconnect from the access point.
ADI_WIFI_RESULT adi_wifi_radio_EnableMultipleConnections | ( | uint8_t | nEnable | ) |
Enable/disable multiple connections.
[in] | nEnable | : Set the state of multiple connections. 1 : Enable. 0 : Disable. |
ADI_WIFI_RESULT adi_wifi_radio_EstablishTCPConnection | ( | ADI_WIFI_TCP_CONNECT_CONFIG *const | pTCPConnect | ) |
Establish TCP connection.
[in] | pTCPConnect | : Configuration data to establish the connection. - nLinkID is used in the case of multiple connections. It is the ID of the network connection. Can be 0-(#ADI_WIFI_RADIO_MAX_NUM_CONNECTIONS - 1). For a single connection system, set to be ADI_WIFI_RADIO_MAX_NUM_CONNECTIONS. - pType is the type of connection. Should be "TCP" or "SSL". - pIP is the remote server IP address as a string. - pPort is the remote server port. - nTCPKeepAlive is the detection time interval when TCP is kept alive, this function is disabled by default. 0 : Disable TCP keep-alive. 1 ~ 7200 : Detection time interval, unit: second. |
ADI_WIFI_RESULT adi_wifi_radio_GetAP | ( | uint8_t *const | pAPInfo, |
uint32_t | nBufSize | ||
) |
Get information on the access point the Wi-Fi module is connected to.
The type of this command is "query". It's used to to query the AP to which the Station is already connected.
[out] | pAPInfo | : Information about the access point in which the Wi-Fi module is connected. The format of this packet should resemble: <ssid>,<bssid>,<channel>,<rssi>. |
[in] | nBufSize | : Size of the buffer pAPInfo. |
ADI_WIFI_RESULT adi_wifi_radio_GetConnectionStatus | ( | uint8_t *const | pStatus | ) |
Get information about the connection.
The type of this command is "execute". It's used to get the connection status.
[out] | pStatus | : One byte status of the Wi-Fi module.
|
ADI_WIFI_RESULT adi_wifi_radio_GetVersionInfo | ( | uint8_t *const | pVersionInfoBuf, |
uint32_t | nBufSize | ||
) |
Get the AT command version and SDK version info.
This AT command is used to check the version of AT commands and SDK, the type of which is "executed".
[in] | nBufSize | : Size of the buffer pVersionInfoBuf. |
[out] | pVersionInfoBuf | : Pointer to the buffer where the version info will be written. |
ADI_WIFI_RESULT adi_wifi_radio_Init | ( | ADI_CALLBACK | pCallbackFunc | ) |
Initialize Wi-Fi module.
Initialize the Wi-Fi transport layer driver and register the callback function.
[in] | pCallbackFunc | : Pointer to the callback function to be passed to the transport layer. |
ADI_WIFI_RESULT adi_wifi_radio_MQTTConnect | ( | ADI_WIFI_MQTT_CONNECT_CONFIG *const | pMQTTConnect | ) |
Connect to a MQTT broker.
[in] | pMQTTConnect | Structure used to configure the MQTT connection.
|
ADI_WIFI_RESULT adi_wifi_radio_MQTTDisconnect | ( | uint32_t | nLinkID | ) |
Disconnect from the MQTT broker.
[in] | nLinkID | It is the ID of the network connection in the case of multiple connections. Can be 0-4. Set to #ADI_WIFI_RADIO_MAX_NUM_CONNECTIONS for single connection mode. |
ADI_WIFI_RESULT adi_wifi_radio_MQTTPing | ( | uint32_t | nLinkID | ) |
Ping the MQTT broker.
This command can be used to ping the MQTT broker to keep the connection alive.
[in] | nLinkID | It is the ID of the network connection in the case of multiple connections. Can be 0-4. Set to #ADI_WIFI_RADIO_MAX_NUM_CONNECTIONS for single connection mode. |
ADI_WIFI_RESULT adi_wifi_radio_MQTTPublish | ( | ADI_WIFI_PUBLISH_CONFIG *const | pPublishConfig | ) |
Publish MQTT data.
[in] | ePublishConfig | Configuration structure to publish data. - nLinkID is used in the case of multiple connections. It is the ID of the network connection. Can be 0-4. Set to #ADI_WIFI_RADIO_MAX_NUM_CONNECTIONS for single connection mode. - nQos is the type of quality of service for the packet. Valid options are 0, 1 and 2. - pMQTTData is a pointer to the MQTT data to publish. - nMQTTDataSize is size of the MQTT data being published. - pTopic is a pointer to the topic to publish to. Must be smaller than #ADI_WIFI_MQTT_PACKET_SIZE -sizeof(ADI_DATA_PACKET) - 2u - nPacketId is the packet id for this packet. |
ADI_WIFI_RESULT adi_wifi_radio_MQTTSubscribe | ( | ADI_WIFI_SUBSCRIBE_CONFIG *const | pSubscribeConfig | ) |
Subscribe to a topic.
[in] | pSubscribeConfig | Configuration structure to subscribe to a topic. - nLinkID is used in the case of multiple connections. It is the ID of the network connection. Can be 0-4. Set to #ADI_WIFI_RADIO_MAX_NUM_CONNECTIONS for single connection mode. - nQos is the type of quality of service for the packet. Valid options are 0, 1 and 2. - pTopic is a pointer to the topic to subscribe to. Must be smaller than #ADI_WIFI_MQTT_PACKET_SIZE -sizeof(ADI_DATA_PACKET) - 2u - nPacketId is the packet id for this packet. |
ADI_WIFI_RESULT adi_wifi_radio_Restart | ( | ) |
Restart Wi-Fi module.
The type of this command is "executed". It’s used to restart the module.
ADI_WIFI_RESULT adi_wifi_radio_SendData | ( | ADI_WIFI_SEND_DATA_CONFIG *const | pSendDataConfig, |
ADI_WIFI_AT_CMDCODE | eCipSendCmd | ||
) |
Send data to server.
This command is actually three separate transactions. The first portion sends the length of data that will follow in the second data packet. Each data packet needs to be sent 20ms apart. The third portion of this only applies to packets who have a quality of service level greater than 0. This means that a response is expected to confirm that the data is been received by the server.
[in] | pSendDataConfig | Configuration structure to send data.
|
[in] | eCipSendCmd | Type of data to send to the remote server. |
ADI_WIFI_RESULT adi_wifi_radio_SetWiFiMode | ( | uint32_t | nMode | ) |
Set the Wi-Fi mode.
The type of this command is "executed". This setting will be stored in the flash system parameter area. It won’t be erased even when the power is off.
[in] | nMode | : Mode to set. 1: Station mode. 2: SoftAP mode (access point). 3: SoftAP + Station mode. |
ADI_WIFI_RESULT adi_wifi_radio_TestAT | ( | ) |
Test AT command.
The type of this command is "executed". It's used to test the hardware setup of the Wi-Fi module.