SinoBLEInterface
三诺生物蓝牙血糖仪接入API
如何安装
1.使用CocoaPods安装
推荐使用这种安装方式。
step1:在Podfile中添加以下语句
pod 'SinoBLEInterface','~> 2.2.2'
step2:导入.h文件
#import "SinoSDK/SinoSDK.h"
2. 手动安装
不推荐。
step1: 添加SinoSDK.framework到工程中。
step2: 添加开源项目到工程中:
- FMDB v2.6.2
- LKDBHelper v2.4
- ProtocolBuffers v1.9.11
step3: 导入.h文件
#import "SinoSDK/SinoSDK.h"
如何使用
1. 设置代理和数据源
@interface MainViewController ()<SCBLEInterfaceDelegate, SCBLEInterfaceDataSource>
2. 初始化SDK配置
- (void)initSinoSDK {
[SCBleInterface sharedInterface].delegate = self;
[SCBleInterface sharedInterface].dataDelegate = self;
[SCBleInterface sharedInterface].deviceType = SC_BLE_DEVICE_TYPE_TRUE;
[[SCBleInterface sharedInterface] setAccessKey:self.accessKey secretKey:self.secretKey];
}
3.扫描
NSInteger rv = [[SCBleInterface sharedInterface] scan:8];
4.连接
NSInteger rv = [[SCBleInterface sharedInterface] connectedWithDevice:peripheral];
详细使用请查看SinoSDKDemo-v2.