Is there any way to shutdown the BlueCove stack, in my application user can able to start, stop and restart the bluetooth server whenever they wish, for that I can able to start the server, listen for connection, accept message from the client. But when I try to stop and restart the BlueCove, I’m gettting BluetoothStateException, instead I’ve to restart the application itself.
For shutting down I used,
BlueCoveImpl.shutdown();
and another thing
BlueCoveImpl blueCoveImpl = BlueCoveImpl.instance();
blueCoveImpl.setBluetoothStack(null);
but both not worked for me.
Any Ideas to do this.
EDIT: When I close the whole application it displays
BlueCove stack shutdown completed
in the Console.
Thanks.
When I start the Bluetooth server, I set it to be visible in search mode using,
and to stop the server I just added the following code,
and this one solved my problem.