Last Updated on : 2024-11-22 02:19:32download
API description
+ (void)getGatewayDeviceListWithSiteId:(long long)siteId
pageSize:(NSInteger)pageSize
startId:(NSInteger)startId
success:(ThingLockDeviceListSuccess)success
failure:(ThingFailureError)failure;
Parameters
Parameter | Description |
---|---|
pageNo | The page number. |
siteId | The site ID. |
pageSize | The number of items returned per page. |
startId | The pagination cursor. Pass 0 for the first request. On subsequent requests, its value is the lastId returned in the previous response. |
success | The success callback. |
failure | The failure callback. |
Example
[ThingResidenceSiteManager getGatewayDeviceListWithSiteId:siteId
pageSize:20
startId:self.lastIndex
success:^(NSArray<NSString *> * _Nullable deviceIdList, NSInteger lastIndex) {
} failure:^(NSError *error) {
}];
API description
+ (void)getSubDeviceListWithGatewayId:(NSString *)gatewayId
pageSize:(NSInteger)pageSize
startId:(NSInteger)startId
success:(ThingLockDeviceListSuccess)success
failure:(ThingFailureError)failure;
Parameters
Parameter | Description |
---|---|
gatewayId | The gateway ID. |
pageSize | The number of items returned per page. |
startId | The pagination cursor. Pass 0 for the first request. On subsequent requests, its value is the lastId returned in the previous response. |
success | The success callback. |
failure | The failure callback. |
Example
[ThingLockGateway getSubDeviceListWithGatewayId:self.devId
pageSize:20
startId:self.lastIndex
success:^(NSArray<NSString *> * _Nullable deviceIdList, NSInteger lastIndex) {
} failure:^(NSError *error) {
}];
API description
+ (void)getUnbinedDeviceListWithSiteId:(long long)siteId
pageSize:(NSInteger)pageSize
startId:(NSInteger)startId
success:(ThingLockDeviceListSuccess)success
failure:(ThingFailureError)failure;
Parameters
Parameter | Description |
---|---|
siteId | The site ID. |
pageSize | The number of items returned per page. |
startId | The pagination cursor. Pass 0 for the first request. On subsequent requests, its value is the lastId returned in the previous response. |
success | The success callback. |
failure | The failure callback. |
Example
[ThingLockGateway getUnbinedDeviceListWithSiteId:SiteManager.shared.siteId
pageSize:20
startId:self.lastIndex
success:^(NSArray<NSString *> * _Nullable deviceIdList, NSInteger lastIndex) {
} failure:^(NSError *error) {
}];
When the Bluetooth gateway is associating with a sub-device, this method returns the list of Bluetooth locks not yet bound with a gateway in the current site.
API description
+ (void)bindSubDeviceWithGatewayId:(NSString *)gatewayId
devIdList:(NSArray<NSString *> *)devIdList
success:(ThingSuccessID)success
failure:(ThingFailureError)failure;
Parameters
Parameter | Description |
---|---|
gatewayId | The gateway ID. |
devIdList | The list of device IDs to bind. |
success | The success callback. |
failure | The failure callback. |
Example
[ThingLockGateway bindSubDeviceWithGatewayId:self.devId
devIdList:@[devId]
success:^(id result) {
} failure:^(NSError *error) {
}];
API description
+ (void)unbindSubDeviceWithGatewayId:(NSString *)gatewayId
devIdList:(NSArray<NSString *> *)devIdList
success:(ThingSuccessID)success
failure:(ThingFailureError)failure;
Parameters
Parameter | Description |
---|---|
gatewayId | The gateway ID. |
devIdList | The list of device IDs to unbind. |
success | The success callback. |
failure | The failure callback. |
Example
[ThingLockGateway unbindSubDeviceWithGatewayId:self.devId
devIdList:@[devId]
success:^(id result) {
} failure:^(NSError *error) {
}];
API description
- (void)updateName:(NSString *)name
success:(nullable ThingSuccessHandler)success
failure:(nullable ThingFailureError)failure;
Parameters
Parameter | Description |
---|---|
name | The name of the gateway. |
success | The success callback. |
failure | The failure callback. |
Example
ThingSmartDevice *device = [ThingSmartDevice deviceWithDeviceId:self.devId];
[device updateName:newName success:^{
} failure:^(NSError *error) {
}];
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback