devices = g_slist_append(devices, sdi);
devc = sdi->priv;
if (ezusb_upload_firmware(drvc->sr_ctx, devlist[i],
- USB_CONFIGURATION, prof->firmware) == SR_OK)
+ USB_CONFIGURATION, prof->firmware) == SR_OK) {
/* Remember when the firmware on this device was updated */
devc->fw_updated = g_get_monotonic_time();
- else
- sr_err("Firmware upload failed");
+ } else {
+ sr_err("Firmware upload failed, name %s", prof->firmware);
+ }
/* Dummy USB address of 0xff will get overwritten later. */
sdi->conn = sr_usb_dev_inst_new(
libusb_get_bus_number(devlist[i]), 0xff, NULL);
*/
static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer)
{
- struct sr_datafeed_packet packet;
struct sr_dev_inst *sdi;
struct dev_context *devc;
int num_samples, pre;
devc->framebuf = NULL;
/* Mark the end of this frame. */
- packet.type = SR_DF_FRAME_END;
- sr_session_send(sdi, &packet);
+ std_session_send_df_frame_end(sdi);
if (devc->limit_frames && ++devc->num_frames >= devc->limit_frames) {
/* Terminate session */
static int handle_event(int fd, int revents, void *cb_data)
{
const struct sr_dev_inst *sdi;
- struct sr_datafeed_packet packet;
struct timeval tv;
struct sr_dev_driver *di;
struct dev_context *devc;
devc->dev_state = FETCH_DATA;
/* Tell the frontend a new frame is on the way. */
- packet.type = SR_DF_FRAME_BEGIN;
- sr_session_send(sdi, &packet);
+ std_session_send_df_frame_begin(sdi);
break;
case CAPTURE_READY_9BIT:
/* TODO */