struct context *ctx;
struct sr_datafeed_packet *packet;
struct sr_datafeed_header *header;
+ struct sr_datafeed_meta_logic meta;
struct clockselect_50 clockselect;
int frac, triggerpin, ret;
uint8_t triggerselect;
return SR_ERR_MALLOC;
}
- /* Add capture source. */
- sr_source_add(0, G_IO_IN, 10, receive_data, sdi);
-
/* Send header packet to the session bus. */
packet->type = SR_DF_HEADER;
packet->payload = header;
header->feed_version = 1;
gettimeofday(&header->starttime, NULL);
- header->samplerate = ctx->cur_samplerate;
- header->num_logic_probes = ctx->num_probes;
sr_session_send(ctx->session_dev_id, packet);
+
+ /* Send metadata about the SR_DF_LOGIC packets to come. */
+ packet->type = SR_DF_META_LOGIC;
+ packet->payload = &meta;
+ meta.samplerate = ctx->cur_samplerate;
+ meta.num_probes = ctx->num_probes;
+ sr_session_send(ctx->session_dev_id, packet);
+
+ /* Add capture source. */
+ sr_source_add(0, G_IO_IN, 10, receive_data, sdi);
+
g_free(header);
g_free(packet);
struct context *ctx;
struct sr_datafeed_packet packet;
struct sr_datafeed_header header;
+ struct sr_datafeed_meta_logic meta;
uint8_t buf[4];
int bytes_written;
packet.payload = &header;
header.feed_version = 1;
gettimeofday(&header.starttime, NULL);
- header.samplerate = ctx->cur_samplerate;
- header.num_logic_probes = NUM_PROBES;
+ sr_session_send(ctx->session_dev_id, &packet);
+
+ /* Send metadata about the SR_DF_LOGIC packets to come. */
+ packet.type = SR_DF_META_LOGIC;
+ packet.payload = &meta;
+ meta.samplerate = ctx->cur_samplerate;
+ meta.num_probes = NUM_PROBES;
sr_session_send(ctx->session_dev_id, &packet);
/* Time when we should be done (for detecting trigger timeouts). */
{
struct sr_datafeed_packet *packet;
struct sr_datafeed_header *header;
+ struct sr_datafeed_meta_logic meta;
struct context *ctx;
/* TODO: 'ctx' is never g_free()'d? */
packet->payload = header;
header->feed_version = 1;
gettimeofday(&header->starttime, NULL);
- header->samplerate = cur_samplerate;
- header->num_logic_probes = NUM_PROBES;
sr_session_send(ctx->session_dev_id, packet);
+
+ /* Send metadata about the SR_DF_LOGIC packets to come. */
+ packet->type = SR_DF_META_LOGIC;
+ packet->payload = &meta;
+ meta.samplerate = cur_samplerate;
+ meta.num_probes = NUM_PROBES;
+ sr_session_send(ctx->session_dev_id, packet);
+
g_free(header);
g_free(packet);
struct sr_dev_inst *sdi;
struct sr_datafeed_packet *packet;
struct sr_datafeed_header *header;
+ struct sr_datafeed_meta_logic meta;
struct context *ctx;
struct libusb_transfer *transfer;
const struct libusb_pollfd **lupfd;
packet->payload = header;
header->feed_version = 1;
gettimeofday(&header->starttime, NULL);
- header->samplerate = ctx->cur_samplerate;
- header->num_logic_probes = ctx->profile->num_probes;
sr_session_send(cb_data, packet);
+
+ /* Send metadata about the SR_DF_LOGIC packets to come. */
+ packet->type = SR_DF_META_LOGIC;
+ packet->payload = &meta;
+ meta.samplerate = ctx->cur_samplerate;
+ meta.num_probes = ctx->profile->num_probes;
+ sr_session_send(cb_data, packet);
+
g_free(header);
g_free(packet);
{
struct sr_datafeed_packet *packet;
struct sr_datafeed_header *header;
+ struct sr_datafeed_meta_logic meta;
struct sr_dev_inst *sdi;
struct context *ctx;
uint32_t trigger_config[4];
packet->payload = (unsigned char *)header;
header->feed_version = 1;
gettimeofday(&header->starttime, NULL);
- header->samplerate = ctx->cur_samplerate;
- header->num_logic_probes = NUM_PROBES;
+ sr_session_send(cb_data, packet);
+
+ /* Send metadata about the SR_DF_LOGIC packets to come. */
+ packet->type = SR_DF_META_LOGIC;
+ packet->payload = &meta;
+ meta.samplerate = ctx->cur_samplerate;
+ meta.num_probes = NUM_PROBES;
sr_session_send(cb_data, packet);
g_free(header);
struct sr_datafeed_packet packet;
struct sr_datafeed_logic logic;
struct sr_datafeed_header header;
+ struct sr_datafeed_meta_logic meta;
uint64_t samples_read;
int res;
unsigned int packet_num;
packet.payload = &header;
header.feed_version = 1;
gettimeofday(&header.starttime, NULL);
- header.samplerate = ctx->cur_samplerate;
- header.num_logic_probes = ctx->num_channels;
+ sr_session_send(cb_data, &packet);
+
+ /* Send metadata about the SR_DF_LOGIC packets to come. */
+ packet.type = SR_DF_META_LOGIC;
+ packet.payload = &meta;
+ meta.samplerate = ctx->cur_samplerate;
+ meta.num_probes = ctx->num_channels;
sr_session_send(cb_data, &packet);
if (!(buf = g_try_malloc(PACKET_SIZE))) {
{
struct sr_datafeed_header header;
struct sr_datafeed_packet packet;
+ struct sr_datafeed_meta_logic meta;
struct sr_datafeed_logic logic;
unsigned char buffer[CHUNKSIZE];
int fd, size, num_probes;
/* send header */
header.feed_version = 1;
- header.num_logic_probes = num_probes;
- header.samplerate = 0;
gettimeofday(&header.starttime, NULL);
packet.type = SR_DF_HEADER;
packet.payload = &header;
sr_session_send(in->vdev, &packet);
+ /* Send metadata about the SR_DF_LOGIC packets to come. */
+ packet.type = SR_DF_META_LOGIC;
+ packet.payload = &meta;
+ meta.samplerate = 0;
+ meta.num_probes = num_probes;
+ sr_session_send(in->vdev, &packet);
+
/* chop up the input file into chunks and feed it into the session bus */
packet.type = SR_DF_LOGIC;
packet.payload = &logic;
{
struct sr_datafeed_header header;
struct sr_datafeed_packet packet;
+ struct sr_datafeed_meta_logic meta;
struct sr_datafeed_logic logic;
uint8_t buf[PACKET_SIZE], divcount;
int i, fd, size, num_probes;
packet.payload = &header;
header.feed_version = 1;
gettimeofday(&header.starttime, NULL);
- header.num_logic_probes = num_probes;
- header.samplerate = samplerate;
+ sr_session_send(in->vdev, &packet);
+
+ /* Send metadata about the SR_DF_LOGIC packets to come. */
+ packet.type = SR_DF_META_LOGIC;
+ packet.payload = &meta;
+ meta.samplerate = samplerate;
+ meta.num_probes = num_probes;
sr_session_send(in->vdev, &packet);
/* TODO: Handle trigger point. */
struct session_vdev *vdev;
struct sr_datafeed_header *header;
struct sr_datafeed_packet *packet;
+ struct sr_datafeed_meta_logic meta;
int ret;
if (!(vdev = get_vdev_by_index(dev_index)))
packet->payload = (unsigned char *)header;
header->feed_version = 1;
gettimeofday(&header->starttime, NULL);
- header->samplerate = vdev->samplerate;
- header->num_logic_probes = vdev->num_probes;
sr_session_send(cb_data, packet);
+
+ /* Send metadata about the SR_DF_LOGIC packets to come. */
+ packet->type = SR_DF_META_LOGIC;
+ packet->payload = &meta;
+ meta.samplerate = vdev->samplerate;
+ meta.num_probes = vdev->num_probes;
+ sr_session_send(cb_data, packet);
+
g_free(header);
g_free(packet);