Skip to content

Commit ed8712e

Browse files
authored
Merge pull request #99466 from baanders/Edits-Pnp-Quickstarts-MultiLanguage
PNP Multi-language Quickstarts - Edit
2 parents 03a6704 + 5dd765b commit ed8712e

File tree

2 files changed

+37
-30
lines changed

2 files changed

+37
-30
lines changed

articles/iot-pnp/quickstart-connect-pnp-device-java.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,7 @@ Run a sample application to simulate an IoT Plug and Play device that sends tele
7474
java -jar environmental-sensor-sample\target\environmental-sensor-sample-with-deps.jar
7575
```
7676

77-
You see the following output, indicating the device is now ready to receive commands and property updates, and has begun sending telemetry data to the hub.
78-
79-
![Device confirmation messages](media/quickstart-connect-pnp-device/device-confirmation-java.png)
80-
81-
Keep the sample running as you complete the next steps.
77+
You see messages saying that the device is connected, performing various setup steps, and waiting for service updates, followed by telemetry logs. This indicates that the device is now ready to receive commands and property updates, and has begun sending telemetry data to the hub. Keep the sample running as you complete the next steps.
8278

8379
## Use the Azure IoT explorer to validate the code
8480

articles/iot-pnp/quickstart-connect-pnp-device-solution-java.md

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,20 @@ In this quickstart, you use a sample environmental sensor that's written in Java
6262
java -jar environmental-sensor-sample\target\environmental-sensor-sample-with-deps.jar
6363
```
6464
65-
1. You see messages saying that the device is connected and waiting for service updates, followed by telemetry logs. This indicates that the device is now ready to receive commands and property updates, and has begun sending telemetry data to the hub. Keep the sample running as you complete the next steps. Don't close this terminal, you'll need it later to confirm the service samples also worked.
65+
1. You see messages saying that the device is connected, performing various setup steps, and waiting for service updates, followed by telemetry logs. This indicates that the device is now ready to receive commands and property updates, and has begun sending telemetry data to the hub. Keep the sample running as you complete the next steps. Don't close this terminal, you'll need it later to confirm the service samples also worked.
6666
6767
## Run the sample solution
6868
6969
In this quickstart, you use a sample IoT solution in Java to interact with the sample device.
7070
7171
1. Open another terminal window (this will be your _service_ terminal). Go to the folder of your cloned repository, and navigate to the **/azure-iot-samples-java\digital-twin\Samples\service\JdkSample** folder.
7272
73+
1. Install the required libraries and build the simulated device application by running the following command:
74+
75+
```cmd/sh
76+
mvn clean install -DskipTests
77+
```
78+
7379
1. Configure the _IoT hub connection string_ and _device ID_ to allow the service to connect to both of these:
7480
7581
```cmd/sh
@@ -79,7 +85,7 @@ In this quickstart, you use a sample IoT solution in Java to interact with the s
7985
8086
### Read a property
8187
82-
1. When you connected the _device_ in its terminal, you saw the following message indicating its online status. The `state` property, which is used to indicate whether or not the device is online, is _true_:
88+
1. When you connected the _device_ in its terminal, one of the output messages was the following message to indicate its online status. The `state` property, which is used to indicate whether or not the device is online, is _true_:
8389
8490
```cmd/sh
8591
State of environmental sensor was set to true
@@ -133,9 +139,7 @@ In this quickstart, you use a sample IoT solution in Java to interact with the s
133139
"desired": {
134140
"value": "42"
135141
}
136-
}
137-
}
138-
}
142+
},
139143
```
140144
141145
1. Go to your _device_ terminal, you see the device has received the update:
@@ -152,26 +156,33 @@ In this quickstart, you use a sample IoT solution in Java to interact with the s
152156
3. In the _service_ terminal output, under the `environmentalSensor` component, you see the updated brightness value has been reported. Note: it might take a while for the device to finish the update. You can repeat this step until the device has actually processed the property update.
153157
154158
```json
155-
"environmentalSensor": {
156-
"name": "environmentalSensor",
157-
"properties": {
158-
"brightness": {
159-
"reported": {
160-
"value": {
161-
"value": "42"
162-
},
163-
"desiredState": {
164-
"code": 200,
165-
"version": 2,
166-
"description": "OK"
167-
}
168-
},
169-
"desired": {
170-
"value": "42"
171-
}
159+
"environmentalSensor" : {
160+
"name" : "environmentalSensor",
161+
"properties" : {
162+
"brightness" : {
163+
"reported" : {
164+
"value" : {
165+
"value" : "42"
166+
},
167+
"desiredState" : {
168+
"code" : 200,
169+
"version" : 2,
170+
"description" : "OK"
172171
}
172+
},
173+
"desired" : {
174+
"value" : "42"
175+
}
176+
},
177+
"state" : {
178+
"reported" : {
179+
"value" : true,
180+
"desiredState" : null
181+
},
182+
"desired" : null
173183
}
174-
}
184+
}
185+
},
175186
```
176187
177188
### Invoke a command
@@ -193,14 +204,14 @@ In this quickstart, you use a sample IoT solution in Java to interact with the s
193204
194205
```cmd/sh
195206
Invoking blink on device <YourDeviceID> with interface instance name environmentalSensor
196-
Command invoked on the device successfully, the returned status was 500 and the request id was <some ID value>
207+
Command invoked on the device successfully, the returned status was 200 and the request id was <some ID value>
197208
The returned PAYLOAD was
198209
```
199210
200211
1. Go to the _device_ terminal, you see the command has been acknowledged:
201212
202213
```cmd/sh
203-
OnCommandReceived called: commandName=blink, requestId=5372ccd9-0636-4a34-83e5-685286cf3728, commandPayload="10"
214+
OnCommandReceived called: commandName=blink, requestId=<some ID value>, commandPayload="10"
204215
EnvironmentalSensor is blinking every 10 seconds.
205216
```
206217

0 commit comments

Comments
 (0)