libftdi Archives

Subject: Re: ftdi_setflowctrl() incorrectly sets XON and XOFF character values

From: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Cc: Pawel Jewstafjew <pawel.jewstafjew@xxxxxxxxx>
Date: Fri, 15 Sep 2017 18:30:37 +0200
Hi Pawel,

On Sunday, 10 September 2017 17:02:54 CEST Pawel Jewstafjew wrote:
> Or, to preserve backward compatibility of the libftdi ABI, this can be
> also done by adding a new function, for example:
> 
> int ftdi_setflowctrl_xonxoff(struct ftdi_context *ftdi, uint8_t xon,
> uint8_t xoff)
> {
> […]
> uint16_t value = (xoff_char << 8) | xon_char;
> if (usb_control_msg(ftdi->usb_dev, FTDI_DEVICE_OUT_REQTYPE,
>                         SIO_SET_FLOW_CTRL_REQUEST, value,
> (SIO_XON_XOFF_HS | ftdi->index),
>                         NULL, 0, ftdi->usb_write_timeout) != 0)
> […]

I would prefer the second approach since it will be API compatible, the ABI
is not so important as we can just increase the .so number. Breaking existing 
source code would be more of a pain for distributions and users.

Do I understand the existing code correctly: It allows you do
enable XON/XOFF mode like it is documented, but misconfigures
the actual XON/XOFF characters?

Please send a proper git patch and I'll include it.

Thank you,
Thomas


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx

Current Thread