#kylekhus - Terminal
1 messages · Page 1 of 1 (latest)
Hello! To clarify, this is in an Android app? And when you say "the timeout still happens" what does that mean exactly?
Yea we have have an android app and the Java SDK is also communicating with React Native components!! And "timeout still happens" meaning reader discovery emits a "Bluetooth scan timed out" error
Does this still happen when not using the simulated reader?
That looks correct to me. Does this same code work as expected if you set the timeout to 0?
Let me double check!
Yup, works as expected (I see our list of discovered readers and discovery is still going)
So the timeout happens after you call Terminal.getInstance().connectBluetoothReader?
the timeout no longer happens after we connect a reader, everything works fine after that
we dont want the timeout to occur when bluetooth is in discovery and it detects readers nearby (but not yet connected)
we only want the timeout to occur when bluetooth is not able to detect any nearby readers
but timeout is occurring regardless if it detects readers or not
Oh, okay, I think I misunderstood. It sounds like this is behaving as expected. The timeout is for the discovery process itself. If you don't want it to time out you should leave it set to the default of 0.
I don't know of a way to only timeout if no readers are found. Can you tell me why you want it to behave that way?
Ah okay, and because we want to let our partners know that there could be issues with their reader (they forgot to turn it on, etc) if a reader is not discovered in X seconds. After X seconds, we show a troubleshooting tip on the screen that tells them something like "hey check that your reader is turned on and nearby"
Gotcha. I recommend increasing the timeout value to something like a few minutes and then display that info with tweaked wording that's something like "you haven't connected to a reader..." and maybe include instructions about selecting the reader to connect to in addition to what to do if no readers show up.