/* Send header packet to the session bus. */
std_session_send_df_header(cb_data, LOG_PREFIX);
- if ((ret = fx2lafw_command_start_acquisition(usb->devhdl,
- devc->cur_samplerate, devc->sample_wide)) != SR_OK) {
+ if ((ret = fx2lafw_command_start_acquisition(sdi)) != SR_OK) {
fx2lafw_abort_acquisition(devc);
return ret;
}
return SR_OK;
}
-static int command_get_revid_version(libusb_device_handle *devhdl,
- uint8_t *revid)
+static int command_get_revid_version(struct sr_dev_inst *sdi, uint8_t *revid)
{
+ struct sr_usb_dev_inst *usb = sdi->conn;
+ libusb_device_handle *devhdl = usb->devhdl;
int ret;
ret = libusb_control_transfer(devhdl, LIBUSB_REQUEST_TYPE_VENDOR |
return SR_OK;
}
-SR_PRIV int fx2lafw_command_start_acquisition(libusb_device_handle *devhdl,
- uint64_t samplerate, gboolean samplewide)
+SR_PRIV int fx2lafw_command_start_acquisition(const struct sr_dev_inst *sdi)
{
+ struct dev_context *devc = sdi->priv;
+ struct sr_usb_dev_inst *usb = sdi->conn;
+ libusb_device_handle *devhdl = usb->devhdl;
+ uint64_t samplerate = devc->cur_samplerate;
+ gboolean samplewide = devc->sample_wide;
struct cmd_start_acquisition cmd = { 0 };
int delay = 0, ret;
break;
}
- ret = command_get_revid_version(usb->devhdl, &revid);
+ ret = command_get_revid_version(sdi, &revid);
if (ret != SR_OK) {
sr_err("Failed to get REVID.");
break;
struct sr_context *ctx;
};
-SR_PRIV int fx2lafw_command_start_acquisition(libusb_device_handle *devhdl,
- uint64_t samplerate, gboolean samplewide);
+SR_PRIV int fx2lafw_command_start_acquisition(const struct sr_dev_inst *sdi);
SR_PRIV gboolean fx2lafw_check_conf_profile(libusb_device *dev);
SR_PRIV int fx2lafw_dev_open(struct sr_dev_inst *sdi, struct sr_dev_driver *di);
SR_PRIV int fx2lafw_configure_channels(const struct sr_dev_inst *sdi);