TuyaSmartSIGMeshManager Class Reference

Inherits from NSObject
Declared in TuyaSmartSIGMeshManager.h

Other Methods

+ sharedInstance

+ (instancetype)sharedInstance

  isLogin

@property (nonatomic, assign, readonly) BOOL isLogin

  sigMesh

@property (nonatomic, strong) TuyaSmartBleMesh *sigMesh

  delegate

@property (nonatomic, weak) id<TuyaSmartSIGMeshManagerDelegate> delegate

  otaTargetNodeId

@property (nonatomic, copy) NSString *otaTargetNodeId

Activator Methods

– startScanWithScanType:meshModel:

开始扫描设备

- (void)startScanWithScanType:(TuyaSmartSIGScanType)scanType meshModel:(TuyaSmartBleMeshModel *)meshModel

Parameters

scanType

扫描类型,目前分为未配网和已配网,已配网扫描到结果会自动入网

meshModel

mesh model 信息

Discussion

开始扫描设备

Declared In

TuyaSmartSIGMeshManager+Activator.h

– startActive:meshModel:

开始激活设备

- (void)startActive:(NSArray<TuyaSmartSIGMeshDiscoverDeviceInfo*> *)devList meshModel:(TuyaSmartBleMeshModel *)meshModel

Parameters

devList

待激活设备列表

meshModel

mesh model 信息

Discussion

开始激活设备

Declared In

TuyaSmartSIGMeshManager+Activator.h

– stopActiveDevice

停止激活设备

- (void)stopActiveDevice

Discussion

停止激活设备

Declared In

TuyaSmartSIGMeshManager+Activator.h

Config Methods

– sendNodeResetWithDeviceModel:success:failure:

重置节点

- (void)sendNodeResetWithDeviceModel:(TuyaSmartDeviceModel *)deviceModel success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

deviceModel

节点地址

success

成功回调(- 目前通过代理回调,block 暂未实现)

failure

失败回调(- 目前通过代理回调,block 暂未实现)

Discussion

重置节点

Declared In

TuyaSmartSIGMeshManager+Config.h

– sendOnoffWithNodeId:state:useUnacknowledged:success:failure:

开关命令

- (void)sendOnoffWithNodeId:(NSString *)nodeId state:(BOOL)state useUnacknowledged:(BOOL)useUnacknowledged success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

nodeId

节点地址

state

开关状态

useUnacknowledged

是否需要回复,建议群组使用 no,单设备控制 yes

success

成功回调(- 目前通过代理回调,block 暂未实现)

failure

失败回调(- 目前通过代理回调,block 暂未实现)

Discussion

开关命令

Declared In

TuyaSmartSIGMeshManager+Config.h

– sendLightBrightWithNodeId:brightValue:useUnacknowledged:success:failure:

亮度命令

- (void)sendLightBrightWithNodeId:(NSString *)nodeId brightValue:(int)brightValue useUnacknowledged:(BOOL)useUnacknowledged success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

nodeId

节点地址

brightValue

亮度值,0 – 65535

useUnacknowledged

是否需要回复,建议群组使用 no,单设备控制 yes

success

成功回调(- 目前通过代理回调,block 暂未实现)

failure

失败回调(- 目前通过代理回调,block 暂未实现)

Discussion

亮度命令

Declared In

TuyaSmartSIGMeshManager+Config.h

– sendLightCTLTempeValueWithNodeId:tempValue:useUnacknowledged:success:failure:

冷暖控制

- (void)sendLightCTLTempeValueWithNodeId:(NSString *)nodeId tempValue:(int)tempValue useUnacknowledged:(BOOL)useUnacknowledged success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

nodeId

节点地址

tempValue

冷暖值 300 - 20000

useUnacknowledged

是否需要回复,建议群组使用 no,单设备控制 yes

success

成功回调(- 目前通过代理回调,block 暂未实现)

failure

失败回调(- 目前通过代理回调,block 暂未实现)

Discussion

冷暖控制

Declared In

TuyaSmartSIGMeshManager+Config.h

– sendLightHSLWithNodeId:hue:andSaturation:lightness:useUnacknowledged:success:failure:

HSL 颜色控制

- (void)sendLightHSLWithNodeId:(NSString *)nodeId hue:(int)aHue andSaturation:(int)aSaturation lightness:(int)aLightness useUnacknowledged:(BOOL)useUnacknowledged success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

nodeId

节点地址

aHue

色调 0 - 65535

aSaturation

饱和度 0 - 65535

aLightness

亮度 l or v,0 - 65535

useUnacknowledged

是否需要回复,建议群组使用 no,单设备控制 yes

success

成功回调(- 目前通过代理回调,block 暂未实现)

failure

失败回调(- 目前通过代理回调,block 暂未实现)

