core-bluetooth

Bluetooth LE Device scan in background from iOS

老子叫甜甜 提交于 2019-12-18 22:31:50
问题 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 ==

CBCentralManager iOS10 and iOS9

痴心易碎 提交于 2019-12-18 21:18:05
问题 So I'm migrating to iOS10 but I also need my code to run on iOS9. I'm using CoreBluetooth and CBCentralManagerDelegate. I can get my code to work for iOS10 however I need the fallback to work for iOS9 as well. func centralManagerDidUpdateState(_ central: CBCentralManager) { if #available(iOS 10.0, *) { switch central.state{ case CBManagerState.unauthorized: print("This app is not authorised to use Bluetooth low energy") case CBManagerState.poweredOff: print("Bluetooth is currently powered off

How to read information from core bluetooth device

时光总嘲笑我的痴心妄想 提交于 2019-12-18 15:05:35
问题 I am working on an iOS core Bluetooth application, I am able to connect with the BLE device using iPad3. I am able to reach to the block didDiscoverServices , but unable to proceed from here. My questions are ; How can I read characteristic from Bluetooth device? How can I read other information of Bluetooth device? Help me on this or provide any suggestion. Thanks Wilhelmsen for reply. I got the following from the mentioned block : [0] - Service : <CBConcreteService: 0x1769a0> UUID: Generic

iOS Core Bluetooth : Getting API MISUSE Warning

可紊 提交于 2019-12-18 13:54:10
问题 I am writing a test app in iOS 7 with the Core Bluetooth API. When I am testing the application I found that I am getting the following warning message: TestBluetooth[626:60b] CoreBluetooth[API MISUSE] can only accept commands while in the powered on state Later I debugged app and found that, warning is coming from the following line of code: [manager scanForPeripheralsWithServices:array options:scanOptions]; So can anyone please tell me why I am getting this message in the console? There are

iPhone 4S - BLE data transfer speed

梦想与她 提交于 2019-12-18 13:37:07
问题 I've been tinkering around with the BLE (Bluetooth Low Energy) connectivity classes quiet a bit lately and haven't been able to make it transfer data any faster than 1KB / 5 seconds. I believe, in the documentation, it says the max speed is 60 bytes per 20 milliseconds. With data transfer and counting the Ack transfer after each set of packets, I believe we should be able to go as fast as 1.5KB per second. So my code is around 7-8 times slower than it should be. I'm just wondering if anyone

Not able to scan Through CBCentral Manager with service ID for iBecon Signal

独自空忆成欢 提交于 2019-12-18 09:09:10
问题 Working on iBecon signal using Core Bluetooth i am able to search with CBCentralManager scan optionn nil :- Shared.sharedInstance.centralManager?.scanForPeripherals(withServices: nil, options:[CBCentralManagerScanOptionAllowDuplicatesKey:true]) But when i provide my desirable service ID i.e :- Shared.sharedInstance.centralManager?.scanForPeripherals(withServices: [serviceID], options:[CBCentralManagerScanOptionAllowDuplicatesKey:true]) it never calls didDiscoverPeripheral Delegate method, I

iOS 6 - Bluetooth LE disconnect

你。 提交于 2019-12-18 04:52:45
问题 Ok what the heck is up with iOS6 and how it handles Bluetooth LE disconnections? Before the device would disconnect immediately but now, for some strange reason, the device waits to disconnect for about 30-60 seconds. I need it to disconnect ASAFP! I've been searing all over the internet trying to figure out how to initiate an immediate disconnection from the peripheral and I found this nifty email that explains a workaround is to unsubscribe from notifications on the service characteristics.

Obtaining Bluetooth LE scan response data with iOS

与世无争的帅哥 提交于 2019-12-17 19:25:06
问题 I am working with Bluetooth Low Energy devices, and I was wondering whether it is possible to read the Scan Response Data to an advertisement with iOS and Core Bluetooth without connecting. I understand that after reading an advertisement packet, you can request additional data from the peripheral in the format of a 31 byte scan response. I know that Core Bluetooth suggests that if the ad packet is full, you can put the local name in the scan response packet, but does it allow you to see the

iOS CoreBluetooth / iBeacon: Advertise an iBeacon and a peripheral service concurrently

天涯浪子 提交于 2019-12-17 18:39:56
问题 I'm writing an application for iOS that requires that the application advertise both an iOS iBeacon as well as advertise peripheral service concurrently. It's necessary that the service is advertised rather that simply discoverable on the peripheral because the use case requires the central (in BLE parlance) connect to the peripheral after being woken up by iOS (but still in the background) due to proximity to the iBeacon. Apps running in the background on centrals can only discover

Core Bluetooth State Preservation and Restoration Not Working, Can't relaunch app into background

和自甴很熟 提交于 2019-12-17 16:07:36
问题 I'm trying to make core bluetooth wake up the app even when it's not running. As Apple stated, "Because state preservation and restoration is built in to Core Bluetooth, your app can opt in to this feature to ask the system to preserve the state of your app’s central and peripheral managers and to continue performing certain Bluetooth-related tasks on their behalf, even when your app is no longer running. When one of these tasks completes, the system relaunches your app into the background