1 of 1 people found this helpful
When the iOS device is actively scanning, it will send a "Scan request" to the peripheral it received the Advertising packet from.
First didDiscoverPeripheral() callback will be for the initial advertising packet. When the peripheral responds with the "Scan response", there will be a second callback, possibly with additional info in the advertising data which the peripheral sends in the scan response.
Usually (depending on what the peripheral sends), it is possible to not have some data such as peripheral name, additional service UUIDs, etc. until the second callback.
An important aside: This second packet is not guaranteed to be requested in passive scan mode (could be when your app is in the background), so it is important to make sure the primary service UUID your app is scanning for is contained in the first advertising packet (ADV_IND)
thanks for the explanation! It would be nice to find your explanation back in the documentation.
I am seeing this issue of more calls (twice as many (approx)) to didDiscoverPeripheral from devices providing Scan Response. However my confusion stems from the fact that the dictionary (advertisementData) containing the additional data is fully populated in all cases.
If I am understanding your explanation correctly then I would expect half of the calls to be as a result of the initial advert, consequently not containing the data from the scan response. However this doesn't appear to be the case in my scenario.