]> sigrok.org Git - pulseview.git/blobdiff - pv/data/decode/decoder.cpp
Implement portable LA sample packing and unpacking.
[pulseview.git] / pv / data / decode / decoder.cpp
index 0404227eeaef48a92da5581e93f29d16e7e42bf7..b293cacb010790c61f46edef34c7f81f0306abfe 100644 (file)
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
+#include <libsigrok/libsigrok.h>
 #include <libsigrokdecode/libsigrokdecode.h>
 
 #include "decoder.h"
@@ -84,6 +85,18 @@ void Decoder::set_option(const char *id, GVariant *value)
        _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
 {