core-bluetooth

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

谁说胖子不能爱 提交于 2019-12-06 07:46:42
问题 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.

Detect nearby mobile devices from an iOS app

我怕爱的太早我们不能终老 提交于 2019-12-06 07:40:19
Is it possible to create an iOS app which will scan for nearby mobile devices (eg. iPhone, Android, iPad etc), without needing to run any custom app on those nearby mobile devices? I have tried using CoreBluetooth like so, running on my iPhone 6+: [self.centralManager scanForPeripheralsWithServices:nil options:nil]; But the only nearby device it detects is my iMac, it will not detect my iPad Air 2, or my bluetooth earpiece. Am I doing something wrong? Core Bluetooth works only with Bluetooth Low Energy (a.k.a. Bluetooth 4.0) devices, not the classic Bluetooth ones. In order to be discoverable,

Launching iOS BLE Central application on iPhone reboot

青春壹個敷衍的年華 提交于 2019-12-06 06:45:16
问题 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.

iOS to Mac OS X [core] bluetooth data transfer

萝らか妹 提交于 2019-12-06 05:11:07
问题 My objective here is to create a connection between a device running iOS to a device running Mac OS X , via bluetooth. I know that I might be able to use CoreBluetooth for this but I don't understand how since I don't see a method to setup a service on the iOS device and broadcast it as an available service for a device running Mac OS X . In other words, I simply want to setup a connection to get the iOS device to send data to the Mac OS X device . Also, how would I go about to specify how to

Swift: Choose queue for Bluetooth Central manager

亡梦爱人 提交于 2019-12-06 04:39:08
问题 I'm working on the app that will connect with a smart device via BLE and communicate with it. The question is: In what queue is the best practice to handle bluetooth events? I've read a lot of tutorials and in all of them I found this: centralManager = CBCentralManager(delegate: self, queue: nil) They choose to handle bluetooth events in main queue ( queue: nil ), but I suppose that it's not good practice. Because it could be a lot of queries send to peripheral device from central and a lot

Is it possible to programmatically access the error codes logged by CoreBluetooth?

筅森魡賤 提交于 2019-12-06 02:41:50
问题 I am implementing a BLE central device on the iPhone, using as peripheral a custom BLE device developed (whose firmware has been written by a colleague). The peripheral for some operation will return a BLE error code, conforming to the standard Bluetooth ATT error codes as defined in BLE specifications. On the iPhone side, where I'm using the CoreBluetooth stack to develop the central device, I am notified of such errors on the debugger output window of xCode as: CoreBluetooth[WARNING]

BLE takes too much time while sending data from iOS 7.1 to iOS 8

左心房为你撑大大i 提交于 2019-12-06 01:54:01
问题 I have a strange issue. I am developing an app in which I am sending Chunks in 20-20 bytes. . Everything is working fine. When I am sending Bytes data from iOS 8 to iOS 8 device it take around 4-5 second to transfer from one device to another, but my problem is when I am sending Bytes data from iOs 7.1 to iOs 8 or reverse, It take around 17-20 seconds to transfer the data from one device to any device. Why it's taking too much time in iOS 7.1 to iOS 8 or reverse? 回答1: Try to look at some of

peripheral writeValue: forCharacteristic: type: return null error and value

六眼飞鱼酱① 提交于 2019-12-05 23:54:32
I am using the code below written by Apple. https://developer.apple.com/library/mac/samplecode/HeartRateMonitor/Listings/HeartRateMonitor_HeartRateMonitorAppDelegate_m.html#//apple_ref/doc/uid/DTS40011322-HeartRateMonitor_HeartRateMonitorAppDelegate_m-DontLinkElementID_4 Here is the writeValue section written by Apple if ([aChar.UUID isEqual:[CBUUID UUIDWithString:@"2A39"]]) { uint8_t val = 1; NSData* valData = [NSData dataWithBytes:(void*)&val length:sizeof(val)]; [aPeripheral writeValue:valData forCharacteristic:aChar type:CBCharacteristicWriteWithResponse]; } I added

iOS Detect Bluetooth connection/disconnection

帅比萌擦擦* 提交于 2019-12-05 21:35:37
问题 Is it possible to be notified when a Bluetooth Device is connected or disconnected from iOS even when my app is in background ? On Android, I use the ACTION_ACL_CONNECTED and ACTION_ACL_DISCONNECTED events. But I cannot find equivalents for iOS. I found the CBCentralManager that can be used to monitor Bluetooth events, but my functions aren't called when a bluetooth device is connected/disconnected, only when I enable/disable the bluetooth. Is it an error on my side or is it normal ? I also

Send Data from CentralManager to PeripheralManager using CoreBluetooth (BLE)

安稳与你 提交于 2019-12-05 20:49:52
I have my app running on two iOS device (both have 6.1.4) where one device acts as the Central and one acts as a Peripheral. I have been successful in getting notifications (characteristics set up to notify) from the Peripheral over to the Central just fine. However, I was wanting to write a value from the Central to the Peripheral to a specific writable characteristic but that always fails. The peripheral:didWriteValueForCharacteristic:error: delegate's method is immediately called where the error description says: "One or more parameters were invalid" I have been searching the net for any