Skip to content

Commit

Permalink
bindings: Add new Context::create_end_packet() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinling authored and uwehermann committed Dec 28, 2018
1 parent 62bd644 commit a9ed2eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bindings/cxx/classes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>{
Expand Down
2 changes: 2 additions & 0 deletions bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ class SR_API Context : public UserOwned<Context>
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);
Expand Down

0 comments on commit a9ed2eb

Please sign in to comment.