bindings: Add new Context::create_end_packet() method.

This commit is contained in:
Martin Ling 2018-12-27 20:38:30 +01:00 committed by Uwe Hermann
parent 62bd644f55
commit a9ed2eb069
2 changed files with 10 additions and 0 deletions

View 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>{

View 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);