ACBindManager Class Reference

Inherits from NSObject
Declared in ACBindManager.h

+ listDevicesWithCallback:

获取设备列表,不包含设备状态信息

+ (void)listDevicesWithCallback:(void ( ^ ) ( NSArray<ACUserDevice*> *devices , NSError *error ))callback

Parameters

callback

数组:devices保存的对象是ACUserDevice的对象

Discussion

单次最多返回100个设备信息

Declared In

ACBindManager.h

+ listDevicesFrom:limit:callback:

分页获取设备列表,不包含设备状态信息

+ (void)listDevicesFrom:(NSInteger)offset limit:(NSInteger)limit callback:(void ( ^ ) ( NSArray<ACUserDevice*> *devices , NSError *error ))callback

Parameters

offset

查询起始点偏移量

limit

返回设备的数量

callback

数组:devices保存的对象是ACUserDevice的对象

Discussion

此接口不会缓存设备的信息因此调用此接口后局域网无法通信

Declared In

ACBindManager.h

+ listDevicesWithStatusCallback:

获取设备列表,包含设备在线状态信息

+ (void)listDevicesWithStatusCallback:(void ( ^ ) ( NSArray<ACUserDevice*> *devices , NSError *error ))callback

Parameters

callback

数组:devices保存的对象是ACUserDevice的对象

Discussion

单次最多返回100个设备信息

Declared In

ACBindManager.h

+ listDevicesWithStatusFrom:limit:callback:

分页获取设备列表,包含设备在线状态信息

+ (void)listDevicesWithStatusFrom:(NSInteger)offset limit:(NSInteger)limit callback:(void ( ^ ) ( NSArray<ACUserDevice*> *devices , NSError *error ))callback

Parameters

offset

查询起始点偏移量

limit

返回设备的数量

callback

数组:devices保存的对象是ACUserDevice的对象

Discussion

此接口不会缓存设备的信息因此调用此接口后局域网无法通信

Declared In

ACBindManager.h

+ getDeviceCountInSubDomain:callback:

获取用户绑定设备的总数

+ (void)getDeviceCountInSubDomain:(NSString *)subDomain callback:(void ( ^ ) ( NSInteger count , NSError *error ))callback

Parameters

subDomain

子域

callback

结果回调

Discussion

可以通过ACProductManager当中的接口获取产品相关信息

Declared In

ACBindManager.h

+ listUsersWithSubDomain:deviceId:calllback:

获取用户列表

+ (void)listUsersWithSubDomain:(NSString *)subDomain deviceId:(NSInteger)deviceId calllback:(void ( ^ ) ( NSArray *users , NSError *error ))callback

Parameters

deviceId

设备唯一标识

callback

数组:users保存的对象是ACBindUser的对象

Declared In

ACBindManager.h

+ bindDeviceWithSubDomain:physicalDeviceId:name:callback:

绑定设备

+ (void)bindDeviceWithSubDomain:(NSString *)subDomain physicalDeviceId:(NSString *)physicalDeviceId name:(NSString *)name callback:(void ( ^ ) ( ACUserDevice *userDevice , NSError *error ))callback

Parameters

physicalDeviceId

设备物理ID

name

设备名称

callback

回调 deviceId 设备的逻辑Id

Declared In

ACBindManager.h

+ setDeviceProfileWithSubDomain:deviceId:profile:callback:

修改设备扩展属性

+ (void)setDeviceProfileWithSubDomain:(NSString *)subDomain deviceId:(NSInteger)deviceId profile:(ACObject *)profile callback:(void ( ^ ) ( NSError *error ))callback

Declared In

ACBindManager.h

+ getDeviceProfileWithSubDomain:deviceId:callback:

获取设备扩展属性

+ (void)getDeviceProfileWithSubDomain:(NSString *)subDomain deviceId:(NSInteger)deviceId callback:(void ( ^ ) ( ACObject *profile , NSError *error ))callback

Declared In

ACBindManager.h

+ bindDeviceWithShareCode:callback:

根据分享码 绑定设备

