Bug 1253

Summary: Scan doesn't seem to wait for FX2 renumeration
Product: libsigrok Reporter: Uwe Hermann <uwe>
Component: Driver: fx2lafwAssignee: Nobody <nobody>
Status: CONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unreleased development snapshot   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Uwe Hermann 2018-07-24 20:34:39 CEST
Running a --scan in sigrok-cli for fx2lafw devices returns pretty much immediately. It *does* upload a firmware to all scanned potential fx2lafw devices, but doesn't wait for a successful renumeration. The dev_open() does wait for it (or errors out if it didn't work after a certain time).

We should probably have the scan do the same. Otherwise sigrok-cli results (among other things) are pretty confusing:

$ sigrok-cli --scan
The following devices were found:
fx2lafw - CWAV USBee SX with 8 channels: D0 D1 D2 D3 D4 D5 D6 D7
fx2lafw - CWAV USBee SX with 8 channels: D0 D1 D2 D3 D4 D5 D6 D7

Re-run immediately:

$ sigrok-cli --scan
The following devices were found:
[None]

Re-run after a few seconds:

$ sigrok-cli --scan
The following devices were found:
fx2lafw:conn=2.30 - CWAV USBee SX with 8 channels: D0 D1 D2 D3 D4 D5 D6 D7
fx2lafw:conn=2.31 - CWAV USBee SX with 8 channels: D0 D1 D2 D3 D4 D5 D6 D7

The conn will only be shown after successful renumeration, and having to re-run to see this info is not intuitive for users. During renumeration the --scan will return empty, which is also confusing.