7 #ifndef AZURE_IOT_ADU_CLIENT_H
8 #define AZURE_IOT_ADU_CLIENT_H
15 #include <azure/iot/az_iot_adu_client.h>
36 uint8_t * pucPropertyNames[ _az_IOT_ADU_CLIENT_MAX_DEVICE_CUSTOM_PROPERTIES ];
37 uint32_t ulPropertyNamesLengths[ _az_IOT_ADU_CLIENT_MAX_DEVICE_CUSTOM_PROPERTIES ];
38 uint8_t * pucPropertyValues[ _az_IOT_ADU_CLIENT_MAX_DEVICE_CUSTOM_PROPERTIES ];
39 uint32_t ulPropertyValuesLengths[ _az_IOT_ADU_CLIENT_MAX_DEVICE_CUSTOM_PROPERTIES ];
40 uint32_t ulPropertyCount;
44 az_iot_adu_device_custom_properties xCustomProperties;
57 const uint8_t * ucManufacturer;
58 uint32_t ulManufacturerLength;
60 const uint8_t * ucModel;
61 uint32_t ulModelLength;
65 const uint8_t * ucCurrentUpdateId;
66 uint32_t ulCurrentUpdateIdLength;
68 const uint8_t * ucDeliveryOptimizationAgentVersion;
69 uint32_t ulDeliveryOptimizationAgentVersionLength;
78 eAzureIoTADUActionApplyDownload = 3,
79 eAzureIoTADUActionCancel = 255
97 const uint8_t * pucID;
100 const uint8_t * pucRetryTimestamp;
101 uint32_t ulRetryTimestampLength;
110 uint32_t ulResultCode;
111 uint32_t ulExtendedResultCode;
113 const uint8_t * pucResultDetails;
114 uint32_t ulResultDetailsLength;
124 int32_t lExtendedResultCode;
126 const uint8_t * pucResultDetails;
127 uint32_t ulResultDetailsLength;
130 uint32_t ulStepResultsCount;
142 eAzureIoTADUAgentStateIdle = 0,
143 eAzureIoTADUAgentStateDeploymentInProgress = 6,
144 eAzureIoTADUAgentStateFailed = 255,
145 eAzureIoTADUAgentStateError,
154 eAzureIoTADURequestDecisionAccept,
155 eAzureIoTADURequestDecisionReject
167 uint32_t ulUrlLength;
178 uint8_t * pucProvider;
179 uint32_t ulProviderLength;
181 uint32_t ulNameLength;
182 uint8_t * pucVersion;
183 uint32_t ulVersionLength;
192 uint8_t * pucFileName;
193 uint32_t ulFileNameLength;
205 uint32_t ulHashLength;
216 uint8_t * pucFileName;
217 uint32_t ulFileNameLength;
218 int64_t llSizeInBytes;
219 uint32_t ulHashesCount;
229 uint8_t * pucHandler;
230 uint32_t ulHandlerLength;
231 uint8_t * pucInstalledCriteria;
232 uint32_t ulInstalledCriteriaLength;
233 uint32_t ulFilesCount;
242 uint32_t ulStepsCount;
254 uint32_t ulFilesCount;
256 uint8_t * pucManifestVersion;
257 uint32_t ulManifestVersionLength;
258 uint8_t * pucCreateDateTime;
259 uint32_t ulCreateDateTimeLength;
270 uint8_t * pucUpdateManifest;
271 uint32_t ulUpdateManifestLength;
272 uint8_t * pucUpdateManifestSignature;
273 uint32_t ulUpdateManifestSignatureLength;
274 uint32_t ulFileUrlCount;
284 const uint8_t * pucCompatibilityProperties;
285 uint32_t ulCompatibilityPropertiesLength;
296 az_iot_adu_client xADUClient;
340 const uint8_t * pucComponentName,
341 uint32_t ulComponentNameLength );
382 uint32_t ulPropertyVersion,
383 uint8_t * pucWritablePropertyResponseBuffer,
384 uint32_t ulWritablePropertyResponseBufferSize,
385 uint32_t * pulRequestId );
410 uint32_t ulBufferSize,
411 uint32_t * pulRequestId );
struct AzureIoTADUInstructionStepFile AzureIoTADUUpdateManifestInstructionStepFile_t
The name of a file referenced in the update manifest.
enum AzureIoTADUAgentState AzureIoTADUAgentState_t
States of the ADU agent.
AzureIoTResult_t AzureIoTADUClient_DevicePropertiesInit(AzureIoTADUClientDeviceProperties_t *pxADUDeviceProperties)
Initialize the Azure IoT Device Properties with default values.
struct AzureIoTADUClientOptions AzureIoTADUClientOptions_t
User-defined options for the Azure IoT ADU client.
AzureIoTResult_t AzureIoTADUClient_SendAgentState(AzureIoTADUClient_t *pxAzureIoTADUClient, AzureIoTHubClient_t *pxAzureIoTHubClient, AzureIoTADUClientDeviceProperties_t *pxDeviceProperties, AzureIoTADUUpdateRequest_t *pxAduUpdateRequest, AzureIoTADUAgentState_t xAgentState, AzureIoTADUClientInstallResult_t *pxUpdateResults, uint8_t *pucBuffer, uint32_t ulBufferSize, uint32_t *pulRequestId)
Sends the current state of the Azure IoT ADU agent.
AzureIoTResult_t AzureIoTADUClient_OptionsInit(AzureIoTADUClientOptions_t *pxADUClientOptions)
Initialize the Azure IoT ADU Options with default values.
struct AzureIoTADUUpdateManifestFileHash AzureIoTADUUpdateManifestFileHash_t
Hash value of a given file.
AzureIoTResult_t AzureIoTADUClient_SendResponse(AzureIoTADUClient_t *pxAzureIoTADUClient, AzureIoTHubClient_t *pxAzureIoTHubClient, AzureIoTADURequestDecision_t xRequestDecision, uint32_t ulPropertyVersion, uint8_t *pucWritablePropertyResponseBuffer, uint32_t ulWritablePropertyResponseBufferSize, uint32_t *pulRequestId)
Updates the ADU Agent Client with ADU service device update properties.
struct AzureIoTADUUpdateRequest AzureIoTADUUpdateRequest_t
Structure that holds the parsed contents of the ADU request in the Plug and Play writable properties ...
struct AzureIoTADUUpdateId AzureIoTADUUpdateId_t
Identity of the update request.
const uint32_t AzureIoTADUModelIDLength
The length of AzureIoTADUModelID.
AzureIoTADUAction
Actions requested by the ADU Service.
Definition: azure_iot_adu_client.h:77
AzureIoTADURequestDecision
Decision values for accepting an update request or not.
Definition: azure_iot_adu_client.h:153
bool AzureIoTADUClient_IsADUComponent(AzureIoTADUClient_t *pxAzureIoTADUClient, const uint8_t *pucComponentName, uint32_t ulComponentNameLength)
Returns whether the component is the ADU component.
struct AzureIoTADUInstructions AzureIoTADUInstructions_t
Instructions in the update manifest.
struct AzureIoTADUClientDeviceProperties AzureIoTADUClientDeviceProperties_t
ADU Device Properties.
AzureIoTResult_t AzureIoTADUClient_ParseRequest(AzureIoTADUClient_t *pxAzureIoTADUClient, AzureIoTJSONReader_t *pxReader, AzureIoTADUUpdateRequest_t *pxAduUpdateRequest)
Parse the ADU update request into the requisite structure.
enum AzureIoTADUAction AzureIoTADUAction_t
Actions requested by the ADU Service.
struct AzureIoTADUUpdateManifestFileUrl AzureIoTADUUpdateManifestFileUrl_t
A map of file ID to download url.
AzureIoTResult_t AzureIoTADUClient_Init(AzureIoTADUClient_t *pxAzureIoTADUClient, AzureIoTADUClientOptions_t *pxADUClientOptions)
Initialize the Azure IoT ADU Client.
enum AzureIoTADURequestDecision AzureIoTADURequestDecision_t
Decision values for accepting an update request or not.
struct AzureIoTADUClientWorkflow AzureIoTADUClientWorkflow_t
ADU workflow struct.
struct AzureIoTADUDeviceCustomProperties AzureIoTADUDeviceCustomProperties_t
Holds any user-defined custom properties of the device.
struct AzureIoTADUClientStepResult AzureIoTADUClientStepResult_t
The update step result reported by the agent.
struct AzureIoTADUInstructionStep AzureIoTADUInstructionStep_t
A step in the instructions of an ADU update manifest.
struct AzureIoTADUClientInstallResult AzureIoTADUClientInstallResult_t
The update result reported by the agent.
struct AzureIoTADUUpdateManifest AzureIoTADUUpdateManifest_t
Structure that holds the parsed contents of the update manifest sent by the ADU service.
AzureIoTADUAgentState
States of the ADU agent.
Definition: azure_iot_adu_client.h:141
struct AzureIoTADUUpdateManifestFile AzureIoTADUUpdateManifestFile_t
Details of a file referenced in the update request.
struct AzureIoTADUClient AzureIoTADUClient_t
Azure IoT ADU Client (ADU agent) to handle stages of the ADU process.
const uint8_t * AzureIoTADUModelID
The DTMI specifying the capabilities for the Azure Device Update client.
The middleware IoT Hub Client used to connect a device to Azure IoT Hub.
The JSON reader used by the middleware for PnP properties.
Azure IoT FreeRTOS middleware result values.
enum AzureIoTResult AzureIoTResult_t
The results used by the middleware.
ADU Device Properties.
Definition: azure_iot_adu_client.h:56
Azure IoT ADU Client (ADU agent) to handle stages of the ADU process.
Definition: azure_iot_adu_client.h:293
struct AzureIoTADUClient::@1 _internal
The update result reported by the agent.
Definition: azure_iot_adu_client.h:122
User-defined options for the Azure IoT ADU client.
Definition: azure_iot_adu_client.h:283
The update step result reported by the agent.
Definition: azure_iot_adu_client.h:109
ADU workflow struct.
Definition: azure_iot_adu_client.h:94
Holds any user-defined custom properties of the device.
Definition: azure_iot_adu_client.h:35
The name of a file referenced in the update manifest.
Definition: azure_iot_adu_client.h:191
A step in the instructions of an ADU update manifest.
Definition: azure_iot_adu_client.h:228
Instructions in the update manifest.
Definition: azure_iot_adu_client.h:241
Identity of the update request.
Definition: azure_iot_adu_client.h:177
Hash value of a given file.
Definition: azure_iot_adu_client.h:201
Details of a file referenced in the update request.
Definition: azure_iot_adu_client.h:213
A map of file ID to download url.
Definition: azure_iot_adu_client.h:163
Structure that holds the parsed contents of the update manifest sent by the ADU service.
Definition: azure_iot_adu_client.h:251
Structure that holds the parsed contents of the ADU request in the Plug and Play writable properties ...
Definition: azure_iot_adu_client.h:268
Azure IoT Hub Client used to manage connections and features for Azure IoT Hub.
The struct to use for Azure IoT JSON reader functionality.
Definition: azure_iot_json_reader.h:50