Saturday, February 25, 2012

Implemented Quit() function for CLD and BlueMesh

We have implemented a quit function for BlueMesh. While in the application (using Commandline Like Display), hit the "options" button and then a quit option will appear. This calls a quit function in the CLD service, which in turn calls a disconnect() function from blueMeshService. From here, the threads are interrupted and the sockets are closed.

We had a bit of trouble with this at first. The first issue was with the clientThread quitting properly. Before having the thread interrupted, all the sockets opened must be closed. Also, IOExceptions cause a bit of trouble with the thread.interrupt() flag, so we used a boolean. Second, CLDMessage uses a blocking call to get a line from the Android Keyboard. since CLDMessage.getLine() was being called from a thread in the blueMeshDisplay example service, we implemented a function that calls alertAll() from within the CLDMessage class.


We hope to have an official Beta release very soon.

No comments:

Post a Comment