#include <memory>
#include <vector>
#include <map>
+#include <set>
namespace sigrok
{
friend class Driver;
};
+enum Capability {
+ GET = SR_CONF_GET,
+ SET = SR_CONF_SET,
+ LIST = SR_CONF_LIST
+};
+
/** An object that can be configured. */
class SR_API Configurable
{
* @param key ConfigKey to enumerate values for. */
Glib::VariantContainerBase config_list(const ConfigKey *key);
/** Enumerate available keys, according to a given index key. */
- vector<const ConfigKey *> config_keys(const ConfigKey *key);
+ map<const ConfigKey *, set<Capability> > config_keys(const ConfigKey *key);
/** Check for a key in the list from a given index key. */
bool config_check(const ConfigKey *key, const ConfigKey *index_key);
protected:
string model();
/** Version string for this device. */
string version();
+ /** Serial number for this device. */
+ string serial_number();
+ /** Connection ID for this device. */
+ string connection_id();
/** List of the channels available on this device. */
vector<shared_ptr<Channel> > channels();
/** Channel groups available on this device, indexed by name. */
Session(shared_ptr<Context> context);
Session(shared_ptr<Context> context, string filename);
~Session();
+ shared_ptr<Device> get_device(const struct sr_dev_inst *sdi);
const shared_ptr<Context> _context;
- map<const struct sr_dev_inst *, shared_ptr<Device> > _devices;
+ map<const struct sr_dev_inst *, SessionDevice *> _owned_devices;
+ map<const struct sr_dev_inst *, shared_ptr<Device> > _other_devices;
vector<DatafeedCallbackData *> _datafeed_callbacks;
map<shared_ptr<EventSource>, SourceCallbackData *> _source_callbacks;
bool _saving;
/** Send next stream data.
* @param data Next stream data. */
void send(string data);
+ /** Signal end of input data. */
+ void end();
protected:
Input(shared_ptr<Context> context, const struct sr_input *structure);
~Input();