So here's the situation: I am able to see the services inside the peripheral, however I have not been able to decode them properly without calling discoverServices:
.
The question is: how can i convert a CBUUID.data
into the actual NSString
that is stored?
-The Data appears as <20c0b7a0 982c11e2 9e960800 200c9a66>
-But the real value being stored is DF8EE4F1-4899-4FF6-8EE4-75890
BUT before jumping to any conclusions, I've tried every decoding method I have found including:
1.)
NSString *uuidString = [NSString stringWithUTF8String:[uuidData bytes]];
2.)
NSString *uuidString = [[NSString alloc] initWithBytes:[uuidData bytes]
length:[uuidData length] encoding: NSUTF8StringEncoding];
//I tried this method with every single type of encoding actually
Both of these methods above were (null)
;
3.)
size_t length = [uuidData length];
unsigned char aBuffer[length];
[uuidData getBytes:aBuffer length:length];
aBuffer[length - 1] = 0;
NSLog(@"uuid: %s", aBuffer);
And this method returned: ¿∑†ò,‚ûñ
If anyone can decode or encode this properly I will be eternally grateful!!!