B BorisK Member Licensed User Longtime User Nov 9, 2013 #1 Hello, I wrote the application using Bluetooth connection like it is described in tutorial: http://www.b4x.com/android/forum/threads/android-serial-tutorial.6908/ I communicate with my own external hardware which is using BT module. It works excellent. But when I disconnect the connection in my application and then connect again the connection seems to be OK (I get toastmessage, control LED turns on) but the datastream is not established. Exiting from application doesn't help. I can fix this by: 1) turn my Samsung device off and on (just disabling and re-enabling Bluetooth is not enough) 2) go to Task manager and clear RAM; This helps! How could I save this problem inside my B4A application? Thank you very much!
Hello, I wrote the application using Bluetooth connection like it is described in tutorial: http://www.b4x.com/android/forum/threads/android-serial-tutorial.6908/ I communicate with my own external hardware which is using BT module. It works excellent. But when I disconnect the connection in my application and then connect again the connection seems to be OK (I get toastmessage, control LED turns on) but the datastream is not established. Exiting from application doesn't help. I can fix this by: 1) turn my Samsung device off and on (just disabling and re-enabling Bluetooth is not enough) 2) go to Task manager and clear RAM; This helps! How could I save this problem inside my B4A application? Thank you very much!
Erel B4X founder Staff member Licensed User Longtime User Nov 10, 2013 #2 Are you sure that you are correctly closing the connection? Upvote 0
B BorisK Member Licensed User Longtime User Nov 10, 2013 #3 That is what I do to close the connection (and nothing else): Code: Copy Serial1.Disconnect connected = False After this the control LED on my external hardware turns off. Last edited: Nov 10, 2013 Upvote 0
That is what I do to close the connection (and nothing else): Code: Copy Serial1.Disconnect connected = False After this the control LED on my external hardware turns off.
Erel B4X founder Staff member Licensed User Longtime User Nov 10, 2013 #4 Are you using AsyncStream? You should close it as well. Upvote 0
B BorisK Member Licensed User Longtime User Nov 10, 2013 #5 Yes, that was an issue! Thank you. Another question: Is the order of the following sentences important? Code: Copy AStream.Close connected = False Serial1.Disconnect Upvote 0
Yes, that was an issue! Thank you. Another question: Is the order of the following sentences important? Code: Copy AStream.Close connected = False Serial1.Disconnect
B BorisK Member Licensed User Longtime User Nov 11, 2013 #7 Thank you for your support, it helped me a lot. Upvote 0