|
IoT managed integrations End Device SDK
|
This file defines MQTT agent public header. More...
Go to the source code of this file.
Macros | |
| #define | MQTT_AGENT_MAX_SUBSCRIPTIONS (30U) |
Typedefs | |
| typedef struct iotmiDev_MQTTAgentUserContext | iotmiDev_MQTTAgentUserContext_t |
| typedef iotmiDev_MQTTAgentUserContext_t * | iotmiDev_MQTTAgentUserHandle_t |
| typedef void(* | IncomingPubCallback_t) (void *pvIncomingPublishCallbackContext, MQTTPublishInfo_t *pxPublishInfo) |
| Callback function called when receiving a publish. | |
Functions | |
| MQTTStatus_t | iotmiDev_MQTTAgentInit (NetworkContext_t *pxNetworkContext, size_t networkBufferSize) |
| MQTT Agent init function for IoT managed integrations connection. Two type of the MQTT connections are used in the SDK. The fleet provisioning connection is used to provision the device with credentials to connect to IoT managed integrations endpoint. iotmiDev_MQTTAgentFleetProvisioningInit should be called for fleet provisioning connection. The IoT Managed Integrations connection is used to exchange message with IoT Managed Integrations service. iotmiDev_MQTTAgentInit should be called for IoT managed integrations service connection. | |
| MQTTStatus_t | iotmiDev_MQTTAgentFleetProvisioningInit (NetworkContext_t *pxNetworkContext, size_t networkBufferSize) |
| MQTT Agent init function for fleet provisioning connection. | |
| void | iotmiDev_MQTTAgentDeinit (void) |
| MQTT Agent de-init function to free all the resource allocated in iotmiDev_MQTTAgentInit. | |
| MQTTStatus_t | iotmiDev_MQTTAgentThreadLoop (char *pClientId, const char *pManagedIntegrationsEndpoint, uint16_t managedIntegrationsEndpointPort, bool xCleanSession, CK_SESSION_HANDLE pxSession, char *pRootCaLabel, char *pCertificateLabel, char *pPrivateKeyLabel) |
| MQTT Agent connection and command loop function. | |
| MQTTStatus_t | iotmiDev_MQTTAgentStop (void) |
| MQTT Agent thread loop stop function. | |
| iotmiDev_MQTTAgentUserHandle_t | iotmiDev_MQTTAgentCreateUserContext (void) |
| MQTT Agent create user context for IoT managed integrations connection. User context should be created according to the which iotmiDev_MQTTAgentInit is called. iotmiDev_MQTTAgentCreateFleetProvisioningUserContext should be called to create user context with iotmiDev_MQTTAgentFleetProvisioningInit. iotmiDev_MQTTAgentCreateUserContext should be called to create user context with iotmiDev_MQTTAgentInit. | |
| iotmiDev_MQTTAgentUserHandle_t | iotmiDev_MQTTAgentCreateFleetProvisioningUserContext (void) |
| MQTT Agent create user context for fleet provisioning connection. | |
| void | iotmiDev_MQTTAgentDeleteUserContext (iotmiDev_MQTTAgentUserHandle_t userHandle) |
| MQTT Agent delete user context. | |
| MQTTStatus_t | iotmiDev_MQTTAgentPublish (iotmiDev_MQTTAgentUserHandle_t userHandle, MQTTPublishInfo_t *pPublishInfo, uint32_t blockTimeMs) |
| MQTT Agent synchronous publish function. | |
| MQTTStatus_t | iotmiDev_MQTTAgentAddSubscription (iotmiDev_MQTTAgentUserHandle_t userHandle, const char *pcTopicFilterString, uint16_t usTopicFilterLength, IncomingPubCallback_t pxIncomingPublishCallback, void *pvIncomingPublishCallbackContext, uint32_t blockTimeMs) |
| MQTT Agent synchronous subscription function. Qos1 will be used in this function. | |
| MQTTStatus_t | iotmiDev_MQTTAgentRemoveSubscription (iotmiDev_MQTTAgentUserHandle_t userHandle, const char *pcTopicFilterString, uint16_t usTopicFilterLength, uint32_t blockTimeMs) |
| MQTT Agent synchronous unsubscription function. Qos1 will be used in this function. | |
This file defines MQTT agent public header.
| typedef void(* IncomingPubCallback_t) (void *pvIncomingPublishCallbackContext, MQTTPublishInfo_t *pxPublishInfo) |
Callback function called when receiving a publish.
| [in] | pvIncomingPublishCallbackContext | The incoming publish callback context. |
| [in] | pxPublishInfo | Deserialized publish information. |
| MQTTStatus_t iotmiDev_MQTTAgentAddSubscription | ( | iotmiDev_MQTTAgentUserHandle_t | userHandle, |
| const char * | pcTopicFilterString, | ||
| uint16_t | usTopicFilterLength, | ||
| IncomingPubCallback_t | pxIncomingPublishCallback, | ||
| void * | pvIncomingPublishCallbackContext, | ||
| uint32_t | blockTimeMs | ||
| ) |
MQTT Agent synchronous subscription function. Qos1 will be used in this function.
| [in] | pUserContext | pointer to MQTT Agent user context. |
| [in] | pcTopicFilterString | Topic filter of the subscription. |
| [in] | usTopicFilterLength | Topic filter length. |
| [in] | pxIncomingPublishCallback | callback function for incoming publish. |
| [in] | pvIncomingPublishCallbackContext | context passed to callback function. |
| [in] | blockTimeMs | Maximum block time to wait for operation complete. |
| iotmiDev_MQTTAgentUserHandle_t iotmiDev_MQTTAgentCreateFleetProvisioningUserContext | ( | void | ) |
MQTT Agent create user context for fleet provisioning connection.
| iotmiDev_MQTTAgentUserHandle_t iotmiDev_MQTTAgentCreateUserContext | ( | void | ) |
MQTT Agent create user context for IoT managed integrations connection. User context should be created according to the which iotmiDev_MQTTAgentInit is called. iotmiDev_MQTTAgentCreateFleetProvisioningUserContext should be called to create user context with iotmiDev_MQTTAgentFleetProvisioningInit. iotmiDev_MQTTAgentCreateUserContext should be called to create user context with iotmiDev_MQTTAgentInit.
| void iotmiDev_MQTTAgentDeleteUserContext | ( | iotmiDev_MQTTAgentUserHandle_t | userHandle | ) |
MQTT Agent delete user context.
| [in] | pUserContext | user context to be deleted. |
| MQTTStatus_t iotmiDev_MQTTAgentFleetProvisioningInit | ( | NetworkContext_t * | pxNetworkContext, |
| size_t | networkBufferSize | ||
| ) |
MQTT Agent init function for fleet provisioning connection.
| [in] | pxNetworkContext | pointer to user defined network context. |
| [in] | networkBufferSize | Size of network buffer. |
| MQTTStatus_t iotmiDev_MQTTAgentInit | ( | NetworkContext_t * | pxNetworkContext, |
| size_t | networkBufferSize | ||
| ) |
MQTT Agent init function for IoT managed integrations connection. Two type of the MQTT connections are used in the SDK. The fleet provisioning connection is used to provision the device with credentials to connect to IoT managed integrations endpoint. iotmiDev_MQTTAgentFleetProvisioningInit should be called for fleet provisioning connection. The IoT Managed Integrations connection is used to exchange message with IoT Managed Integrations service. iotmiDev_MQTTAgentInit should be called for IoT managed integrations service connection.
| [in] | pxNetworkContext | pointer to user defined network context. |
| [in] | networkBufferSize | Size of network buffer. |
| MQTTStatus_t iotmiDev_MQTTAgentPublish | ( | iotmiDev_MQTTAgentUserHandle_t | userHandle, |
| MQTTPublishInfo_t * | pPublishInfo, | ||
| uint32_t | blockTimeMs | ||
| ) |
MQTT Agent synchronous publish function.
| [in] | pUserContext | pointer to MQTT Agent user context. |
| [in] | pPublishInfo | publish info. |
| [in] | blockTimeMs | Maximum block time to wait for operation complete. |
| MQTTStatus_t iotmiDev_MQTTAgentRemoveSubscription | ( | iotmiDev_MQTTAgentUserHandle_t | userHandle, |
| const char * | pcTopicFilterString, | ||
| uint16_t | usTopicFilterLength, | ||
| uint32_t | blockTimeMs | ||
| ) |
MQTT Agent synchronous unsubscription function. Qos1 will be used in this function.
| [in] | pUserContext | pointer to MQTT Agent user context. |
| [in] | pcTopicFilterString | Topic filter of the unsubscription. |
| [in] | usTopicFilterLength | Topic filter length. function. |
| [in] | blockTimeMs | Maximum block time to wait for operation complete. |
| MQTTStatus_t iotmiDev_MQTTAgentStop | ( | void | ) |
MQTT Agent thread loop stop function.
| MQTTStatus_t iotmiDev_MQTTAgentThreadLoop | ( | char * | pClientId, |
| const char * | pManagedIntegrationsEndpoint, | ||
| uint16_t | managedIntegrationsEndpointPort, | ||
| bool | xCleanSession, | ||
| CK_SESSION_HANDLE | pxSession, | ||
| char * | pRootCaLabel, | ||
| char * | pCertificateLabel, | ||
| char * | pPrivateKeyLabel | ||
| ) |
MQTT Agent connection and command loop function.
| [in] | pClientId | for the MQTT connection. |
| [in] | pManagedIntegrationsEndpoint | pointer to IoT managed integrations endpoint. |
| [in] | managedIntegrationsEndpointPort | port of the IoT Managed Integrations endpoint. |
| [in] | xCleanSession | Set true to create a clean session. |
| [in] | pxSession | User created PKCS11 session. |
| [in] | pRootCaLabel | PKCS11 Root CA label. |
| [in] | pCertificateLabel | PKCS11 device certificate label. |
| [in] | pPrivateKeyLabel | PKCS11 private key label. |