CoreBluetooth蓝牙扫描协议问题
来源:互联网 发布:蚁群算法流程 编辑:程序博客网 时间:2024/06/03 11:32
ios蓝牙协议比较简单,实现一些常用的功能只需要调用相对的方法就会触发相应的协议,不过在ios8中调用扫描方法却无法触发相对应的协议,不知道为什么?
解决方法如下:
//开始扫瞄
-(void)scanForPer{
if (!TARGET_IPHONE_SIMULATOR) {
NSDictionary *options = [NSDictionary
dictionaryWithObject:[NSNumber numberWithBool:NO]
forKey:CBCentralManagerScanOptionAllowDuplicatesKey];
//ServicesUUIDs
[self.centralManager scanForPeripheralsWithServices:ServicesUUIDs options:options];
}
}
需要在此协议中再次调用一次才会执行
#pragma mark - ====== centralManager methods and delegate ======
- (void)centralManagerDidUpdateState:(CBCentralManager *)central{
switch (central.state) {//蓝牙状态的改变
case CBCentralManagerStatePoweredOn:{
[self scanForPer];
}
break;
default:
break;
}
}
- CoreBluetooth蓝牙扫描协议问题
- [蓝牙]CoreBluetooth
- 读书笔记---蓝牙(CoreBluetooth)
- iOS蓝牙CoreBluetooth介绍
- ios蓝牙开发(CoreBluetooth)
- 蓝牙 CoreBluetooth基本使用
- iOS蓝牙开发--CoreBluetooth
- iOS 蓝牙 Corebluetooth
- iOS 蓝牙入门CoreBluetooth
- iOS 蓝牙(CoreBluetooth)
- ios corebluetooth蓝牙4.0事例
- iOS蓝牙框架CoreBluetooth Framework
- iOS--蓝牙 ble4.0 CoreBluetooth
- ios 蓝牙4.0开发(CoreBlueTooth)
- iOS蓝牙框架CoreBluetooth应用
- ios蓝牙框架CoreBluetooth使用
- CoreBluetooth连接蓝牙健康设备
- iOS开发 CoreBluetooth 蓝牙4.0
- Android:onNewIntent()触发机制及注意事项
- Android_ViewStub
- Extjs5.0(2):手动搭建MVVM架构项目
- iPhone/iOS图片相关(读取、保存、绘制、其它相关)
- poj1984 带权并查集
- CoreBluetooth蓝牙扫描协议问题
- drawCircle方法:绘制圆形
- IOS 6 自动布局 入门-2
- IPhone之ASINetworkQueue 异步队列
- spring-boot rest 加jsp页面
- linux CFS调度策略源码解析
- 【leetcode 哈希表】Majority Element
- 异常org.hibernate.proxy.HibernateProxy.Forgot to register a type adapter
- 【比特科技】基础的重要性(程序员之路)-----摘自《程序员的自我修养》