_options[id] = value;
}
+bool Decoder::have_required_probes() const
+{
+ for (GSList *p = _decoder->probes; p; p = p->next) {
+ const srd_probe *const probe = (const srd_probe*)p->data;
+ assert(probe);
+ if (_probes.find(probe) == _probes.end())
+ return false;
+ }
+
+ return true;
+}
+
srd_decoder_inst* Decoder::create_decoder_inst(
srd_session *const session) const
{
void set_option(const char *id, GVariant *value);
+ bool have_required_probes() const;
+
srd_decoder_inst* create_decoder_inst(
srd_session *const session) const;
assert(data);
+ // Check we have a snapshot of data
const deque< shared_ptr<pv::data::LogicSnapshot> > &snapshots =
data->get_snapshots();
if (snapshots.empty())
return;
+ // Check that all decoders have the required probes
+ BOOST_FOREACH(const shared_ptr<decode::Decoder> &dec, _stack)
+ if (!dec->have_required_probes())
+ return;
+
const shared_ptr<pv::data::LogicSnapshot> &snapshot =
snapshots.front();
const int64_t sample_count = snapshot->get_sample_count();