Skip to main content

FileOutputStream and serial communication Problem

4 replies [Last post]
rgw21
Offline
Joined: 2010-07-25
Points: 0

Hi, I upgraded from IBM J9 to Phoneme advanced, and when I test my applicationo on WinCE + WinMobile 5+6, I faced a problem with the serial communication,

My Code says:
FileOutputStream out = new FileOutputStream("COM5:");

I got the following Exception:
java.io.FileNotFoundException: COM5:
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:194)
at java.io.FileOutputStream.(FileOutputStream.java:85)
at com.bisan.hh.ExtechPrinter.openOutputStream(ExtechPrinter.java:60)

Thanks for help.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Gary Adams

On 8/27/10 4:27 AM, phonemeadvanced@mobileandembedded.org wrote:
> Hi, I upgraded from IBM J9 to Phoneme advanced, and when I test my applicationo on WinCE + WinMobile 5+6, I faced a problem with the serial communication,
>
> My Code says:
> FileOutputStream out = new FileOutputStream("COM5:");
>
> I got the following Exception:
> java.io.FileNotFoundException: COM5:
> at java.io.FileOutputStream.open(Native Method)
> at java.io.FileOutputStream.(FileOutputStream.java:194)
> at java.io.FileOutputStream.(FileOutputStream.java:85)
> at com.bisan.hh.ExtechPrinter.openOutputStream(ExtechPrinter.java:60)
>
> Thanks for help.
> [Message sent by forum member 'rgw21']
>
> http://forums.java.net/jive/thread.jspa?messageID=481133
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
> For additional commands, e-mail: advanced-help@phoneme.dev.java.net
>
Perhaps the CommConnection is the API you need.

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

davyp
Offline
Joined: 2007-01-03
Points: 0

Have you tried the CommConnection API?

Here is a javax.comm example with libraries I used to read the NMEA sentences of a Bluetooth
GPS module through its Serial Port Profile:

http://davy.preuveneers.be/phoneme/?q=node/16

Davy

rgw21
Offline
Joined: 2010-07-25
Points: 0

Thanks for your reply, regarding your question..yes i tried the jars "comm.jar, jcl.jar and the dll file) from that link, should I used different jars for windows mobile v5.

when I debugged the code I found that it failed just before the while loop:
---------
while (portList.hasMoreElements())
--------
since I was able to system.out the portList.

Caught java.lang.UnsatisfiedLinkError: \Flash Disk\bsn\rxtxSerial.dll while loading driver gnu.io.RXTXCommDriver

Thanks,

Message was edited by: rgw21

rgw21
Offline
Joined: 2010-07-25
Points: 0

I also tried to use javax.comm as but got this exceptoin:

Caught java.lang.UnsatisfiedLinkError: \Flash Disk\bsn\rxtxSerial.dll while loading driver gnu.io.RXTXCommDriver

any idea?