Questions tagged [cbperipheralmanager]

CBPeripheralManager objects are used to manage published services within the local peripheral device’s Generic Attribute Profile (GATT) database and to advertise these services to central devices (represented by CBCentral objects).

In iOS, CBPeripheralManager objects are used to manage published services within the local peripheral device’s Generic Attribute Profile (GATT) database and to advertise these services to central devices (represented by CBCentral objects).

https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBPeripheralManager_Class/index.html#//apple_ref/occ/cl/CBPeripheralManager

70 questions
2
votes
2 answers

CoreBluetooth is disconnecting from unused peripherals due to an API Misuse

I am trying to connect to a MacBook Pro from an iPad with CoreBluetooth. Here is my delegation for CBCentralManagerDelegate: extension MasterViewController: CBCentralManagerDelegate { func centralManagerDidUpdateState(_ central:…
Caleb Kleveter
  • 11,170
  • 8
  • 62
  • 92
2
votes
1 answer

CoreBluetooth APIMISUSE (send command - peripheral not connected)

The system i'm working with uses the following scenario: Connecting to bluetooth LE device Discover Services & Characteristics Write command to TX characteristic and receive response Above works fine 90% of time. Now and then the system gets into…
2
votes
1 answer

CLPeripheralManager.startAdvertising does not accept return value of CLBeaconRegion.peripheralDataWithMeasuredPower

According to the Swift 2.0 documentation for CLBeaconRegion, it should still be possible to pass the output of the peripheralDataWithMeasuredPower: method to the startAdvertising: method of CLPeripheralManager. Getting Beacon Advertisement Data -…
PassKit
  • 12,231
  • 5
  • 57
  • 75
2
votes
2 answers

iOS Bluetooth peripheralManagerDidUpdateState never called

I'm trying to set up my iPhone to act as a heart rate monitor and send information using the standard heart rate service so that the app I have running on my PC can retrieve the data. I'm a newbie to iOS but I have got bluetooth stuff running on…
2
votes
1 answer

Change advertising iPhone local name

Using the CoreBluetooth framework is it possible to change the peripheral name of an iPhone that is advertising in peripheral mode? For example: I would like the peripheral iPhone to broadcast a custom name and have another iPhone be able to read…
2
votes
1 answer

Get UUID of BLE IOS Peripheral, not service UUID

how is it possible to fetch the UUID from Peripheral side. Not the service UUIDs out of the advertising package. Lets see it from the central side: - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral …
2
votes
0 answers

Should I fulfill all CBATTRequests to write to characteristics or just the first one in the array?

When I receive a - (void)peripheralManager:(CBPeripheralManager *)peripheral didReceiveWriteRequests:(NSArray *)requests it's unclear whether or not I'm supposed to fill all the requests but only respond to the first one with a success, or if I'm…
JuJoDi
  • 14,627
  • 23
  • 80
  • 126
1
vote
1 answer

CBPeripheralManagerState is Depreciated in iOS 10+. What is the alternative?

The BTLe documentation says I should check this Enum value before broadcasting. Now that this is depreciated, what is my best alternative? No substitute is in the docs. Also, the same issue applies to CoreLocation, where iBeacon also requires me to…
TLDR
  • 1,198
  • 1
  • 12
  • 31
1
vote
0 answers

Is there any way in iOS to find the exact time when we are connected to any device?

If in our app we are acting as a peripheral mode. Don't we have anyway to find when we are connected to any device. I want to log the the time when my device connects to another device. As in central mode we have this CBPeripheralState for getting…
1
vote
2 answers

CoreBluetooth : CBPeripheral has no member setnotifyValue iOS 10.0

I am working on an app where i need to have a bluetooth connection with external device and i successfully made connection with external device. Now, in below CBPeripheralManager delegate generate error in iOS 10 and working perfectly in iOS…
Kirti Parghi
  • 1,142
  • 3
  • 14
  • 31
1
vote
1 answer

what is the best way to detect multiple BLE's out of range at the same time?

Problem statement : if have multiple BLE's at my end and i connect them one by one. but now when more than 1 BLE goes out of range at the same time i am not able to detect the state in central manager of core bluetooth framework. Explanation - 1) if…
Nik
  • 1,679
  • 1
  • 20
  • 36
1
vote
1 answer

CoreBluetooth `retrieveConnectedPeripheralsWithServices` returns disconnected peripherals

I wonder about the semantics of CBManager's retrieveConnectedPeripheralsWithServices. Everytime I'm using this I get CBPeripheral instances back with state CBPeripheralStateDisconnected. It's not a problem to connect again, but isn't this method…
DrMickeyLauer
  • 4,455
  • 3
  • 31
  • 67
1
vote
1 answer

iOS Peripheral Not Receiving Write Requests after Power Toggle

I have an iOS app that is set up as a peripheral with a CBPeripheralManager and a service with several characteristics. I’m trying to achieve reconnection after the user opens Control Center and toggles Bluetooth off and on. It looks like my service…
1
vote
1 answer

In CBPeripheralManager, how to know if user push a cancel button when it's trying to pairing

I'm making BLE connection between iPhone and device with CBPeripheralManager. If Central tried to pair with peripheral, Bluetooth pairing alertController pops up and user can choice which one there're going to use. Most of them will push a connect…
Hwangho Kim
  • 629
  • 4
  • 20
1
vote
0 answers

Data missing while sending data from central to peripheral - CoreBluetooth ios

In CoreBluetooth, am trying to transfer data from central to peripheral using writevalue: with type:CBCharacteristicWriteWithoutResponse which makes the data transfer faster. but datas getting missed in between. i dont want to use writevalue: with…