summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
inline | side by side (from parent 1:
995713f)
It's actually unused, but a good example of how to handle these.
static void datafeed_in(const struct sr_dev_inst *sdi,
const struct sr_datafeed_packet *packet)
{
static void datafeed_in(const struct sr_dev_inst *sdi,
const struct sr_datafeed_packet *packet)
{
+ const struct sr_datafeed_meta *meta;
const struct sr_datafeed_logic *logic;
const struct sr_datafeed_analog *analog;
const struct sr_datafeed_logic *logic;
const struct sr_datafeed_analog *analog;
static struct sr_output *o = NULL;
static GArray *logic_probelist = NULL;
static uint64_t received_samples = 0;
static struct sr_output *o = NULL;
static GArray *logic_probelist = NULL;
static uint64_t received_samples = 0;
uint64_t *samplerate, output_len, filter_out_len;
uint8_t *output_buf, *filter_out;
GString *out;
uint64_t *samplerate, output_len, filter_out_len;
uint8_t *output_buf, *filter_out;
GString *out;
/* If the first packet to come in isn't a header, don't even try. */
if (packet->type != SR_DF_HEADER && o == NULL)
/* If the first packet to come in isn't a header, don't even try. */
if (packet->type != SR_DF_HEADER && o == NULL)
+ case SR_DF_META:
+ g_debug("cli: received SR_DF_META");
+ meta = packet->payload;
+ for (l = meta->config; l; l = l->next) {
+ src = l->data;
+ switch (src->key) {
+ case SR_HWCAP_SAMPLERATE:
+ samplerate = (uint64_t *)src->value;
+ g_debug("cli: got samplerate %"PRIu64, *samplerate);
+ break;
+ default:
+ /* Unknown metadata is not an error. */
+ break;
+ }
+ }
+ break;
+
case SR_DF_TRIGGER:
g_debug("cli: received SR_DF_TRIGGER");
if (o->format->event)
case SR_DF_TRIGGER:
g_debug("cli: received SR_DF_TRIGGER");
if (o->format->event)