| 25 | #include "../../log.h" |
| 26 | |
| 27 | SR_PRIV int command_ctl_wr(libusb_device_handle *devhdl, struct ctl_wr_cmd cmd) |
| 28 | { |
| 29 | int ret; |
| 30 | |
| 31 | assert(devhdl); |
| 32 | |
| 33 | /* Send the control command. */ |
| 34 | ret = libusb_control_transfer(devhdl, LIBUSB_REQUEST_TYPE_VENDOR | |
| 35 | LIBUSB_ENDPOINT_OUT, CMD_CTL_WR, 0x0000, 0x0000, |
| 36 | (unsigned char *)&cmd, cmd.header.size+sizeof(struct ctl_header), 3000); |
| 37 | if (ret < 0) { |
| 38 | sr_err("Unable to send CMD_CTL_WR command(dest:%d/offset:%d/size:%d): %s.", |
| 39 | cmd.header.dest, cmd.header.offset, cmd.header.size, |
| 40 | libusb_error_name(ret)); |
| 41 | return SR_ERR; |
| 42 | } |
| 43 | |
| 44 | return SR_OK; |
| 45 | } |
| 46 | |
| 47 | SR_PRIV int command_ctl_rd(libusb_device_handle *devhdl, struct ctl_rd_cmd cmd) |
| 48 | { |
no outgoing calls
no test coverage detected