cbcentralmanager

iOS stops waking up the app upon incoming BLE connection from peripheral

孤街醉人 提交于 2019-12-06 03:02:23
we have a BLE peripheral that connects to the phone every hour and passes some data. Here is how the process works: Upon launch with key UIApplicationLaunchOptionsBluetoothCentralsKey in application(didFinishLaunchingWithOptions launchOptions) app re-initializes CBCentralManager with ID that was passed to it. Then it goes through the regular restoration cycle and reads data off the BLE peripheral. Performs REST request to the service in the cloud. Assuming that app has been launched at least once after phone reboot everything works well for a few days (if app isnt running or been forced out of

A way to uniquely identify a BTLE device

▼魔方 西西 提交于 2019-12-05 07:25:01
Is there a way to uniquely identify a BTLE device (something like hardware ID)? I have 2 hardware BTLE devices and 2 soft BTLE devices (using CBCentralManager). All these devices are sending same UUID. I want to identify the exact BTLE device when all the devices are lying near me. Any clue? Tim Tisdall The devices should have unique Bluetooth addresses. If they don't then you wouldn't be able to properly connect to them without them interfering with each other. However, with BTLE it's possible for a device to have a randomized address for privacy (but those conform to a particular pattern so

Peripheral transmit queue issue

和自甴很熟 提交于 2019-12-04 14:28:13
I’m working on a simple wrapper around CoreBluetooth to send any data to any device. During developing I encountered a lot of bugs in framework, they were very annoying and to make my wrapper stable I had to shorten some of functionality for reliability. For now I’m working on sending data from peripheral. Ok, so I have following case: Client asks for value of dynamic characteristic I get a callback on server-side - peripheral:didReceiveReadRequest:. Note : I need to respond to this CBATTRequest in this method - I can’t store it elsewhere and respond to it asynchronously. (Im just putting some

centralManagerDidUpdateState returns power off iOS 11-Beta 4

喜夏-厌秋 提交于 2019-12-04 14:25:32
I'm working with CoreBluetooth and I'm using CBCentralManager and its delegates. But the problem is that when I run my code in iOS 11-Beta 4 I get power off state in delegate - (void)centralManagerDidUpdateState:(CBCentralManager *)central while bluetooth is ON. When I turn bluetooth off and then turn it back to on, it returns power on. Also it is working fine in iOS 10 and 9. The peripheral is working fine too and it is discoverable using LightBlue application in iOS 11-Beta 4. I'm not sure why it's happening. It looks like bug there, check the bug report here: https://bugreport.apple.com/web

CoreBluetooth Central --> Peripheral

痴心易碎 提交于 2019-12-04 13:24:37
I'm quite new to bluetooth communication. My first project intends to transfer data from an iOS device to a BLEshield (small chip). To test my central code, I decided to setup an iPhone as peripheral (the role the chip will have, once I got it) and an iPad as Central. I can connect the devices and also send data from the peripheral to the central. It's quite easy though: - (void)startService { _readChar = [[CBMutableCharacteristic alloc] initWithType:[CBUUID ...] properties:CBCharacteristicPropertyNotify value:nil permissions:CBAttributePermissionsReadable]; _writeChar = [

In iOS 10+, is there ANY way to RELIABLY wake up an app

半世苍凉 提交于 2019-12-04 04:56:17
问题 I have been at this over 3 months and pulling my hair out. So please don't respond with beginner answers. I am wondering if, in 2017 with iOS 10+, there is ANY way possible to wake up the app from terminated state... preferably by bluetooth peripheral... but i'll take what I can get! I consider terminated to be when user swiped the app in task manager or when the peripheral is turned on/off and the app was already dead I need important health related BT peripheral data (recorded by BT device)

Central writing characteristic to Peripheral (iOS Core Bluetooth)

不想你离开。 提交于 2019-12-03 09:10:09
Okay, so I've looked through a thousand tutorials and other Stack Overflow threads (so please don't list as duplicate without answering the question) and I cannot work out how to use this functionality. I have followed this tutorial: http://code.tutsplus.com/tutorials/ios-7-sdk-core-bluetooth-practical-lesson--mobile-20741 I have a system where a central can connect to a peripheral and read a characteristic from it. I am now trying to get my central to rewrite the data within the characteristic but am finding the write line that I have called just being ignored. I have declared my

iOS Apps that access the same BLE peripheral: How to distinguish?

我是研究僧i 提交于 2019-12-02 04:53:07
I have to following scenario: My app requests and receives data from an BLE peripheral (a glucometer). It it possible that the user has another app (from another developer) installed, that also communicates with the peripheral. I noticed that my app receives characteristic notifications for requests that where initiated by the other app. This causes my app to receive some data twice. Is there any way to distinguish between responses to my request and responses that are caused by another app? Or how can I handle it? While the stack obviously knows which app a certain (read, write) response

In iOS 10+, is there ANY way to RELIABLY wake up an app

守給你的承諾、 提交于 2019-12-01 23:00:15
I have been at this over 3 months and pulling my hair out. So please don't respond with beginner answers. I am wondering if, in 2017 with iOS 10+, there is ANY way possible to wake up the app from terminated state... preferably by bluetooth peripheral... but i'll take what I can get! I consider terminated to be when user swiped the app in task manager or when the peripheral is turned on/off and the app was already dead I need important health related BT peripheral data (recorded by BT device) maintained in the app so I need a consistent connection or the ability to wake the app back up and

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