Hi Bert, Am 26.10.2014 um 13:13 schrieb Bert Vermeulen <[email protected]>: >>>> There probably should be some sensible method of determining >>>> which drivers support certain device type. >>> >>> There is already one. >>> Grab the DEVICE_OPTIONS with sr_config_list() and check that >>> the list contains SR_CONF_LCRMETER. >> >> Yes, but that currently doesn't always work if I don't have >> the device yet (sdi == NULL). At least these drivers return >> an error if DEVICE_OPTIONS are tried to be listed without >> a device: >> >> atten-pps3203 >> demo >> hameg-hmo >> manson-hcs-3xxx >> motech-lps-301 >> scpi-pps >> yokogawa-dlm
Took it onto my todo list for manson-hcs-3xxx and motech-lps-301 because I wrote the motech driver and much of the manson driver, but this will take a while because I’m busy with other stuff currently. >> Of course if you think that is a bug, they can be fixed. Some >> of those may in reality not even care about the device at all, >> but just happen to check that one is given and return an error >> if there isn't one. > > Yeah, this is arguably a bug. These drivers basically present different > options based on the type of device found, and on whether a channel group > was selected. But they should also be returning what they can even without a > device, such as SR_CONF_LCRMETER. This is getting tricky if there are drivers where device detection needs to be done before the driver has detected the device and can tell what the device can do. Simple example: http://sigrok.org/wiki/Gossen_Metrawatt_Metrahit_29S This is a multimeter with energy measurement capability. It is currently supported by the driver gmc-mh-1x-2x-rs232 that can address nearly all Metrahit 1x and 2x multimeters, and there are a lot of different types. So what should the driver return, only SR_CONF_MULTIMETER or also SR_CONF_ENERGYMETER? Probably the driver should return the maximum it can do when called with (sdi == NULL) and the client application has to recheck when accessing a device instance. Bye, Matthias ------------------------------------------------------------------------------ _______________________________________________ sigrok-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sigrok-devel

