From eb4dc915529e08bfd52ae15255b6d65ae42cb839 Mon Sep 17 00:00:00 2001 From: Ryan Winter Date: Thu, 10 Jun 2021 12:06:17 -0700 Subject: [PATCH] update pnp model to v2 (#252) * update pnp model to v2 --- MXChip/AZ3166/app/nx_client.c | 2 +- Microchip/ATSAME54-XPRO/app/nx_client.c | 2 +- Microchip/ATSAME54-XPRO/readme.md | 2 +- NXP/MIMXRT1050-EVKB/app/nx_client.c | 2 +- NXP/MIMXRT1060-EVK/app/nx_client.c | 2 +- Renesas/RSK_RX65N_2MB/app/nx_client.c | 2 +- Renesas/RSK_RX65N_2MB/readme.md | 2 +- .../STM32L4_L4+/app/nx_client.c | 2 +- core/model/gsg-2.json | 53 ++++++ core/model/gsgmxchip-2.json | 163 ++++++++++++++++++ mlc_config.json | 3 + 11 files changed, 227 insertions(+), 8 deletions(-) create mode 100644 core/model/gsg-2.json create mode 100644 core/model/gsgmxchip-2.json create mode 100644 mlc_config.json diff --git a/MXChip/AZ3166/app/nx_client.c b/MXChip/AZ3166/app/nx_client.c index 71b1d135..8fd74a86 100644 --- a/MXChip/AZ3166/app/nx_client.c +++ b/MXChip/AZ3166/app/nx_client.c @@ -21,7 +21,7 @@ #include "azure_device_x509_cert_config.h" #include "azure_pnp_info.h" -#define IOT_MODEL_ID "dtmi:azurertos:devkit:gsgmxchip;1" +#define IOT_MODEL_ID "dtmi:azurertos:devkit:gsgmxchip;2" // Device telemetry names #define TELEMETRY_HUMIDITY "humidity" diff --git a/Microchip/ATSAME54-XPRO/app/nx_client.c b/Microchip/ATSAME54-XPRO/app/nx_client.c index 51562e4b..6153a258 100644 --- a/Microchip/ATSAME54-XPRO/app/nx_client.c +++ b/Microchip/ATSAME54-XPRO/app/nx_client.c @@ -20,7 +20,7 @@ #include "azure_device_x509_cert_config.h" #include "azure_pnp_info.h" -#define IOT_MODEL_ID "dtmi:azurertos:devkit:gsg;1" +#define IOT_MODEL_ID "dtmi:azurertos:devkit:gsg;2" #define TELEMETRY_TEMPERATURE "temperature" #define TELEMETRY_INTERVAL_PROPERTY "telemetryInterval" diff --git a/Microchip/ATSAME54-XPRO/readme.md b/Microchip/ATSAME54-XPRO/readme.md index 1419b92f..57c228d7 100644 --- a/Microchip/ATSAME54-XPRO/readme.md +++ b/Microchip/ATSAME54-XPRO/readme.md @@ -245,7 +245,7 @@ You can use the **Termite** utility to monitor communication and confirm that yo Initializing Azure IoT Hub client Hub hostname: *** Device id: *** - Model id: dtmi:azurertos:devkit:gsg;1 + Model id: dtmi:azurertos:devkit:gsg;2 Connected to IoTHub SUCCESS: Azure IoT Hub client initialized diff --git a/NXP/MIMXRT1050-EVKB/app/nx_client.c b/NXP/MIMXRT1050-EVKB/app/nx_client.c index 947ebea4..9f843239 100644 --- a/NXP/MIMXRT1050-EVKB/app/nx_client.c +++ b/NXP/MIMXRT1050-EVKB/app/nx_client.c @@ -19,7 +19,7 @@ #include "fsl_tempmon.h" -#define IOT_MODEL_ID "dtmi:azurertos:devkit:gsg;1" +#define IOT_MODEL_ID "dtmi:azurertos:devkit:gsg;2" #define TELEMETRY_TEMPERATURE "temperature" #define TELEMETRY_INTERVAL_PROPERTY "telemetryInterval" diff --git a/NXP/MIMXRT1060-EVK/app/nx_client.c b/NXP/MIMXRT1060-EVK/app/nx_client.c index 6d06ea08..8936ba5f 100644 --- a/NXP/MIMXRT1060-EVK/app/nx_client.c +++ b/NXP/MIMXRT1060-EVK/app/nx_client.c @@ -19,7 +19,7 @@ #include "fsl_tempmon.h" -#define IOT_MODEL_ID "dtmi:azurertos:devkit:gsg;1" +#define IOT_MODEL_ID "dtmi:azurertos:devkit:gsg;2" #define TELEMETRY_TEMPERATURE "temperature" #define TELEMETRY_INTERVAL_PROPERTY "telemetryInterval" diff --git a/Renesas/RSK_RX65N_2MB/app/nx_client.c b/Renesas/RSK_RX65N_2MB/app/nx_client.c index 3c2ad093..c390f739 100644 --- a/Renesas/RSK_RX65N_2MB/app/nx_client.c +++ b/Renesas/RSK_RX65N_2MB/app/nx_client.c @@ -19,7 +19,7 @@ #include "platform.h" -#define IOT_MODEL_ID "dtmi:azurertos:devkit:gsg;1" +#define IOT_MODEL_ID "dtmi:azurertos:devkit:gsg;2" #define TELEMETRY_TEMPERATURE "temperature" #define TELEMETRY_INTERVAL_PROPERTY "telemetryInterval" diff --git a/Renesas/RSK_RX65N_2MB/readme.md b/Renesas/RSK_RX65N_2MB/readme.md index edc8f9a6..1707190c 100644 --- a/Renesas/RSK_RX65N_2MB/readme.md +++ b/Renesas/RSK_RX65N_2MB/readme.md @@ -242,7 +242,7 @@ You can use the **Termite** utility to monitor communication and confirm that yo Initializing Azure IoT Hub client Hub hostname: *** Device id: *** - Model id: dtmi:azurertos:devkit:gsg;1 + Model id: dtmi:azurertos:devkit:gsg;2 Connected to IoTHub SUCCESS: Azure IoT Hub client initialized diff --git a/STMicroelectronics/STM32L4_L4+/app/nx_client.c b/STMicroelectronics/STM32L4_L4+/app/nx_client.c index 9563e916..2b59eb63 100644 --- a/STMicroelectronics/STM32L4_L4+/app/nx_client.c +++ b/STMicroelectronics/STM32L4_L4+/app/nx_client.c @@ -20,7 +20,7 @@ #include "azure_device_x509_cert_config.h" #include "azure_pnp_info.h" -#define IOT_MODEL_ID "dtmi:azurertos:devkit:gsg;1" +#define IOT_MODEL_ID "dtmi:azurertos:devkit:gsg;2" #define TELEMETRY_TEMPERATURE "temperature" #define TELEMETRY_INTERVAL_PROPERTY "telemetryInterval" diff --git a/core/model/gsg-2.json b/core/model/gsg-2.json new file mode 100644 index 00000000..839a8b5b --- /dev/null +++ b/core/model/gsg-2.json @@ -0,0 +1,53 @@ +{ + "@context": "dtmi:dtdl:context;2", + "@id": "dtmi:azurertos:devkit:gsg;2", + "@type": "Interface", + "displayName": "Getting Started Guide", + "description": "Example model for the Azure RTOS Getting Started Guides", + "contents": [ + { + "@type": [ + "Telemetry", + "Temperature" + ], + "name": "temperature", + "displayName": "Temperature", + "unit": "degreeCelsius", + "schema": "double" + }, + { + "@type": "Property", + "name": "telemetryInterval", + "displayName": "Telemetry Interval", + "description": "Specify the interval in seconds for the telemetry.", + "schema": "integer", + "writable": true + }, + { + "@type": "Property", + "name": "ledState", + "displayName": "LED state", + "description": "Returns the current state of the onboard LED.", + "schema": "boolean" + }, + { + "@type": "Command", + "name": "setLedState", + "displayName": "Set LED state", + "description": "Sets the state of the onboard LED.", + "request": { + "name": "state", + "displayName": "State", + "description": "True is LED on, false is LED off.", + "schema": "boolean" + } + }, + { + "@type": "Component", + "schema": "dtmi:azure:DeviceManagement:DeviceInformation;1", + "name": "deviceInformation", + "displayName": "Device Information", + "description": "Interface with basic device hardware information." + } + ] +} diff --git a/core/model/gsgmxchip-2.json b/core/model/gsgmxchip-2.json new file mode 100644 index 00000000..6e2bf126 --- /dev/null +++ b/core/model/gsgmxchip-2.json @@ -0,0 +1,163 @@ +{ + "@context": "dtmi:dtdl:context;2", + "@id": "dtmi:azurertos:devkit:gsgmxchip;2", + "@type": "Interface", + "displayName": "MXCHIP Getting Started Guide", + "description": "Example model for the Azure RTOS MXCHIP Getting Started Guide", + "contents": [ + { + "@type": [ + "Telemetry", + "Temperature" + ], + "name": "temperature", + "displayName": "Temperature", + "unit": "degreeCelsius", + "schema": "double" + }, + { + "@type": [ + "Telemetry", + "RelativeHumidity" + ], + "name": "humidity", + "displayName": "Humidity", + "unit": "percent", + "schema": "double" + }, + { + "@type": [ + "Telemetry", + "Pressure" + ], + "name": "pressure", + "displayName": "Pressure", + "unit": "kilopascal", + "schema": "double" + }, + { + "@type": "Telemetry", + "name": "magnetometerX", + "displayName": "Magnetometer X / mgauss", + "schema": "double" + }, + { + "@type": "Telemetry", + "name": "magnetometerY", + "displayName": "Magnetometer Y / mgauss", + "schema": "double" + }, + { + "@type": "Telemetry", + "name": "magnetometerZ", + "displayName": "Magnetometer Z / mgauss", + "schema": "double" + }, + { + "@type": [ + "Telemetry", + "Acceleration" + ], + "name": "accelerometerX", + "displayName": "Accelerometer X", + "schema": "double", + "unit": "gForce" + }, + { + "@type": [ + "Telemetry", + "Acceleration" + ], + "name": "accelerometerY", + "displayName": "Accelerometer Y", + "schema": "double", + "unit": "gForce" + }, + { + "@type": [ + "Telemetry", + "Acceleration" + ], + "name": "accelerometerZ", + "displayName": "Accelerometer Z", + "schema": "double", + "unit": "gForce" + }, + { + "@type": [ + "Telemetry", + "AngularVelocity" + ], + "name": "gyroscopeX", + "displayName": "Gyroscope X", + "schema": "double", + "unit": "degreePerSecond" + }, + { + "@type": [ + "Telemetry", + "AngularVelocity" + ], + "name": "gyroscopeY", + "displayName": "Gyroscope Y", + "schema": "double", + "unit": "degreePerSecond" + }, + { + "@type": [ + "Telemetry", + "AngularVelocity" + ], + "name": "gyroscopeZ", + "displayName": "Gyroscope Z", + "schema": "double", + "unit": "degreePerSecond" + }, + { + "@type": "Property", + "name": "telemetryInterval", + "displayName": "Telemetry Interval", + "description": "Control the frequency of the telemetry loop.", + "schema": "integer", + "writable": true + }, + { + "@type": "Property", + "name": "ledState", + "displayName": "LED state", + "description": "Returns the current state of the onboard LED.", + "schema": "boolean" + }, + { + "@type": "Command", + "name": "setLedState", + "displayName": "Set LED state", + "description": "Sets the state of the onboard LED.", + "request": { + "name": "state", + "displayName": "State", + "description": "True is LED on, false is LED off.", + "schema": "boolean" + } + }, + { + "@type": "Command", + "name": "setDisplayText", + "displayName": "Display Text", + "description": "Display text on screen.", + "request": { + "name": "text", + "displayName": "Text", + "description": "Text displayed on the screen.", + "schema": "string" + } + }, + { + "@type": "Component", + "schema": "dtmi:azure:DeviceManagement:DeviceInformation;1", + "name": "deviceInformation", + "displayName": "Device Information", + "description": "Interface with basic device hardware information." + } + ] +} \ No newline at end of file diff --git a/mlc_config.json b/mlc_config.json new file mode 100644 index 00000000..d393e1b9 --- /dev/null +++ b/mlc_config.json @@ -0,0 +1,3 @@ +{ + "aliveStatusCodes": [0, 200] +} \ No newline at end of file