Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
39 views3 pages

Summary: (/en/ict/) (/en/ict/)

The gateway manages sensors connected to its network by registering new sensors, updating their status, and handling online and offline messages. When a new sensor connects, the gateway registers it with the IoT platform using an SDK function that provides sensor details. The gateway also uses SDK functions to update the online/offline status of sensors. This allows the IoT platform to keep accurate records of active sensors.

Uploaded by

Pankaj Garg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views3 pages

Summary: (/en/ict/) (/en/ict/)

The gateway manages sensors connected to its network by registering new sensors, updating their status, and handling online and offline messages. When a new sensor connects, the gateway registers it with the IoT platform using an SDK function that provides sensor details. The gateway also uses SDK functions to update the online/offline status of sensors. This allows the IoT platform to keep accurate records of active sensors.

Uploaded by

Pankaj Garg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

10/17/2017 Sensor Management

(/en/ict/) (/en/ict/)

Home (/en/ict) IoT (/en/ict/Products/IoT2) Sensor Management (/en/ict/Products/IoT2/Gateway/SensorMgnt/SDK)

1. Summary
The gateway manages online and offline messages of sensors

2. The gateway registers a sensor


After detecting the access of a sensor, the gateway registers the sensor with Huawei IoT platform by invoking the sensor registration function
provided by the SDK.

Function prototype:

INT RiverAddSensor(CHAR *PhyId, CHAR *Name, CHAR *Type, CHAR *Manufacturer, CHAR *SubsId, CHAR *Location, CHAR *Status);

Parameter Description

Parameter Mandatory/Optional Type Description

PhyId Mandatory CHAR * Sensor ID, used to identify a sensor. The sensor ID
must be unique and can be set to the MAC address of
the sensor.

Name Optional CHAR * Sensor name

Type Mandatory CHAR * Sensor type

Manufacturer Optional CHAR * Sensor vendor

SubsId Optional CHAR * Sensor user ID

Location Optional CHAR * Sensor location

Status Optional CHAR * Sensor status

Execution Results

Field Description

OK Success

FAILED Failure

For example, if the gateway needs to register a smart lamp with the physical address 58bOK-35f7-6e65 in the IoT system, the following
function, of which the PhyId and Type fields are mandatory parameters and others are optional, is invoked:

RiverAddSensor("58bOK-35f7-6e65", "Out door light", "light", "huawei", "Alice", "Shenzhen", "normal");

3. The gateway updates the sensor status

http://developer.huawei.com/en/ict/Products/IoT2/Gateway/SensorMgnt/SDK 1/3
10/17/2017 Sensor Management
When the gateway detects that the sensor is inactive, for example, because no sensor battery is installed, the gateway invokes the
RiverUpdateSensor (CHAR *PhyId, CHAR *Data) interface to inform the SDK that the sensor is offline. After the gateway is restarted or the
sensor becomes online, the gateway invokes the RiverUpdateSensor interface to inform the SDK that the sensor is online.

Function prototype:

INT RiverUpdateSensor(CHAR *PhyId, CHAR *Data);

Parameter Description

Parameter Mandatory/Optional Type Description

PhyId Mandatory CHAR * Sensor ID.

Status Mandatory CHAR * Sensor status, online or offline.

Execution Results

Field Description

OK Success

FAILED Failure

For example, when an added smart lamp is offline, the following function is invoked:

RiverRmvSensor ("58bOK-35f7-6e65");

Quick Links
RemoteLab (http://developer.huawei.com/en/ict/remotelab)

Developer Tools (http://developer.huawei.com/en/ict/tool/)

Marketplace (http://developer.huawei.com/en/ict/marketplace/home/)

Training (http://developer.huawei.com/en/ict/training)

Information For
Enterprises (http://e.huawei.com/en/)

Carriers (http://carrier.huawei.com/en/)

Consumers (http://consumer.huawei.com/en/)

Friendship Links

Others
GitHub (https://github.com/esdk)

Contact Us (mailto:[email protected]?subject=I want to feedback. &body=Please drop your comments below: (Come from the page of
:http://developer.huawei.com/en/ict/Products/IoT2/Gateway/SensorMgnt/SDK))

Privacy (http://developer.huawei.com/en/ict/site-static/privacy) |
Terms of Use (http://developer.huawei.com/en/ict/site-static/terms_of_use)

http://developer.huawei.com/en/ict/Products/IoT2/Gateway/SensorMgnt/SDK 2/3
10/17/2017 Sensor Management

http://developer.huawei.com/en/ict/Products/IoT2/Gateway/SensorMgnt/SDK 3/3

You might also like