]> sigrok.org Git - libsigrok.git/commitdiff
bindings: Add new Context::create_end_packet() method.
authorMartin Ling <redacted>
Thu, 27 Dec 2018 19:38:30 +0000 (20:38 +0100)
committerUwe Hermann <redacted>
Fri, 28 Dec 2018 11:47:59 +0000 (12:47 +0100)
bindings/cxx/classes.cpp
bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp

index 925a557ac3948204f5229c0ac925f6b183c6540e..12ab2c294abb6d62ae31acdfb74c60b5ead2e58b 100644 (file)
@@ -377,6 +377,14 @@ shared_ptr<Packet> Context::create_analog_packet(
        return shared_ptr<Packet>{new Packet{nullptr, packet}, default_delete<Packet>{}};
 }
 
+shared_ptr<Packet> Context::create_end_packet()
+{
+       auto packet = g_new(struct sr_datafeed_packet, 1);
+       packet->type = SR_DF_END;
+       return shared_ptr<Packet>{new Packet{nullptr, packet},
+               default_delete<Packet>{}};
+}
+
 shared_ptr<Session> Context::load_session(string filename)
 {
        return shared_ptr<Session>{
index 80888af61c5064a81c97110af4e6568740126371..b8cae54518aa302496a64162a11a05a482fc73a5 100644 (file)
@@ -287,6 +287,8 @@ public:
                vector<shared_ptr<Channel> > channels,
                const float *data_pointer, unsigned int num_samples, const Quantity *mq,
                const Unit *unit, vector<const QuantityFlag *> mqflags);
+       /** Create an end packet. */
+       shared_ptr<Packet> create_end_packet();
        /** Load a saved session.
         * @param filename File name string. */
        shared_ptr<Session> load_session(string filename);