Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/Azure_IoT_Adu_ESP32/Azure_IoT_Adu_ESP32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
#define SAMPLE_MQTT_PAYLOAD_LENGTH 1024

// ADU Values
#define ADU_PPV_DTMI "dtmi:azure:iot:deviceUpdateContractModel;1"
#define ADU_PPV_DTMI AZ_IOT_ADU_CLIENT_AGENT_MODEL_ID
#define ADU_DEVICE_SHA_SIZE 32
#define ADU_SHA_PARTITION_READ_BUFFER_SIZE 32
#define HTTP_DOWNLOAD_CHUNK 4096
Expand Down
22 changes: 7 additions & 15 deletions examples/Azure_IoT_Adu_ESP32/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ _The following was run on Windows 11 and Ubuntu Desktop 20.04 environments, with

- ESP32 boards are not natively supported by Arduino IDE, so you need to add them manually.
- Follow the [instructions](https://github.com/espressif/arduino-esp32) in the official ESP32 repository.
- Install Azure CLI and Azure IoT Module

See steps to install both [here](https://learn.microsoft.com/azure/iot-hub-device-update/create-update?source=recommendations#prerequisites).

## Add Azure IoT Hub Device to an ADU Deployment Group

Expand All @@ -88,7 +90,7 @@ Viewing the device twin on the portal, the "tag" section should look similar to

- On the Arduino IDE, go to menu `Sketch`, `Include Library`, `Manage Libraries...`.
- Search for and install `azure-sdk-for-c`.
- **Make sure to install the latest `1.1.0-beta.*` to use the preview version of the Embedded C SDK.**
- **Make sure to install version `1.1.0` or later to use the new Azure Device Update client of the Embedded C SDK.**

1. Open the ESPRESSIF ESP32 sample.

Expand Down Expand Up @@ -220,24 +222,14 @@ Once you are done with the ADU sample, you may remove the added configuration to

### Generate the ADU Update Manifest

Navigate to the `C:\ADU-update` directory in a Powershell prompt.
Open PowerShell.

Clone the ADU toolset.
Navigate to the `C:\ADU-update` directory.

```bash
git clone https://github.com/Azure/iot-hub-device-update
```

Generate the update manifest using **powershell**.
Run the following command:

```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
Import-Module .\iot-hub-device-update\tools\AduCmdlets\AduUpdate.psm1
$updateId = New-AduUpdateId -Provider "Contoso" -Name "ESP32-Embedded" -Version 1.1
$compat = New-AduUpdateCompatibility -Properties @{ deviceManufacturer = 'ESPRESSIF'; deviceModel = 'ESP32-Embedded' }
$installStep = New-AduInstallationStep -Handler 'microsoft/swupdate:1'-HandlerProperties @{ installedCriteria = '1.1' } -Files C:\ADU-update\Azure_IoT_Adu_ESP32_1.1.bin
$update = New-AduImportManifest -UpdateId $updateId -Compatibility $compat -InstallationSteps $installStep
$update | Out-File "./$($updateId.provider).$($updateId.name).$($updateId.version).importmanifest.json" -Encoding utf8
az iot du update init v5 --update-provider Contoso --update-name ESP32-Embedded --update-version 1.1 --compat deviceModel=ESP32-Embedded deviceManufacturer=ESPRESSIF --step handler=microsoft/swupdate:1 properties='{\"installedCriteria\":\"1.1\"}' --file path=./Azure_IoT_Adu_ESP32_1.1.bin > ./Contoso.ESP32-Embedded.1.1.importmanifest.json
```

Verify you have the following files in your ADU-update directory:
Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=Azure SDK for C
version=1.1.0
version=1.1.1
author=Microsoft Corporation
maintainer=Microsoft Corporation <aziotarduino@microsoft.com>
sentence=Azure SDK for C library for Arduino.
paragraph=This is an Arduino port of the Azure SDK for C (1.4.0). It allows you to use your Arduino device with Azure services like Azure IoT Hub and Azure Device Provisioning Service. See README.md for more details. Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.
paragraph=This is an Arduino port of the Azure SDK for C (1.5.0-beta.1). It allows you to use your Arduino device with Azure services like Azure IoT Hub and Azure Device Provisioning Service. See README.md for more details. Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.
category=Communication
url=https://github.com/Azure/azure-sdk-for-c-arduino/releases
architectures=*
Expand Down
8 changes: 4 additions & 4 deletions src/az_iot_adu_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
/* Define the ADU agent component name. */
#define AZ_IOT_ADU_CLIENT_AGENT_COMPONENT_NAME "deviceUpdate"

#define AZ_IOT_ADU_CLIENT_AGENT_INTERFACE_ID "dtmi:azure:iot:deviceUpdate;1"
#define AZ_IOT_ADU_CLIENT_AGENT_CONTRACT_MODEL_ID "dtmi:azure:iot:deviceUpdateContractModel;2"

/* Define the ADU agent property name "agent" and sub property names. */
#define AZ_IOT_ADU_CLIENT_AGENT_PROPERTY_NAME_AGENT "agent"

#define AZ_IOT_ADU_CLIENT_AGENT_PROPERTY_NAME_DEVICEPROPERTIES "deviceProperties"
#define AZ_IOT_ADU_CLIENT_AGENT_PROPERTY_NAME_MANUFACTURER "manufacturer"
#define AZ_IOT_ADU_CLIENT_AGENT_PROPERTY_NAME_MODEL "model"
#define AZ_IOT_ADU_CLIENT_AGENT_PROPERTY_NAME_INTERFACE_ID "interfaceId"
#define AZ_IOT_ADU_CLIENT_AGENT_PROPERTY_NAME_CONTRACT_MODEL_ID "contractModelId"
#define AZ_IOT_ADU_CLIENT_AGENT_PROPERTY_NAME_ADU_VERSION "aduVer"
#define AZ_IOT_ADU_CLIENT_AGENT_PROPERTY_NAME_DO_VERSION "doVer"

Expand Down Expand Up @@ -206,9 +206,9 @@ AZ_NODISCARD az_result az_iot_adu_client_get_agent_state_payload(
}

_az_RETURN_IF_FAILED(az_json_writer_append_property_name(
ref_json_writer, AZ_SPAN_FROM_STR(AZ_IOT_ADU_CLIENT_AGENT_PROPERTY_NAME_INTERFACE_ID)));
ref_json_writer, AZ_SPAN_FROM_STR(AZ_IOT_ADU_CLIENT_AGENT_PROPERTY_NAME_CONTRACT_MODEL_ID)));
_az_RETURN_IF_FAILED(az_json_writer_append_string(
ref_json_writer, AZ_SPAN_FROM_STR(AZ_IOT_ADU_CLIENT_AGENT_INTERFACE_ID)));
ref_json_writer, AZ_SPAN_FROM_STR(AZ_IOT_ADU_CLIENT_AGENT_CONTRACT_MODEL_ID)));

_az_RETURN_IF_FAILED(az_json_writer_append_property_name(
ref_json_writer, AZ_SPAN_FROM_STR(AZ_IOT_ADU_CLIENT_AGENT_PROPERTY_NAME_ADU_VERSION)));
Expand Down
7 changes: 3 additions & 4 deletions src/az_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,18 @@

/// The version in string format used for telemetry following the `semver.org` standard
/// (https://semver.org).
#define AZ_SDK_VERSION_STRING "1.4.0"
#define AZ_SDK_VERSION_STRING "1.5.0-beta.1"

/// Major numeric identifier.
#define AZ_SDK_VERSION_MAJOR 1

/// Minor numeric identifier.
#define AZ_SDK_VERSION_MINOR 4
#define AZ_SDK_VERSION_MINOR 5

/// Patch numeric identifier.
#define AZ_SDK_VERSION_PATCH 0

/// Optional pre-release identifier. SDK is in a pre-release state when present.
#define AZ_SDK_VERSION_PRERELEASE
#undef AZ_SDK_VERSION_PRERELEASE
#define AZ_SDK_VERSION_PRERELEASE "beta.1"

#endif //_az_VERSION_H
Loading