X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhp-59306a%2Fprotocol.c;fp=src%2Fhardware%2Fhp-59306a%2Fprotocol.c;h=3628f98d458e339f05b6913120b48f57546b7fc9;hb=584269fd2f44daa61497fb2cc9baa10a472577b0;hp=737ffde49931823f419b93a3f5610cdd7ac3af46;hpb=12e7abe2197e303c484de0fa61bf2c2a96e3f596;p=libsigrok.git diff --git a/src/hardware/hp-59306a/protocol.c b/src/hardware/hp-59306a/protocol.c index 737ffde4..3628f98d 100644 --- a/src/hardware/hp-59306a/protocol.c +++ b/src/hardware/hp-59306a/protocol.c @@ -18,24 +18,23 @@ */ #include +#include "scpi.h" #include "protocol.h" -SR_PRIV int hp_59306a_receive_data(int fd, int revents, void *cb_data) +SR_PRIV int hp_59306a_switch_cg(const struct sr_dev_inst *sdi, + const struct sr_channel_group *cg, gboolean enabled) { - const struct sr_dev_inst *sdi; - struct dev_context *devc; + int ret; + struct sr_scpi_dev_inst *scpi; + struct channel_group_context *cgc; - (void)fd; + scpi = sdi->conn; + cgc = cg->priv; - if (!(sdi = cb_data)) - return TRUE; + if (enabled) + ret = sr_scpi_send(scpi, "A%zu", cgc->number); + else + ret = sr_scpi_send(scpi, "B%zu", cgc->number); - if (!(devc = sdi->priv)) - return TRUE; - - if (revents == G_IO_IN) { - /* TODO */ - } - - return TRUE; + return ret; }