Questions tagged [cbcentralmanager]

CBCentralManager is an object used by CoreBluetooth on OS X and iOS to manage peripheral devices.

CBCentralManager is an object used by CoreBluetooth on OS X and iOS to manage peripheral devices. On CBCentralManager, you can find the following methods:

Initializing a Central Manager

– initWithDelegate:queue:

– initWithDelegate:queue:options:

Establishing or Canceling Connections with Peripherals

– connectPeripheral:options:

– cancelPeripheralConnection:

Retrieving Lists of Peripherals

– retrieveConnectedPeripheralsWithServices:

– retrievePeripheralsWithIdentifiers:

– retrieveConnectedPeripherals Deprecated in iOS 7.0

– retrievePeripherals: Deprecated in iOS 7.0

Scanning or Stopping Scans of Peripherals

– scanForPeripheralsWithServices:options:

– stopScan

Monitoring Properties

state property

delegate property

235 questions
17
votes
2 answers

How to detect with CoreBluetooth when a peripheral disappears?

I would like to have a list of ble devices to which my iOS can connect, which refreshes when ble devices appear and disappear. In order to do that, I created an NSMutableDictionnary* peripheralsAvailable, and everytime -…
darksider
  • 1,030
  • 2
  • 14
  • 20
17
votes
4 answers

How to wake up iOS app with bluetooth signal (BLE)

When using the BLE with CoreBluetooth (no iBeacon), is there a way to wake an app that is not running when the device receives a Bluetooth signal? I'm simulating a beacon with the RedBearlab's BLE Shield…
DAN
  • 919
  • 1
  • 6
  • 23
16
votes
1 answer

When would CBCentralManager's state ever be powered on but still give me a "not powered on" warning?

I keep getting this error when I run my app that uses CoreBluetooth on an iPhone 5: is not powered on But when I call state on my program's one and only CBCentralManager object, it returns 5, which is…
sudo
  • 5,604
  • 5
  • 40
  • 78
15
votes
3 answers

Core Bluetooth State Preservation and Restoration Not Working, Can't relaunch app into background

I'm trying to make core bluetooth wake up the app even when it's not running. As Apple stated, "Because state preservation and restoration is built in to Core Bluetooth, your app can opt in to this feature to ask the system to preserve the state of…
9
votes
2 answers

Bluetooth LE Device scan in background from iOS

I am working on to scan BLE in Background mode. Issue is not working in Background scan. Its working very fine in Foreground mode. Below is few code lines. dispatch_queue_t centralQueue = dispatch_queue_create("com.XXXXX.BLEback",…
Solid Soft
  • 1,872
  • 2
  • 25
  • 55
7
votes
1 answer

CentralManager State Resetting - what causes this and how can i prevent it?

I have an issue with my centralManger object, its working great I can connect and disconnect to a peripheral. Once I pair 2 peripherals, after half an hour (more or less..) the centralManger state becomes "CentralManagerStateResetting" which causes…
Gili Ariel
  • 572
  • 1
  • 6
  • 18
6
votes
2 answers

Can a single BLE central connect with multiple BLE peripherals via bluetooth low energy?

I am using core bluetooth framework in my iOS application project. I have following questions regarding bluetooth low energy- Is it possible for a single central to connect multiple peripherals in iOS? Can multiple central device connect with a…
6
votes
1 answer

CoreBluetooth "willRestoreState" - what exactly should be done there?

I'm developing an application that needs to continuously run and track some peripheral characteristic. All works fine in foreground. It also works in background, but I'm not sure that I do it correctly. I red many posts about state restoration and…
6
votes
1 answer

BLE background reconnect

I want to reconnect to BLE device after device is moved out/terminated by user or system/reboted in background mode. I know that it's possible : - see this question with description Question - How can i setup centralManager for automatically…
hbk
  • 10,908
  • 11
  • 91
  • 124
6
votes
0 answers

What are the conditions for ios to cache BLE Services and Characteristics?

I have read that ios is caching Services and Characteristics of a BLE peripheral when I disconnect and then reconnect to the same device (After those Services and Characteristics have been discovered of course). So the lenghty process of…
6
votes
1 answer

iOS CoreBluetooth operating as a peripheral and central simultaneously in the background

I'm writing an app using CoreBluetooth in iOS8 that detects and connects to other phones using the app. I'm trying to figure out the best way to be able to create a connection while both apps are backgrounded, but have been having difficulty in the…
6
votes
1 answer

CBCentralManager *manager EXC_BAD_ACCESS with iOS7.0

I just upgraded to Xcode V5.0 (5A1413) the build success but running the program against the emulator causes the error at the property definition: @property (nonatomic, strong) CBCentralManager *manager; --> Thread 1:EXC_BAD_ACCESS (code=2,…
6
votes
3 answers

CoreBlueTooth: Getting error even if data is written into writable characteristics

I am using CoreBlueTooth framework to write into one of the writable characteristics of Peripheral. I am implementing "didWriteValueForCharacteristic:error:" delegate in central which is always returning me below error. Though I have received data…
Abhinav
  • 37,684
  • 43
  • 191
  • 309
6
votes
1 answer

A way to uniquely identify a BTLE device

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…
Abhinav
  • 37,684
  • 43
  • 191
  • 309
5
votes
1 answer

No name or address. CBCentralManager no longer working on macOS 12

every since I updated macOS to macOS 12, I have trouble using CoreBluetooth. In one of my apps, I will list all BLE devices using the CGCentralManager class. This has worked for years. But now, when I start my app, the following output appears in…
inexcitus
  • 2,471
  • 2
  • 26
  • 41
1
2 3
15 16