Skip to content

Commit

Permalink
Support parsing SCPI commands in sigrok-cli.
Browse files Browse the repository at this point in the history
The support for sending custom SCPI commands to the device
has recently been added to libsigrok.

Add the corresponding support for parsing such commands in
sigrok-cli.

Signed-off-by: Guido Trentalancia <[email protected]>
---
 parsers.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
  • Loading branch information
gtrentalancia committed Dec 21, 2018
1 parent 6451abf commit 8cc8080
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion parsers.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,12 @@ GHashTable *parse_generic_arg(const char *arg, gboolean sep_first)
i = 0;
hash = g_hash_table_new_full(g_str_hash, g_str_equal,
g_free, g_free);
elements = g_strsplit(arg, ":", 0);
/* SCPI command syntax uses the ":" character */
if (strncmp("command", arg, 7)) {
elements = g_strsplit(arg, ":", 0);
} else {
elements = g_strsplit(arg, "\n", 1);
}
if (sep_first)
g_hash_table_insert(hash, g_strdup("sigrok_key"),
g_strdup(elements[i++]));
Expand Down

0 comments on commit 8cc8080

Please sign in to comment.