Go to the documentation of this file.
26 #include <azure/iot/internal/az_iot_adu_internal.h>
31 #include <azure/core/_az_cfg_prefix.h>
38 #define AZ_IOT_ADU_CLIENT_AGENT_MODEL_ID "dtmi:azure:iot:deviceUpdateContractModel;2"
43 #define AZ_IOT_ADU_CLIENT_AGENT_VERSION "DU;agent/1.0.0"
48 #define AZ_IOT_ADU_CLIENT_PROPERTIES_COMPONENT_NAME "deviceUpdate"
53 #define AZ_IOT_ADU_CLIENT_AGENT_DEFAULT_COMPATIBILITY_PROPERTIES "manufacturer,model"
123 az_span names[_az_IOT_ADU_CLIENT_MAX_DEVICE_CUSTOM_PROPERTIES];
127 az_span values[_az_IOT_ADU_CLIENT_MAX_DEVICE_CUSTOM_PROPERTIES];
337 az_span files[_az_IOT_ADU_CLIENT_MAX_FILE_COUNT_PER_STEP];
357 steps[_az_IOT_ADU_CLIENT_MAX_INSTRUCTIONS_STEPS];
605 #include <azure/core/_az_cfg_suffix.h>
607 #endif // _az_IOT_ADU_H
int32_t result_code
Definition: az_iot_adu_client.h:213
az_span id
Definition: az_iot_adu_client.h:392
Definition of az_result and helper functions.
az_span hash_value
Definition: az_iot_adu_client.h:377
AZ_NODISCARD az_iot_adu_client_options az_iot_adu_client_options_default()
Gets the default Azure IoT ADU Client options.
Returns the JSON tokens contained within a JSON buffer, one at a time.
Definition: az_json.h:664
az_span handler
Definition: az_iot_adu_client.h:331
Provides forward-only, non-cached writing of UTF-8 encoded JSON text into the provided buffer.
Definition: az_json.h:305
AZ_NODISCARD az_result az_iot_adu_client_parse_service_properties(az_iot_adu_client *client, az_json_reader *ref_json_reader, az_iot_adu_client_update_request *update_request)
Parses the json content from the ADU service writable properties into a pre-defined structure.
az_span id
Definition: az_iot_adu_client.h:249
User-defined options for the Azure IoT ADU client.
Definition: az_iot_adu_client.h:448
az_iot_adu_client_update_manifest_instructions instructions
Definition: az_iot_adu_client.h:428
AZ_NODISCARD az_result az_iot_adu_client_parse_update_manifest(az_iot_adu_client *client, az_json_reader *ref_json_reader, az_iot_adu_client_update_manifest *update_manifest)
Parses the json content from the ADU service update manifest into a pre-defined structure.
az_iot_adu_client_update_manifest_instructions_step_handler_properties handler_properties
Definition: az_iot_adu_client.h:345
az_span file_name
Definition: az_iot_adu_client.h:396
Step in the instructions of an update manifest.
Definition: az_iot_adu_client.h:322
int32_t az_result
The type represents the various success and error conditions.
Definition: az_result.h:46
az_iot_adu_client_request_decision
Decision codes to accept or reject a received update deployment.
Definition: az_iot_adu_client.h:59
az_span hash_type
Definition: az_iot_adu_client.h:373
az_span installed_criteria
Definition: az_iot_adu_client.h:314
AZ_NODISCARD az_result az_iot_adu_client_get_service_properties_response(az_iot_adu_client *client, int32_t version, az_iot_adu_client_request_decision status, az_json_writer *ref_json_writer)
Generates the payload necessary to respond to the service after receiving incoming properties.
A map of file ID to download url.
Definition: az_iot_adu_client.h:260
az_span result_details
Definition: az_iot_adu_client.h:222
int32_t extended_result_code
Definition: az_iot_adu_client.h:195
User-defined properties for handling an update request.
Definition: az_iot_adu_client.h:310
az_span adu_version
Definition: az_iot_adu_client.h:163
az_span model
Definition: az_iot_adu_client.h:153
az_iot_adu_client_service_action action
Definition: az_iot_adu_client.h:245
az_span manifest_version
Definition: az_iot_adu_client.h:420
@ AZ_IOT_ADU_CLIENT_AGENT_STATE_IDLE
ADU Agent State (Idle)
Definition: az_iot_adu_client.h:72
uint32_t files_count
Definition: az_iot_adu_client.h:341
az_span update_id
Definition: az_iot_adu_client.h:175
az_span provider
Definition: az_iot_adu_client.h:102
@ AZ_IOT_ADU_CLIENT_REQUEST_DECISION_ACCEPT
ADU Service Response (Accept)
Definition: az_iot_adu_client.h:61
AZ_NODISCARD bool az_iot_adu_client_is_component_device_update(az_iot_adu_client *client, az_span component_name)
Verifies if the Azure Plug-and-Play writable properties component is for ADU device update.
az_span id
Definition: az_iot_adu_client.h:264
az_iot_adu_device_custom_properties * custom_properties
Definition: az_iot_adu_client.h:158
Structure that holds the parsed contents of the ADU request in the Plug and Play writable properties ...
Definition: az_iot_adu_client.h:277
az_span result_details
Definition: az_iot_adu_client.h:199
az_span delivery_optimization_agent_version
Definition: az_iot_adu_client.h:171
An az_span represents a contiguous byte buffer and is used for string manipulations,...
Instructions in the update manifest.
Definition: az_iot_adu_client.h:352
az_span update_manifest_signature
Definition: az_iot_adu_client.h:293
Structure that holds the state of the Azure IoT ADU client.
Definition: az_iot_adu_client.h:460
az_span url
Definition: az_iot_adu_client.h:268
uint32_t file_urls_count
Definition: az_iot_adu_client.h:302
Structure that holds the parsed contents of the update manifest sent by the ADU service.
Definition: az_iot_adu_client.h:416
@ AZ_IOT_ADU_CLIENT_REQUEST_DECISION_REJECT
ADU Service Response (Reject)
Definition: az_iot_adu_client.h:63
az_span update_manifest
Definition: az_iot_adu_client.h:289
Holds the ADU agent device properties.
Definition: az_iot_adu_client.h:145
uint32_t files_count
Definition: az_iot_adu_client.h:436
az_span manufacturer
Definition: az_iot_adu_client.h:149
@ AZ_IOT_ADU_CLIENT_SERVICE_ACTION_APPLY_DEPLOYMENT
ADU Service Action (Apply)
Definition: az_iot_adu_client.h:85
@ AZ_IOT_ADU_CLIENT_AGENT_STATE_FAILED
ADU Agent State (Failed)
Definition: az_iot_adu_client.h:76
AZ_NODISCARD az_iot_adu_client_device_properties az_iot_adu_client_device_properties_default()
Gets the default az_iot_adu_client_device_properties.
AZ_NODISCARD az_result az_iot_adu_client_init(az_iot_adu_client *client, az_iot_adu_client_options *options)
Initializes an Azure IoT ADU Client.
A set of values that indicate which deployment the agent is currently working on.
Definition: az_iot_adu_client.h:240
This header defines the types and functions your application uses to read or write JSON objects.
uint32_t steps_count
Definition: az_iot_adu_client.h:361
az_iot_adu_client_agent_state
Agent states used to notify the ADU service of current state.
Definition: az_iot_adu_client.h:70
az_span device_compatibility_properties
Definition: az_iot_adu_client.h:452
az_span create_date_time
Definition: az_iot_adu_client.h:440
@ AZ_IOT_ADU_CLIENT_SERVICE_ACTION_CANCEL
ADU Service Action (Cancel)
Definition: az_iot_adu_client.h:87
Holds any user-defined custom properties for the device.
Definition: az_iot_adu_client.h:119
Definition for the Azure IoT Hub client.
@ AZ_IOT_ADU_CLIENT_AGENT_STATE_DEPLOYMENT_IN_PROGRESS
ADU Agent State (In Progress)
Definition: az_iot_adu_client.h:74
az_iot_adu_update_id update_id
Definition: az_iot_adu_client.h:424
The update result reported by the agent.
Definition: az_iot_adu_client.h:208
AZ_NODISCARD az_result az_iot_adu_client_get_agent_state_payload(az_iot_adu_client *client, az_iot_adu_client_device_properties *device_properties, az_iot_adu_client_agent_state agent_state, az_iot_adu_client_workflow *workflow, az_iot_adu_client_install_result *last_install_result, az_json_writer *ref_json_writer)
Generates the Azure Plug-and-Play (reported) properties payload with the state of the ADU agent.
az_span name
Definition: az_iot_adu_client.h:106
The update step result reported by the agent.
Definition: az_iot_adu_client.h:185
Hash value for a given file.
Definition: az_iot_adu_client.h:369
int32_t count
Definition: az_iot_adu_client.h:131
int32_t result_code
Definition: az_iot_adu_client.h:190
int64_t size_in_bytes
Definition: az_iot_adu_client.h:400
int32_t extended_result_code
Definition: az_iot_adu_client.h:218
int32_t step_results_count
Definition: az_iot_adu_client.h:226
az_iot_adu_client_service_action
Actions specified by the service for the agent to process.
Definition: az_iot_adu_client.h:83
az_iot_adu_client_workflow workflow
Definition: az_iot_adu_client.h:281
Identity of the update request.
Definition: az_iot_adu_client.h:98
Represents a "view" over a byte buffer that represents a contiguous region of memory....
Definition: az_span.h:33
Details of a file referenced in the update request.
Definition: az_iot_adu_client.h:387
az_span retry_timestamp
Definition: az_iot_adu_client.h:253
az_span version
Definition: az_iot_adu_client.h:110
uint32_t hashes_count
Definition: az_iot_adu_client.h:408