Skip the emission of session datafeed packets for disabled analog
channels.
Implementation detail: Allow for quick lookup of the channel that is
associated with an analog generator, as the data generation routines
only pass generator references in later calls.
This fixes part of bug #923 (which initially is about unexpected
logic data while analog channels were affected in similar ways).
/* Every channel gets a generator struct. */
ag = g_malloc(sizeof(struct analog_gen));
+ ag->ch = ch;
ag->amplitude = DEFAULT_ANALOG_AMPLITUDE;
sr_analog_init(&ag->packet, &ag->encoding, &ag->meaning, &ag->spec, 2);
ag->packet.meaning->channels = cg->channels;
int ag_pattern_pos;
unsigned int i;
+ if (!ag->ch || !ag->ch->enabled)
+ return;
+
devc = sdi->priv;
packet.type = SR_DF_ANALOG;
packet.payload = &ag->packet;
};
struct analog_gen {
+ struct sr_channel *ch;
int pattern;
float amplitude;
float pattern_data[ANALOG_BUFSIZE];