views:

536

answers:

2

Hi,

I'm trying to write part of a J2ME application and I'm responsible for reading NMEA data from a GPS device attached via bluetooth (to a Dell Axim X51 PDA).

I've paired the gps device with the PDA and I can run the sample program that comes with the gps device and it succesfully streams NMEA strings.

In system settings, in GPS settings, I've set up a COM port (8) for programs to use to obtain GPS data, however, when providing the details for the GPS hardware port there doesn't seem to be a matching baud rate to the one I had to use in the sample program? Does this matter? What does baud rate actually mean?

Now, as far as I understand the settings, I should now be able to read NMEA data over COM 8?

However, when I print out:

System.getProperty("microedition.commports")

COM8 does not appear in the list returned and if I try and open a connection on that port I get the following error:

java.io.IOException: GetCommState() failed; error code=21, (21) The device is not ready.

Any pointers on successfully setting up the COM port for reading, and actually reading from it would be most welcome. I'm pretty stumped and clueless as to what to do.

Thanks in advance

Adam

A: 

There is a good chance the j2me implementation on your device doesn't support bluetooth COM ports at all. I would suggest confirming that first. It could be worth comparing the result of the system property call on other (recent) handsets.

QuickRecipesOnSymbianOS
A: 

Don't know about that particular device, but the usual way of opening a bluetooth COM port in J2ME is using the JSR-82 API.

You would scan for devices within your vicinity, figure out which is your GPS (usually contains "GPS" in the friendly name), scan for services on that device (most GPSs only offer one), and open a BTSPP connection to that service.

funkybro