You Are Here:

Community: Developer Discussion Boards

#1 Old NOKIA Experts.Please advice! - 2006-04-17, 15:19

Join Date: Oct 2005
Posts: 1,149
Location: Hyderabad,India
Priju Jacob Paul's Avatar
Priju Jacob Paul
Offline
Super Contributor
hi all,
Im working on an BT application.The thing is that i need to send a notification to the other mobile phone user asking him to open my application and connect to mine.
Hence forth i used OBEX to connect and send a message which goes to his inbox.

now,as the obex servers are not able to send messages to the client i need to transfer the connection to RFCOMM and proceed with the chat!

I have done all these part.But the problem is with the swtiching between OBEX and RFCOMM.

Even thogh i disconnect (closing the server and the client) im not able to connect immediately.i get the message like "Maximum amount of bluetooth connections in use.Cant establish a new one"
Why is that so?
Can any of you please suggest me how to recover from this problem.I need to switch the connecting protcols by staying with in the application.If i exit from the application and try again it works fine..
PLEASE HELP ME OUT!!!

Regards

Priju
Reply With Quote

#2 Old Re: NOKIA Experts.Please advice! - 2006-05-27, 08:25

Join Date: Dec 2005
Posts: 1,159
Location: England,UK
jimgilmour1's Avatar
jimgilmour1
Offline
Forum Nokia Champion
Hi,I dont know whose OBEX stack you are using on PC. I am assuming you are using XP SP2 bluecove and de.aventena. I use these because they are free so I will talk about these as I have source code for these.
Typically they are run in a seperate Thread. This thread is not accessible once started therefore after a Thread m.start(); we need an m.join() to get back.
When you opened the session with btgeop:// and recieved a SessionNotifer back as a result from the acceptAndOpen, did you know that is really a btspp:// connection that goes out and has to be replied with btspp://.

Because of this I have cast my returned SessionNotifier as a StreamNotifier.
----------------------------------------------------------------
String url = "btgoep://localhost:" + uuid + ";name=BTTP;authenticate=false;master=false;encrypt=false";


try{

// obtain connection and stream to this service
btServerNotifier = (StreamConnectionNotifier) Connector.open( url );
} catch ( Exception e) {
e.printStackTrace();
}

while (mServerState )
{
StreamConnection btConn = null;
try {
updateStatus("[server:] Now waiting for a client to connect");

btConn = btServerNotifier.acceptAndOpen();
} catch (IOException ioe) {

}
if (btConn != null) processConnection(btConn);
}
}
---------------------------------------------------------------------
This means I can open the connection and hang on to it and I can open and close channel. I do however lose the benifit of the File transfer functions onGet and onPut.

Have you checked the channels with
try { op.close}
catch (IOexception) { System.out.put("the channel was closed");}
To see if its really closed?.

my process code calls a new Thread and needs to .join before I can close and leave the code.
Sorry if this is vague but there is so much variance is systems today.
In Java everyone has there own setup.
Good Luck

Jim
Reply With Quote

#3 Old Re: NOKIA Experts.Please advice! - 2006-05-28, 22:07

Join Date: Dec 2005
Posts: 1,159
Location: England,UK
jimgilmour1's Avatar
jimgilmour1
Offline
Forum Nokia Champion
Reading the specification I see CLDC 1.0 supports

Quote:
On actual devices this is limited to the non parked
connection use case, which leaves the figure at 7.
Please can you check the values of bluetooth :-
using
public static String propertyValue = LocalDevice localDevice.getProperty("bluetooth.connected.devices.max");
//The maximum number of connected devices supported.
//This number may be greater than 7 if the implementation handles parked connections.
//The string will be in Base 10 digits.

public static String propertyValue = LocalDevice localDevice.getProperty("bluetooth.sd.trans.max");
//Maximum number of concurrent service discovery transactions. The string will be in Base 10 digits.

Well I just hope its java you are working in.
Good Luck
Jim
Reply With Quote

#4 Old Re: NOKIA Experts.Please advice! - 2006-06-02, 13:02

Join Date: Oct 2005
Posts: 1,149
Location: Hyderabad,India
Priju Jacob Paul's Avatar
Priju Jacob Paul
Offline
Super Contributor
Hi Jim,
im sorry for not keeping you updated.anyway thanks a ton for the reply.That project is all up..and for your kind information im not onto Java.Im working in c++.
GoodLuck!
Regards
Priju
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
About the nokia doc: A MIDlet Example Using the Wireless Messaging API ... SStefano Mobile Java Tools & SDKs 2 2008-04-03 20:02
Nokia 6310 or 8910 : PC suite not possible today olivieradler Bluetooth Technology 0 2005-10-13 01:12
createImage on Nokia Series 40 MIDP Concept SDK Beta 0.3 GerardMason Mobile Java Media (Graphics & Sounds) 2 2003-09-30 11:00
Nokia 3310 - Smart Messaging compatibility Nokia_Archive Smart Messaging 2 2002-05-22 14:22

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia