core-bluetooth

Swift 3: Can't connect to peripheral via BLE

隐身守侯 提交于 2019-12-05 06:15:01
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'. How can i identify the problem? Is there any options i can include in connection method, or somehow

Subscribing for notifications from a CBCharacteristic does not work

℡╲_俬逩灬. 提交于 2019-12-05 05:48:50
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 $CBCentralManager.state is .PoweredOn . That's easy, I'm even a good citizen and scan specifically for those with

Bluetooth 4.0 with older Bluetooth

社会主义新天地 提交于 2019-12-05 05:15:40
i'm trying to implement an application using a Bluetooth 4.0 module, and I wonder if using this application with an Iphone 3GS containing a simple Bluetooth 2.1 EDR module is going to enable me take advantage of the the low energy in my 4.0 module. Thank you for your answers Bluetooth 4.0 is the standard, which includes both classical Bluetooth Basic Rate/Enhanced Data Rate (BR/EDR) and Bluetooth Low Energy (BLE, or Bluetooth Smart, which is a marketing name). Compatibility depends on the the device and Bluetooth chip e.g. is it a BR/EDR only chip (Bluetooth 3.0), a BLE only chip or a dual

CoreBluetooth cannot find devices but iOS can

偶尔善良 提交于 2019-12-05 04:34:42
问题 I have a bluetooth barcode scanner whose spec says it's bluetooth 2.0, class 2. It is strange because my iPhone 5 (iOS7) could find and connect it. I thought iOS only connects BLE devices. But in my app I couldn't scan this device. I've no idea if this is because its bluetooth spec. I wish someone could give me some advices about how to connect this device in my app using CoreBluetooth or some other valid libs. By the way my code is correct because I could find LightBlue app on another iPhone

BLE Swift write characterisitc

旧城冷巷雨未停 提交于 2019-12-04 23:50:47
问题 I am trying hard to get my TI sensortag temperature sensor to notify. According to http://processors.wiki.ti.com/images/a/a8/BLE_SensorTag_GATT_Server.pdf I need to set the value of the characteristic with UUID F000AA02-0451-4000-B000-000000000000 to "01:00". Here is what I do: import UIKit import CoreBluetooth class ViewController: UIViewController, CBCentralManagerDelegate, CBPeripheralDelegate{ var centralManager:CBCentralManager! var blueToothReady = false var connectingPeripheral:

CoreBluetooth XPC Connection Invalid on dismiss viewcontroller

柔情痞子 提交于 2019-12-04 23:11:18
After I have finished disconnecting from my bluetooth devices, seeing that they have disconnected in the didDisconnectPeripheral delegate, I attempt to dismiss my viewcontroller. When this happens I see the message: "[CoreBlueooth] XPC Connection Invalid" Is there something in specific that has to be cleaned up with Bluetooth before the viewcontroller is dismissed? I placed CBCentralManager to a singleton and the error message is solved. ( CBCentralManager will not be deallocated) I was getting the following message: [CoreBlueooth] XPC Connection Invalid And I wasn't able to scan BLE devices

Removing PIN in Core Bluetooth Connection

南楼画角 提交于 2019-12-04 19:37:05
I'm working on an application that connects phones via core bluetooth (BLE). The connection and data transmission work beautifully, but there is one small imperfection. When connecting to a new device, a pin must be entered on one of the devices. The application is supposed to be very instantaneous, and the pin-input greatly interrupts this process. I'm not worried about security, and I've personally connected my phone to many bluetooth devices without entering pins, so I was just wondering how this could be done with the iOS api. Thanks! If you specify any of your peripheral's characteristics

In CBCentralManager delegate method didDiscoverPeripheral: never called

爷,独闯天下 提交于 2019-12-04 19:17:57
I initialize the CBCenteralManager in viewdidload on main queue. First time update state method is called and start scanning for bluetooth devices but didDiscoverPeripheral: delegate method never get called. Code is : - (void)viewDidLoad { [super viewDidLoad]; self.CM = [[CBCentralManager alloc]initWithDelegate:self queue:nil]; } -(void)centralManagerDidUpdateState:(CBCentralManager *)central{ if (central.state == CBCentralManagerStatePoweredOn) { [self.CM scanForPeripheralsWithServices:nil options:nil]; } } - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral(CBPeripheral*

Can't connect to AirPods via BLE

孤人 提交于 2019-12-04 19:10:55
问题 I am trying to connect automatically to my AirPods with a simple app using BLE. I get the name of the device and the status to "connecting", but for some reason I can't connect to it. Function 'didConnect peripheral' is never triggered. I tried all different approaches from tutorials and from other posts, tried to store the peripheral data in an array to keep the reference but nothing seem to work. Is there any step which I can get some extra info between 'didDiscover' and 'didConnect'?

Is Core Bluetooth framework intrinsically asynchronous?

浪子不回头ぞ 提交于 2019-12-04 19:04:41
When I utilize the CB framework in my app, I don't introduce any concurrency nor reactive approach and everything works fine. UI is not blocked when I receive over 100 samples per second from peripheral. Does that mean it is designed to work asynchronously? I haven't found any resources that states it's asynchronous nature, nor have I found any implementation where someone introduces dispatch async or background threads while working with Core Bluetooth. Is it safe to say that Core Bluetooth framework is intrinsically asynchronous and one should not bother with dispatch_async and thing like