Hi,
Using BLE Extentions, I manage to populate a list of results when a device is detected, new devices are added to the list.
The only way to refresh the list is to detect new devices.
But how to refresh this list without new detection?
For instance, no new device detected but some devices are gone and no longer detectable.
How to update the list periodically?
This seems like it might be possible in theory but not in the extension. Specifically, the Bluetooth low energy APIs provided by Android added a flag in Android 6.0 to report events when devices stop sending advertisement packets. However, it's unclear to me that there are parameters to control this. For example, is the lack of just one advertising packet in a given time frame sufficient to mark the device as lost?
If you wanted to implement something in App Inventor given the current BLE implementation, you would probably want to have a flag that indicates the first scan versus subsequent scans, and then after the first scan have a copy of the device list that you can then compare against in subsequent scans. After some time elapses, say 15 seconds, you could then filter the first list based on the second and update the display accordingly. This would also give you the benefit of deciding how long you don't hear from a device before considering it gone.