On Sun, 2020-04-12 at 20:43 +0200, Wolfram Sang wrote:
>
> > Is it intended that potential sp_flush() errors get ignored?
> > (Assuming that DEBUG() is silent in regular applications. And at
> > most only results in output but won't affect the return code.)
>
> Yes, to avoid regressions. That shows I rate an error there as 'not
> critical'. I have no strong opinion, though, so can be convinced
> otherwise.

I'm fine with either choice. Ignoring flush errors is acceptable
to me in that location. It's just that the souce code alone did
not clearly communicate that intention, might as well have been
an omission. Add a comment perhaps?

> > Notice that sigrok grew support for several types of serial
> > communication. Libserialport is one of them, but no longer is the
> > only one (HID and BT got implemented, network support and others
> > could get added). Given that libserialport is used in other
> > projects outside of the sigrok environment, is it worth adjusting
> > both the libsp open routine as well as libsigrok's common serial
> > abstraction layer?
>
> I am not sure what you mean exactly here, however I think it is
> generally a good idea to flush buffers when opening a serial port. This
> is why I think libserialport is a good place. Again, I am open for
> discussion.

Did not question that. Quite the opposite. What I tried to say
is this:

libsigrok drivers call into the common libsigrok serial layer.
Which may or may not end up in libserialport. Other means of
communicating serial data are also supported. That's why I
suggested to also adjust that location in the libsigrok serial
layer to cover all transports.

And what I said is that libserialport is also used in setups that
don't involve sigrok components. Which is why I also supported
the adjustment of the libsp open call. That's why I referred to
"both".

And considering the frequency with which applications are opening
serial ports, how expensive that operation already is, and that
it's done for improved robustness, I feel that flushing RX/TX
data two times per open call in the libsp case is acceptable. One
or both of these calls should be cheap when there is no data
anyway.


virtually yours
Gerhard Sittig
--
     If you don't understand or are scared by any of the above
             ask your parents or an adult to help you.


_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to