> Hi
>
[quoted text clipped - 6 lines]
> device connected to the port will receive the garbage which I don't
> want.
Switch off the phone and restart it, then launch your application. The
very first time, does it have the garbage bytes?
If not, but all following times have it, then it means that when you
close the stream you leave some unsent bytes. The phone seems to keep
them until next time you open the port and send something. In this case,
make sure you flush() the outputstream at the end, before closing the
connection.
Hope it'll help.
JSC
Lureon - 16 Aug 2006 14:16 GMT
Hi Thanks for your reply
It's not a phone, it's a Wireless Module, but almost the same :)
It only does this the 1st time I open the connection (after a restart).
I have tried to flush() just after opening but it doesn't work.
If I open the connector:
Open the outputstream and inputstream
Then I write something and then flush.
The 'something' and the garbage are only sent when I have read the
1st message and replied ([garbage][something][reply])
After that, it works perfectly.
It seems like the flush doesn't work.
Does anyone know of any way to empty the buffer without sending the
data?
Thanks
Duane
> > Hi
> >
[quoted text clipped - 18 lines]
>
> JSC