15 #ifndef AZURE_IOT_PROVISIONING_CLIENT_H
16 #define AZURE_IOT_PROVISIONING_CLIENT_H
23 #include "azure_iot_mqtt_port.h"
27 #include "azure/iot/az_iot_common.h"
28 #include "azure/iot/az_iot_provisioning_client.h"
29 #include "azure/core/_az_cfg_prefix.h"
34 #define azureiotprovisioningRESPONSE_MAX ( azureiotconfigTOPIC_MAX + azureiotconfigPROVISIONING_REQUEST_PAYLOAD_MAX )
36 #define azureiotprovisioningNO_WAIT ( 0 )
37 #define azureiotprovisioningWAIT_FOREVER ( ( uint32_t ) 0xFFFFFFFF )
55 AzureIoTMQTT_t xMQTTContext;
57 const uint8_t * pucRegistrationID;
58 uint32_t ulRegistrationIDLength;
59 const uint8_t * pucEndpoint;
60 uint32_t ulEndpointLength;
61 const uint8_t * pucIDScope;
62 uint32_t ulIDScopeLength;
63 const uint8_t * pucSymmetricKey;
64 uint32_t ulSymmetricKeyLength;
65 const uint8_t * pucRegistrationPayload;
66 uint32_t ulRegistrationPayloadLength;
69 uint64_t ullExpiryTimeSecs,
70 const uint8_t * ucKey,
72 uint8_t * pucSASBuffer,
73 uint32_t ulSasBufferLen,
74 uint32_t * pulSaSLength );
78 az_iot_provisioning_client xProvisioningClientCore;
80 uint32_t ulWorkflowState;
81 uint32_t ulLastOperationResult;
82 uint64_t ullRetryAfter;
84 uint8_t * pucScratchBuffer;
85 uint32_t ulScratchBufferLength;
87 size_t xLastResponsePayloadLength;
88 uint16_t usLastResponseTopicLength;
89 az_iot_provisioning_client_register_response xRegisterResponse;
119 const uint8_t * pucEndpoint,
120 uint32_t ulEndpointLength,
121 const uint8_t * pucIDScope,
122 uint32_t ulIDScopeLength,
123 const uint8_t * pucRegistrationID,
124 uint32_t ulRegistrationIDLength,
127 uint32_t ulBufferLength,
150 const uint8_t * pucSymmetricKey,
151 uint32_t ulSymmetricKeyLength,
173 uint32_t ulTimeoutMilliseconds );
186 uint8_t * pucHubHostname,
187 uint32_t * pulHostnameLength,
188 uint8_t * pucDeviceID,
189 uint32_t * pulDeviceIDLength );
201 uint32_t * pulExtendedErrorCode );
213 const uint8_t * pucPayload,
214 uint32_t ulPayloadLength );
216 #include "azure/core/_az_cfg_suffix.h"
Azure IoT FreeRTOS middleware common APIs and structs.
uint32_t(* AzureIoTGetHMACFunc_t)(const uint8_t *pucKey, uint32_t ulKeyLength, const uint8_t *pucData, uint32_t ulDataLength, uint8_t *pucOutput, uint32_t ulOutputLength, uint32_t *pulBytesCopied)
The HMAC256 function used by the SDK to generate SAS keys.
Definition: azure_iot.h:62
uint64_t(* AzureIoTGetCurrentTimeFunc_t)(void)
The platform get time function to be used by the SDK for MQTT connections.
Definition: azure_iot.h:48
AzureIoTResult_t AzureIoTProvisioningClient_SetSymmetricKey(AzureIoTProvisioningClient_t *pxAzureProvClient, const uint8_t *pucSymmetricKey, uint32_t ulSymmetricKeyLength, AzureIoTGetHMACFunc_t xHmacFunction)
Set the symmetric key to use for authentication.
struct AzureIoTProvisioningClient AzureIoTProvisioningClient_t
The Azure IoT Device Provisioning client.
AzureIoTResult_t AzureIoTProvisioningClient_GetExtendedCode(AzureIoTProvisioningClient_t *pxAzureProvClient, uint32_t *pulExtendedErrorCode)
Get extended code for Provisioning failure.
AzureIoTResult_t AzureIoTProvisioningClient_Register(AzureIoTProvisioningClient_t *pxAzureProvClient, uint32_t ulTimeoutMilliseconds)
Begin the provisioning process.
void AzureIoTProvisioningClient_Deinit(AzureIoTProvisioningClient_t *pxAzureProvClient)
Deinitialize the Azure IoT Provisioning Client.
AzureIoTResult_t AzureIoTProvisioningClient_SetRegistrationPayload(AzureIoTProvisioningClient_t *pxAzureProvClient, const uint8_t *pucPayload, uint32_t ulPayloadLength)
Set registration payload.
AzureIoTResult_t AzureIoTProvisioningClient_Init(AzureIoTProvisioningClient_t *pxAzureProvClient, const uint8_t *pucEndpoint, uint32_t ulEndpointLength, const uint8_t *pucIDScope, uint32_t ulIDScopeLength, const uint8_t *pucRegistrationID, uint32_t ulRegistrationIDLength, AzureIoTProvisioningClientOptions_t *pxProvisioningClientOptions, uint8_t *pucBuffer, uint32_t ulBufferLength, AzureIoTGetCurrentTimeFunc_t xGetTimeFunction, const AzureIoTTransportInterface_t *pxTransportInterface)
Initialize the Azure IoT Provisioning Client.
AzureIoTResult_t AzureIoTProvisioningClient_GetDeviceAndHub(AzureIoTProvisioningClient_t *pxAzureProvClient, uint8_t *pucHubHostname, uint32_t *pulHostnameLength, uint8_t *pucDeviceID, uint32_t *pulDeviceIDLength)
After a registration has been completed, get the IoT Hub hostname and device ID.
struct AzureIoTProvisioningClientOptions AzureIoTProvisioningClientOptions_t
The options for the Azure IoT Device Provisioning client.
AzureIoTResult_t AzureIoTProvisioningClient_OptionsInit(AzureIoTProvisioningClientOptions_t *pxProvisioningClientOptions)
Initialize the Azure IoT Provisioning Options with default values.
#define azureiotprovisioningRESPONSE_MAX
The maximum size of the response buffer.
Definition: azure_iot_provisioning_client.h:34
Azure IoT FreeRTOS middleware result values.
enum AzureIoTResult AzureIoTResult_t
The results used by the middleware.
Transport interface definition to send and receive data over the network.
The Azure IoT Device Provisioning client.
Definition: azure_iot_provisioning_client.h:52
struct AzureIoTProvisioningClient::@8 _internal
Internal to the SDK.
The options for the Azure IoT Device Provisioning client.
Definition: azure_iot_provisioning_client.h:43
const uint8_t * pucUserAgent
Definition: azure_iot_provisioning_client.h:44
uint32_t ulUserAgentLength
Definition: azure_iot_provisioning_client.h:45
The transport layer interface.
Definition: azure_iot_transport_interface.h:159