From: Alexandru Gagniuc <mrn...@google.com>

On the Chroma 61604, for example, the SCPI_CMD_BEEPER query returns a
bitmask of what events triggered the beeper. Without this change, the
response was considered to be invalid and the beeper was not disabled.
---
 src/hardware/scpi-pps/protocol.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/hardware/scpi-pps/protocol.c b/src/hardware/scpi-pps/protocol.c
index be47886..233e420 100644
--- a/src/hardware/scpi-pps/protocol.c
+++ b/src/hardware/scpi-pps/protocol.c
@@ -65,7 +65,7 @@ SR_PRIV int scpi_cmd_resp(const struct sr_dev_inst *sdi, 
GVariant **gvar,
        struct sr_scpi_dev_inst *scpi;
        va_list args;
        double d;
-       int ret;
+       int ret, resp;
        char *s;
        const char *cmd;
 
@@ -110,6 +110,8 @@ SR_PRIV int scpi_cmd_resp(const struct sr_dev_inst *sdi, 
GVariant **gvar,
                                *gvar = g_variant_new_boolean(TRUE);
                        else if (!strcasecmp(s, "OFF") || !strcasecmp(s, "0") 
|| !strcasecmp(s, "NO"))
                                *gvar = g_variant_new_boolean(FALSE);
+                       else if (sr_atoi(s, &resp) == SR_OK)
+                               *gvar = g_variant_new_boolean(!!resp);
                        else
                                ret = SR_ERR;
                        g_free(s);
-- 
2.2.0.rc0.207.ga3a616c


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to