Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat's the format for the iOS Bluetooth LE kCBAdvDataServiceUUIDs?
    primarykey
    data
    text
    <p>In centralManager:didDiscoverPeripheral:advertisementData:RSSI (complete code below), I'm finding a key in the NSDictionary called kCBAdvDataServiceUUIDs. I'm trying to read this data to determine the services available on the device. What format is this data in? The class description is simply</p> <pre><code>Unknown (&lt;fff0&gt;) </code></pre> <p>Here's the source:</p> <pre><code>- (void) centralManager: (CBCentralManager *) central didDiscoverPeripheral: (CBPeripheral *) aPeripheral advertisementData: (NSDictionary *) advertisementData RSSI: (NSNumber *) RSSI { printf("Discovered %s\n", [[aPeripheral name] cStringUsingEncoding: NSUTF8StringEncoding]); // TODO: Remove printfs printf(" RSSI: %s\n", [[RSSI stringValue] cStringUsingEncoding: NSUTF8StringEncoding]); NSArray *keys = [advertisementData allKeys]; for (int i = 0; i &lt; [keys count]; ++i) { id key = [keys objectAtIndex: i]; NSString *keyName = (NSString *) key; NSObject *value = [advertisementData objectForKey: key]; if ([value isKindOfClass: [NSArray class]]) { printf(" key: %s\n", [keyName cStringUsingEncoding: NSUTF8StringEncoding]); NSArray *values = (NSArray *) value; for (int j = 0; j &lt; [values count]; ++j) { NSObject *aValue = [values objectAtIndex: j]; printf(" %s\n", [[aValue description] cStringUsingEncoding: NSUTF8StringEncoding]); printf(" is NSData: %d\n", [aValue isKindOfClass: [NSData class]]); } } else { const char *valueString = [[value description] cStringUsingEncoding: NSUTF8StringEncoding]; printf(" key: %s, value: %s\n", [keyName cStringUsingEncoding: NSUTF8StringEncoding], valueString); } } } </code></pre> <p>Here's the output from the keyfob in a TI CC2250 Mini Development Kit:</p> <pre><code>Discovered (null) RSSI: -36 key: kCBAdvDataServiceUUIDs Unknown (&lt;fff0&gt;) is NSData: 0 Discovered SimpleBLEPeripheral RSSI: -37 key: kCBAdvDataServiceUUIDs Unknown (&lt;fff0&gt;) is NSData: 0 key: kCBAdvDataLocalName, value: SimpleBLEPeripheral key: kCBAdvDataTxPowerLevel, value: 0 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload