Can't discover CBPeripheralManager services
Can't discover CBPeripheralManager services
- Subject: Can't discover CBPeripheralManager services
- From: Arvydas Sidorenko <email@hidden>
- Date: Sat, 16 Feb 2013 18:43:23 +0000
I am trying CBPeripheralManager on iPad and CBCentralManager on iPhone
4S and I can't make service discovery work.
This is what I do:
In peripheralManagerDidUpdateState when state changes to
CBPeripheralManagerStatePoweredOn I add services and start
advertising:
CBUUID *cUDID = [CBUUID UUIDWithString:@"DA18"];
CBUUID *cUDID1 = [CBUUID UUIDWithString:@"DA17"];
CBUUID *cUDID2 = [CBUUID UUIDWithString:@"DA16"];
CBUUID *sUDID = [CBUUID UUIDWithString:@"DA00"];
characteristic = [[CBMutableCharacteristic
alloc]initWithType:cUDID properties:CBCharacteristicPropertyNotify
value:nil permissions:CBAttributePermissionsReadable];
characteristic1 = [[CBMutableCharacteristic
alloc]initWithType:cUDID1 properties:CBCharacteristicPropertyWrite
value:nil permissions:CBAttributePermissionsWriteable];
characteristic2 = [[CBMutableCharacteristic
alloc]initWithType:cUDID2 properties:CBCharacteristicPropertyRead
value:nil permissions:CBAttributePermissionsReadable];
servicea = [[CBMutableService alloc] initWithType:sUDID primary:YES];
servicea.characteristics =
@[characteristic,characteristic1,characteristic2];
[peripheral addService:servicea];
NSDictionary *advertisingData =
@{CBAdvertisementDataLocalNameKey : @"peri"};
[self.peripheralManager startAdvertising:advertisingData];
On central device when the device is discovered it establishes
connection and when that is done discovers services and service
characteristics, but all I can find is Generic Access (0x1800) service
with device name characteristics. I tried to run demo applications
from other people github where it makes a device advertise with custom
services, but I still find the same 0x1800 service only. iPad is
running iOS v6.1. Anyone has a clue what is going on?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden