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

CoreBluetooth re-subscribe to characteristic while reconnecting

In my app, I am able to successfully connect to a BLE peripheral and subscribe to a characteristic, so that the app gets notified whenever there is a change in the characteristic value. But the app is not notified upon changes in characteristic…
0
votes
1 answer

peripheral.name always returns null in CoreBluetooth Swift 3

I have been trying to get the name of the nearby peripheral devices. It is detecting the peripheral by showing its identifier, RSSI but not displaying the name. I have turned on bluetooth in iPhone 5s, Android mobile, Mac OS. I'm confused which one…
Mayha
  • 55
  • 6
0
votes
1 answer

CBPeripheralManager: Does add(_ service: CBMutableService) advertise peripheral?

SCENARIO I am working on a framework that must leverage the CoreBluetooth framework in order to send data over BLE. I have already finished my requirement to communicate environmental data using iBeacons, but I need to send data now from one device…
Brandon A
  • 8,153
  • 3
  • 42
  • 77
0
votes
1 answer

Swift Cannot convert value of type CBPeripheral to expected argument type

The code I have: func didDiscoverBLE(_ peripheral: CBPeripheral!, address: String!, rssi: Int32) { DispatchQueue.main.async(execute: {() -> Void in // Handle Discovery …
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

Is it possible to get IP address of devices which is discovered using Core Bluetooth when the devices is connected to WIFI already?

I want a IP address of devices which is discovered using Core Bluetooth. Is there any possibilities to get IP as I want to create TCP socket connection between my iPhone app and external device for two way communication. Note: Device is connected…
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

Data from central is received only every 10 seconds, why?

The peripheral is set up to advertise with one service, which two characteristics are added to. One characteristic has the property notify and the permission readable. The other characteristic has the property write and the permission writable. The…
BCI
  • 465
  • 6
  • 19
0
votes
1 answer

ObjectiveC: Reading Characteristics in a particular order

I am fairly new to objective C programming so please excuse if this is a very simple question. I am connecting to a peripheral device over Bluetooth and want to be able to read the devices characteristics in a particular order. The value(s) returned…
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
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
1 answer

iOS 10.0 : Use of undeclared type 'CBCharacteristic'

I am working on BLE functionality in my app. I have added CoreBluetooth framework in my project. I have added, import CoreBluetooth in the starting to swift file. Now, when i am trying to implement below delegate method, func peripheral(peripheral:…
Kirti Parghi
  • 1,142
  • 3
  • 14
  • 31
0
votes
1 answer

Can I implement an iOS App to act as a BLE service?

Can I implement an iOS App to act as a Bluetooth low energy service? I need to be able to programmatically define: a service UUID characteristics for the service a way to update the values of these a way to define the user permission of the…
mm24
  • 9,280
  • 12
  • 75
  • 170
0
votes
0 answers

BLE Advertising error

Here is the code. After debugging i am getting that instead of going into onStartSuccess method the code goes into onStartFailure method. But in the onStartFailure method i am not getting the particular error although i set the log. But i do not see…
K.Malu
  • 11
  • 10
0
votes
1 answer

Why CBPeripheral identifier and UUID are different?

I have iBeacon that have known UUID. If I search for this beacon from Android device - I can see exact this UUID. But when I search for this iBeacon from iOS device it can't be found with this UUID. I found peripheral with identifier that differs…
moonvader
  • 19,761
  • 18
  • 67
  • 116