Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8284245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:02:14+00:00 2026-06-08T11:02:14+00:00

In centralManager:didDiscoverPeripheral:advertisementData:RSSI (complete code below), I’m finding a key in the NSDictionary called kCBAdvDataServiceUUIDs.

  • 0

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

Unknown (<fff0>)

Here’s the source:

- (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 < [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 < [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);
        }
    }
}

Here’s the output from the keyfob in a TI CC2250 Mini Development Kit:

Discovered (null)
  RSSI: -36
   key: kCBAdvDataServiceUUIDs
       Unknown (<fff0>)
       is NSData: 0
Discovered SimpleBLEPeripheral
  RSSI: -37
   key: kCBAdvDataServiceUUIDs
       Unknown (<fff0>)
       is NSData: 0
   key: kCBAdvDataLocalName, value: SimpleBLEPeripheral
   key: kCBAdvDataTxPowerLevel, value: 0
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T11:02:16+00:00Added an answer on June 8, 2026 at 11:02 am

    After some digging around, here’s what I discovered:

    The advertisement data passed as a parameter to the centralManager:didDiscoverPeripheral:advertisementData:RSSI is an NSDictionary that always seems to contain at least one key called kCBAdvDataServiceUUIDs. The value associated with this key is an NSArray of objects of type CBUUID.

    CBUUID is not documented in the iOS 5 documentation, despite the fact that it is used in many places, including every Apple sample for Bluetooth LE I’ve seen. Among it’s methods is one called data that returns an NSData object. This NSData object has the UUID encoded as a series of bytes.

    So, to get and, in this case, view the bytes in the UUIDs of a BLE advertisement, you can use code such as the following:

    - (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 < [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 < [values count]; ++j) {
                    if ([[values objectAtIndex: j] isKindOfClass: [CBUUID class]]) {
                        CBUUID *uuid = [values objectAtIndex: j];
                        NSData *data = uuid.data;
                        printf("      uuid(%d):", j);
                        for (int j = 0; j < data.length; ++j)
                            printf(" %2X", ((UInt8 *) data.bytes)[j]);
                        printf("\n");
                    } else {
                        const char *valueString = [[value description] cStringUsingEncoding: NSUTF8StringEncoding];
                        printf("      value(%d): %s\n", j, valueString);
                    }
                }
            } else {
                const char *valueString = [[value description] cStringUsingEncoding: NSUTF8StringEncoding];
                printf("   key: %s, value: %s\n", [keyName cStringUsingEncoding: NSUTF8StringEncoding], valueString);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to send/receive data between iOS and OSX via Bluetooth. Because GameKit doesn't
I scan for my peripheral like this: NSDictionary *scanOptions = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:CBCentralManagerScanOptionAllowDuplicatesKey];
I've been racking my brains over this for a while and have resorted to
I connect three servers to form an HPC cluster using condor as a middleware
I am setting the UIGestureRecognizer for iPhone App. I am doing it in InterfaceBuilder
I bought my current Macbook Pro new less than 6 months ago, but my
I have a situation where I'm creating a number of IDisposable objects that encapsulate
I have enabled the 'fontsizeselect' plugin in tinyMCE. My question is how do I
When I use: CBUUID * uuid = [CBUUID UUIDWithString:@1800]; // GAP DEBUG_LOG(@CBUUID: %@,uuid); //
In my app I am using 3 classes MasterViewController, DeviceViewController, and BRButton. The BRButton

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.