You Are Here:

Community: Developer Discussion Boards

#1 Old How to make a JSR-82 Serial Port Service? - 2003-11-18, 15:25

Join Date: Mar 2003
Posts: 77
moamoa
Offline
Regular Contributor
From the 6600, I am able to use device discovery to get devices, and then find a Serial Port Service (SPS) on a device. I can then bond to that, this works fine.

However, I am having problems when trying to open a SPS on the 6600 when orginated from another device (in my case a PC).

If I use the PC BT application to scan the 6600 (with no midlet running), it shows numerious profiles available including a SPS. Next, I start my midlet which opens a server socket as;

try {
StreamConnectionNotifier server = null;
LocalDevice local = LocalDevice.getLocalDevice();
local.setDiscoverable(DiscoveryAgent.GIAC);
server = (StreamConnectionNotifier)Connector.open(
"btspp://localhost:11111111111111111111111111111111");
devList.append("Waiting ...",null);
conn = server.acceptAndOpen();
devList.append("Open!",null);
InputStream is = conn.openInputStream();
byte[] buff = new byte[128];
for (int i=0; i<3; i++) {
is.read(buff);
String s = new String(buff);
devList.append(s.length()+", "+s,null);
}
is.close();
conn.close();
server.close();
}
catch (Exception ex) {
alert.setString(ex.toString());
display.setCurrent(alert);
}

The midlet runs fine with no errors, and sits blocking on the acceptAndOpen() method. I assume I now have 2 SPS's running the Symbian OS's one and my JSR-82 one, is this right?

Now, I rescan the services on the 6600 from the PC, this still show only one SPS, is this mine or the original Symbian OS one? If I try and open this SPS via the PC it fails.

How do I make the SPS for the midlet take priroity over the standard one that is always running?

Help please?
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

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