core-bluetooth

App don't discover services when reconnecting after power cycling bluetooth

跟風遠走 提交于 2019-12-07 11:36:23
问题 When I am toggling bluetooth while connected to a CoreBluetooth peripheral I do a disconnection and deletion of all references to my peripheral in the centralManagerDidUpdateState callback. Doing another scan will find and reconnect to the device and again issue a discoverServices , but this time around the callback didDiscoverServices never happens. By deleting all settings (General -> Reset -> Reset all settings) or do a reboot it works again. Disconnect/reconnect as normal does also work.

CBPeripheralManager connection callback

烈酒焚心 提交于 2019-12-07 08:25:09
问题 I'm trying to set up a bluetooth connection between two iOS devices. The idea is that one device offers a service and multiple devices connect to it: Device A (service): User slides through a presentation Device B (multiple clients): User watches the presentation, no interaction In my understanding the one which offers the service should advertise it and respectively be the peripheral by creating a CBPeripheralManager and implement the CBPeripheralManagerDelegate -> Device A On the other side

scanForPeripheralsWithServices:options: unable to connect when specifying services

对着背影说爱祢 提交于 2019-12-07 06:10:44
问题 When using scanForPeripheralsWithServices:options, I'm able to discover a service when using // Scanning with nil services will return all devices. NSLog(@"Looking for any service."); [self.centralManager scanForPeripheralsWithServices:nil options:nil]; however when specifying the service in advance using the service identifier obtained from the Bluetooth device via the code below, I'm unable to discover the device. #define DEVICE_INFO_SERVICE_UUID @"180a" NSArray *services = [NSArray

BLE MTU higher but speed is the same

為{幸葍}努か 提交于 2019-12-07 05:49:24
问题 I'm playing around with CoreBluetooth in iOS 7, and have successfully got two devices sending quite a large amount of data between each other (one is the central, one is the peripheral). Between an iPhone 5 and 4S I had an MTU of 20 bytes, and between an iPhone 5s and iPhone 5 I had an MTU of 132 bytes. The size is much larger, so I assumed fewer individual messages would be sent and therefore the overall time of the transfer would decrease. Unfortunately the time remains pretty much the same

iOS CoreBluetooth: startAdvertising() Error advertising static data

僤鯓⒐⒋嵵緔 提交于 2019-12-07 04:57:33
问题 I want to advertise static data. I'm using Swift 2.2.1 and CoreBluetooth on iOS. My app builds bluetooth Services and their corresponding Characteristics , then calls startAdvertising() , and the peripheralManagerDidStartAdvertising90 callback returns this error: peripheralManagerDidStartAdvertising encountered an error. // Mine One or more parameters were invalid. // ...from Apple CoreBluetooth nil // ... return value from Apple CoreBluetooth callback I'm relatively new to Swift and iOS

Swift 3: Can't connect to peripheral via BLE

谁都会走 提交于 2019-12-07 03:06:15
问题 I'm new to working with BLE, currently trying to make a simple application which would connect to my custom BLE device. I am able to discover the BLE device, but for some reason i can't connect to it. I tried to check it with 'Light Blue', it shows my device as connectable and seems to work fine. But in my app after i discover the device, CB manager tries to connect to it and seems to 'freeze'? Function 'didConnect peripheral' is never triggered, and state of peripheral is forever 'connecting

Subscribing for notifications from a CBCharacteristic does not work

限于喜欢 提交于 2019-12-07 01:37:14
问题 First things first: running OSX 10.10.4, iOS 4, Xcode 6.3.2, iPhone 6, Swift Short story: I have a certain Bluetooth LE device here from which I want to receive notifications when values of a Characteristic change, e.g. by user input. Trying to subscribe to it does not succeed, but rather yields an error Error Domain=CBATTErrorDomain Code=10 "The attribute could not be found." Long story: So, I have a BluetoothManager class in which I start scanning for Peripherals as soon as my

iOS Bluetooth peripheralManagerDidUpdateState never called

爱⌒轻易说出口 提交于 2019-12-06 21:23:34
I'm trying to set up my iPhone to act as a heart rate monitor and send information using the standard heart rate service so that the app I have running on my PC can retrieve the data. I'm a newbie to iOS but I have got bluetooth stuff running on Android and Windows before. I'm following the information here and I'm falling at the first hurdle... As specified in the doc, I first call CBPeripheralManager *myPeripheralManager = [[CBPeripheralManager alloc] initWithDelegate:(id<CBPeripheralManagerDelegate>)self queue:nil options:nil]; I also implement the peripheralManagerDidUpdateState callback

How long is a CBPeripheral's stored UUID valid for reconnection? [duplicate]

拥有回忆 提交于 2019-12-06 16:27:53
This question already has an answer here : CoreBluetooth: What is the lifetime of unique UUIDs (1 answer) Closed 5 years ago . I've been playing with Corebluetooth and I've learnt that besides going through the tedious process of scanning for a peripheral every time I want to connect, I can also store the peripheral's UUID and use it with retrievePeripheralsWithIdentifiers and connectPeripheral for further reconnections. Turns out that it only works for a certain amount of time, apparently the peripheral has its UUID updated, therefore the stored one can be considered expired. I haven't been

How to transfer a data in Binary form via Bluetooth in iPhone App

主宰稳场 提交于 2019-12-06 14:21:45
问题 I am developing a device driver software for iOS and mac. In this I want to transfer a Number data in Binary form from my iPhone App to a device via blutoogh. Suppose I want to transfer a Data like 20 Jan 2013 10:30 am the i need to transfer 200120131030 in a binary sequence. means first binary of 20 then binary of 01 then binary of 2013 and so on... other device is not running on iOS. I convert this number to NSData but can't understand that NSData is abinary data or not. Is there a way to