B4X FEED Does Serial.Disconnect really close the Bluetooth connection?

اطلاعات موضوع

درباره موضوع در تاریخ, در دسته b4xfeed ایجاد شده و آغاز کننده آن practicalsoftمی باشد و موضوع آن: Does Serial.Disconnect really close the Bluetooth connection? است. این موضوع تا کنون 26 بازدید کننده و, 0 پاسخ داشته و 0 بار پسندیده شده...
نام دسته b4xfeed
نام موضوع Does Serial.Disconnect really close the Bluetooth connection?
آغاز کننده موضوع practicalsoft
تاریخ شروع
پاسخ‌ها
0
بازدیدها
26
پسندها
0
آخرین ارسال توسط PracticalSoft
Jun 6, 2020
11,559
4,422
I'm getting some inconsistent behavior in after a Serial.Disconnect call on Bluetooth connections.

Here is the tipical sequence of events:
- Call Serial.Connect(macaddress) with success
- Data exchange happens with no errors using AsyncStreams.Write
- Call Serial.Disconnect
- after a while call again Serial.Connect(macaddress)

after the last step, the outcome may be either one of these, with no apparent condition causing one or the other:
a) connection successful and the previous cycle runs again with no problems
b) java.io.IOException: read failed, socket might closed or timeout, read ret: -1

if the exception in case b) occurs, a power cycle of the remote Bluetooth device will cause the next Connect attempt to succeed, otherwise, no other connections will be established.
note that even if I kill and restart the app, the Connect will fail until the remote device is also reset, so I think the loose end, is at the remote device, not at the phone side.

am I missing some connection...



 

عقب
بالا