Hi all, I'd like to kick off a discussion on how to improve the way we scan for hardware. I'm going to focus on serial devices but some of the issues are common to other sorts of devices too, I think.
Currently, each driver has a scan() function and frontends basically do this: - Where a driver is specified, call scan() for that driver (passing in any connection parameters provided by the user). - Otherwise, call scan() for all drivers in turn. For serial devices, we're now integrating libserialport (http://github.com/martinling/libserialport) which replaces all the OS-specific serial code in libsigrok, and also provides us the ability to scan for available serial ports in an OS-independent way. Currently you just get the port names, but the next version should also offer details such as USB VID/PID for each detected port. For devices that can be uniquely identified from this information that's great, because those drivers can then find their devices with no user intervention. For those that can't though, it's less clear what we should do. In a GUI frontend, we want to be able to take advantage of the ability to scan for serial ports and then offer the user a list of candidates to choose from for a given driver, rather than having to type one in. But what call should be made to get that list? It would also be nice to avoid the situation where the scan for ports is done over and over again by each driver. The current approach provides no straightforward way for them to share this information. It seems like it would be good to have some sort of shared "pre-scan" for usable hardware (serial ports, USB devices, and whatever else). Each driver could then look through the results to identify the ones that it might be able to use. This would be more efficient and would allow us to present better UI to the user. What does everyone think? Martin ------------------------------------------------------------------------------ November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk _______________________________________________ sigrok-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sigrok-devel

