bluetooth - how to detect the BLE device has gone without connecting to it in Android -
bluetooth - how to detect the BLE device has gone without connecting to it in Android -
i working android ble library our team, library developed 4.3 native framework, seek maintain table of found ble device, , send notification when find new ble device not in found device table, instead of informing each time when device found (default behaviors android ble framework), problem can't observe device gone, in consideration of don't want found ble connection it. can help me out? suppose there way this, ios framework, u can informed when device gone without connecting it.
the basic strategy "undiscover" device maintain track of lastly time device discovered , 1 time every sec or iterate through list of devices. if current time minus lastly time device discovered greater time delta (i utilize 12.5 seconds) consider device undiscovered , remove list.
some gotchas this:
the minimum time takes undiscover device 12.5 seconds, pretty long if sit down downwards , count out. can seek utilize lower time delta thresholds i've found phones results in lot of false undiscoveries, because legitimate time in between discoveries can take while. you should not scan continuously, rather @ in pulses of 5-10 seconds little breaks in between.i've heard of people using rssi. low rssi means undiscover it, experienced lot of false positives approach well.
android bluetooth rssi
Comments
Post a Comment