Skip to content

Commit 54c6008

Browse files
committed
Update The Things Network sample
1 parent 6b67c67 commit 54c6008

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

articles/iot-central/core/howto-build-iotc-device-bridge.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,17 @@ function Decoder(bytes, port) {
266266
After you define the integration, add the following code before the call to `handleMessage` in line 21 of the *IoTCIntegration/index.js* file of your function app. This code translates the body of your HTTP integration to the expected format.
267267
268268
```javascript
269-
device: {
270-
deviceId: req.body.hardware_serial.toLowerCase()
271-
},
272-
measurements: req.body.payload_fields
269+
req.body = {
270+
device: {
271+
deviceId: req.body.end_device_ids.device_id.toLowerCase()
272+
},
273+
measurements: req.body.uplink_message.decoded_payload
273274
};
274275
```
275276
277+
> [!NOTE]
278+
> The previous snippet uses the human-friendly device ID. The Things Network message also includes a technical ID that you can access using `req.body.dev_eui.toLowerCase()`. To learn more, see [The Things Network - Data Formats](https://www.thethingsindustries.com/docs/reference/data-formats/).
279+
276280
## Limitations
277281
278282
The device bridge only forwards messages to IoT Central, and doesn't send messages back to devices. That's why, properties and commands don't work for devices that connect to IoT Central through this device bridge. Because device twin operations aren't supported, it's not possible to update device properties through the device bridge. To use these features, a device must connect directly to IoT Central using one of the [Azure IoT device SDKs](../../iot-hub/iot-hub-devguide-sdks.md).

0 commit comments

Comments
 (0)