version: v3.3.2
The TelinkSigMeshLib library allows to provision、keybind and send messages to Bluetooth Mesh devices.
Bluetooth Mesh specification may be found here: https://www.bluetooth.com/specifications/mesh-specifications/
The library is compatible with version 1.0.1 of the Bluetooth Mesh Profile Specification.
The sample application demonstrates how to use the library.
- GATT provisioning with no oob devices and static oob devices that available in Bluetooth Mesh Profile 1.0.1.
- Fast provisioning with no oob devices that avilable the telink private protocol.
- Normal keybind:connect node -> read servers -> open notify -> set filter -> get composition -> appkey add -> bind model to appkey.
- Fast keybind(Default Bound, node need avilable the telink private protocol):connect node -> read servers -> open notify -> set filter -> appkey add.
- Control node with unicastAddress and groupAddress:onoff,light,temperature,level,HSL.
- Setting and clearing publication to a Model.
- Setting and removing subscriptions to a Model.
- Add node to group and delete node from group.
- Add LPN node.
- GATT OTA: nodes need avilable the telink private protocol.
- Scheduler models.
- Scene models.
- Proxy Filter.
- Xcode 11.0 or newer.
- An iOS 9.0 or newer device with BLE capabilities.
- copy folder
TelinkSigMeshLib
to your project, thenLink Binary With Libraries
theTelinkSigMeshLib.framework
.
-
- Start SDK.
[SDKLibCommand startMeshSDK];
-
- Set SDK log level.
[SigLogger.share setSDKLogLevel:SigLogLevelDebug];
-
- GATT add nodes API1 (auto add)
- (void)startAddDeviceWithNextAddress:(UInt16)address networkKey:(NSData *)networkKey netkeyIndex:(UInt16)netkeyIndex appkeyModel:(SigAppkeyModel *)appkeyModel unicastAddress:(UInt16)unicastAddress uuid:(nullable NSData *)uuid keyBindType:(KeyBindTpye)type productID:(UInt16)productID cpsData:(nullable NSData *)cpsData isAutoAddNextDevice:(BOOL)isAuto provisionSuccess:(addDevice_prvisionSuccessCallBack)provisionSuccess provisionFail:(ErrorBlock)provisionFail keyBindSuccess:(addDevice_keyBindSuccessCallBack)keyBindSuccess keyBindFail:(ErrorBlock)keyBindFail finish:(AddDeviceFinishCallBack)finish;
-
- GATT add node API2 (single add)
- (void)startAddDeviceWithNextAddress:(UInt16)address networkKey:(NSData *)networkKey netkeyIndex:(UInt16)netkeyIndex appkeyModel:(SigAppkeyModel *)appkeyModel peripheral:(CBPeripheral *)peripheral provisionType:(ProvisionTpye)provisionType staticOOBData:(nullable NSData *)staticOOBData keyBindType:(KeyBindTpye)type productID:(UInt16)productID cpsData:(nullable NSData *)cpsData provisionSuccess:(addDevice_prvisionSuccessCallBack)provisionSuccess provisionFail:(ErrorBlock)provisionFail keyBindSuccess:(addDevice_keyBindSuccessCallBack)keyBindSuccess keyBindFail:(ErrorBlock)keyBindFail;
-
- GATT add node API3: simple api (single add)
- (void)startAddDeviceWithSigAddConfigModel:(SigAddConfigModel *)configModel provisionSuccess:(addDevice_prvisionSuccessCallBack)provisionSuccess provisionFail:(ErrorBlock)provisionFail keyBindSuccess:(addDevice_keyBindSuccessCallBack)keyBindSuccess keyBindFail:(ErrorBlock)keyBindFail;
-
- Add nodes by fast provision
- (void)startFastProvisionWithProvisionAddress:(UInt16)provisionAddress productId:(UInt16)productId compositionData:(NSData *)compositionData currentConnectedNodeIsUnprovisioned:(BOOL)unprovisioned addSingleDeviceSuccessCallback:(AddSingleDeviceSuccessOfFastProvisionCallBack)singleSuccess finish:(ErrorBlock)finish;
-
- Start connect mesh network(this api will retry connect action every 5 seconds unless connect success or call
stopMeshConnectWithComplete:
)
- Start connect mesh network(this api will retry connect action every 5 seconds unless connect success or call
- (void)startMeshConnectWithComplete:(nullable startMeshConnectResultBlock)complete;
-
- Stop connect mesh network
- (void)stopMeshConnectWithComplete:(nullable stopMeshConnectResultBlock)complete;
-
- Control node: OnOffSet(more control api in
SDKLibCommand
)
- Control node: OnOffSet(more control api in
+ (SigMessageHandle *)genericOnOffSetWithDestination:(UInt16)destination isOn:(BOOL)isOn retryCount:(NSInteger)retryCount responseMaxCount:(NSInteger)responseMaxCount ack:(BOOL)ack successCallback:(responseGenericOnOffStatusMessageBlock)successCallback resultCallback:(resultBlock)resultCallback;
-
- Send ini command API1(api reference c-lib SDK, iniData like "a3ff000000000200ffffc21102c4020100".)
+ (nullable NSError *)sendOpINIData:(NSData *)iniData successCallback:(responseAllMessageBlock)successCallback resultCallback:(resultBlock)resultCallback;
-
- Send ini command API2
+ (nullable NSError *)sendIniCommandModel:(IniCommandModel *)model successCallback:(responseAllMessageBlock)successCallback resultCallback:(resultBlock)resultCallback;
-
- Message's live from TelinkSigMeshLib(developer need set
SigMeshLib.share.delegateForDeveloper = self;
)
- Message's live from TelinkSigMeshLib(developer need set
12.1. APP did Receive Message from node.
- (void)didReceiveMessage:(SigMeshMessage *)message sentFromSource:(UInt16)source toDestination:(UInt16)destination;
12.2. APP did Send Message to node.
- (void)didSendMessage:(SigMeshMessage *)message fromLocalElement:(SigElementModel *)localElement toDestination:(UInt16)destination;
12.3. APP failed To Send Message.
- (void)failedToSendMessage:(SigMeshMessage *)message fromLocalElement:(SigElementModel *)localElement toDestination:(UInt16)destination error:(NSError *)error;
12.4. APP did Receive SigProxyConfiguration Message from node.
- (void)didReceiveSigProxyConfigurationMessage:(SigProxyConfigurationMessage *)message sentFromSource:(UInt16)source toDestination:(UInt16)destination;
SigMesh iOS SDK of Telink Semiconductor (Shanghai) Co., Ltd.