1

I have one Bluetooth LE device, I need to scan it only, that I have done with Core Bluetooth Framework in iPhone SDk.

Below is sample code,

manager is object of CBCenterManager which writes in the init method:

manager = [[CBCentralManager alloc] initWithDelegate:self queue:nil];

scanning process:

- (void)startScan
{
    NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:FALSE], CBCentralManagerScanOptionAllowDuplicatesKey, nil];

    manager.delegate = self;
    [manager scanForPeripheralsWithServices:nil options:options];
}

Now I got that device in delegate methods,

- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI
{
    NSLog(@"Did discover peripheral. peripheral: %@ rssi: %@, UUID: %@ advertisementData: %@ ", peripheral, RSSI, peripheral.UUID, advertisementData);

}

**Here I have write only few lines of code,

This is not enough data for me to show in interface. Because peripheral.UUID is unique for each device, if I change device to discover BLE, it will be changed. So I want unique address of Bluetooth LE device which I got same in every iOS devices.

Like peripheral.UUID is 1FE639DB-3C54-B5A8-74A4-3D9FBFCAD074

I had discover same thing in android got address like C8:4D:93:78:98:AE this.

and its unique for all android devices,

So I am searching for the same thing in iPhone SDK.

Is it possible to get same unique address of Bluetooth LE in iPhone SDK?

Thanks for your time to read questions.

67cherries
  • 6,931
  • 7
  • 35
  • 51
Solid Soft
  • 1,872
  • 2
  • 25
  • 55
  • UUID read will be unique, and its made from MacAdresse of the device and of the iDevice, with a dateStamp. So if you read it again after without having done a pairing, it will change. – Larme Feb 13 '14 at 12:59
  • UUID is not a unique, For your information, if you scan with iPhone4S you have one UUID, after you will scan with iPhone5 you have different UUID in compare of iPhone4S's got UUID. So i need any one unique key which is same for every device. I already mention that in android there is a one address which scan same for any device, tested with Motorola MotoG, and Samsung S4. So I am in search of How to get same address in iPhone SDK which return in android ?? Thanks for your time.. – Solid Soft Feb 14 '14 at 05:32
  • Worth noting: as of iOS 7, peripheral.UUID is deprecated. Instead use peripheral.identifier. – Jason McDermott Feb 14 '14 at 07:01
  • I know, I am talking about this. NSLog(@"%@",[peripheral.identifier UUIDString]); – Solid Soft Feb 14 '14 at 07:06
  • I said that is made partially made from the MAC of the iDevice. So, it's unique for THIS device for a certain amount of time. What you want to do can only be done with advertising (in Advertisement Data) a unique identifier, but that's not recommended. – Larme Feb 14 '14 at 09:06
  • I need unique address, that i clearly mention. – Solid Soft Feb 14 '14 at 09:12
  • Did you read me? You can't, except if your device advertise an unique address (like it MAC Address). – Larme Feb 14 '14 at 11:08
  • rssi: -54, advertisementData: { kCBAdvDataChannel = 37; kCBAdvDataIsConnectable = 1; kCBAdvDataLocalName = "asdf"; kCBAdvDataServiceUUIDs = ( "Unknown (<180d>)" ); } Where is unique key ?????? – Solid Soft Feb 14 '14 at 12:34
  • 1
    You should take a look at this post: http://stackoverflow.com/questions/18973098/get-mac-address-of-bluetooth-low-energy-peripheral There is no such thing in iOS as a unique address, which is a security measure taken by Apple. On iOS you can only use an address (generated by the corebluetooth framework, used by the app), which will be retained between launches. Android provides access to this data, iOS does not. – Jason McDermott Feb 15 '14 at 01:24
  • Thanks Jason McDermott.. i hope also. let me do with some extra logic to make it unique.. – Solid Soft Feb 24 '14 at 07:29

0 Answers0