X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fdevice%2Ffile.cpp;h=368276a4ba8d8e1ce10e443ab645f9d19e3cad3c;hb=87b79835014a386fb51b52bc993dbb693bd27197;hp=edc2da2bdd96cad6ba3a56eb39d13c2a1a2b2e4e;hpb=ab973f4729258b729d2aa84abfa14b61609fa35e;p=pulseview.git diff --git a/pv/device/file.cpp b/pv/device/file.cpp index edc2da2..368276a 100644 --- a/pv/device/file.cpp +++ b/pv/device/file.cpp @@ -25,6 +25,8 @@ #include +using std::make_pair; +using std::map; using std::string; namespace pv { @@ -40,12 +42,25 @@ std::string File::format_device_title() const return boost::filesystem::path(_path).filename().string(); } +map File::get_device_info() const +{ + map result; + + result.insert(make_pair("vendor", "sigrok")); + result.insert(make_pair("model", "file")); + result.insert(make_pair("connection_id", + boost::filesystem::path(_path).filename().string())); + + return result; +} + File* File::create(const string &name) { - if (sr_session_load(name.c_str(), &SigSession::_sr_session) == SR_OK) { + struct sr_session *temp_session; + if (sr_session_load(name.c_str(), &temp_session) == SR_OK) { GSList *devlist = NULL; - sr_session_dev_list(SigSession::_sr_session, &devlist); - sr_session_destroy(SigSession::_sr_session); + sr_session_dev_list(temp_session, &devlist); + sr_session_destroy(temp_session); if (devlist) { sr_dev_inst *const sdi = (sr_dev_inst*)devlist->data;