NB-IoT Device Pairing

Last Updated on : 2023-06-05 02:50:00download

This topic describes the mode of pairing a narrowband Internet of things (NB-IoT) device based on the low-power wide-area network (LPWAN) radio technology. NB-IoT connects IoT devices more simply and efficiently on already established mobile networks. Smart Life App SDK provides the capabilities to pair NB-IoT devices. Users scan the QR code of a target device to get the device ID used for pairing.

Query the device ID

Returns the device ID by using the API methods in Common API Methods. The URL obtained after the device QR code is scanned is used as a request parameter.

API description

Parameter Description
apiName thing.m.qrcode.parse
version 4.0

postData

Parameter Description
code The string of the QR code.

Example

ObjC:

[self.apiRequest requestWithApiName:@"thing.m.qrcode.parse" postData:@{@"code":url} version:@"4.0" success:^(id result) {

} failure:^(NSError *error) {

}];

Swift:

apiRequest .request(withApiName: "thing.m.qrcode.parse", postData: ["code":url], version: "4.0", success: {_ in

        }, failure: { (Error) in

        })

Start paring

API description

Parameter Description
apiName thing.m.nb.device.user.bind
version 1.0

postData

Parameter Description
hid The pairing token.
timeZone The time zone.

getData

Parameter Description
gid The ID of the home with which the device will be bound.

Example

ObjC:

[self.apiRequest requestWithApiName:@"thing.m.nb.device.user.bind" postData:@{@"hid":id,@"timeZone":timezone} getData:@{@"gid": @(homeId)} version:@"1.0" success:^(id result) {

} failure:^(NSError *error) {

}];

Swift:

apiRequest .request(withApiName: "thing.m.nb.device.user.bind", postData: ["hid":id,"timeZone":timezone], getData:["gid":homeId], version: "1.0", success: {_ in

	}, failure: { (Error) in

	})