Hi,

Thanks for your reply.

On 2014-09-15 23:34, Uwe Hermann wrote:
> On Thu, Sep 11, 2014 at 12:50:07AM +0200, Uffe Jakobsen wrote:
>> * FIX:
>> send_shortcommand() and send_longcommand() did not ensure that the commands
>> were actually sent. Hence the initial 5 times reset followed by identify
>> never left the buffer.
>>
>> The attached patch (against HEAD) fixes above described problem on FreeBSD
>> (10.0)
>
> Great, thanks! I'll give this is a test-run on Linux and Windows as well
> soonish, I'm guessing it'll be an issue that also happens on other OSes (?)
>

Depending on the internal OS buffer-handling it may or may not be a 
problem - in other words it is platform dependant.

On FreeBSD the (serial) buffer needs to be actively flushed (drained) if 
you wish to ensure that the buffer is transmitted to the device within a 
reasonable time.

The buffer will eventually be flushed by the OS - but that typically 
happends after more than 200-300ms (or longer) - and by that time the 
sigrok OpenLogicSniffer input device "driver" have already given up 
listening for a reply to the identify command.

>
>> +SR_PRIV int serial_drain(struct sr_serial_dev_inst *serial)
>
> If the sp_drain() is indeed required, please add them in the ols driver
> directly. We're planning the reduce the amount of serial wrappers in
> serial.c over time (in favor of direct libserialport calls), we'd rather
> not add new wrappers like serial_drain() at this point.
>

I'm quoting your own doxygen documentation on libserialport's 
sp_blocking_write():

*** QUOTE ON ***
Note that this function only ensures that the accepted bytes have been 
written to the OS; they may be held in driver or hardware buffers and 
not yet physically transmitted. To check whether all written bytes have 
actually been transmitted, use the sp_output_waiting() function. To wait 
until all written bytes have actually been transmitted, use the 
sp_drain() function.
*** QUOTE OFF ***

If I'm right in my assumtion:

Then every input device "driver" that uses libserialport would need to 
write and then drain its commands for correct operation on all platforms 
- why not hide that in complexity in a (serial) wrapper layer just above 
the libserialport ?

With OpenLogicSniffer beeing the only input device that AFAIK currently 
uses libserialport - it seems to me that noone ever used 
OpenLogicSniffer with the new libserialport impl on FreeBSD ?

I'll create a bug report with the debug output details

Kind regards Uffe :-)




------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to