BabyBluetooth v0.4.0 Release Notes

Release Date: 2015-10-26 // about 6 years ago
  • 0.4.0

    • 添加了一个demo ,可以作为蓝牙设备被发现、连接、读写、订阅
    • 项目支持cocoapods安装,并支持0.3.0 和 0.4.0两个版本
    • 增加了对获取RSSI的支持
    • 修改了wiki,对使用的每个方法增加了相关委托设置的说明
    • 修改了断开链接方法的委托

      //方法从 方法调用后的立刻回调 改为-》 方法执行后并且全部设备断开后的回调-(void)setBlockOnCancelAllPeripheralsConnectionBlock:(void()(CBCentralManager *centralManager))block;//删除了-(void)cancelPeripheralConnection:(CBPeripheral \*)peripheral;方法调用后的委托-(void)setBlockOnCancelPeripheralConnectionBlock:(void()(CBCentralManager *centralManager,CBPeripheral *peripheral))block; -(void)setBlockOnCancelPeripheralConnectionBlockAtChannel:(NSString *)channel block:(void()(CBCentralManager *centralManager,CBPeripheral *peripheral))block;//若想知道设备是否断开可以设置/*//断开Peripherals的连接的block-(void)setBlockOnDisconnect:(void ()(CBCentralManager *central,CBPeripheral *peripheral,NSError *error))block;//或//断开Peripherals的连接的block-(void)setBlockOnDisconnectAtChannel:(NSString *)channel block:(void ()(CBCentralManager *central,CBPeripheral *peripheral,NSError *error))block;*/

    • 添加了获取当前连接的peripheral的方法和获取centralManager的方法

      //获取当前连接的peripherals-(NSArray *)findConnectedPeripherals;//获取当前连接的peripheral-(CBPeripheral *)findConnectedPeripheral:(NSString *)peripheralName;//获取当前corebluetooth的centralManager对象-(CBCentralManager *)centralManager;

    • 增加了14个新的babybluetooth委托

      //写Characteristic成功后的block-(void)setBlockOnDidWriteValueForCharacteristic:(void ()(CBCharacteristic *characteristic,NSError *error))block;//写descriptor成功后的block-(void)setBlockOnDidWriteValueForDescriptor:(void ()(CBDescriptor *descriptor,NSError *error))block;//characteristic订阅状态改变的block-(void)setBlockOnDidUpdateNotificationStateForCharacteristic:(void ()(CBCharacteristic *characteristic,NSError *error))block;//读取RSSI的委托-(void)setBlockOnDidReadRSSI:(void ()(NSNumber *RSSI,NSError *error))block;//discoverIncludedServices的回调,暂时在babybluetooth中无作用-(void)setBlockOnDidDiscoverIncludedServicesForService:(void ()(CBService *service,NSError *error))block;//外设更新名字后的block-(void)setBlockOnDidUpdateName:(void ()(CBPeripheral *peripheral))block;//外设更新服务后的block-(void)setBlockOnDidModifyServices:(void ()(CBPeripheral *peripheral,NSArray *invalidatedServices))block;/*channel*///写Characteristic成功后的block-(void)setBlockOnDidWriteValueForCharacteristicAtChannel:(NSString *)channel block:(void ()(CBCharacteristic *characteristic,NSError *error))block;//写descriptor成功后的block-(void)setBlockOnDidWriteValueForDescriptorAtChannel:(NSString *)channel block:(void ()(CBDescriptor *descriptor,NSError *error))block;//characteristic订阅状态改变的block-(void)setBlockOnDidUpdateNotificationStateForCharacteristicAtChannel:(NSString *)channel block:(void ()(CBCharacteristic *characteristic,NSError *error))block;//读取RSSI的委托-(void)setBlockOnDidReadRSSIAtChannel:(NSString *)channel block:(void ()(NSNumber *RSSI,NSError *error))block;//discoverIncludedServices的回调,暂时在babybluetooth中无作用-(void)setBlockOnDidDiscoverIncludedServicesForServiceAtChannel:(NSString *)channel block:(void ()(CBService *service,NSError *error))block;//外设更新名字后的block-(void)setBlockOnDidUpdateNameAtChannel:(NSString *)channel block:(void ()(CBPeripheral *peripheral))block;//外设更新服务后的block-(void)setBlockOnDidModifyServicesAtChannel:(NSString *)channel block:(void ()(CBPeripheral *peripheral,NSArray *invalidatedServices))block;