]> sigrok.org Git - libsigrok.git/commitdiff
bindings: Add Packet.get_type() method.
authorMartin Ling <redacted>
Sun, 20 Jul 2014 00:38:31 +0000 (01:38 +0100)
committerMartin Ling <redacted>
Wed, 23 Jul 2014 21:45:37 +0000 (22:45 +0100)
bindings/cxx/classes.cpp
bindings/cxx/include/libsigrok/libsigrok.hpp

index c75f09a00037d847b98559a630c5ee460520b8c3..f8065fd7a6f79de667b42f1f7e849c52ea29e7d4 100644 (file)
@@ -939,6 +939,11 @@ Packet::~Packet()
        delete payload;
 }
 
+const PacketType *Packet::get_type()
+{
+       return PacketType::get(structure->type);
+}
+
 PacketPayload *Packet::get_payload()
 {
        return payload;
index 7a99f325b3503c232f803274b2c542f17ef6b9a3..87e41e6a55cec0e99a9443b027b16a8438ef4392 100644 (file)
@@ -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: