We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Bluetooth Library - platform issues
Page Index Toggle Pages: 1
Bluetooth Library - platform issues? (Read 554 times)
Bluetooth Library - platform issues?
Dec 6th, 2007, 3:32pm
 
I've been working with the modified BT library by Extrapixel(http://www.extrapixel.ch/processing/bluetoothDesktop/), and have achieved a working app that can write data, control object movements on screen, and send text to a computer application. All this functionalities were tested on a Sony Ericsson W810i. I have tried the application on a NokiaN95 and on a Motorola Razr...the midlet simply doesn't write any data. Then I tried to use the basic examples included with the library...but trying to write and read different data types to the server on through the connection event...nothing. The new image example running on the Nokia also takes the picture and after sending it,  I get no picture on the screen, just a kind of preloader that gets stucked. Can it be some security configuration? a kind of OS default? What do you think? I have no clue yet...

Re: Bluetooth Library - platform issues?
Reply #1 - Dec 6th, 2007, 5:44pm
 
hi!
so, it just does not work on the nokia and motorola? I've tested my examples on sony ericsson w810i and on a nokia of about the same age (can't remember the name though).
So, you aren't getting error messages of any sort? Maybe it is some security setting on the phone... but I have no experience with the phones you mentioned. Does nothing get transmitted at all, or just not everything?
Re: Bluetooth Library - platform issues?
Reply #2 - Dec 6th, 2007, 6:20pm
 
Hi, sorry about the not so clear message. To clarify...on the Sony Ericsson, the middlet runs, and all the data is written. I tried the Nokia N95 and an old Razr and the midlet runs but no data of any type is transmitted. Wherever I call a writeXX();method in the midlet, the readXX(); in the computer seems to stop the code from running while waiting for the value that never comes. I guess something can also be wrong with the code...but why it works ok on the Sony?

Codes that illustrate the problem are found here:

http://chronos.zkm.de/~luis/codes/

thx
Re: Bluetooth Library - platform issues?
Reply #3 - Dec 13th, 2007, 9:47pm
 
It was indeed the code. Never forget to flush(); the Toilet... Forget about phone issues and thanks for the reply!
Re: Bluetooth Library - platform issues?
Reply #4 - Dec 14th, 2007, 10:44am
 
alright, thanks for clearifying. I'm now curious if my simple examples have the same flush()-issues on the phones you mentioned? I'd be glad if you could try that and post your results back here Cheesy

grüsse,
patrick
Re: Bluetooth Library - platform issues?
Reply #5 - Dec 14th, 2007, 12:55pm
 
Hi Patrick, actually the only example that has troubles in the Nokia N95 is the image transfer one. It first, doesn't show the camera image properly(It flickers and what you see most of the time is black), and second, after asking for the permission to connect to the server, the program stops showing the messages it should show...after that, by pushing buttons you come to an end where you get the "image sent" message and you get this preloader on the server's screen, that doesn't show any progress...if you keep on pushing buttons it takes another picture and sends an 'out of memory exception'.

I'll try to play around it while I still have the NOKIA with me, and see what's the problem...but rightnow I'm finishing smthng else.

BTW. A question: Is it possible to detect when a client has closed the connection and viceversa? I have some troubles with that...

Thx
Re: Bluetooth Library - platform issues?
Reply #6 - Dec 14th, 2007, 1:24pm
 
thanks! I guess I just need to put flush() stuff in there too.
i think the only way to see if a connection is lost, is to catch exceptions when interacting with a client.

for example:
try {
  client.writeUTF("currywurst");
} catch (Exception e) {
  println("connection lost");
  state=STATE_NOT_CONNECTED;
}
Page Index Toggle Pages: 1