core-bluetooth

IOS CoreBluetooth : App Running in Background When BLE is Disconnected

不打扰是莪最后的温柔 提交于 2019-12-04 15:32:55
I am trying to run my app in background when the BLE is disconnected.But system will kill the app after a period of time.So I read apple's document --《Core Bluetooth Programming Guide》。The last I found the following passage at “Core Bluetooth Background Processing for iOS Apps”。 “Performing Long-Term Actions in the Background Some apps may need to use the Core Bluetooth framework to perform long-term actions in the background. As an example, imagine you are developing a home security app for an iOS device that communicates with a door lock (equipped with Bluetooth low energy technology). The

Setting Notifications on Characteristic results in Invalid Handle error

一笑奈何 提交于 2019-12-04 14:55:16
问题 Using CoreBluetooth I want to send data from iPhone to Mac. For this I wrote code like iPhone as 'Peripheral' and Mac as 'Central'. It works perfectly, but sometimes it disconnects directly and then it continuously connects and disconnects. Some times when it is trying to reconnect, In Central it directly calls 'didDisconnectPeripheral' delegate method. But some times it has error "The handle is invalid" in 'didUpdateNotificationStateForCharacteristic'. I referred all the links in net. But I

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

Launching iOS BLE Central application on iPhone reboot

我是研究僧i 提交于 2019-12-04 14:19:29
I am planning to develop an iOS application using CoreBluetooth framework which monitors a pedometer peripheral continuously and counts the footsteps. I know that if backgroud execution mode is set to BLE Central, the application will continue to receive BLE events even in the background. Apple documentation states that in case the app gets terminated due to low memory, the system can keep track of BLE events for a particular Central Manager if state preservation and restoration is adopted. Assume I have an iOS application that operates in Central mode. The app is subscribed to receive

Bluetooth LE (4.0) How many centrals can connect to a peripheral?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 13:47:32
I'd like to know how many centrals a peripheral can simultaneously be connected to. My question is specific to iOS but I'd appreciate answers from everyone. A couple things: I'm aware that centrals, not peripherals, are designed to handle multiple connections. However I'd like to experiment with the opposite setup for various reasons. From the Bluetooth Core spec V4 - "The Peripheral role is optimized for devices that support a single connection and are less complex than central devices. Devices supporting the peripheral role only require Controllers that support the Controller’s slave role.

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 = [

iOS 8 CoreBluetooth deprecated RSSI methods

喜欢而已 提交于 2019-12-04 12:18:59
问题 So from reading the CBPeripheralDelegate documentation, it appears that RSSI and peripheralDidUpdateRSSI:error: were deprecated with iOS 8. I noticed that my signal strength indicator was no longer being updated, so I did some research and found a new method ( [CBPeripheralDelegate peripheral:didReadRSSI:error:] ) that supposedly get called back asynchronously after calling the readRSSI method. Unfortunately, this method does not seem to get called back either, even though I did set the

What profile can I use with CoreBluetooth?

百般思念 提交于 2019-12-04 12:17:21
I looking for informations about CoreBluetooth , I see iPhone4s/5 support Bluetooth 4.0 and Bluetooth LE . Also, according to this note , I can use these profiles : Hands-Free Profile (HFP 1.6) Phone Book Access Profile (PBAP) Advanced Audio Distribution Profile (A2DP) Audio/Video Remote Control Profile (AVRCP 1.4) Personal Area Network Profile (PAN) Human Interface Device Profile (HID) Message Access Profile (MAP) Can I have access to them using CoreBluetooth and, if so, how could I access to them ? You can't use any of the mentioned profiles if you want to communicate from the application.

CoreBluetooth and Wifi interference

你说的曾经没有我的故事 提交于 2019-12-04 12:15:30
I'm really stuck with a problem, thus, needless to say, I need your help. I'm using CoreBluetooth to communicate between two iDevices, it is the same app, running as a central on one device and as a peripheral on the other device. In some cases the central loses connection to the peripheral with the following error: Error Domain=CBErrorDomain Code=10 "The connection has failed unexpectedly." UserInfo=0x14ee8fe0 {NSLocalizedDescription=The connection has failed unexpectedly.} In this particular case, the peripheral was an iPad 4 and the central was an iPad mini. I tracked down the problem and

iOS Core Bluetooth state Preservation and Restoration issues

那年仲夏 提交于 2019-12-04 11:42:45
问题 I have a question regarding state Preservation and Restoration for Core Bluetooth on iOS 7. I can't seem to get it to work properly. I have followed every guidline that apple mentions in their documentation for core bluetooth as well as the general documentation for state preservation. For example here: Core Bluetooth Background Processing for iOS Apps and here: iOS State Preservation and Restoration I can get the general state preservation to work on the device (for view controllers and