objective-c – 是否可以通过CoreBluetooth将iPhone4S连接到MBA
发布时间:2020-12-16 07:28:28 所属栏目:百科 来源:网络整理
导读:我正在尝试通过蓝牙在iOS和OSX之间发送/接收数据. 因为GameKit不支持OSX,所以我需要使用其他选项. iPhone4S和最新的Mac Book Air支持蓝牙4.0, 所以我认为可以在这些设备之间建立连接. 但我的下面的示例代码不起作用,需要你的帮助. 虽然我只是创建CBCentralMa
我正在尝试通过蓝牙在iOS和OSX之间发送/接收数据.
因为GameKit不支持OSX,所以我需要使用其他选项. 但我的下面的示例代码不起作用,需要你的帮助. - (void)start { self.mgr = [[[CBCentralManager alloc] initWithDelegate:self queue:nil] autorelease]; NSDictionary * opts = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES],CBCentralManagerScanOptionAllowDuplicatesKey,nil]; [self.mgr scanForPeripheralsWithServices:nil options:opts]; } - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI { // not called this delegate method... } 我的代码出了什么问题?我错过了什么吗? 解决方法
不,我担心CoreBluetooth仅适用于低能耗设备(手表,健康监视器等……) 使用此蓝牙配置文件无法将两个低能耗“主机”设备连接在一起.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |