• Home
  • Resources
    • User Guides
    • Concepts Articles
    • API References
    • Client Libraries & SDKs
    • Product Updates
  • FAQs
    • General
    • IoTConnect
      • Device Rules
      • Devices
      • Settings
      • Device Commands
      • Device Templates
      • Device Firmware
      • Device Onboarding
    • Security
  • Contact Us
  • Home
  • Resources
    • User Guides
    • Concepts Articles
    • API References
    • Client Libraries & SDKs
    • Product Updates
  • FAQs
    • General
    • IoTConnect
      • Device Rules
      • Devices
      • Settings
      • Device Commands
      • Device Templates
      • Device Firmware
      • Device Onboarding
    • Security
  • Contact Us

Client Libraries & SDKs

home/Documentation/Client Libraries & SDKs
  • Device SDK Reference
    • Overview
    • Device Authentication Options
    • Data Flow
    • Public Methods
      • Device Connection
      • Send Telemetry
      • Get Attributes
      • Send acknowledgment
      • Update Twin
    • SDKs (Message version 1.0)
      • DOT NET (C#)
      • Node.js
      • Java
      • Python
      • iOS
      • Android
      • Embedded
      • C language
      • Build Your Own SDK
      • Node-RED
        • IoTConnect Node-red 1.0.9
        • IoTConnect Node-red 1.0.8
      • Node-RED Subflow
        • Single Device
        • Multiple Device
    • SDKs (Message version 2.1)
      • Python
      • DOT NET (C#)
      • C language
        • IoTConnect Generic C SDK
          • Linux Build Instructions
          • Windows Build Instructions
      • Python 1.1
    • Code Samples
      • Node.js
        • TPM 3.1
        • Standard SDK 3.0
        • Standard
        • TPM
        • Standard SDK 3.0.1
        • Standard 2.0
      • Java
        • Standard
        • Standard 2.0
        • Standard 3.0
      • Python
        • Standard 2.0
        • TPM 2.1
        • Standard 3.0.1
        • Standard
        • TPM
          • TPM 3.0.1
        • TPM 3.0
        • Standard 3.0.2
        • Standard 3.0.3
        • Standard 3.0.4
        • Python SDK
      • iOS
        • ios1.0.1
      • C Language
        • nRF9160 DK
        • STM32L4
        • ESP32
        • Standard 3.0
        • Standard 2.0
        • Standard 3.1
      • Android
        • Standard 3.0
        • Standard 2.0.6
        • Standard 2.0.0
      • DOT NET (C#)
        • Standard
        • Standard 2.0
        • Standard 3.0
    • Device Message 1.0
      • D2C (Device to Cloud)
        • IoTConnect SDK
        • Custom SDK
      • C2D (Cloud to Device)
        • IoTConnect SDK
        • Custom SDK
      • Troubleshooting & Response codes
      • Know Your Essentials
    • Device Message 2.1
    • AWS Device Message 2.1
    • SDK Deep-diving
Download PDF

IoTConnect SDK

In this article
  • Device Telemetry
  • OTA Acknowledgement
  • Device Acknowledgement Command
  • Gateway Device Telemetry
  • Edge Device Telemetry
  • Edge Device Rule Match Telemetry
  • Twin Update Property

Device Telemetry Data

The following JSON format is used to send data from your SDK client to IoTConnect. In the below example, SDK sends data with temperature, humidity, weight, and gyroscope values from the device.

While sending telemetry data, your device can send a few or all sensor (Template attribute) values. It is not required always to send all sensor ( Template attributes) values.

[{
	"uniqueId": "<DEVICE UNIQUE ID>",
	"time": "2020-01-24T10:06:17.857Z", //Date format <YYYY-HH-MMTHH:RR:SS.mmmz>
	"data": {
		"temperature": 15.55,
		"humidity": 27.97,
		"weight": 36,
		"gyroscope": {
			"x": -1.2,
			"y": 0.25,
			"z": 1.1
		}
	}
}]

uniqueId: It is the device uniqueID
time: Current date and time with UTC timezone
data: Set JSON data with sensor name and value as per the device-generated data

Make sure you set all the required sensor names in the device template, as explained in the prerequisite step.

OTA Acknowledgement Command D2C

JSON payload for users who use our SDK to send Device acknowledgment commands D2C.

{
	"ackId": "<ACK GUID>",
	"st": "<7/4>",
	"msg": "OTA updated successfully.",
	"childId": null
}

ackId: You will receive the Acknowledgement ID from callbackMessage() method while receiving the command.
st: 7 – success, 4 – failed.
msg: Msg (optional). It is used for sending your custom message.
childId: ChildId (optional). It is used when you have a gateway template.

D2C Device Acknowledgement Command

JSON payload for users who use our SDK to send Device acknowledgment commands D2C.

{
	"ackId": "<ACK GUID>",
	"st": "<6/4>",
	"msg": "Device command received successfully.",
	"childId": null
}

ackId: You will receive the Acknowledgement ID from callbackMessage() method while receiving the command.
st: 6 – success, 4 – failed.
msg: Msg (optional). It is used for sending your custom message.
childId: ChildId (optional). It is used when you have a gateway template.

Gateway Device Telemetry D2C

JSON payload for users who use our SDK to send Device Telemetry D2C.

While sending telemetry data, your device can send a few or all sensor (Template attribute) values. It is not required always to send all sensor ( Template attributes) values.

[{
	"uniqueId": "<GATEWAY DEVICE UNIQUE ID>", // Gateway/Parent device Id
	"time": "2020-01-24T10:06:17.857Z", //Date format <YYYY-HH-MMTHH:RR:SS.mmmz>
	"data": {
		"Temperature": 10,
		"Humidity": 20
	}
},
{
	"uniqueId": "<CHILD DEVICE'S UNIQUE ID>", // Child ID associated with Gateway uniqueID
	"time": "2020-01-24T10:06:17.857Z", //Date format <YYYY-HH-MMTHH:RR:SS.mmmz>
	"data": {
		"Temperature": 30,
		"Gyroscope": {
			"x": 40,
			"y": 50,
			"z": 60
		}
	}
},
{
	"uniqueId": "<CHILD DEVICE'S UNIQUE ID>", // Child ID associated with Gateway uniqueID
	"time": "2020-01-24T10:06:17.857Z", //Date format <YYYY-HH-MMTHH:RR:SS.mmmz>
	"data": {
		"Temperature": 10,
		"Humidity": 20
	}
}]

Edge Device Telemetry Data

While sending telemetry data, your device can send a few or all sensor (Template attribute) values. It is not required always to send all sensor ( Template attributes) values.

With using SendData() method of IoTConnect SDK

[{
	"uniqueId": "<DEVICE UNIQUE ID>", // Edge device uniqueID
	"time": "2020-01-24T10:06:17.857Z", //Date format <YYYY-HH-MMTHH:RR:SS.mmmz>
	"data": {
		"Temperature": 10,
		"Humidity": 20,
		"Gyroscope": {
			"x": 30,
			"y": 40,
			"z": 50
		}
	}
}]

Edge Device Rules Match Telemetry

While sending telemetry data, your device can send a few or all sensor (Template attribute) values. It is not required always to send all sensor ( Template attributes) values.

{
	"cpId": "<COMPANY CPID>",
	"t": "2020-01-24T10:06:17.857Z", //Date format <YYYY-HH-MMTHH:RR:SS.mmmz>
	"mt": 3, // Message Type 3 - Rule Matched Data
	"dtg": "<DEVICE TEMPLATE GUID>",
	"sdk": {
		"l": "M_<LANGUAGE CODE>",
		"v": "2.0",
		"e": "<ENV>"
	},
	"d": [{
		"rg": "620164A4-A501-42D9-979D-D5C68436625A",
		"ct": "Temperature > 50",
		"cv": {
			"Temperature": 66
		},
		"sg": "B4E647B7-68FB-4E18-BBB2-B9C27EF11DBD",
		"d": [{
			"temp": "11",
			"humidity": "80",
			"Temperature": "66",
			"aaa": "red",
			"gyro": {
				"x": "1",
				"y": "-5",
				"z": "8"
			}
		}],
		"id": "<EDGE DEVICE UNIQUE ID>", // It is Edge Device unique ID 
		"dt": "2020-01-24T10:06:17.857Z", //Date format <YYYY-HH-MMTHH:RR:SS.mmmz>
		"tg": ""
	}]
}

cpId: Company code CPID. Get it from portal “Settings -> Key Vault” page.
dtg: Device Template GUID
sdk.l: SDK language code. You can refer in above example on same page.
sdk.e: This is the Environment of your solution
id: It is the Edge device’s uniqueID
rg: It is Rule GUID
ct: Rule Condition Text
cv: Evaluated Condition value
sg: Subscription GUID

Twin update property

{
	"Key" : "value" // e.g { "frm_version": 1.5 }
}

key: Twin desired property key
value: value associated with the desired property key.

Powered by Softweb – An Avnet Company.

Copyright ©2022 Avnet, Inc. All rights reserved.

Human Rights Privacy Terms of Use