*/
/* TODO: This shouldn't be a global. */
SR_API struct sr_hwcap_option sr_hwcap_options[] = {
+ /* Driver scanning options. */
+ {SR_HWOPT_MODEL, SR_T_KEYVALUE, "Model", "model"},
+ {SR_HWOPT_CONN, SR_T_CHAR, "Connection", "conn"},
+ {SR_HWOPT_SERIALCOMM, SR_T_CHAR, "Serial communication", "serialcomm"},
+ /* Device instance options. */
{SR_HWCAP_SAMPLERATE, SR_T_UINT64, "Sample rate", "samplerate"},
{SR_HWCAP_CAPTURE_RATIO, SR_T_UINT64, "Pre-trigger capture ratio", "captureratio"},
{SR_HWCAP_PATTERN_MODE, SR_T_CHAR, "Pattern generator mode", "pattern"},
{SR_HWCAP_FILTER, SR_T_CHAR, "Filter targets", "filter"},
{SR_HWCAP_VDIV, SR_T_RATIONAL_VOLT, "Volts/div", "vdiv"},
{SR_HWCAP_COUPLING, SR_T_CHAR, "Coupling", "coupling"},
- {SR_HWCAP_MODEL, SR_T_KEYVALUE, "Model", "model"},
- {SR_HWCAP_CONN, SR_T_CHAR, "Connection", "connect"},
- {SR_HWCAP_SERIALCOMM, SR_T_CHAR, "Serial communication", "serialcomm"},
{0, 0, NULL, NULL},
};
char *trigger;
};
-/* Hardware driver capabilities */
+struct sr_hwopt {
+ int hwopt;
+ const void *value;
+};
+
+/* Hardware driver options */
+enum {
+ /** Some drivers cannot detect the exact model they're talking to. */
+ SR_HWOPT_MODEL,
+
+ /** Specification on how to connect to a device */
+ SR_HWOPT_CONN,
+
+ /** Serial communication spec: <data bits><parity><stop bit> e.g. 8n1 */
+ SR_HWOPT_SERIALCOMM,
+};
+
+/* Hardware device capabilities */
enum {
SR_HWCAP_DUMMY = 0, /* Used to terminate lists. Must be 0! */
SR_HWCAP_DEMO_DEV,
- /*--- Device communication ------------------------------------------*/
- /** Some drivers cannot detect the exact model they're talking to. */
- SR_HWCAP_MODEL,
-
- /** Specification on how to connect to a device */
- SR_HWCAP_CONN,
-
- /** Serial communication spec: <data bits><parity><stop bit> e.g. 8n1 */
- SR_HWCAP_SERIALCOMM,
-
-
/*--- Device configuration ------------------------------------------*/
/** The device supports setting/changing its samplerate. */