{
struct sr_datafeed_header header;
struct sr_datafeed_packet packet;
- struct sr_datafeed_meta_logic meta;
+ struct sr_datafeed_meta meta;
struct sr_datafeed_logic logic;
+ struct sr_config *src;
unsigned char buffer[CHUNKSIZE];
int fd, size, num_probes;
struct context *ctx;
packet.payload = &header;
sr_session_send(in->sdi, &packet);
- /* Send metadata about the SR_DF_LOGIC packets to come. */
- packet.type = SR_DF_META_LOGIC;
- packet.payload = &meta;
- meta.samplerate = ctx->samplerate;
- meta.num_probes = num_probes;
- sr_session_send(in->sdi, &packet);
+ if (ctx->samplerate) {
+ packet.type = SR_DF_META;
+ packet.payload = &meta;
+ src = sr_config_make(SR_HWCAP_SAMPLERATE, (const void *)&ctx->samplerate);
+ meta.config = g_slist_append(NULL, src);
+ sr_session_send(in->sdi, &packet);
+ }
/* Chop up the input file into chunks & send it to the session bus. */
packet.type = SR_DF_LOGIC;
{
struct sr_datafeed_header header;
struct sr_datafeed_packet packet;
- struct sr_datafeed_meta_logic meta;
+ struct sr_datafeed_meta meta;
struct sr_datafeed_logic logic;
+ struct sr_config *src;
uint8_t buf[PACKET_SIZE], divcount;
int i, fd, size, num_probes;
uint64_t samplerate;
sr_session_send(in->sdi, &packet);
/* Send metadata about the SR_DF_LOGIC packets to come. */
- packet.type = SR_DF_META_LOGIC;
+ packet.type = SR_DF_META;
packet.payload = &meta;
- meta.samplerate = samplerate;
- meta.num_probes = num_probes;
+ src = sr_config_make(SR_HWCAP_SAMPLERATE, (const void *)&samplerate);
+ meta.config = g_slist_append(NULL, src);
sr_session_send(in->sdi, &packet);
/* TODO: Handle trigger point. */
{
struct sr_datafeed_header header;
struct sr_datafeed_packet packet;
- struct sr_datafeed_meta_logic meta;
+ struct sr_datafeed_meta meta;
+ struct sr_config *src;
FILE *file;
struct context *ctx;
+ uint64_t samplerate;
ctx = in->internal;
sr_session_send(in->sdi, &packet);
/* Send metadata about the SR_DF_LOGIC packets to come. */
- packet.type = SR_DF_META_LOGIC;
+ packet.type = SR_DF_META;
packet.payload = &meta;
- meta.samplerate = ctx->samplerate / ctx->downsample;
- meta.num_probes = ctx->probecount;
+ samplerate = ctx->samplerate / ctx->downsample;
+ src = sr_config_make(SR_HWCAP_SAMPLERATE, (const void *)&samplerate);
+ meta.config = g_slist_append(NULL, src);
sr_session_send(in->sdi, &packet);
/* Parse the contents of the VCD file */