+ (void)bindDeviceWithShareCode:(NSString *)shareCode callback:(void ( ^ ) ( ACUserDevice *userDevice , NSError *error ))callback

Parameters

shareCode

分享码

callback

回调 ACUserDevice 设备的对象

Declared In

ACBindManager.h

+ bindDeviceWithUserSubdomain:deviceId:account:callback:

根据账户绑定设备

+ (void)bindDeviceWithUserSubdomain:(NSString *)subDomain deviceId:(NSInteger)deviceId account:(NSString *)account callback:(void ( ^ ) ( NSError *error ))callback

Parameters

subDomain

子域

deviceId

设备ID

phone

电话号码

Declared In

ACBindManager.h

+ unbindDeviceWithSubDomain:deviceId:callback:

解绑设备

+ (void)unbindDeviceWithSubDomain:(NSString *)subDomain deviceId:(NSInteger)deviceId callback:(void ( ^ ) ( NSError *error ))callback

Parameters

subDomain

子域名称

deviceId

设备唯一标识

Declared In

ACBindManager.h

+ unbindDeviceWithUserSubDomain:userId:deviceId:callback:

管理员取消 某个用户的绑定 (管理员接口)

+ (void)unbindDeviceWithUserSubDomain:(NSString *)subDomain userId:(NSInteger)userId deviceId:(NSInteger)deviceId callback:(void ( ^ ) ( NSError *error ))callback

Parameters

subDomain

子域

userId

用户ID

deviceId

设备逻辑ID

callback

回调

Declared In

ACBindManager.h

+ changeOwnerWithSubDomain:deviceId:userId:callback:

设备管理员权限转让 (管理员接口)

+ (void)changeOwnerWithSubDomain:(NSString *)subDomain deviceId:(NSInteger)deviceId userId:(NSInteger)userId callback:(void ( ^ ) ( NSError *error ))callback

Parameters

subDomain

子域名称

deviceId

设备逻辑ID

userId

新的管理员ID

Declared In

ACBindManager.h

+ changeDeviceWithSubDomain:physicalDeviceId:deviceId:callback:

更换物理设备 (管理员接口)

+ (void)changeDeviceWithSubDomain:(NSString *)subDomain physicalDeviceId:(NSString *)physicalDeviceId deviceId:(NSInteger)deviceId callback:(void ( ^ ) ( NSError *error ))callback

Parameters

subDomain

子域名称

physicalDeviceId

设备物理ID

deviceId

设备逻辑ID

Declared In

ACBindManager.h

+ changNameWithSubDomain:deviceId:name:callback:

修改设备名称 (管理员接口)

+ (void)changNameWithSubDomain:(NSString *)subDomain deviceId:(NSInteger)deviceId name:(NSString *)name callback:(void ( ^ ) ( NSError *error ))callback

Parameters

subDomain

子域名称

deviceId

设备逻辑ID

name

设备的新名称

Declared In

ACBindManager.h

+ fetchShareCodeWithSubDomain:deviceId:timeout:callback:

获取分享码 (管理员接口)

+ (void)fetchShareCodeWithSubDomain:(NSString *)subDomain deviceId:(NSInteger)deviceId timeout:(NSTimeInterval)timeout callback:(void ( ^ ) ( NSString *shareCode , NSError *error ))callback

Parameters

subDomain

子域名称

deviceId

设备唯一标识

timeout

超时时间(秒)

callback

shareCode 分享码

Discussion

若已存在未过期二维码则返回原有二维码并更新timeout时间,若原有二维码已过期则返回新的二维码

Declared In

ACBindManager.h

+ regenerateShareCodeWithSubDomain:deviceId:timeout:callback:

获取分享码 (管理员接口)

+ (void)regenerateShareCodeWithSubDomain:(NSString *)subDomain deviceId:(NSInteger)deviceId timeout:(NSTimeInterval)timeout callback:(void ( ^ ) ( NSString *shareCode , NSError *error ))callback

Parameters

subDomain

子域名称

deviceId

设备唯一标识

timeout

