|
AWS IoT for ESP32 v1.0.0
An ESP-IDF based solution
|
An AWS library file. More...
Go to the source code of this file.
Data Structures | |
| union | value_ut |
| struct | awsShadow_st |
| AWS Shadow structure used by the library to handle shadow updates. You should initialize the callback handler and register this awsShadow_st by calling AWS_shadowDeltaRegister function to receive callbacks whenever the shadow element is updated. More... | |
| struct | awsConfig_st |
| AWS configuration structure used by the library. More... | |
Typedefs | |
| typedef void(* | awsShadowUpdateCallBack_t) (char *pKeyStr, void *pValue) |
| Shadow update callback function type. The application should define the callback function and intialize it in the awsShadow_st configuration. | |
Functions | |
| bool | AWS_isConnected () |
| Check if the device is connected state. More... | |
| awsIotStates_et | AWS_getState () |
| Get the current state of AWS library. More... | |
| const char * | AWS_getStateString () |
| Get current state of AWS library as string. More... | |
| const char * | AWS_getThingName () |
| Get thing name. More... | |
| void | AWS_suspend () |
| Suspend AWS library. More... | |
| void | AWS_resume () |
| Resume AWS library from suspended state. More... | |
| void | AWS_close () |
| Disconnect and close the AWS IoT connection. More... | |
| void | AWS_restart () |
| Disconnect from AWS IoT and Reconnect back. More... | |
| bool | AWS_subscribe (char *pTopicStr, uint8_t qos_e) |
| Subscribe to a given Topic on AWS IoT. More... | |
| uint16_t | AWS_subMsgAvailable () |
| Check if messages received for subscribed topics are available in the subscription message buffer. More... | |
| bool | AWS_subMsgRead (mqttMsg_st *ps_msg) |
| Read the available message from the subscription message buffer. More... | |
| bool | AWS_publish (mqttMsg_st *ps_msg) |
| Publish given message to AWS IoT. The message is queued in a Publish buffer, then gets published. More... | |
| uint16_t | AWS_pubMsgAvailable () |
| Check if message is available to publish in the Publish queue. More... | |
| bool | AWS_publishInProgress () |
| Check if library is still publishing messages. More... | |
| bool | AWS_shadowDeltaRegister (awsShadow_st *ps_shadow) |
| Register a shadow element to receive callbacks whenever the shadow element is updated with a new value. More... | |
| bool | AWS_shadowUpdate (char *pKeyStr, void *pValue, shadowUpdateType_et updateType_e) |
| Update the shadow element. More... | |
| bool | AWS_shadowDocumentUpdate (awsThingShadow_st as_thingShadow[], uint8_t maxKeys_u8, shadowUpdateType_et updateType_e) |
| Update device shadow. More... | |
| void | AWS_printStatus () |
| Print the status of AWS IoT. More... | |
| void | AWS_printSubscribedTopics () |
| Print all of the subscribed topics. More... | |
| void | AWS_printCertificates () |
| Print the configured certificates. Prints ROOT CA, Client Cert. & Private key. More... | |
An AWS library file.
AWS library handles AWS IoT events like Publish, Subscribe, Shadow updates, Connection events, Device Provisioning... etc.
| enum awsIotStates_et |
An enum that represents states of AWS library. The AWS library will be in one of the following mode.
| enum shadowUpdateType_et |
| enum shadowValueType_et |
| void AWS_close | ( | ) |
Disconnect and close the AWS IoT connection.
| none |
| awsIotStates_et AWS_getState | ( | ) |
Get the current state of AWS library.
| none |
| const char * AWS_getStateString | ( | ) |
Get current state of AWS library as string.
| none |
| IDLE | - for STATE_AWS_IDLE |
| INIT | - for STATE_AWS_INIT |
| START | - for STATE_AWS_START |
| PROVISIONING | - for STATE_AWS_PROVISIONING |
| CONNECTED | - for STATE_AWS_CONNECTED |
| DISCONNECTED | - for STATE_AWS_DISCONNECTED |
| SUSPENDED | - for STATE_AWS_SUSPENDED |
| RESUME | - for STATE_AWS_RESUME |
| PROVISION_FAILED | - for STATE_AWS_PROVISION_FAILED |
| const char * AWS_getThingName | ( | ) |
Get thing name.
| none |
| bool AWS_isConnected | ( | ) |
Check if the device is connected state.
| none |
| true | when connected |
| false | when not connected |
| void AWS_printCertificates | ( | ) |
Print the configured certificates. Prints ROOT CA, Client Cert. & Private key.
| none |
| void AWS_printStatus | ( | ) |
Print the status of AWS IoT.
| none |
| void AWS_printSubscribedTopics | ( | ) |
Print all of the subscribed topics.
| none |
| bool AWS_publish | ( | mqttMsg_st * | ps_msg | ) |
Publish given message to AWS IoT. The message is queued in a Publish buffer, then gets published.
| [in] | mqttMsg_st | MQTT message type for publishing |
| true | when message is queued for publishing |
| false | on errors |
| bool AWS_publishInProgress | ( | ) |
Check if library is still publishing messages.
| none |
| true | when library is publishing messages |
| false | when it's not publishing |
| uint16_t AWS_pubMsgAvailable | ( | ) |
Check if message is available to publish in the Publish queue.
| none |
| true | if message is available for publishing |
| false | if no message is available |
| void AWS_restart | ( | ) |
Disconnect from AWS IoT and Reconnect back.
| none |
| void AWS_resume | ( | ) |
Resume AWS library from suspended state.
| none |
| bool AWS_shadowDeltaRegister | ( | awsShadow_st * | ps_shadow | ) |
Register a shadow element to receive callbacks whenever the shadow element is updated with a new value.
| [in] | awsShadow_st | shadow element to receive callback on update |
| true | registed successfully |
| false | when failed |
| bool AWS_shadowDocumentUpdate | ( | awsThingShadow_st | as_thingShadow[], |
| uint8_t | maxKeys_u8, | ||
| shadowUpdateType_et | updateType_e | ||
| ) |
Update device shadow.
| [in] | awsThingShadow_st | The Device shadow |
| [in] | maxKeys_u8 | Max keys to update |
| [in] | shadowUpdateType_et | Type of shadow update |
| true | on success |
| false | on failure |
| bool AWS_shadowUpdate | ( | char * | pKeyStr, |
| void * | pValue, | ||
| shadowUpdateType_et | updateType_e | ||
| ) |
Update the shadow element.
| [in] | pKeyStr | A key representing shadow element |
| [in] | pValue | New value of the shadow element |
| [in] | shadowUpdateType_et | Type of shadow update |
| true | on success |
| false | on failure |
| uint16_t AWS_subMsgAvailable | ( | ) |
Check if messages received for subscribed topics are available in the subscription message buffer.
| none |
| bool AWS_subMsgRead | ( | mqttMsg_st * | ps_msg | ) |
Read the available message from the subscription message buffer.
| [out] | mqttMsg_st | MQTT message type |
| true | when message is read successfully from the buffer. |
| false | on errors |
| bool AWS_subscribe | ( | char * | pTopicStr, |
| uint8_t | qos_e | ||
| ) |
Subscribe to a given Topic on AWS IoT.
| [in] | pTopicStr | topic as string |
| [in] | qos_e | QOS level |
| true | on success |
| false | on failure |
| void AWS_suspend | ( | ) |
Suspend AWS library.
| none |