core-bluetooth

iOS CoreBluetooth passively check if Bluetooth is enabled without prompting user to turn Bluetooth on

ε祈祈猫儿з 提交于 2019-11-27 14:24:59
The scenario is as follows. I have an already deployed app being used by people. I am considering implementing some experimental Bluetooth Low Energy features, but before I do, I want to conduct an "in the wild" survey of the number of users who already have Bluetooth turned on/leave Bluetooth on all the time. So, I would just like to check this in the background and send back to a server statistics on number of users with Bluetooth already on, without ever actually using Bluetooth communications. I have successfully instantiated a CBCentralManager in my app and can retrieve the Bluetooth

CoreBluetooth: What is the lifetime of unique UUIDs

风流意气都作罢 提交于 2019-11-27 13:44:52
Following off of this question, After connecting to a peripheral, I can retrieve its CFUUIDRef , which is unique, and can use it to reconnect via retrievePeripherals . However, I have found that I can not use it to reconnect after closing the application. Is the unique UUID generated after a connection only valid for the lifetime of the application or are we supposed to be able to save it for later use? I am trying to have my application remember one particular peripheral, but besides peripheral.UUID , I don't know of any other unique identifiers. Long story short, YES you can use the UUID to

How to detect nearby devices with Bluetooth LE in iOS 7.1 both in background and foreground?

僤鯓⒐⒋嵵緔 提交于 2019-11-27 11:40:48
问题 I have an app that needs to detect a nearby (in range for Bluetooth LE) devices running the same application and iOS 7.1. I've considered two alternatives for the detection: Having the devices act as iBeacons and detect iBeacons in range Using CoreBluetooth (like in Vicinity implementation here) to create a BLE peripheral, advertise that and scan the peripherals It seems that the option 1 is out of the question because: It may take at least 15 minutes for iOS to detect entering a beacon

Reading long characteristic values using CoreBluetooth

大憨熊 提交于 2019-11-27 11:23:41
I have a characteristic value which contains the data for an image. In the peripheral I setup the value like this: _photoUUID = [CBUUID UUIDWithString:bPhotoCharacteristicUUID]; _photoCharacteristic = [[CBMutableCharacteristic alloc] initWithType:_photoUUID properties:CBCharacteristicPropertyRead value:Nil permissions:CBAttributePermissionsReadable]; My understanding is that when this value is requested, the didRecieveRequest callback will be called: -(void) peripheralManager:(CBPeripheralManager *)peripheral didReceiveReadRequest:(CBATTRequest *)request { if ([request.characteristic.UUID

Communicating between iOS and Android with Bluetooth LE

假装没事ソ 提交于 2019-11-27 10:06:45
I've got a working app using CoreBluetooth to communicate between an iPad (central) and iPhone (peripheral). I have one service that has two characteristics. I have a Nexus 7 running the latest Android 4.3 with BTLE support. Android is a bit late to jump on the BTLE bandwagon but it appears they are approaching it similarly to how iOS did, where initially they only support acting as a central with the peripheral mode coming in a later version. I can load the sample Android BTLE app and browse for nearby peripherals. With my iPhone advertising as a peripheral I can see the value from

Why use coreBluetooth connectPeripheral did not call delegate methods in IOS8

隐身守侯 提交于 2019-11-27 06:49:39
问题 I want use CoreBluetooth.framework in IOS8 to achieve data transfer, i did discover peripheral in the follow method and try connect the peripheral. - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI { NSLog(@"Discover name : %@", peripheral.name); [self.centralManager connectPeripheral:peripheral options:nil]; } But it did not call the delegate methods

Core Bluetooth advertise and scan in the background

不想你离开。 提交于 2019-11-27 06:21:04
I have been trying to setup an app to make the device both scan for peripherals and advertise as a peripheral. The goal is for two devices to be woken up in the background when they become near each other via bluetooth discovery. From the Apple Documentation, it seems that you should be able to run BLE in the background (with bluetooth-central and bluetooth-peripheral background modes enabled), and my application works when one device is in the foreground. First, I advertise data like so: NSDictionary *advertisingData = @{CBAdvertisementDataLocalNameKey:@"my-peripheral",

Corebluetooth central manager callback didDiscoverPeripheral twice

痞子三分冷 提交于 2019-11-27 05:50:44
问题 I scan for my peripheral like this: NSDictionary *scanOptions = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:CBCentralManagerScanOptionAllowDuplicatesKey]; // Scan for peripherals with given UUID [cm scanForPeripheralsWithServices:[NSArray arrayWithObject:HeliController.serviceUUID] options:scanOptions] No problem there, I find the peripheral and are able to connect to it. As you can see I give it CBCentralManagerScanOptionAllowDuplicatesKey with bool NO to not allow

iBeacon in the background - Use cases

拜拜、爱过 提交于 2019-11-27 05:04:56
问题 The number of questions on SO related to iBeacon and its background capabilities is increasing and there is some confusion on that point. I have been testing the AirLocate project. iBeacon has 2 "capabilities": Region monitoring and Ranging. Region monitoring is limited to 20 regions and can function in the background (of the listening device) and has different delegates to notify listening app (and user) of entry/exit in the region - even if app is in the background or phone is locked.

how to find Bluetooth audio devices in iOS

谁说胖子不能爱 提交于 2019-11-27 03:42:05
Okay, I'm working on a fun project that has a hurdle where I need to enable Bluetooth audio support for my iOS app. The hurdle I'm at is that I simply can't even begin to get a list of connected Bluetooth audio devices. Even though my iPhone 5S recognizes my earpiece (a ~3 - 4 year old LG HBM-230 , to be precise) and plays audio through it for phone calls, BOTH External Accessory and CoreBluetooth are giving me nothing useful when I query both. I'm basing my own code off questions & answers I found for both the CoreBluetooth and External Accessory frameworks. When my code simply tries to "