MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / command_ctl_rd

Function command_ctl_rd

libsigrok4DSL/hardware/DSL/command.c:47–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47SR_PRIV int command_ctl_rd(libusb_device_handle *devhdl, struct ctl_rd_cmd cmd)
48{
49 int ret;
50
51 assert(devhdl);
52
53 /* Send the control message. */
54 ret = libusb_control_transfer(devhdl, LIBUSB_REQUEST_TYPE_VENDOR |
55 LIBUSB_ENDPOINT_OUT, CMD_CTL_RD_PRE, 0x0000, 0x0000,
56 (unsigned char *)&cmd, sizeof(struct ctl_header), 3000);
57 if (ret < 0) {
58 sr_err("Unable to send CMD_CTL_RD_PRE command(dest:%d/offset:%d/size:%d): %s.",
59 cmd.header.dest, cmd.header.offset, cmd.header.size,
60 libusb_error_name(ret));
61 return SR_ERR;
62 }
63
64 g_usleep(10*1000);
65
66 /* Send the control message. */
67 ret = libusb_control_transfer(devhdl, LIBUSB_REQUEST_TYPE_VENDOR |
68 LIBUSB_ENDPOINT_IN, CMD_CTL_RD, 0x0000, 0x0000,
69 (unsigned char *)cmd.data, cmd.header.size, 3000);
70
71 if (ret < 0) {
72 sr_err("Unable to send CMD_CTL_RD command: %s.",
73 libusb_error_name(ret));
74 return SR_ERR;
75 }
76
77 return SR_OK;
78}

Callers 11

receive_dataFunction · 0.85
hw_dev_openFunction · 0.85
dsl_hdl_versionFunction · 0.85
dsl_rd_regFunction · 0.85
dsl_rd_extFunction · 0.85
dsl_rd_nvmFunction · 0.85
dsl_rd_probeFunction · 0.85
dsl_fpga_armFunction · 0.85
dsl_fpga_configFunction · 0.85
dsl_dev_openFunction · 0.85
receive_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected