• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: Parsing Advertisement data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Parsing Advertisement data


  • Subject: RE: Parsing Advertisement data
  • From: Joakim Fernstad <email@hidden>
  • Date: Fri, 19 Apr 2013 19:00:58 +0000
  • Thread-topic: Parsing Advertisement data

I assume you get advertisementData from the didDiscoverPeripheral delegate.

 

advertisementData is a dictionary. What you see in your debug output is the key kCBAdvDataHashedServiceUUIDs which contain an NSArray with service CBUUIDs.

 

NSArray* containedServiceUUIDs = [advertisementData objectForKey:@” kCBAdvDataHashedServiceUUIDs”]; // Will give you the array

 

At this point though, you should connect to the accessory to get more information about services and characteristics. The UUIDs themselves contain no characteristic information.

 

Regards,

 

Joakim

 

From: bluetooth-dev-bounces+jfernstad=email@hidden [mailto:bluetooth-dev-bounces+jfernstad=email@hidden] On Behalf Of email@hidden
Sent: Friday, April 19, 2013 9:33 AM
To: BLE-Dev
Subject: Parsing Advertisement data

 

 

I am struggling with parsing the advertisement data from a peripheral.

The peripheral has specified a service and attribute (value) which I can see if I print the whole advertisement thru NSlog.

 

In didDiscoverPeripheral method I have:

 

    NSLog(@"AdvertisementData: %@\n", advertisementData);

 

which shows me all the relevant data and the specific service and value that I am interested in.

 

However I need to get a handle to the specific service and value. How do I parse the advertisement? Any suggestions appreciated.

 

Rgds,

-BPa

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Parsing Advertisement data
      • From: email@hidden
References: 
 >Parsing Advertisement data (From: email@hidden)

  • Prev by Date: Parsing Advertisement data
  • Next by Date: BLE scan under simulator finds service twice
  • Previous by thread: Parsing Advertisement data
  • Next by thread: Re: Parsing Advertisement data
  • Index(es):
    • Date
    • Thread