RE: Parsing Advertisement data
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.
|
_______________________________________________
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