Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Problem connection after acceptAndOpen

46 views
Skip to first unread message

Fabio Di Giuseppe

unread,
Oct 1, 2014, 9:23:51 AM10/1/14
to bluecov...@googlegroups.com
Hi guys,
i have a problem.
First, i have to set my device as discoverable for another device, and then i wait.

CODE

url = "btspp://localhost:"+macaddress;

System.out.println("Setting device to be discoverable...");

local = LocalDevice.getLocalDevice();

local.setDiscoverable(DiscoveryAgent.GIAC);

System.out.println("Start advertising service...");

server = (StreamConnectionNotifier)Connector.open(url);

System.out.println("Waiting for incoming connection...");

con = (StreamConnection) server.acceptAndOpen();


after this, if i close the server (acceptandopen) because i need to send something to the same device, i get an error on line 2

CODE

1 url = "btspp://"+macaddress+":5";

2 con = (StreamConnection) Connector.open(url); 


ERROR

java.io.IOException: Failed to connect. [115] Operation now in progress

at com.intel.bluetooth.BluetoothStackBlueZ.connectionRfOpenClientConnectionImpl(Native Method)


Why?

Thank you at all.

Reply all
Reply to author
Forward
0 new messages