bindings: Add Channel::get_index() method.

This commit is contained in:
Martin Ling 2014-07-24 15:01:26 +01:00
parent f36ca8893d
commit 06bd935e16
3 changed files with 8 additions and 0 deletions

View File

@ -482,6 +482,11 @@ void Channel::set_enabled(bool value)
check(sr_dev_channel_enable(parent->structure, structure->index, value));
}
unsigned int Channel::get_index()
{
return structure->index;
}
ChannelGroup::ChannelGroup(Device *device,
struct sr_channel_group *structure) :
StructureWrapper<Device, struct sr_channel_group>(structure),

View File

@ -340,6 +340,8 @@ public:
bool get_enabled();
/** Set the enabled status of this channel. */
void set_enabled(bool value);
/** Get the index number of this channel. */
unsigned int get_index();
protected:
Channel(struct sr_channel *structure);
~Channel();

View File

@ -200,6 +200,7 @@ typedef std::map<const sigrok::ConfigKey *, Glib::VariantBase>
%attributestring(sigrok::Channel, std::string, name, get_name, set_name);
%attribute(sigrok::Channel, bool, enabled, get_enabled, set_enabled);
%attribute(sigrok::Channel, const sigrok::ChannelType *, type, get_type);
%attribute(sigrok::Channel, unsigned int, index, get_index);
%attributestring(sigrok::ChannelGroup, std::string, name, get_name);
%attributeval(sigrok::ChannelGroup,