The following function is called after I receive CBPeripheralManagerStatePoweredOn.
- (void) setupService{
NSString *kBRSPServiceUUID = @"DA2B84F1-6279-48DE-BDC0-AFBEA0226079";
NSString *kBRSPInfoCharacteristicUUID = @"99564A02-DC01-4D3C-B04E-3BB1EF0571B2";
NSString *kBRSPModeCharacteristicUUID = @"A87988B9-694C-479C-900E-95DFA6C00A24";
NSString *kBRSPRxCharacteristicUUID = @"BF03260C-7205-4C25-AF43-93B1C299D159";
NSString *kBRSPTxCharacteristicUUID = @"18CDA784-4BD3-4370-85BB-BFED91EC86AF";
NSString *kBRSPCtsCharacteristicUUID = @"0A1934F5-24B8-4F13-9842-37BB167C6AFF";
NSString *kBRSPRtsCharacteristicUUID = @"FDD6B4D3-046D-4330-BDEC-1FD0C90CB43B";
CBUUID *cbuuidService = [CBUUID UUIDWithString:kBRSPServiceUUID];
CBUUID *cbuuidInfoChar = [CBUUID UUIDWithString:kBRSPInfoCharacteristicUUID];
CBUUID *cbuuidModeChar = [CBUUID UUIDWithString:kBRSPModeCharacteristicUUID];
CBUUID *cbuuidRxChar = [CBUUID UUIDWithString:kBRSPRxCharacteristicUUID];
CBUUID *cbuuidTxChar = [CBUUID UUIDWithString:kBRSPTxCharacteristicUUID];
CBUUID *cbuuidCtsChar = [CBUUID UUIDWithString:kBRSPCtsCharacteristicUUID];
CBUUID *cbuuidRtsChar = [CBUUID UUIDWithString:kBRSPRtsCharacteristicUUID];
int infoInt = 0x030002;
NSData *infoData = [NSData dataWithBytes: &infoInt length: sizeof(infoInt)];
cbBRSPInfoCharacteristic = [[CBMutableCharacteristic alloc] initWithType:cbuuidInfoChar
properties:CBCharacteristicPropertyRead
value:infoData
permissions:CBAttributePermissionsReadable];
cbBRSPModeCharacteristic = [[CBMutableCharacteristic alloc] initWithType:cbuuidModeChar
properties:(CBCharacteristicPropertyRead|CBCharacteristicPropertyWrite)
value:nil
permissions:(CBAttributePermissionsReadable|CBAttributePermissionsWriteable)];
cbBRSPRxCharacteristic = [[CBMutableCharacteristic alloc] initWithType:cbuuidRxChar
properties:CBCharacteristicPropertyWrite
value:nil
permissions:CBAttributePermissionsWriteable];
cbBRSPTxCharacteristic = [[CBMutableCharacteristic alloc] initWithType:cbuuidTxChar
properties:CBCharacteristicPropertyIndicate
value:nil
permissions:0];
cbBRSPCtsCharacteristic = [[CBMutableCharacteristic alloc] initWithType:cbuuidCtsChar
properties:(CBCharacteristicPropertyRead|CBCharacteristicPropertyWrite)
value:nil
permissions:CBAttributePermissionsReadable];
cbBRSPRtsCharacteristic = [[CBMutableCharacteristic alloc] initWithType:cbuuidRtsChar
properties:(CBCharacteristicPropertyRead|CBCharacteristicPropertyNotify)
value:nil
permissions:CBAttributePermissionsReadable];
NSArray *characteristicArray = [NSArray arrayWithObjects:cbBRSPInfoCharacteristic, cbBRSPModeCharacteristic, cbBRSPRxCharacteristic, cbBRSPTxCharacteristic, cbBRSPCtsCharacteristic, cbBRSPRtsCharacteristic, nil];
cbBRSPService = [[CBMutableService alloc] initWithType:cbuuidService primary:YES];
cbBRSPService.characteristics = characteristicArray;
[pManager addService:cbBRSPService];
}
Let me know if you need any other information or would like me to test something.
Thanks,
--Deric
-------- Original Message --------
Subject: Re: Subscribe to Characteristics iOS6 peripheralManager
From: Khrob Edmonds <
email@hidden>
Date: Mon, September 24, 2012 11:30 am
To:
email@hidden
Cc:
email@hidden