Hello,
I am discovering my BLE device, so far so good.
When i look at the UUID it returns, which i want to save for later use, it changes each time i does a discovery.
As i understand peripheral.UUID returns the device UUID, but do i need to connect to the device or ...
I have tried different things, this is my last debug code. Why do i get a different UUID each time i does a discovery (There is only one BLE device in the entire city)
- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI; { BLEDevice *newDevice; newDevice = [NSEntityDescription insertNewObjectForEntityForName:@"BLEDevice" inManagedObjectContext:self.tempMoc]; newDevice.desc = peripheral.name;
NSLog(@"Direct UUID: %@", peripheral.UUID); CBUUID *uuid = [CBUUID UUIDWithCFUUID:peripheral.UUID]; NSData *uuidData = [[uuid data] copy]; NSLog(@"UUID: %@", uuid);
Thanks in advance Thomas
|