I just wrote a simple app where I scan and connect to peripheral (which is also an IOS device). However the CBPeripheral object I get back from ConnectPeripheral function does not have the device UUID and it's always null. Now I am trying to understand where do I set it so that it gets passed. Here is what I am doing.
To advertise my service I am doing
NSDictionary *advertisingDict=[NSDictionary dictionaryWithObject: services forKey:CBAdvertisementDataServiceUUIDsKey]
[manager startAdvertising:advertisingDicts];
(From the framework I understand that I cannot pass the device UUID in the advertising packet. Correct me if I am wrong here)
My client scan for the service and gets into the function
centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral
And as expected the peripheral.uuid is null. If I call connectPeripheral on this peripheral it works fine too. I am not sure how it understands which device to connect when the uuid is null. Also what would I need to do If I want to reconnect later. How do I fill this uuid?