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

CoreBluetooth state preservation: correct way to restore CBCentralManager

what is the correct way to restore the CBCentralManager from AppDelegate when the App gets lunched with options due to a state preservation event? - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary…
mm24
  • 9,280
  • 12
  • 75
  • 170
2
votes
1 answer

How to search for continuously for bluetooth peripherals in iOS

I basically want search the nearby BLE devices from my iOS app, even when the app is in background. iOS provides this method: //_cbcManager is the object of CBCentralManager [_cbcManager scanForPeripheralsWithServices:nil options:[NSDictionary…
nr5
  • 4,228
  • 8
  • 42
  • 82
2
votes
0 answers

iOS CoreBluetooth losing local peripheral.name after connection

I'm building a bluetooth app using CoreBluetooth on iOS. Every time an app is launch user receives an ID, which is saved in Peripheral's LocalNameKey, begin to advertise with it and start to search for other users using CentralManager. Every user is…
2
votes
0 answers

Failed to Advertise and Discover BLE with Swift

I am trying to advertise BLE with the following var perMan: CBPeripheralManager! let myCustomServiceUUID: CBUUID = CBUUID(string: "109F17E4-EF68-43FC-957D-502BB0EFCF46") var myService: CBMutableService! override func viewDidLoad() { …
2
votes
1 answer

Why, sometimes, do I need to restart the iOS Bluetooth (using the system button) to make my central manager able to connect successfully?

I'm developing an application on iOS and OS X Yosemite which is using CoreBluetooth on iOS and IOBluetooth on Mac. The iOS app plays the "central" role while the Mac app is playing the "peripheral" role. Basically, the iOS app (the central) starts a…
2
votes
1 answer

Updating CentralManagers list of services for a peripheral

I'm Having an issue with Core Bluetooth under iOS. I'm programming an OTA updater, and running into a strange issue. When I switch the device into OTAU mode it disconnects and advertises different services under the same device UUID, problem is,…
2
votes
1 answer

iOS Bluetooth Central Manager

I am trying out the iOS Bluetooth Central Manager on my iPhone. - (void)centralManagerDidUpdateState:(CBCentralManager *)central { // Determine the state of the peripheral if ([central state] == CBCentralManagerStatePoweredOff) { …
lilzz
  • 5,243
  • 14
  • 59
  • 87
2
votes
2 answers

CoreBluetooth peripheral using Arduino

If I want to connect my peripheral (Arduino) to my central (Iphone) do I have to structure the data in the arduino as a services and characteristics? I have seen some projects where an iphone is connected to an arduino but iphones scan for UUID's…
user2076774
  • 405
  • 1
  • 8
  • 21
2
votes
1 answer

Directly writing into already connected CBPeripheral without re-discovering it

In my app, I need to write data into a writable characteristics of a peripheral. I am able to do this by following the process of scanning the peripherals, detecting and connecting to peripheral, discover services, discover characteristics and then…
Abhinav
  • 37,684
  • 43
  • 191
  • 309
2
votes
1 answer

will CBCentralManager ,CBService delegate methods be called in background mode in iOS6

I am using Apple core bluetooth example .The peripheral is running in foreground in one iphone device.I am running cbcentral client application in one device.It is pairing well when both application in foreground condition.My need is when I run…
user141302
1
vote
1 answer

iOS Swift application instance time alive

I have created an application that uses location services and bluetooth services. Inside AppDelegate using significant location changes I am assigning a new instance of CBCentralManager like this: class AppDelegate: UIResponder,…
1
vote
0 answers

BLE shows connected even when 'didDisconnectPeripheral' is already called

I am trying to disconnect from a BLE device (raspberry-pi3), the delegates for disconnection are being triggered and upon checking explicitly if the peripheral is disconnected it shows that the peripheral is indeed disconnected. But, when I see in…
1
vote
0 answers

How to gracefully restart CBCentralManager, in Swift

How do I gracefully stop all CBCentralManager activity and then, later, restart it? He's my plan. Is anything missing? Stopping... If inadvertently still scanning, then stop. Unsubscribe all services and characs. Restarting... scan connect add…
Doug Null
  • 7,989
  • 15
  • 69
  • 148
1
vote
1 answer

central unsubscribes from characteristic when restart app

IOS app is a peripheral. After pairing, peripheral can successfully update characteristic value to and indicate to subscribed central via updateValue:forCharacteristic:onSubscribedCentrals: When I call this method successfully (after pairing), logs…
1
vote
1 answer

Whats the default alert action of CBCentralManager when options = nil in initialization?

Whats the default alert action of CBCentralManager when options = nil in initialization? For the below code, bleCentralManager = CBCentralManager(delegate: self, queue: nil) System pop up is showing. Don't know why. One of available options let…
Sazzad Hissain Khan
  • 37,929
  • 33
  • 189
  • 256