From 7d43b9aff3e1a8d02adf1bd6e38b404109044b8a Mon Sep 17 00:00:00 2001 From: Dominic Betts Date: Fri, 30 Apr 2021 11:45:39 +0100 Subject: [PATCH] Update readme for samples --- device/samples/pnp/readme.md | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/device/samples/pnp/readme.md b/device/samples/pnp/readme.md index f6d8f449a..4f313c385 100644 --- a/device/samples/pnp/readme.md +++ b/device/samples/pnp/readme.md @@ -1,14 +1,38 @@ -# Samples to demonstrate Azure IoT Plug and Play +--- +page_type: sample +description: "A set of JavaScript samples that show how a device that uses the IoT Plug and Play conventions interacts with either IoT Hub or IoT Central." +languages: +- javascript +products: +- azure-iot-hub +- azure-iot-central +- azure-iot-pnp +urlFragment: azure-iot-pnp-device-samples-for-javascript +--- -The samples in this directory demonstrate how to implement an Azure IoT Plug and Play device. Azure IoT Plug and Play is documented [here](aka.ms/iotpnp). The samples assume basic familiarity with Plug and Play concepts, though not in depth knowledge of the Plug and Play "convention". The "convention" is a set of rules for serializing and de-serialing data that uses IoTHub primitives for transport which the samples themselves implement. +# IoT Plug And Play device samples -## Directory structure +These samples demonstrate how a device that follows the [IoT Plug and Play conventions](https://docs.microsoft.com/azure/iot-pnp/concepts-convention) interacts with IoT Hub or IoT Central, to: -The directory contains the following samples: +- Send telemetry. +- Update read-only and read-write properties. +- Respond to command invocation. -* [simple_thermostat](./simple_thermostat) A simple thermostat that implements the model [dtmi:com:example:Thermostat;1](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/samples/Thermostat.json). This sample is considered simple because it only implements one component, the thermostat itself. **You should begin with this sample.** +The samples demonstrate two scenarios: -* [pnpTemperatureController](./pnpTemperatureController) A temperature controller that implements the model [dtmi:com:example:TemperatureController;1](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/samples/TemperatureController.json). This is considerably more complex than the [simple_thermostat](./simple_thermostat) and demonstrates the use of subcomponents. **You should move onto this sample only after fully understanding simple_thermostat.** +- An IoT Plug and Play device that implements the [Thermostat](https://devicemodels.azure.com/dtmi/com/example/thermostat-1.json) model. This model has a single interface that defines telemetry, read-only and read-write properties, and commands. +- An IoT Plug and Play device that implements the [Temperature controller](https://devicemodels.azure.com/dtmi/com/example/temperaturecontroller-2.json) model. This model uses multiple components: + - The top-level interface defines telemetry, read-only property and commands. + - The model includes two [Thermostat](https://devicemodels.azure.com/dtmi/com/example/thermostat-1.json) components, and a [device information](https://devicemodels.azure.com/dtmi/azure/devicemanagement/deviceinformation-1.json) component. + +## Quickstarts and tutorials + +To learn more about how to configure and run the Thermostat device sample with IoT Hub, see [Quickstart: Connect a sample IoT Plug and Play device application running on Linux or Windows to IoT Hub](https://docs.microsoft.com/azure/iot-pnp/quickstart-connect-device?pivots=programming-language-javascript). + +To learn more about how to configure and run the Temperature Controller device sample with: + +- IoT Hub, see [Tutorial: Connect an IoT Plug and Play multiple component device application running on Linux or Windows to IoT Hub](https://docs.microsoft.com/azure/iot-pnp/tutorial-multiple-components?pivots=programming-language-javascript) +- IoT Central, see [Tutorial: Create and connect a client application to your Azure IoT Central application](https://docs.microsoft.com/azure/iot-central/core/tutorial-connect-device?pivots=programming-language-javascript) ## Configuring the samples