core-bluetooth

Create iOS BLE HID service?

微笑、不失礼 提交于 2019-12-01 01:28:24
问题 I tried to create a simple "Hello World" app implementing the HID service (i.e. my app acting as a simple HID button). However, when trying this I receive the error The specified UUID is not allowed for this operation after adding my service to my CBPeripheralManager instance. Adding any "generic" (random UUID) service works, and other builtins such as Heart Rate monitor works fine, but I was curious about the HID service in particular. I found this thread, indicating that support for HID has

Cannot find peripheral when scanning for specific service CBUUID

感情迁移 提交于 2019-12-01 00:34:02
When I use: CBUUID * uuid = [CBUUID UUIDWithString:@"1800"]; // GAP DEBUG_LOG(@"CBUUID: %@",uuid); // CBUUID: Generic Access Profile _centralMan = [[CBCentralManager alloc] initWithDelegate:self queue:nil]; [_centralMan scanForPeripheralsWithServices:[NSArray arrayWithObject:uuid] options:nil]; I cannot find my peripheral, but when I use: _centralMan = [[CBCentralManager alloc] initWithDelegate:self queue:nil]; [_centralMan scanForPeripheralsWithServices:nil options:nil]; …it shows up immediately. When I connect, I am able to discover/read/write to all the services I am expecting. My

The advertisement key 'Manufacturer Data' is not allowed in CoreBluetooth

主宰稳场 提交于 2019-12-01 00:11:24
问题 I am working with the core bluetooth framework . I am trying to create the peripheral using this framework . My peripheral advertise the data using : manager=[[CBPeripheralManager alloc]initWithDelegate:self queue:nil]; [manager startAdvertising:dictionary]; here the dictionary that I am passing for the advertisement is : NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: @"name", CBAdvertisementDataLocalNameKey,@"some other data",CBAdvertisementDataManufacturerDataKey

iOS CoreBluetooth not scanning for services in iPad Air

£可爱£侵袭症+ 提交于 2019-12-01 00:10:43
I'm working on a app that connects to a BLE peripheral and receives data from it. It scans for peripherals, finds a peripheral, discovers services, and if the right service is found, it receives data. It works great on an iPhone 5, but when I run it on an iPad Air it connects , but doesn't discover any services, and receives no data. Both devices run iOS 7.0.4 This is some of the relevant parts of the code - (void)startScan { [manager scanForPeripheralsWithServices:nil options:nil]; } - (void)stopScan { [manager stopScan]; } - (void)centralManager:(CBCentralManager *)central

Core Bluetooth State Restoration

为君一笑 提交于 2019-11-30 21:09:33
问题 I am working on an app that reacts on disconnects of peripherals and I am now trying to adopt the ne state preservation and restoration introduced in iOS 7. I did everything like the documentation says, means: I added the background mode for centrals. I always instantiate my central manager with the same unique identifier. I implemented the centralManager:willRestoreState: method. When my App moves to background I kill it in the AppDelegate callback with an kill(getpid(), SIGKILL); . (Core

CoreBluetooth repeatedly disconnecting

删除回忆录丶 提交于 2019-11-30 20:01:31
I've looked up and down for this problem, but no one seems to have it. I have two iPads. One is acting as a Bluetooth peripheral that is always in the foreground. Since I am more interested in the central side, I have made my central iPad background-capable for BLE-central. My workflow is as follows: Central app runs and starts scanning Peripheral advertises service (or comes within range) Central device connects to peripheral and stops scanning Peripheral stops advertisement (or leaves range) Central device disconnects and starts scanning Do steps 1-5 seamlessly whether the central is in the

iOS - CoreBluetooth didDiscoverPeripheral not being called

南楼画角 提交于 2019-11-30 19:46:38
问题 I have made a very simple iOS app in Xcode 6 to try out CoreBluetooth and communicate to my Polar H6 heart rate monitor. For some reason the didDiscoverPeripheral method is not being called. I have found the following similar questions on StackOverflow but thy are either a bit different or do not really answer it for me: corebluetooth-diddiscoverperipheral-not-being-called-in-swift not-working-call-to-centralmanager-diddiscoverperipheral-advertisementdata diddiscoverperipheral-delegate-method

Bluetooth LE Device scan in background from iOS

一世执手 提交于 2019-11-30 19:19:15
I am working on to scan BLE in Background mode. Issue is not working in Background scan. Its working very fine in Foreground mode. Below is few code lines. dispatch_queue_t centralQueue = dispatch_queue_create("com.XXXXX.BLEback", DISPATCH_QUEUE_SERIAL);// or however you want to create your dispatch_queue_t manager = [[CBCentralManager alloc] initWithDelegate:self queue:centralQueue options:nil]; - (void)centralManagerDidUpdateState:(CBCentralManager *)central { if (central.state == CBCentralManagerStatePoweredOn) { [self startScan]; } if (![self supportLEHardware]) { @throw ([NSError

CoreBluetooth device name change

时光怂恿深爱的人放手 提交于 2019-11-30 18:52:11
问题 I am currently creating a simple iOS bluetooth app. I currently have a device with the ability to modify the name. What I am finding is that when I connect to a CBPeripheral device, it seems to be caching the old device name. Connect to the device via my app. Disconnect from device via my app. Change the name of the device. Rediscover/reconnect to the device via my app (with an existing CBPeripheral object). By following the procedure above, I was expecting my iOS app to discover the new

Wake up ios app when a bluetooth device is near by

我与影子孤独终老i 提交于 2019-11-30 18:04:18
I am running core bluetooth in the background to scan for a device. It works fine, and pretty much stops when i QUIT the app manually. Apple docs state that the app can be woken up by the peripheral sometimes, and this may bring it from suspended state for about 10 seconds or so, do some operation and then go back to suspended. Source: https://developer.apple.com/library/IOs/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothBackgroundProcessingForIOSApps/PerformingTasksWhileYourAppIsInTheBackground.html For this to work, does the peripheral need to have already