Hi
I’m trying to implement a bluetooth library and in it I want to connect an rfcomm socket once and then reuse it on all calls.
I want to know if it’s connected or not in order to know if I should call the connect method.
I can’t find anything in the source code for Bluetooth sockets since it’s all native calls and there’s no isConnected method defined in the API…
Does anyone have any experience with this?
Hi I’m trying to implement a bluetooth library and in it I want to
Share
I think you would have a member variable maintain the state of your connection. on successful connection set it to true, start a thread that loops always reading bytes from the sockets inputstream and if you get an IOException on that thread, set your flag to false.