超时时间(秒)

callback

shareCode 分享码

Discussion

此接口会强制删除其他已生成的二维码,并返回新的二维码

Declared In

ACBindManager.h

+ isDeviceBoundsWithSubDomain:physicalDeviceId:callback:

查询设备绑定状态

+ (void)isDeviceBoundsWithSubDomain:(NSString *)subDomain physicalDeviceId:(NSString *)physicalDeviceId callback:(void ( ^ ) ( BOOL isBounded , NSError *error ))callback

Parameters

subDomain

子域名称

physicalDeviceId

物理id

callback

是否被绑定

Declared In

ACBindManager.h

+ isDeviceOnlineWithSubDomain:deviceId:physicalDeviceId:callback:

查询设备在线状态

+ (void)isDeviceOnlineWithSubDomain:(NSString *)subDomain deviceId:(NSInteger)deviceId physicalDeviceId:(NSString *)physicalDeviceId callback:(void ( ^ ) ( Boolean online , NSError *error ))callback

Parameters

subDomain

子域名称

deviceId

设备逻辑ID

physicalDeviceId

物理id

callback

online 是否在线

Declared In

ACBindManager.h

+ sendToDeviceWithOption:SubDomain:physicalDeviceId:msg:callback:

向设备发送消息

+ (void)sendToDeviceWithOption:(ACDeviceCommunicationOption)option SubDomain:(NSString *)subDomain physicalDeviceId:(NSString *)physicalDeviceId msg:(ACDeviceMsg *)msg callback:(void ( ^ ) ( ACDeviceMsg *responseMsg , NSError *error ))callback

Parameters

option

与设备交互的方式 1:仅通过局域网 2:仅通过云 3:通过云优先 4:通过局域网优先

subDomain

子域名

physicalDeviceId

设备物理ID

msg

发送的消息

callback

返回结果的监听

Declared In

ACBindManager.h

+ networkChangeHanderWithTimeout:SubDomainId:Callback:

监听网络变化并且更新设备信息

+ (void)networkChangeHanderWithTimeout:(NSInteger)timeout SubDomainId:(NSInteger)subDomainId Callback:(void ( ^ ) ( NSArray *deviceArray , NSError *error ))callback

Parameters

timeout

超时时间

subDomainId

子域ID

callback

返回结果的回调

Declared In

ACBindManager.h

+ updateAccessKeyWithSubDomain:deviceId:callback:

更新设备的密钥accessKey

+ (void)updateAccessKeyWithSubDomain:(NSString *)subDomain deviceId:(NSInteger)deviceId callback:(void ( ^ ) ( NSError *error ))callback

Parameters

subDomain

子域名,如djj(豆浆机)

deviceId

设备id(这里的id,是调用list接口返回的id,不是制造商提供的id)

callback

返回结果的监听回调

Declared In

ACBindManager.h

+ sendToDeviceWithOption:SubDomain:deviceId:msg:callback:

向设备发送消息

+ (void)sendToDeviceWithOption:(int)option SubDomain:(NSString *)subDomain deviceId:(NSInteger)deviceId msg:(ACDeviceMsg *)msg callback:(void ( ^ ) ( ACDeviceMsg *responseMsg , NSError *error ))callback

Parameters

option

与设备交互的方式 1:仅通过局域网 2:仅通过云 3:通过云优先 4:通过局域网优先

subDomain

子域名

deviceId

设备Id

msg

发送的消息

callback

返回结果的监听

Declared In

ACBindManager.h

+ getShareCodeWithSubDomain:deviceId:timeout:callback:

  • 获取分享码 (管理员接口)
+ (void)getShareCodeWithSubDomain:(NSString *)subDomain deviceId:(NSInteger)deviceId timeout:(NSTimeInterval)timeout callback:(void ( ^ ) ( NSString *shareCode , NSError *error ))callback

Discussion

  • @param subDomain 子域名称
  • @param deviceId 设备唯一标识
  • @param timeout 超时时间(秒)
  • @param callback shareCode 分享码

Declared In

ACBindManager.h