]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/arachnid-labs-re-load-pro/protocol.c
arachnid-labs-re-load-pro: Add support for setting SR_CONF_ENABLED.
[libsigrok.git] / src / hardware / arachnid-labs-re-load-pro / protocol.c
index 697f75a0890500dff958bbe79531df3c0dfe01ba..1f2e0dd4ecd212493ff1a2213efec26a8a75d4a5 100644 (file)
@@ -89,6 +89,21 @@ SR_PRIV int reloadpro_set_current_limit(const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
+SR_PRIV int reloadpro_set_on_off(const struct sr_dev_inst *sdi, gboolean on)
+{
+       int ret;
+       char buf[100];
+       const char *cmd;
+
+       cmd = (on) ? "on\n" : "off\n";
+       if ((ret = send_cmd(sdi, cmd, (char *)&buf, sizeof(buf))) < 0) {
+               sr_err("Error sending on/off command: %d.", ret);
+               return SR_ERR;
+       }
+
+       return SR_OK;
+}
+
 SR_PRIV int reloadpro_get_current_limit(const struct sr_dev_inst *sdi,
                                        float *current)
 {