core-bluetooth

Bluetooth 4.0 Low Energy and iOS: How do I detect if device is bondable or not?

女生的网名这么多〃 提交于 2019-12-11 03:09:47
问题 Is it possible, using corebluetooth framework, to detect if peripheral is bondable? Should I implement the failed to connect to delegate? 回答1: There is nothing at this time. With later versions of BLE, bonding information (GAP modes) is in the GAP profile, but not one bit of that information is available to you via CoreBluetooth. With the exception of some advertising data and limited scan response data, It only provides GATT information and below. You could read any desired characteristic

Changing CBAdvertisementDataManufacturerDataKey from peripheral

北慕城南 提交于 2019-12-11 03:05:24
问题 Is there any way to modify CBAdvertisementDataManufacturerDataKey from CBPeripheralManager ? I understand I can get the CBAdvertisementDataManufacturerDataKey from CBCentralManager . The reason I want to do this is because I want the peripheral to advertise a 10-byte value without resorting to having the central connect to it, discover services, and then reading a characteristic which would contain the 10-byte value. 回答1: No, this is currently not possible as of iOS 7. The Manufacturer Data

How to detect if a iphone is connected to any bluetooth device or not?

拥有回忆 提交于 2019-12-11 02:44:50
问题 I came across this new API from iOS 7. - (NSArray *)retrieveConnectedPeripheralsWithServices:(NSArray *)serviceUUIDs NS_AVAILABLE(NA, 7_0); So its pretty clear that if the return array count is greater than 0 than its connected to atleast one device. But before using this API I am not able to figure it out the argument (serviceUUIDs) that I have to passed here. Can someone explain here with an example? 回答1: You can't use this method unless you know at least one service exposed by the device.

Exchange data b/w iOS devices using Bluetooth 4.0

对着背影说爱祢 提交于 2019-12-11 01:48:21
问题 I am looking into how to exchange data (information/files/etc.) between multiple iOS devices using Bluetooth 4.0. What frameworks are better to use to do that? Will Core Bluetooth do the work, or GameKit? Any help, tips, recommendations will be appreciated. 回答1: The CoreBluetooth framework will work for information/file exchange on iOS 6+ devices with Bluetooth 4.0 (iPhone 4s and 5, iPod Touch Gen 5, iPad Gen 3 and 4, iPad Mini). It has a range of about 50 meters and a data rate of about ~2

iOS RxSwift how to connect Core bluetooth to Rx sequences?

依然范特西╮ 提交于 2019-12-11 01:23:00
问题 I'm trying to create an observable sequence to indicate the status of Bluetooth on device. I'm using ReplaySubject<CBManagerState> , but am curious if there is something better, as I hear bad things about using onNext() What is the appropriate way to connect callback delegates to the RxSwift observable domain? class BluetoothStatusMonitor: NSObject, CBPeripheralManagerDelegate { let bluetoothStatusSequence = ReplaySubject<CBManagerState>.create(bufferSize: 1) var bluetoothPeripheralManager:

Why Is CoreBluetooth Discovering the Same Peripheral Again, and Again, and Again?

自作多情 提交于 2019-12-11 00:29:20
问题 I have reviewed similar questions on StackOverflow but they all deal with a second call to the CBManager delegate's didDiscover method as a result of scan response data being received. My scenario is different. I am sitting at my desk home. My app is running on an iPhone 6, iOS 10.2. My app starts a scan without specifying any service uuids (i.e. discover all peripherals). My app does not connect to any of the peripherals that are discovered. Five different peripherals are being discovered,

how can iOS app set the Core Bluetooth advertisement rate?

对着背影说爱祢 提交于 2019-12-10 20:00:08
问题 My iOS app running iPad is advertising too often, and subsequently seems to be spamming my embedded Bluetooth LE device, which is reading data out of ad from iPad. How can I slow down iPad rate of advertising? 回答1: Advertisement rate is not settable in Core Bluetooth. There is no public API that enables you to do it. While your application is in the foreground, the advertisement will be fast, and in the background it will be limited, most importantly rate throttled down, advertised services

Multiple CBPeripheral's for same device

社会主义新天地 提交于 2019-12-10 18:15:00
问题 When using the CoreBluetooth framework to access Bluetooth Low Energy devices, the CBCentralManager returns a CBPeripheral for the peripheral. Multiple services are available on the peripheral and I would like to split the code that handles characteristic value updates for the different services into multiple classes. Therefore, I would need to attach multiple id<CBPeripheralDelegate> delegates to the peripheral. However, this is not possible because only one delegate is supported. Is there a

CoreBluetooth never calls didDiscoverServices on iPhone5S

孤街浪徒 提交于 2019-12-10 15:15:08
问题 Most of the time, the app we are coding works quite well with our BLE peripheral. Often for iPhone 5S users the device gets in a funk and whenever we scan for services, the didDiscoverServices: delegate method is never called. Rebooting the device or deleting all settings (General -> Reset -> Reset all settings) fixes the problem temporarily. Once the device exhibits this problem, even other apps (eg. LightBlue) are affected; no peripherals are able to discover services until a reboot. For

How do you create a descriptor for a mutable characteristic?

旧时模样 提交于 2019-12-10 14:20:57
问题 The documentation for CBMutableDescriptor:initWithType:value: says to pass a "128-bit UUID that identifies the characteristic" for the type parameter. It then goes on to say you should only use one of CBUUIDCharacteristicUserDescriptionString or CBUUIDCharacteristicFormatString for the type parameter. Finally, there is no method to add a descriptor to a mutable characteristic. It appears that the parameter is doing two mutually exclusive things. On the one hand, it is being used to tell the O