return NULL;
cmd = NULL;
- for (i = 0; cmdtable[i].command; i++) {
+ for (i = 0; cmdtable[i].string; i++) {
if (cmdtable[i].command == command) {
cmd = cmdtable[i].string;
break;
const char *cmd;
if (!(cmd = scpi_cmd_get(cmdtable, command))) {
- /* Device does not implement this command, that's OK. */
- return SR_OK;
+ /* Device does not implement this command. */
+ return SR_ERR_NA;
}
scpi = sdi->conn;
else
ret = SR_ERR;
g_free(s);
- } if (g_variant_type_equal(gvtype, G_VARIANT_TYPE_DOUBLE)) {
+ } else if (g_variant_type_equal(gvtype, G_VARIANT_TYPE_DOUBLE)) {
if ((ret = sr_scpi_get_double(scpi, NULL, &d)) == SR_OK)
*gvar = g_variant_new_double(d);
- } if (g_variant_type_equal(gvtype, G_VARIANT_TYPE_STRING)) {
+ } else if (g_variant_type_equal(gvtype, G_VARIANT_TYPE_STRING)) {
if ((ret = sr_scpi_get_string(scpi, NULL, &s)) == SR_OK)
*gvar = g_variant_new_string(s);
} else {