I tried to create a 128Bit with the iOS CoreBluetooth framework.
The code that I have written is here:
//16Bit Value-String
static NSString * const ADVERTISING_SERVICE_16=@"FFC0";
//Var for 128Bit String
static NSString * ADVERTISING_SERVICE;
//A Base UUID
static NSString * const BASE_UUID=@"0405060708090A0B0C0D0E0F";
+ (NSString*) get128BitUUID:(NSString*)uuid{
return [[NSString alloc] initWithFormat:@"0000%@%@",uuid,BASE_UUID];
}
ADVERTISING_SERVICE = [UUIDFuncs get128BitUUID:ADVERTISING_SERVICE_16];
And now when I try to get a UUID with this:
if([service.UUID isEqual:[CBUUID UUIDWithString:ADVERTISING_SERVICE] ]){
[peripheral discoverCharacteristics:nil forService:service];
}
I get this error message:
2012-09-04 14:18:06.127 blukiiFirmwareTest[3154:707] *** Terminating app due to uncaught
exception 'Invalid UUID string', reason: 'String 0000FFC00405060708090A0B0C0D0E0F
does not represent a valid UUID'
I don't understand why; the string is a 16 Byte long UUID, this is 128 Bit so why am i getting this error?