Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


lovemeabyssinia

8 posts

Wannabe Geek


#36530 27-Jun-2009 08:40
Send private message

hi there,

i wrote a code that will create a connection between my nokia 6300 mobile and Bluesoleil on my pc. i just want the mobile to be the server and the pc a client using the btspp. i want to connect to the bluesoleil and send a text from the mobile. However, the mobile can not get connected to the pc. it'll just stuck after asking my confirmation to connect. By the way, i've set both serial port A and B on the Bluesoleil.  What could be the problem? is there any tutorial on this topic?

the connection could not be established. it just stop responding when it executes the acceptAndOpen() method.

what do you guys suggest?

Create new topic
freitasm
BDFL - Memuneh
80652 posts

Uber Geek
+1 received by user: 41037

Administrator
ID Verified
Trusted
Geekzone
Lifetime subscriber

  #228724 27-Jun-2009 09:00
Send private message

Is the SPP on the PC an Incoming port?




Referral links: Quic Broadband (free setup code: R587125ERQ6VE) | Samsung | AliExpress | Wise | Sharesies 

 

Support Geekzone by subscribing (browse ads-free), or making a one-off or recurring donation through PressPatron.

 




lovemeabyssinia

8 posts

Wannabe Geek


  #228729 27-Jun-2009 09:17
Send private message

i've a bluetooth dongle on my pc detected by the Bluesoleil 2.7.0.8 VoIP. i set the serial port A and B on the bluesoleil. is it not enough?

freitasm
BDFL - Memuneh
80652 posts

Uber Geek
+1 received by user: 41037

Administrator
ID Verified
Trusted
Geekzone
Lifetime subscriber

  #228730 27-Jun-2009 09:28
Send private message

IIRC Serial Ports are uni-directional - either Incoming or Outgoing. If you are expecting a connection from another device then it should be Incoming (or Server in some software).





Referral links: Quic Broadband (free setup code: R587125ERQ6VE) | Samsung | AliExpress | Wise | Sharesies 

 

Support Geekzone by subscribing (browse ads-free), or making a one-off or recurring donation through PressPatron.

 




lovemeabyssinia

8 posts

Wannabe Geek


  #228739 27-Jun-2009 09:58
Send private message

i want the mobile device to act as a server. I've set the Serial Port A and B on the Bluesoleil. i want my pc (Bluesoleil) to act as a client. my problem is that the acceptAndOpen() can not proceed. What do you recommend me, then?

freitasm
BDFL - Memuneh
80652 posts

Uber Geek
+1 received by user: 41037

Administrator
ID Verified
Trusted
Geekzone
Lifetime subscriber

  #228742 27-Jun-2009 10:15
Send private message

Reading the description again - and not knowing where the code is running... Are you iniiating the connection from a program on your PC or Mobile?





Referral links: Quic Broadband (free setup code: R587125ERQ6VE) | Samsung | AliExpress | Wise | Sharesies 

 

Support Geekzone by subscribing (browse ads-free), or making a one-off or recurring donation through PressPatron.

 


lovemeabyssinia

8 posts

Wannabe Geek


  #228743 27-Jun-2009 10:22
Send private message

Sorry sir, i am initiating the connection from the mobile. Which means, the connection code is on the mobile

 
 
 

Shop now at Mighty Ape (affiliate link).
lovemeabyssinia

8 posts

Wannabe Geek


  #228749 27-Jun-2009 10:54
Send private message

here is the code that is supposed to establish the connection

LocalDevice device;
UUID uuid = new UUID("F0E0D0C0B0A000908070605040302010", false);//spp

try {
device = LocalDevice.getLocalDevice();
device.setDiscoverable(DiscoveryAgent.GIAC);

service = (StreamConnectionNotifier) Connector.open("btspp://localhost:" + uuid.toString() + ";name=BTClient;authorize=true");
ServiceRecord record = device.getRecord(service);
device.updateRecord(record);
bluetoothConnection = service.acceptAndOpen();
dataOut = bluetoothConnection.openDataOutputStream();
dataIn = bluetoothConnection.openDataInputStream();
System.out.println("Client Connected!");

} catch (Exception ioe) {
System.out.println("Excetpion stating BTServer: " + ioe.getMessage());
ioe.printStackTrace();
error(ioe.getMessage());
}

however, the execution stops at acceptAndOpen()

Create new topic








Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.