M
Thanks for getting back with me.
It appears I get the same results using the Toolbox app, but did notice something interesting. My flow using Toolbox app after having connected to two devices
Turn device 1 on. Wait for button to turn green and say "Disconnect". Usually takes about 5-10 seconds
I'm able to get notify values
Turn device off. Wait for button to turn white and say "Connect"
=========
Turn device 2 on. Wait for button to turn green and say "Disconnect". Usually takes about 5-10 seconds.
I'm able to get notify values
Turn device off. Wait for button to turn white and say "Connect"
This is pretty consistent. I can do this multiple times with the same result, but sometimes when I turn a device on, it's button will not turn green even after waiting for over a minute. But as soon as I turn on another device (two devices are now on), both devices will connect and buttons will turn green.
When a third device is added, the only way I can get a device to connect and turn green, is to turn on another device too.
This is pretty consistent with results I'm seeing with Sweetblue in our app. We try to connect to devices use a ReconnectFilter
val deviceReconnectFilter = object : DeviceReconnectFilter {
override fun onConnectFailed(connectFailEvent: DeviceReconnectFilter.ConnectFailEvent): ConnectFailPlease {
return ConnectFailPlease.retry()
}
override fun onConnectionLost(connectionLostEvent: ConnectionLostEvent): ConnectionLostPlease {
return ConnectionLostPlease.retryIn(Interval.secs(3.0) )
}
}
So our app is continuously trying to connect to devices it knows about. When device is turned on ConnectionEvent is triggered and we start getting data. When the device is turned off, onConnectionLost is fired and we start continuously trying to reconnect.
Is there another way we should be trying to handle continuously being connected to a device?