Questions tagged [cbperipheral]

The CBPeripheral class represents remote peripheral devices that your app—by means of a central manager (an instance of CBCentralManager)—has discovered advertising or is currently connected to.

The CBPeripheral class represents remote peripheral devices that your app—by means of a central manager (an instance of CBCentralManager)—has discovered advertising or is currently connected to. On CBPeripheral, you can find the following methods:

Identifying a Peripheral

identifier property

name property

delegate property

UUID property Deprecated in iOS 7.0

Discovering Services

– discoverServices:

– discoverIncludedServices:forService:

services property

Discovering Characteristics and Characteristic Descriptors

– discoverCharacteristics:forService:

– discoverDescriptorsForCharacteristic:

Reading Characteristic and Characteristic Descriptor Values

– readValueForCharacteristic:

– readValueForDescriptor:

Writing Characteristic and Characteristic Descriptor Values

– writeValue:forCharacteristic:type:

– writeValue:forDescriptor:

Setting Notifications for a Characteristic’s Value

– setNotifyValue:forCharacteristic:

Monitoring a Peripheral’s Connection State

state property

isConnected property Deprecated in iOS 7.0

Accessing a Peripheral’s Received Signal Strength Indicator (RSSI) Data

– readRSSI

RSSI property

221 questions
2
votes
1 answer

Is it possible to customize the Bluetooth message when the alert first show up in iOS

I am writing an app which uses bluetooth to send data. The first time the call is made an alert pops which says "app name" would like to make data available to nearby bluetooth devices even when you're not using the app. Is there a way to…
user3570727
  • 10,163
  • 5
  • 18
  • 24
2
votes
1 answer

CoreBluetooth read/write data

I am working with iOS central to communicate with BLE peripheral device. Using LGBluetooth framework https://github.com/DavidSahakyan/LGBluetooth The method gets [LGUtils readDataFromCharactUUID:aCharactId …
l0gg3r
  • 8,864
  • 3
  • 26
  • 46
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

iOS 6 peripheral disconnect immediately after connected

OK, I'm using Core Bluetooth to connect my i-Pad to another BLE sensor. I scan and detect it easily but when I want to establish a connection, the "did connect peripheral" method is only called during 30 sec as if I've called a disconnection... And…
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
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

Backgrounded CBPeripheral doesn't stay readable

I have an app that broadcasts a CBPeripheral with a small amount of text. I use the bluetooth-peripheral background mode to allow it to broadcast in the background. When I scan from another device, in the foreground it works fine. I detect the…
Darren
  • 10,182
  • 20
  • 95
  • 162
1
vote
0 answers

Core Bluetooth scan not returning all devices

I just tried a sample code to find the list of all bluetooth devices that are connected or discoverable. class ViewController: UIViewController, CBCentralManagerDelegate { var centralManager: CBCentralManager! var peripheral:…
Deepak Sharma
  • 5,577
  • 7
  • 55
  • 131
1
vote
1 answer

Detecting CBPeripheral object state change from "Connected" to "Disconnected" in iOS

Is there any why to detect CBPeripheral object state change from "Connected" to "Disconnected" in iOS.
a.palo
  • 258
  • 2
  • 12
1
vote
1 answer

Get own Bluetooth unique id

My question is how can we detect our own device's unique bluetooth ID (must be available from other device when we scan for nearby available bluetooth) I tried this CBUUID *myService = [CBUUID UUIDWithString: @"MyServiceID"]; but in my case this…
Mayank Jain
  • 5,663
  • 7
  • 32
  • 65
1
vote
0 answers

Failed to retrieve services of a CBPeripheral after restart the peripheral

I have a problem while trying to reconnect with a paired peripheral, it connects but I can not find the services. The steps are as follows. Turn on the peripheral device and open app. Find the peripheral after scan. OK Connect to the peripheral.…
1
vote
0 answers

How to concatenate several subscriptions to a Disposable in RxSwift with RxBluetooth?

With RxBluetooth it never has been easier to connect to a CBPeripheral: disposable = peripheral.establishConnection() .flatMap { $0.discoverServices([serviceId]) }.asObservable() .flatMap { Observable.from($0) } .flatMap {…
1
vote
1 answer

CBCentralManger Delegate method behaves differently in iOS 11 and below iOS 11 when central manager state is CBManagerStatePoweredOff

CBCentralManger Delegate method behaves differently in iOS 11 and below iOS 11 Below iOS 11: After updating the CBCentralMangaer state to CBManagerStatePoweredOff state CentralManager delegate -(void)centralManager:(CBCentralManager *)central…
user5180348
1
vote
0 answers

CoreBluetooth Peripheral takes a long time to write value to Characteristic

I am writing an app that needs to write a byte value to a CBPeripheral using iOS CoreBluetooth. I am able to read values, and the write is successful and triggers the didWriteValueFor delegate like it should. Basically, it does work, BUT, it takes a…
Lee Probert
  • 10,308
  • 8
  • 43
  • 70