Hi,
I just discovered this great tool, sigrok, Today. And having fun last
couple of hours. Thank you for creating great software.
While playing with sigrok-cli, I noticed that `sigrok-cli --show`
prints "(NULL)".
$ ./sigrok-cli --show
zeroplus-logic-cube - ZEROPLUS LAP-C(322000) with 32 channels: A0 A1 A2
A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4
D5 D6 D7
Supported configuration options:
(null):
Maximum number of samples: 2097152
:
:
The reason seems to be a mismatch between sigrok-cli and libsigrok
`sr_key_info_config`. That is, sigrok-cli is printing id when
srci->datatype == SR_T_STRING, but `sr_key_info_config` does not have
id set.
Browsing though the commit histry does not tell me id must be non-NULL
nor sigrok-cli better to print srci->name. Thus I decide to just
report the fact.
On my system with my device, the following change does not cause any
error and prints nicely. If it's ok, I can send a patch or pull
request.
best,
--
yashi
diff --git a/show.c b/show.c
index 54b367c..b5e4e0c 100644
--- a/show.c
+++ b/show.c
@@ -405,7 +405,7 @@ void show_dev_detail(void)
} else if (key == SR_CONF_SAMPLERATE) {
/* Supported samplerates */
- printf(" %s", srci->id);
+ printf(" %s", srci->name);
if (maybe_config_list(driver, sdi, channel_group,
SR_CONF_SAMPLERATE,
&gvar_dict) != SR_OK) {
printf("\n");
@@ -447,7 +447,7 @@ void show_dev_detail(void)
g_variant_unref(gvar_dict);
} else if (srci->datatype == SR_T_UINT64) {
- printf(" %s: ", srci->id);
+ printf(" %s: ", srci->name);
gvar = NULL;
if (maybe_config_get(driver, sdi, channel_group, key,
&gvar) == SR_OK) {
@@ -476,7 +476,7 @@ void show_dev_detail(void)
g_variant_unref(gvar_list);
} else if (srci->datatype == SR_T_STRING) {
- printf(" %s: ", srci->id);
+ printf(" %s: ", srci->name);
if (maybe_config_get(driver, sdi, channel_group, key,
&gvar) == SR_OK) {
tmp_str = g_strdup(g_variant_get_string(gvar,
NULL));
@@ -509,7 +509,7 @@ void show_dev_detail(void)
g_variant_unref(gvar);
} else if (srci->datatype == SR_T_UINT64_RANGE) {
- printf(" %s: ", srci->id);
+ printf(" %s: ", srci->name);
if (maybe_config_list(driver, sdi, channel_group, key,
&gvar_list) != SR_OK) {
printf("\n");
@@ -539,7 +539,7 @@ void show_dev_detail(void)
g_variant_unref(gvar_list);
} else if (srci->datatype == SR_T_BOOL) {
- printf(" %s: ", srci->id);
+ printf(" %s: ", srci->name);
if (maybe_config_get(driver, sdi, channel_group, key,
&gvar) == SR_OK) {
if (g_variant_get_boolean(gvar))
@@ -551,7 +551,7 @@ void show_dev_detail(void)
printf("on, off\n");
} else if (srci->datatype == SR_T_DOUBLE_RANGE) {
- printf(" %s: ", srci->id);
+ printf(" %s: ", srci->name);
if (maybe_config_list(driver, sdi, channel_group, key,
&gvar_list) != SR_OK) {
printf("\n");
@@ -581,7 +581,7 @@ void show_dev_detail(void)
g_variant_unref(gvar_list);
} else if (srci->datatype == SR_T_FLOAT) {
- printf(" %s: ", srci->id);
+ printf(" %s: ", srci->name);
if (maybe_config_get(driver, sdi, channel_group, key,
&gvar) == SR_OK) {
printf("%f\n", g_variant_get_double(gvar));
@@ -591,7 +591,7 @@ void show_dev_detail(void)
} else if (srci->datatype == SR_T_RATIONAL_PERIOD
|| srci->datatype == SR_T_RATIONAL_VOLT) {
- printf(" %s", srci->id);
+ printf(" %s", srci->name);
if (maybe_config_get(driver, sdi, channel_group, key,
&gvar) == SR_OK) {
g_variant_get(gvar, "(tt)", &cur_p, &cur_q);
@@ -622,7 +622,7 @@ void show_dev_detail(void)
g_variant_unref(gvar_list);
} else if (srci->datatype == SR_T_MQ) {
- printf(" %s: ", srci->id);
+ printf(" %s: ", srci->name);
if (maybe_config_get(driver, sdi, channel_group, key,
&gvar) == SR_OK
&& g_variant_is_of_type(gvar,
G_VARIANT_TYPE_TUPLE)
@@ -664,7 +664,7 @@ void show_dev_detail(void)
} else {
/* Everything else */
- printf(" %s\n", srci->id);
+ printf(" %s\n", srci->name);
}
}
g_array_free(opts, TRUE);
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel