*/
#include "file.h"
-#include "inputfile.h"
#include "sessionfile.h"
#include <boost/filesystem.hpp>
#include <libsigrok/libsigrok.h>
+using std::make_pair;
+using std::map;
using std::string;
namespace pv {
return boost::filesystem::path(_path).filename().string();
}
+map<string, string> File::get_device_info() const
+{
+ map<string, string> 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;
}
}
- return new InputFile(name);
+ return NULL;
}
} // device