Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distinguish between model id and interface id #2354

Merged
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
4 changes: 2 additions & 2 deletions sdk/inc/azure/iot/az_iot_adu_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
#include <azure/core/_az_cfg_prefix.h>

/**
* @brief Define the ADU agent interface ID.
* @brief Define the ADU agent model ID.
*/
#define AZ_IOT_ADU_CLIENT_AGENT_INTERFACE_ID "dtmi:azure:iot:deviceUpdateModel;1"
#define AZ_IOT_ADU_CLIENT_AGENT_MODEL_ID "dtmi:azure:iot:deviceUpdateModel;1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this being used somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No not here but would be in samples which want to use ADU. Link here for docs.

Copy important part here:

Device Update for IoT Hub requires the IoT Plug and Play smart device to announce a model ID with a value of "dtmi:azure:iot:deviceUpdateModel;1" as part of the device connection.


/**
* @brief ADU Agent Version
Expand Down
2 changes: 2 additions & 0 deletions sdk/src/azure/iot/az_iot_adu_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
/* 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 the ADU agent property name "agent" and sub property names. */
#define AZ_IOT_ADU_CLIENT_AGENT_PROPERTY_NAME_AGENT "agent"

Expand Down
4 changes: 2 additions & 2 deletions sdk/tests/iot/adu/test_az_iot_adu.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@

static uint8_t expected_agent_state_payload[]
= "{\"deviceUpdate\":{\"__t\":\"c\",\"agent\":{\"deviceProperties\":{\"manufacturer\":"
"\"Contoso\",\"model\":\"Foobar\",\"interfaceId\":\"dtmi:azure:iot:deviceUpdateModel;1\","
"\"Contoso\",\"model\":\"Foobar\",\"interfaceId\":\"dtmi:azure:iot:deviceUpdate;1\","
"\"aduVer\":\"DU;agent/"
"0.8.0-rc1-public-preview\"},\"compatPropertyNames\":\"manufacturer,model\",\"state\":0,"
"\"installedUpdateId\":\"{\\\"provider\\\":\\\"Contoso\\\",\\\"name\\\":\\\"Foobar\\\","
"\\\"version\\\":\\\"1.0\\\"}\"}}}";
static uint8_t expected_agent_state_long_payload[]
= "{\"deviceUpdate\":{\"__t\":\"c\",\"agent\":{\"deviceProperties\":{\"manufacturer\":"
"\"Contoso\",\"model\":\"Foobar\",\"interfaceId\":\"dtmi:azure:iot:deviceUpdateModel;1\","
"\"Contoso\",\"model\":\"Foobar\",\"interfaceId\":\"dtmi:azure:iot:deviceUpdate;1\","
"\"aduVer\":\"DU;agent/"
"0.8.0-rc1-public-preview\"},\"compatPropertyNames\":\"manufacturer,model\","
"\"lastInstallResult\":{\"resultCode\":0,\"extendedResultCode\":1234,\"resultDetails\":"
Expand Down