add bt polling speedtest

This commit is contained in:
goapunk
2018-05-10 11:50:33 +02:00
parent 8f9d7a70bf
commit a51f0f803f
8 changed files with 247 additions and 18 deletions

View File

@@ -79,10 +79,12 @@ class Poller implements EventListener {
public void eventOccurred(Event e) {
if (e instanceof ContactStatusChangedEvent) {
ContactStatusChangedEvent c = (ContactStatusChangedEvent) e;
/*
if (c.isActive()) {
// Connect to the newly activated contact
connectToContact(c.getContactId());
}
*/
} else if (e instanceof ConnectionClosedEvent) {
ConnectionClosedEvent c = (ConnectionClosedEvent) e;
// Reschedule polling, the polling interval may have decreased

View File

@@ -59,7 +59,7 @@ abstract class BluetoothPlugin<SS> implements DuplexPlugin, EventListener {
* How many milliseconds to pause between connection attempts when
* polling, to avoid interfering with other Bluetooth or wifi connections.
*/
private static final int POLLING_PAUSE_MS = 1000;
private static final int POLLING_PAUSE_MS = 3000;
final BluetoothConnectionLimiter connectionLimiter;