Bug 264 - Drivers need to report options properly according to sdi and probe groups
Summary: Drivers need to report options properly according to sdi and probe groups
Status: CONFIRMED
Alias: None
Product: libsigrok
Classification: Unclassified
Component: API (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-13 02:09 CET by Bert Vermeulen
Modified: 2014-01-13 02:09 CET (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bert Vermeulen 2014-01-13 02:09:47 CET
- config_get() is not guaranteed to have a non-NULL sdi, so sdi must be checked before use. Keys that don't require an sdi may be returned before sdi is checked -- so are valid regardless of sdi. Keys that do require sdi must be handled only after the check. If sdi is required but is NULL, SR_ERR_ARG must be returned.

- config_list() must be very particular in what it returns, depending on sdi and/or probe group:
 - SR_CONF_SCAN_SETTINGS is always valid, regardless of sdi or probe group.
 - if sdi is NULL, nothing except SR_CONF_SCAN_SETTINGS can be provided.
 - if probe_group is NULL, only the SR_CONF_DEVICE_OPTIONS that are not specific to a probe group must be returned. If a probe group is non-NULL, this key must return a different list. There must be no overlap between the lists: either a key requires a probe group or it doesn't.

- If a driver needs probe groups at all, i.e. it has settings which are particular to one (group of) probes but not another, the config_get/set/list() implementation for a key that requires a probe group must return SR_ERR_NA.
probe group options should look like this, in general: