logic.length = tosend * sizeof(uint16_t);
logic.unitsize = 2;
logic.data = samples + sent;
- sr_session_send(devc->session_dev_id, &packet);
+ sr_session_send(devc->cb_data, &packet);
sent += tosend;
}
logic.length = tosend * sizeof(uint16_t);
logic.unitsize = 2;
logic.data = samples;
- sr_session_send(devc->session_dev_id, &packet);
+ sr_session_send(devc->cb_data, &packet);
sent += tosend;
}
/* Only send trigger if explicitly enabled. */
if (devc->use_triggers) {
packet.type = SR_DF_TRIGGER;
- sr_session_send(devc->session_dev_id, &packet);
+ sr_session_send(devc->cb_data, &packet);
}
}
logic.length = tosend * sizeof(uint16_t);
logic.unitsize = 2;
logic.data = samples + sent;
- sr_session_send(devc->session_dev_id, &packet);
+ sr_session_send(devc->cb_data, &packet);
}
*lastsample = samples[n - 1];
if (devc->state.chunks_downloaded >= numchunks) {
/* End of samples. */
packet.type = SR_DF_END;
- sr_session_send(devc->session_dev_id, &packet);
+ sr_session_send(devc->cb_data, &packet);
devc->state.state = SIGMA_IDLE;
gettimeofday(&devc->start_tv, 0);
sigma_set_register(WRITE_MODE, 0x0d, devc);
- devc->session_dev_id = cb_data;
+ devc->cb_data = cb_data;
/* Send header packet to the session bus. */
std_session_send_df_header(cb_data, DRIVER_LOG_DOMAIN);
struct sigma_trigger trigger;
int use_triggers;
struct sigma_state state;
- void *session_dev_id;
+ void *cb_data;
};
#endif
devc->cur_samplerate = SR_MHZ(100); /* 100MHz == max. samplerate */
devc->limit_msec = 0;
devc->limit_samples = 0;
- devc->session_dev_id = NULL;
+ devc->cb_data = NULL;
memset(devc->mangled_buf, 0, BS);
devc->final_buf = NULL;
devc->trigger_pattern = 0x00; /* Value irrelevant, see trigger_mask. */
sr_dbg("Hardware acquisition started successfully.");
- devc->session_dev_id = cb_data;
+ devc->cb_data = cb_data;
/* Send header packet to the session bus. */
std_session_send_df_header(cb_data, DRIVER_LOG_DOMAIN);
logic.length = BS;
logic.unitsize = 1;
logic.data = devc->final_buf + (block * BS);
- sr_session_send(devc->session_dev_id, &packet);
+ sr_session_send(devc->cb_data, &packet);
return;
}
logic.length = trigger_point;
logic.unitsize = 1;
logic.data = devc->final_buf + (block * BS);
- sr_session_send(devc->session_dev_id, &packet);
+ sr_session_send(devc->cb_data, &packet);
}
/* Send the SR_DF_TRIGGER packet to the session bus. */
(block * BS) + trigger_point);
packet.type = SR_DF_TRIGGER;
packet.payload = NULL;
- sr_session_send(devc->session_dev_id, &packet);
+ sr_session_send(devc->cb_data, &packet);
/* If at least one sample is located after the trigger... */
if (trigger_point < (BS - 1)) {
logic.length = BS - trigger_point;
logic.unitsize = 1;
logic.data = devc->final_buf + (block * BS) + trigger_point;
- sr_session_send(devc->session_dev_id, &packet);
+ sr_session_send(devc->cb_data, &packet);
}
}
/** The current sampling limit (in number of samples). */
uint64_t limit_samples;
- /** TODO */
- void *session_dev_id;
+ void *cb_data;
/**
* A buffer containing some (mangled) samples from the device.
GIOChannel *channels[2];
uint8_t sample_generator;
uint64_t samples_counter;
- void *session_dev_id;
+ void *cb_data;
int64_t starttime;
};
logic.length = sending_now;
logic.unitsize = 1;
logic.data = buf;
- sr_session_send(devc->session_dev_id, &packet);
+ sr_session_send(devc->cb_data, &packet);
devc->samples_counter += sending_now;
}
}
devc->sample_generator = default_pattern;
- devc->session_dev_id = cb_data;
+ devc->cb_data = cb_data;
devc->samples_counter = 0;
/*
/* Send last packet. */
packet.type = SR_DF_END;
- sr_session_send(devc->session_dev_id, &packet);
+ sr_session_send(devc->cb_data, &packet);
return SR_OK;
}
/* Terminate session. */
packet.type = SR_DF_END;
- sr_session_send(devc->session_dev_id, &packet);
+ sr_session_send(devc->cb_data, &packet);
/* Remove fds from polling. */
lupfd = libusb_get_pollfds(drvc->sr_ctx->libusb_ctx);
*/
packet.type = SR_DF_TRIGGER;
packet.payload = NULL;
- sr_session_send(devc->session_dev_id, &packet);
+ sr_session_send(devc->cb_data, &packet);
/*
* Send the samples that triggered it,
logic.unitsize = sizeof(*devc->trigger_buffer);
logic.length = devc->trigger_stage * logic.unitsize;
logic.data = devc->trigger_buffer;
- sr_session_send(devc->session_dev_id, &packet);
+ sr_session_send(devc->cb_data, &packet);
devc->trigger_stage = TRIGGER_FIRED;
break;
logic.length = transfer->actual_length - trigger_offset_bytes;
logic.unitsize = sample_width;
logic.data = cur_buf + trigger_offset_bytes;
- sr_session_send(devc->session_dev_id, &packet);
+ sr_session_send(devc->cb_data, &packet);
devc->num_samples += cur_sample_count;
if (devc->limit_samples &&
return SR_ERR;
}
- devc->session_dev_id = cb_data;
+ devc->cb_data = cb_data;
devc->num_samples = 0;
devc->empty_transfer_count = 0;
int submitted_transfers;
int empty_transfer_count;
- void *session_dev_id;
+ void *cb_data;
struct sr_usb_dev_inst *usb;
double dso_trigger_voltage;
uint16_t dso_trigger_width;
struct mso_prototrig protocol_trigger;
- void *session_dev_id;
+ void *cb_data;
uint16_t buffer_n;
char buffer[4096];
};