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

How to refresh CBPeripheral to get advertisementData again?

I am able to get a list of CBPeripheral devices in following delegate method. - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData…
Hemang
  • 26,840
  • 19
  • 119
  • 186
0
votes
1 answer

Wake up iOS app when app state is closed using corebluetooth

I am creating an iOS app with CoreBluetooth and BLE.When BLE peripheral device detects central(APP) peripheral wants to send data to central. If central is in foreground it works fine. How do i wakeup a not running app when device receives a signal.…
0
votes
0 answers

Is it possible to save connection with BLE device when app will closed

I connect BLE to app locally(without system app) using CBCentralManager func connect(_ peripheral: CBPeripheral, options: [String : Any]? = nil) When my app will finished then device will be disconnected. Is it possible to save connection…
Dmitry
  • 2,963
  • 2
  • 21
  • 39
0
votes
0 answers

Bluetooth send non string data (AT command to HM-10/11)

I want to control my HM-11 BLE module from phone. My code works when I want to send string to the BLE module. But now I need to send AT commands and I'm lost. Here is part of the code: @IBAction func sendButton(_ sender: AnyObject) { …
imi79
  • 9
  • 1
0
votes
1 answer

CBCentral vs CBCentralManager

What is a difference between them? When should I use CBCentral and when CBCentralManager? As I understood, Both CBCentralManager and CBCentral are used to manage connections, but CBCentral allows mobile app to acts as another BLE device, am I right?
nicq
  • 2,182
  • 5
  • 22
  • 38
0
votes
0 answers

How long central manager scan for peripherals?

I start working with CoreBluetooth for a week, but I dont know how to reconnect to the peripheral after losing connection. For example, my CBCentralManager connect to peripheral A, the real manager on iPhone said 'Connected', then I go away for…
Hieu Dinh
  • 692
  • 5
  • 18
0
votes
0 answers

Send Data From Central To Peripheral

I'm developing an app using BTLE iOS. I want to send data from central to peripheral without delay. As of now i can received the data coming from the peripheral, and also i send data from central to peripheral. I have four data to be send: 1.…
user5412643
0
votes
0 answers

Retrieve previously paired bluetooth device lists

Is there any way to retrieve paired bluetooth device list on iOS without given UDID? Ex: I'have connected sound-stick, car sound system etc.. I would like to retrieve these device names... Regards.
Onder OZCAN
  • 1,556
  • 1
  • 16
  • 36
0
votes
1 answer

How to tell if CBCentralManager is still processing scanForPeripheralsWithServices?

Is there a way to tell if the CBCentralManager is busy doing a scanForPeripheralsWithServices? I tried looking at the state, but nothing seems to indicate that it's busy scanning.
TruMan1
  • 33,665
  • 59
  • 184
  • 335
0
votes
1 answer

Polling for Response from BLE Adapter in Swift

Using a Wi-Fi socket based adapter, I can successfully poll for a response like so: func writeMessageWithResponse(message: String) -> [String] { self.waitingForResponse = true let runLoop = NSRunLoop.currentRunLoop() if…
iJeep
  • 989
  • 1
  • 10
  • 28
0
votes
1 answer

CoreBluetooth set central delegate to another view controller

I have just started translating my app to Swift, I want the CBCentralManager.delegate to be set to another view controller(One that navigation controller pushes onto). I am trying to do the same with following code: let viewCont =…
0
votes
1 answer

iOS Bluetooth: central- peripheral got connected before accepting pairing request

I have some problem with bluetooth connection as i am communicating with one device to other following CBCentral and CBPeripherel concepts. But, Peripherel device gets connected to Central before accepting pairing request pop up, basically central…
manish
  • 109
  • 1
  • 11
0
votes
0 answers

didWriteValueForCharacteristic getting null in Characteristic value

I am sending the date from to the peripheral by using the below code. NSString* alternative = [NSString stringWithFormat:@"hello"]; NSData *dataToSend = [alternative dataUsingEncoding:NSUTF8StringEncoding]; [self.discoveredPeripheral…
Vineesh TP
  • 7,755
  • 12
  • 66
  • 130
0
votes
0 answers

Is there anyway to monitor CLBeaconRegion without using CLLocationManager

In my current app i am using self.locationManager = [[CLLocationManager alloc] init]; if ([_locationManager respondsToSelector:@selector(requestAlwaysAuthorization)])/ [_locationManager requestAlwaysAuthorization]; …
Mihir Mehta
  • 13,743
  • 3
  • 64
  • 88
0
votes
1 answer

CBCentralManager: how to determine which peripheral is the manager scanning for

I am wondering how to determine which peripherals a CBCentralManager is scanning for without using additional variables, in other words only from the CBCentralManager object.
mm24
  • 9,280
  • 12
  • 75
  • 170