2
votes

I'm using core bluetooth with a programmable BLE device (CC2541). I'm trying to scan for peripherals using a specific service like this:

CBUUID* serviceID = [CBUUID UUIDWithString:  @"adabfb00-6e7d-4601-bda2-bffaa68956ba"];
[self.manager scanForPeripheralsWithServices:@[serviceID] options:nil];

I'm coming up empty but if I set 'scanForPeripheralsWithServices:' to nil then I get all my BLE devices to come up. So I know the BLE is sending out ads.

Here is what I get when I log advertisementData from centralManager:didDiscoverPeripheral:advertisementData:RSSI:

AdvData: {
    kCBAdvDataChannel = 38;
    kCBAdvDataIsConnectable = 1;
    kCBAdvDataLocalName = "JhBC_ZDHTMDRNg";
    kCBAdvDataTxPowerLevel = 0;
}

I'm expecting kCBAdvDataServiceUUIDs to come up like my other BLE devices but the CC2541 doesn't seem to advertise this value.

kCBAdvDataServiceUUIDs =     (
    "Unknown (<adabfb00 6e7d4601 bda2bffa a68956ba>)"
);

How do I get CC2541 to advertise the custom UUID?

1
Have you tried modifying the SimpleBLEPeripheral example?allprog
@allprog I don't have SimpleBLEPeripheral nor any other hardware. I was just handed the device. Is there a way I can enable UUID to be included in the advertisement by writing to a characteristic?Jay Q.
CC2541 is just a chip. Can you tell what the device is? If it can be programmed, then you can probably upload the SimpleBLEPeripheral application on it. FYI: processors.wiki.ti.com/index.php/LPRF_BLE_Simple_Applicationallprog
Here's the device: ankhmaway.en.alibaba.com/product/1447639232-218447309/… I'm able to change uuid, minor, major valuesJay Q.

1 Answers

3
votes

The device you are using is an iBeacon. As such, it is handled specially by iOS. It doesn't have advertised services or anything it just broadcasts a specific advertisement. For more info on the details checkout this page and this SO answer.

The device manufacturer does not seem to have provided the functionality to update the firmware so you can only use the SDK they provide. If you want to, you can try to flash the firmware but there is no guarantee that the device will accept it or if it will be operating at all. (This is similar to changing the firmware in your dish washer; you can try but most probably it will be broken by the end.) The SDK seems to support the change or every parameter an iBeacon advertises so it's pretty good.

Also, note that iBeacons should be used with CoreLocation for location services, but the setup functions are possible only on CoreBluetooth usually. The parameters are exposed as services and characteristics that you can discover after connection and make the necessary changes by modifying the values.