View Single Post
  #6 (permalink)  
Old 11-10-2007, 03:01 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 325
amansundar is on a distinguished road
Default Re: Exception "security block" while connecting to bluetooth device

I have the same problem with a K800i.

Start server, start client, first connection... all ok.

both server and client, close the Connection (server close StreamConnectionNotifier too),

next,
restart server conn (not app!), restart client conn, client throws "security block" !

So,
the first connection don't make problem, all next connections make a "security block" until the application server be closed and restarted.

And I don't have any idea how to fix the problem

These are the server and client codes to make connection url:
(if there are any security problem, the problem is in these codes)
----------------------------------------------------------
// Server

Code:
LocalDevice.getLocalDevice().setDiscoverable( DiscoveryAgent.GIAC );

StringBuffer url = new StringBuffer();
url.append("btspp://localhost:");
url.append( BToothInitServer.SERVER_UUID.toString() );
url.append(";authenticate=false");
url.append(";authorize=false");
url.append(";encrypt=false");
url.append(";name=" + BToothInitServer.SERVER_NAME );

notifier = (StreamConnectionNotifier) Connector.open( url.toString() );
----------------------------------------------------------
// Client

Code:
String url = clientServiceRecord.getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);
conn = (StreamConnection) Connector.open(url);

----------------------------------------------------------
__________________
cheers
Aman

Last edited by amansundar : 11-10-2007 at 03:04 AM.
Reply With Quote