Collecting peripherals used to accumulate newly received advertisements, resulting in a costantly growing set. My modification filters the old set before adding new devices, so if a device already exists in the set it is filtered out and then re-appended.
This behaviour is necessary to update the rssi field into BluetoothPeripheral object, while avoiding duplicate entries with same UUID.
Collecting peripherals used to accumulate newly received advertisements, resulting in a costantly growing set. My modification filters the old set before adding new devices, so if a device already exists in the set it is filtered out and then re-appended. This behaviour is necessary to update the rssi field into BluetoothPeripheral object, while avoiding duplicate entries with same UUID.