On Tue, 12 Nov 2013 10:56:42 +0000, Martin Ling <[email protected]> wrote:
> On Tue, Nov 12, 2013 at 09:51:04AM +0100, Bert Vermeulen wrote: > > The driver just asks libserialport, supplying any info it has on > > what kind of serial port it wants: the driver might know for sure > > the port is behind a specific VID/PID, for example. > > I'd be inclined to do this the other way round; give the driver the > list of what's available and then let it go through and match the > ones it's interested in. That makes sense. > > I'm not so sure this is really needed -- a scan for ports is not an > > expensive operation. > > I'm not convinced yet that it won't become annoying on some operating > systems, especially once there are a sufficient number of drivers. > > The current enumeration operations in libserialport on the "big three" > OSes seem reasonably quick, but I'm not certain yet if that will > always be the case. Once you've eliminated "fake" static serial ports -- the devices are just always there -- you can keep that list cached, right? Then it's just a matter of checking only for dynamic devices, or even devices that show up and aren't in the list of already handled ones. > > libserialport might even cache this list to save even this effort -- > > it's static once eumerated, after all. > > No, absolutely it is not. The available ports can change at any time > as hardware is hotplugged and so libserialport should never cache the > list. If libsigrok wants to cache the list it will need to wrap the > call. I meant the "hardwired" serial ports. Mostly the ancient computers that still come with actual RS-232. But ok, that's not too common anymore. -- Bert Vermeulen [email protected] email/xmpp ------------------------------------------------------------------------------ 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

