11

I am working with the core bluetooth framework . I am trying to create the peripheral using this framework . My peripheral advertise the data using :

manager=[[CBPeripheralManager alloc]initWithDelegate:self queue:nil];
[manager startAdvertising:dictionary];

here the dictionary that I am passing for the advertisement is :

NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys:
                                    @"name", CBAdvertisementDataLocalNameKey,@"some other data",CBAdvertisementDataManufacturerDataKey,nil];

when I am running the application I getting the warning :The advertisement key 'Manufacturer Data' is not allowed in CoreBluetooth

and I am not getting "some other data " which I have sent using the key CBAdvertisementDataManufacturerDataKey at the central side . I am getting the name at the central side. So how can I send the some other data with the advertising data ?

Paras Joshi
  • 20,427
  • 11
  • 57
  • 70
V-Xtreme
  • 7,230
  • 9
  • 39
  • 79
  • did you find a solution on this? – civiac Feb 24 '14 at 14:34
  • @civiac: No,actually you cant alter manufacturer data . I was doing demo application so I have used name_some data (differentiate with the _) and done processing accordingly at central side. further In my case I got the BLE device according to my need . – V-Xtreme Feb 25 '14 at 03:26

1 Answers1

12

As the CBPeripheralManager documentation on startAdvertising states:

An optional dictionary containing the data you want to advertise. The possible keys of an advertisementData dictionary are detailed in CBCentralManagerDelegate Protocol Reference. That said, only two of the keys are supported for peripheral manager objects: CBAdvertisementDataLocalNameKey and CBAdvertisementDataServiceUUIDsKey.

Those keys are only applicable when the iOS device is in central mode and is discovering outside peripherals (i.e. read-only). I have no idea why this restriction is in place when operating in peripheral mode, you might try filing a bug report on it.

russbishop
  • 16,587
  • 7
  • 61
  • 74
  • 2
    They're in place in peripheral mode because the device is an Apple iPhone, not whatever your app is wanting it to be. So all the manufacturer stuff is Apple's data, and all the device stuff is the iPhone. What you can modify is the name of the device, and you specify the services offered by your app (which iOS can then combine with services offered by other apps). – James Billingham Jan 22 '15 at 20:07
  • @russbishop Hey Can you look at my question ? I need your help. https://stackoverflow.com/questions/46402904/is-there-any-way-access-manufacturer-data-from-ios-device – yusufonderd Sep 26 '17 at 06:53