From: Martin Ling Date: Sun, 20 Jul 2014 00:38:31 +0000 (+0100) Subject: bindings: Add Packet.get_type() method. X-Git-Tag: libsigrok-0.4.0~1210 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=90ba83f21dae08fdafa26f9db513b25c1aeea92d;p=libsigrok.git bindings: Add Packet.get_type() method. --- diff --git a/bindings/cxx/classes.cpp b/bindings/cxx/classes.cpp index c75f09a0..f8065fd7 100644 --- a/bindings/cxx/classes.cpp +++ b/bindings/cxx/classes.cpp @@ -939,6 +939,11 @@ Packet::~Packet() delete payload; } +const PacketType *Packet::get_type() +{ + return PacketType::get(structure->type); +} + PacketPayload *Packet::get_payload() { return payload; diff --git a/bindings/cxx/include/libsigrok/libsigrok.hpp b/bindings/cxx/include/libsigrok/libsigrok.hpp index 7a99f325..87e41e6a 100644 --- a/bindings/cxx/include/libsigrok/libsigrok.hpp +++ b/bindings/cxx/include/libsigrok/libsigrok.hpp @@ -477,6 +477,8 @@ protected: class SR_API Packet { public: + /** Type of this packet. */ + const PacketType *get_type(); /** Payload of this packet. */ PacketPayload *get_payload(); protected: