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
0
votes
1 answer

CoreBluetooth read value of specific characteristic while reading other characteristcs

In my application, I need to read/write values from more than one peripherals that have the same service and characteristics UUIDs. Each peripheral has many characteristics, out of which value of one particular characteristic is used to uniquely…
0
votes
1 answer

Receive string data via Bluetooth

I'm creating a simple BLE app that communicates with a single peripheral. The phone acts as the central. I have an iPad which I'm using as the peripheral for testing. It has the app LightBlue installed to simulate a peripheral. The peripheral is…
Isuru
  • 30,617
  • 60
  • 187
  • 303
0
votes
0 answers

didUpdateValueForCharacteristic not called when the app is in suspended state

I'm developing an App that needs, in certan scenarios, to be connected to a bluetooth Peripheral indefinitely. Before I go on with my question, I want to confirm that: I'm initializing my CBCoreBluetoothManager in…
0
votes
1 answer

Peripheral always state connecting and never connect after upgrading to IOS 11

I am using CoreBluetooth for IOS app, after upgrading IOS version the central manager can´t connect to peripheral and not showing any error. Before starting te process to connect I receive this values from the device: CBPeripheral: 0x1c0106e40,…
0
votes
1 answer

iOS Bluetooth Central, Reliable Delegate Method to Detect Connection/Disconnect

I am looking to figure out which delegate methods fire reliably when connecting / disconnecting in the background when terminated. Whenever the user gets close enough to my BLE device, I want it to auto connect and then fire a quick method to…
GoreDefex
  • 1,461
  • 2
  • 17
  • 41
0
votes
0 answers

How can we handle speakers play/pause button events in ios

How to get events/ callback from Bluetooth play/ pause button in iOS? I have multiple speakers with version 2.1 and 4.0 I have tried with Core Bluetooth framework but not getting device in centralManager.scanForPeripheralsWithServices(nil,…
0
votes
0 answers

How to get nearest Bluetooth Device List in Swift 3.0

I am trying to get the nearest Bluetooth using CoreBluetooth framework, I import framework and implement CBCentralManagerDelegate, CBPeripheralDelegate. Here is my code: import CoreBluetooth centralManager = CBCentralManager(delegate:…
Nirmalsinh Rathod
  • 5,079
  • 4
  • 26
  • 56
0
votes
1 answer

iOS BluetoothLE: CBCentralManager Unsubscribes From Updates

I have a mac set up as a bluetooth accessory using CoreBluetooth as a CBPeripheralManager. The Mac is advertising on a set characteristic CBUUID, and once it has a subscriber, I click a button to stream a UTF-8-encoded time stamp every half second.…
0
votes
2 answers

iOS: Not receiving the write requests from Central to Peripheral

I am trying to get the write request sent from Central and no delegate is getting called for the same in Peripheral. If I unsubscribe characteristic from Central then didUnsubscribeFromCharacteristic gets called. I am not sure how will I get the…
0
votes
0 answers

How can I use CBCentralManager from other viewController?

I have a viewController that implements coreBluetooth on my objective c application. I initialize my CBCentralManager on a viewController, but I want reconnect and use didDiscoverPeripheral from another viewController and from APpDelegate. If I use…
user3745888
  • 6,143
  • 15
  • 48
  • 97
0
votes
3 answers

Bluetooth controller lists multiple versions of device - Swift 3.1

I am having trouble scanning for Bluetooth devices on an app I am building as part of a group project. The code for the view is as follows: import UIKit import CoreBluetooth class bluetoothConnectViewController: UIViewController,…
0
votes
0 answers

Invalid Parameter Not Satisfying: peripheral != nil

In my app I have a method that reconnects the device to the peripheral if it had previously gone out of range. I put an exception breakpoint in my app, and it seems to have crashed at this line: [centralManager…
Faisal Syed
  • 921
  • 1
  • 11
  • 25
0
votes
1 answer

Conform to CBCentralManagerDelegate Protocol

I am trying to implement a BLEHandler. This is my code: import CoreBluetooth class BLEHandler : NSObject, CBCentralManagerDelegate { override init() { super.init() } func cenrealManagerDidUpdateState(central:…
B.Chok
  • 23
  • 3
0
votes
1 answer

iOS Bluetooth connected according to Settings, but my app has no connected peripherals

I am making an app for a custom Bluetooth device. The app connects/communicates correctly with the device, however some strange connection/reconnection problems occur sometimes. One reproducible situation of this issue is when the battery…
0
votes
1 answer

How can I block system alert and show my custom screen instead

I make an app that can connect to ble device. My ble device required pairing. Now when I connect to device - system shows me "Bluetooth Pairing Request" alert. But I wont to make custom code input screen for pairing action. How can I block system…
Dmitry
  • 2,963
  • 2
  • 21
  • 39