From 29280de194ae551e1e5335605c9e89c9fd5d2741 Mon Sep 17 00:00:00 2001 From: Lenny Goodell Date: Tue, 13 Jun 2023 15:58:54 -0700 Subject: [PATCH] fix: Adjust profile and devices files used in Getting Started Device SDK Go (#1135) fixes #1131 Signed-off-by: Leonard Goodell --- .../getting-started/Ch-GettingStartedSDK-C.md | 8 ++++---- .../getting-started/Ch-GettingStartedSDK-Go.md | 8 ++++---- .../getting-started/random-generator-device.json | 14 -------------- .../getting-started/random-generator-devices.yaml | 15 +++++++++++++++ ...enerator-device.yaml => random-generator.yaml} | 8 +++----- 5 files changed, 26 insertions(+), 27 deletions(-) delete mode 100644 docs_src/getting-started/random-generator-device.json create mode 100644 docs_src/getting-started/random-generator-devices.yaml rename docs_src/getting-started/{random-generator-device.yaml => random-generator.yaml} (81%) diff --git a/docs_src/getting-started/Ch-GettingStartedSDK-C.md b/docs_src/getting-started/Ch-GettingStartedSDK-C.md index e8af486b7..2b1f222a4 100644 --- a/docs_src/getting-started/Ch-GettingStartedSDK-C.md +++ b/docs_src/getting-started/Ch-GettingStartedSDK-C.md @@ -127,9 +127,9 @@ Follow these steps to create a device profile for the simple random number gener ![image](EdgeX_SampleDeviceProfile_DeviceResourcesC.png) -2. A pre-created device profile for the random number device is provided in this documentation. This is supplied in the alternative file format .yaml. Download **[random-generator-device.yaml](random-generator-device.yaml)** and save the file to the `./res/profiles` folder. +2. A pre-created device profile for the random number device is provided in this documentation. This is supplied in the alternative file format .yaml. Download **[random-generator.yaml](random-generator.yaml)** and save the file to the `./res/profiles` folder. -3. Open the random-generator-device.yaml file in a text editor. In this device profile, the device described has a deviceResource: `RandomNumber`. Note how the association of a type to the deviceResource. In this case, the device profile informs EdgeX that `RandomNumber` will be a Int32. In real world IoT situations, this deviceResource list could be extensive and filled with many deviceResources all different types of data. +3. Open the random-generator.yaml file in a text editor. In this device profile, the device described has a deviceResource: `RandomNumber`. Note how the association of a type to the deviceResource. In this case, the device profile informs EdgeX that `RandomNumber` will be a Int32. In real world IoT situations, this deviceResource list could be extensive and filled with many deviceResources all different types of data. ## Creating your Device @@ -139,9 +139,9 @@ Follow these steps to create a pre-defined device for the simple random number g 1. Explore the files in the cmd/device-simple/res/devices folder. Note the example simple-device.json that is already in this folder. Open the file with your favorite editor and explore its contents. Note how the file contents represent an actual device with its properties (properties like Name, ProfileName, AutoEvents). -2. A pre-created device for the random number device is provided in this documentation. Download **[random-generator-device.json](random-generator-device.json)** and save the file to the `~/edgexfoundry/device-simple/cmd/device-simple/res/devices` folder. +2. A pre-created device for the random number device is provided in this documentation. Download **[random-generator-devices.yaml](random-generator-devices.yaml)** and save the file to the `~/edgexfoundry/device-simple/cmd/device-simple/res/devices` folder. -3. Open the random-generator-device.json file in a text editor. In this example, the device described has a profileName: `RandNum-Device`. In this case, the device informs EdgeX that it will be using the device profile we created in [Creating your Device Profile](./Ch-GettingStartedSDK-C.md#creating-your-device-profile) +3. Open the random-generator-devices.yaml file in a text editor. In this example, the device described has a profileName: `RandNum-Device`. In this case, the device informs EdgeX that it will be using the device profile we created in [Creating your Device Profile](./Ch-GettingStartedSDK-C.md#creating-your-device-profile) ## Configuring your Device Service diff --git a/docs_src/getting-started/Ch-GettingStartedSDK-Go.md b/docs_src/getting-started/Ch-GettingStartedSDK-Go.md index 17f12e91a..f50c4d5d3 100644 --- a/docs_src/getting-started/Ch-GettingStartedSDK-Go.md +++ b/docs_src/getting-started/Ch-GettingStartedSDK-Go.md @@ -192,9 +192,9 @@ Follow these steps to create a device profile for the simple random number gener ![image](EdgeX_SampleDeviceProfile_DeviceResources.png) -2. A pre-created device profile for the random number device is provided in this documentation. Download **[random-generator-device.yaml](random-generator-device.yaml)** and save the file to the `~/edgexfoundry/device-simple/cmd/device-simple/res/profiles` folder. +2. A pre-created device profile for the random number device is provided in this documentation. Download **[random-generator.yaml](random-generator.yaml)** and save the file to the `~/edgexfoundry/device-simple/cmd/device-simple/res/profiles` folder. -3. Open the random-generator-device.yaml file in a text editor. In this device profile, the device described has a deviceResource: `RandomNumber`. Note how the association of a type to the deviceResource. In this case, the device profile informs EdgeX that RandomNumber will be a INT32. In real world IoT situations, this deviceResource list could be extensive. Rather than a single deviceResource, you might find this section filled with many deviceResources and each deviceResource associated to a different type. +3. Open the random-generator.yaml file in a text editor. In this device profile, the device described has a deviceResource: `RandomNumber`. Note how the association of a type to the deviceResource. In this case, the device profile informs EdgeX that RandomNumber will be a INT32. In real world IoT situations, this deviceResource list could be extensive. Rather than a single deviceResource, you might find this section filled with many deviceResources and each deviceResource associated to a different type. ## Creating your Device @@ -204,9 +204,9 @@ Follow these steps to create a pre-defined device for the simple random number g 1. Explore the files in the cmd/device-simple/res/devices folder. Note the example simple-device.yaml that is already in this folder. Open the file with your favorite editor and explore its contents. Note how `DeviceList` in the file represent an actual device with its properties (properties like Name, ProfileName, AutoEvents). -2. A pre-created device for the random number device is provided in this documentation. Download **[random-generator-device.yaml](random-generator-device.yaml)** and save the file to the `~/edgexfoundry/device-simple/cmd/device-simple/res/devices` folder. +2. A pre-created device for the random number device is provided in this documentation. Download **[random-generator-devices.yaml](random-generator-devices.yaml)** and save the file to the `~/edgexfoundry/device-simple/cmd/device-simple/res/devices` folder. -3. Open the random-generator-device.yaml file in a text editor. In this example, the device described has a ProfileName: `RandNum-Device`. In this case, the device informs EdgeX that it will be using the device profile we created in [Creating your Device Profile](./Ch-GettingStartedSDK-Go.md#creating-your-device-profile) +3. Open the random-generator-devices.yaml file in a text editor. In this example, the device described has a ProfileName: `RandNum-Device`. In this case, the device informs EdgeX that it will be using the device profile we created in [Creating your Device Profile](./Ch-GettingStartedSDK-Go.md#creating-your-device-profile) ### Validating your Device diff --git a/docs_src/getting-started/random-generator-device.json b/docs_src/getting-started/random-generator-device.json deleted file mode 100644 index cb5c824ba..000000000 --- a/docs_src/getting-started/random-generator-device.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name":"RandNum-Device01", - "profileName":"RandNum-Device", - "description":"Random Number Generator Device", - "labels": ["test","random"], - "protocols": - { - "Other":{"Address":"random","Port":"300"} - }, - "autoEvents": - [ - {"interval":"10s","sourceName":"RandomNumber","onChange":false} - ] -} diff --git a/docs_src/getting-started/random-generator-devices.yaml b/docs_src/getting-started/random-generator-devices.yaml new file mode 100644 index 000000000..88861fafb --- /dev/null +++ b/docs_src/getting-started/random-generator-devices.yaml @@ -0,0 +1,15 @@ +deviceList: + - name: RandNum-Device01 + profileName: RandNum-Device + description: "Random Number Generator Device" + labels: + - test + - random + protocols: + other: + Address: random + Port: 300 + autoEvents: + - interval: 10s + sourceName: RandomNumber + onChange: false diff --git a/docs_src/getting-started/random-generator-device.yaml b/docs_src/getting-started/random-generator.yaml similarity index 81% rename from docs_src/getting-started/random-generator-device.yaml rename to docs_src/getting-started/random-generator.yaml index b915adf8c..a6fc50ed0 100644 --- a/docs_src/getting-started/random-generator-device.yaml +++ b/docs_src/getting-started/random-generator.yaml @@ -2,13 +2,11 @@ name: "RandNum-Device" manufacturer: "Dell Technologies" model: "1" labels: - - "random" - - "test" + - "random" + - "test" description: "random number generator to simulate a device" - deviceResources: - - - name: "RandomNumber" + - name: "RandomNumber" description: "generated random number" attributes: { type: "random" }