Discussion

HSL 颜色控制

Declared In

TuyaSmartSIGMeshManager+Config.h

– sendLightModelWithNodeId:lightModel:useUnacknowledged:success:failure:

设置模式

- (void)sendLightModelWithNodeId:(NSString *)nodeId lightModel:(int)alightModel useUnacknowledged:(BOOL)useUnacknowledged success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

nodeId

nodeId 节点地址

alightModel

0: 白光模式。 1: 彩光模式

useUnacknowledged

是否需要回复,建议群组使用 no,单设备控制 yes

success

成功回调(- 目前通过代理回调,block 暂未实现)

failure

失败回调(- 目前通过代理回调,block 暂未实现)

Discussion

设置模式

Declared In

TuyaSmartSIGMeshManager+Config.h

– sendVendorDataWithNodeId:vendorData:isQuery:useUnacknowledged:success:failure:

通用 vendor 协议

- (void)sendVendorDataWithNodeId:(NSString *)nodeId vendorData:(NSData *)vendorData isQuery:(BOOL)isisQuery useUnacknowledged:(BOOL)useUnacknowledged success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

nodeId

节点地址

vendorData

数据内容

isisQuery

是否为查询指令

useUnacknowledged

是否需要回复,建议群组使用 no,单设备控制 yes

success

成功回调(- 目前通过代理回调,block 暂未实现)

failure

失败回调(- 目前通过代理回调,block 暂未实现)

Discussion

通用 vendor 协议

Declared In

TuyaSmartSIGMeshManager+Config.h

– publishDpsWithNodeId:schemaArray:dps:pcc:useUnacknowledged:success:failure:

单设备下发消息

- (void)publishDpsWithNodeId:(NSString *)nodeId schemaArray:(NSArray<TuyaSmartSchemaModel*> *)schemaArray dps:(NSDictionary *)dps pcc:(NSString *)pcc useUnacknowledged:(BOOL)useUnacknowledged success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

nodeId

节点地址

schemaArray

dps 信息

dps

下发 dp

pcc

产品大小类标示

useUnacknowledged

是否需要消息回复

success

成功回调

failure

失败回调

Discussion

单设备下发消息

Declared In

TuyaSmartSIGMeshManager+Config.h

– getDeviceStatusWithDeviceModel:

获取某个设备的状态

- (void)getDeviceStatusWithDeviceModel:(TuyaSmartDeviceModel *)deviceModel

Parameters

deviceModel

设备 model

Discussion

获取某个设备的状态

Declared In

TuyaSmartSIGMeshManager+Config.h

– queryDpsWithDeviceModel:dpIds:

查询设备的 dps

- (void)queryDpsWithDeviceModel:(TuyaSmartDeviceModel *)deviceModel dpIds:(NSArray<NSString*> *)dpIds

Parameters

deviceModel

查询的设备

dpIds

要查询的 dp id 组

Discussion

查询设备的 dps

Declared In

TuyaSmartSIGMeshManager+Config.h

Group Methods

– addDeviceToGroupWithDevId:groupAddress:

把设备加入到群组

- (void)addDeviceToGroupWithDevId:(NSString *)devId groupAddress:(uint32_t)groupAddress

Parameters

devId

设备 id

groupAddress

群组地址

Discussion

把设备加入到群组

Declared In

TuyaSmartSIGMeshManager+Group.h

– deleteDeviceToGroupWithDevId:groupAddress:

把设备从群组内移除

- (void)deleteDeviceToGroupWithDevId:(NSString *)devId groupAddress:(uint32_t)groupAddress

Parameters

devId

设备 id

groupAddress

群组地址

Discussion

把设备从群组内移除

Declared In

TuyaSmartSIGMeshManager+Group.h

– queryGroupMemberWithGroupAddress:

通过群组地址查询群组中的设备

- (void)queryGroupMemberWithGroupAddress:(uint32_t)groupAddress

Parameters

groupAddress

群组地址

Discussion

通过群组地址查询群组中的设备

Declared In

TuyaSmartSIGMeshManager+Group.h

OTA Methods

– prepareForOTAWithTargetNodeId:

准备给目标设备升级

- (void)prepareForOTAWithTargetNodeId:(NSString *)targetNodeId

Parameters

targetNodeId

目标设备 nodeid

Discussion

准备给目标设备升级

Declared In

TuyaSmartSIGMeshManager+OTA.h

– startSendOTAPack:targetVersion:success:failure:

开始发送升级包

- (void)startSendOTAPack:(NSData *)data targetVersion:(NSString *)targetVersion success:(TYSuccessHandler)success failure:(TYFailureHandler)failure

Discussion

开始发送升级包

Declared In

TuyaSmartSIGMeshManager+OTA.h