| Reply | « Previous Thread | Next Thread » |
|
Hello
I'm having a problem with a 6230i (haven't tested it with different nokias yet) and a PC-Mobile spp connection using bluecove. My program works well with motorola and sony ericsson devices. I build on the spp example (BTGallery) from benhuis site. I receive a msg from the PC, send back an answer (which works) and then I get: input stream already opened Well well, a bit of a surprise that this natel is the only one having that problem. Here the code I used on both, PC and mobile public void send(String s) { try { DataOutputStream out = c.openDataOutputStream(); out.writeUTF(s); print("writing: '" + s + "'"); out.flush(); Thread.sleep(1000); out.close(); Thread.sleep(1000); } catch (Exception e) { print("send error in spp server "+e.getMessage()); e.printStackTrace(); } } public String receive() { String s = null; try { // obtain an input stream to the remote service DataInputStream in = c.openDataInputStream(); // read in a string from the string s = in.readUTF(); print("reading: '" + s + "'"); Thread.sleep(1000); in.close(); Thread.sleep(1000); } catch (Exception e) { print("receive error in spp server "+e.getMessage()); e.printStackTrace(); } return s; } there's too a function for image receiving: private byte[] receiveImage(int numberOfBytes) { byte[] b = new byte[numberOfBytes]; try { DataInputStream in = c.openDataInputStream(); in.readFully(b); in.close(); Thread.sleep(1000); } catch (Exception e) { e.printStackTrace(); } return b; } -------------------------------------------- A different question is the authentication If i use for example btspp://0013fd9c52aa:25;authenticate=false;encrypt=false as service URL I still have to authenticate with passkey to enable the bt transfer. Is there a way to get around this or to automate it on the PC side? thanks Jossi |
|
Hi Jossnaz,
The problem with passkey is due to fact that you have not "paired" 6230i with the PC. Then you must set Autoconnect =yes on 6230i. You cannot bypass this security setting except when you have a commercial application which has been "signed" with a certificate. Development has to take place with "paired" devices. See OBEX code at http://discussion.forum.nokia.com/fo...highlight=obex Good Luck Jim |
| jimgilmour1 |
| View Public Profile |
| Find all posts by jimgilmour1 |
|
First of all, thanks the link is hot!
gotta give it a closer lookQuote:
Autoconnect is an option somewhere in the settings of the mobile which the user has to enter, not a piece of code I missed right? I guess this doesn't solve the PC-Side problem of having to accept pairing each time a new nokia-user tries to use the BT connection to the PC server? (what I'm programming is a Midlet which downloads questions from a server and sends back some answers. This midlet is meant to be used by the students coming to the courses of our professors... now if a Nokia-student decides to download the questions, but isn't paired with the server, the professor has to hit something like "click this message to pair the BT connection" which in fact, he simply will not do ) |
|
Quote:
Settings -> scroll down to Connectivity, red dot blue circles, Select (middle button), Bluetooth,Scroll down to "Paired devices" Select the already "paired Device", Select "Options", (left hand button) Scroll down one item to "Auto-conn with- out confirmation" Press Select, scroll up to yes, press Select, message pops up says "Confirmation will not be asked" Click back (right) until at main screen menu. Good Luck Jim |
| jimgilmour1 |
| View Public Profile |
| Find all posts by jimgilmour1 |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Problem with SPP and InputStream. Problem 2 how to get around authentication | Jossnaz | Mobile Java Networking & Messaging & Security | 0 | 2006-09-24 14:46 |
| 7610 SPP inputstream close after a single read() | aluckybird | Bluetooth Technology | 2 | 2004-12-28 14:25 |