0

Good Morning, this is Pavan, I have doubts in corebluetooth. I am using the bluetooth LE device. i wrote the sample code in Using core bluetooth frameworking in objective c , I got the bluetooth name, UUID, RRSI value. I used central manager, peripheral manager, and periheral delegate methods.MY code does not execute the CBPeripheralManager delegate methods. it give only one UUID kCBAdvDataServiceUUIDs = "00001C00-D102-11E1-9B23-00025B00A5A5", unable to get remaining services.

Here I need to get Alarm settings, bettery levels, date and time settings. I used your sample project I got the below result . Peripheral found with name: Optional("name")

UUID: 48D98C88-4FAC-A584-839D-D06D953B941D
RSSI: -71
Advertisement Data: ["kCBAdvDataServiceUUIDs": (
    "00001C00-D102-11E1-9B23-00025B00A5A5"
), "kCBAdvDataTxPowerLevel": 8, "kCBAdvDataIsConnectable": 1]

Failed to disconnect from peripheral with error: Error Domain=CBErrorDomain Code=7 "The specified device has disconnected from us." UserInfo=0x165d4000 {NSLocalizedDescription=The specified device has disconnected from us.}

Peripheral:

I am unable to get what is the issue. Please help me.

We tried code here:http://www.filedropper.com/btbackground-master

1 Answers1

0

Could you explain a bit more about your issue. You say it gives only one UUID kCBAdvDataServiceUUIDs = "00001C00-D102-11E1-9B23-00025B00A5A5"

This is the advertisement data for services UUIDs, it returns an incomplete list of services UUIDs and is managed by the peripheral.

To get the complete list of services UUIDs you must discover them after connecting to the peripheral with discoverServices

It seems you do :

[peripheral discoverServices:@[[CBUUID UUIDWithString:@"0x1811"]]];

It will only discover the service with the 0x1811 UUID. If you want to discover all services you have to call

[peripheral discoverServices:nil];

The failed to disconnect from peripheral seems to be an issue on the peripheral side. It just tells you it couldn't be disconnected because the peripheral already disconnected your device.

Anyway, is your issue with the disconnection error or with the services discovery ? Because it's not clear from your question.

Elendir
  • 203
  • 5
  • 16