{
}
-void DevInst::use(SigSession *owner)
+void DevInst::use(SigSession *owner) throw(QString)
{
assert(owner);
assert(!_owner);
_owner = owner;
- sr_dev_open(dev_inst());
}
void DevInst::release()
if (_owner) {
_owner->release_device(this);
_owner = NULL;
- sr_dev_close(dev_inst());
}
}
GVariant* DevInst::get_config(const sr_probe_group *group, int key)
{
GVariant *data = NULL;
+ assert(_owner);
sr_dev_inst *const sdi = dev_inst();
assert(sdi);
if (sr_config_get(sdi->driver, sdi, group, key, &data) != SR_OK)
bool DevInst::set_config(const sr_probe_group *group, int key, GVariant *data)
{
+ assert(_owner);
sr_dev_inst *const sdi = dev_inst();
assert(sdi);
if(sr_config_set(sdi, group, key, data) == SR_OK) {
GVariant* DevInst::list_config(const sr_probe_group *group, int key)
{
GVariant *data = NULL;
+ assert(_owner);
sr_dev_inst *const sdi = dev_inst();
assert(sdi);
if (sr_config_list(sdi->driver, sdi, group, key, &data) != SR_OK)
void DevInst::enable_probe(const sr_probe *probe, bool enable)
{
+ assert(_owner);
sr_dev_inst *const sdi = dev_inst();
assert(sdi);
for (const GSList *p = sdi->probes; p; p = p->next)
return false;
}
+void DevInst::start()
+{
+ if (sr_session_start() != SR_OK)
+ throw tr("Failed to start session.");
+}
+
+void DevInst::run()
+{
+ sr_session_run();
+}
+
} // device
} // pv