{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", "patternmode"},
- {SR_HWCAP_RLE, SR_T_CHAR, "Run Length Encoding", "rle"},
+ {SR_HWCAP_RLE, SR_T_BOOL, "Run Length Encoding", "rle"},
{0, 0, NULL, NULL},
};
g_message("initializing %s plugin", plugin->name);
num_devices = plugin->init(NULL);
for (i = 0; i < num_devices; i++) {
- num_probes = (int)plugin->get_device_info(i, SR_DI_NUM_PROBES);
+ num_probes = GPOINTER_TO_INT(
+ plugin->get_device_info(i, SR_DI_NUM_PROBES));
sr_device_new(plugin, i, num_probes);
}
const char *triggerstring);
uint64_t sr_parse_sizestring(const char *sizestring);
uint64_t sr_parse_timestring(const char *timestring);
+gboolean sr_parse_boolstring(const char *boolstring);
#endif
return time_msec;
}
+
+gboolean sr_parse_boolstring(const char *boolstr)
+{
+ if (!boolstr)
+ return FALSE;
+
+ if (!g_strcasecmp(boolstr, "true") ||
+ !g_strcasecmp(boolstr, "yes") ||
+ !g_strcasecmp(boolstr, "on") ||
+ !g_strcasecmp(boolstr, "1"))
+ return TRUE;
+
+ return FALSE;
+}
+