[Gambas-user] Serial port (gb.net) curious error - reading byte value incorrectly.

Benoît Minisini gambas at ...1...
Wed Jan 13 15:37:37 CET 2010


> On 13/01/10 11:00, Anthony Ivan wrote:
> > Hello to All,
> >
> > [Gambas 2.19.0-1 on Fedora 12, Intel X86_64]
> >
> > I am currently working on a little project that communicates with a VHF
> > radio via the MAP27 instruction set. All is working perfectly except for
> > one small error... as detailed below...
> >
> > When the radio communicates with the PC the serialport_read() triggers
> > perfectly and takes the byte's of data provided and places them into a
> > queue for processing ... a typical translated incoming hex string may
> > look something like:
> > 16 10 02 04 01 00 00 10 03
> >
> > The next message will increment the 5th byte value by one thus giving:
> > 16 10 02 04 02 00 00 10 03
> >
> > Oddly enough if the value coming to the serial port from the radio is 1D
> > (binary value 00011101), Gambas seems to see that value as 1A (binary
> > value 00011010).
> > Every other input is working perfectly... and there is absolute
> > certainty that the incoming byte value is indeed 1D. Also, the outbound
> > side is ok... if I reply to the radio as if it had sent a 1D with the
> > appropriate CRC16 checksum everything is happy. Could this be a small
> > error in the serial code (gb.Net) that someone has encountered or rather
> > a known issue elsewhere which I have not yet found in my searches?
> >
> > Thanks,
> >
> > Anthony
> 
> We've discussed that about one month ago. It is about a flag that must
> be set/cleared. The thread can be found in the archive.
> 
> Regards
> Werner
> 

Yes. I forgot that problem.

I fixed it in revision #2610. Now the CR/NL input conversion flags are cleared 
when opening a serial port.

Regards,

-- 
Benoît Minisini




More information about the User mailing list