projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use libsigrok C++ bindings (patch version 7).
[pulseview.git]
/
pv
/
devicemanager.h
diff --git
a/pv/devicemanager.h
b/pv/devicemanager.h
index acef8a42d93ba2b1f1d1f5475717ab3a97557079..0a47a35a004659b09da56ce7545135159a448939 100644
(file)
--- a/
pv/devicemanager.h
+++ b/
pv/devicemanager.h
@@
-21,53
+21,58
@@
#ifndef PULSEVIEW_PV_DEVICEMANAGER_H
#define PULSEVIEW_PV_DEVICEMANAGER_H
#ifndef PULSEVIEW_PV_DEVICEMANAGER_H
#define PULSEVIEW_PV_DEVICEMANAGER_H
-#include <glib.h>
-
#include <list>
#include <list>
+#include <map>
+#include <memory>
#include <string>
#include <string>
-#include <boost/shared_ptr.hpp>
+namespace Glib {
+ class VariantBase;
+}
-struct sr_context;
-struct sr_dev_driver;
+namespace sigrok {
+ class ConfigKey;
+ class Context;
+ class Driver;
+ class Device;
+ class HardwareDevice;
+}
namespace pv {
class SigSession;
namespace pv {
class SigSession;
-namespace device {
-class Device;
-}
-
class DeviceManager
{
public:
class DeviceManager
{
public:
- DeviceManager(st
ruct sr_context *sr_ctx
);
+ DeviceManager(st
d::shared_ptr<sigrok::Context> context
);
~DeviceManager();
~DeviceManager();
- const std::list< boost::shared_ptr<pv::device::Device> >&
- devices() const;
-
- std::list< boost::shared_ptr<pv::device::Device> > driver_scan(
- struct sr_dev_driver *const driver,
- GSList *const drvopts = NULL);
+ std::shared_ptr<sigrok::Context> context();
-private:
-
void init_drivers()
;
+ const std::list< std::shared_ptr<sigrok::HardwareDevice> >&
+
devices() const
;
- void release_devices();
+ std::list< std::shared_ptr<sigrok::HardwareDevice> > driver_scan(
+ std::shared_ptr<sigrok::Driver> driver,
+ std::map<const sigrok::ConfigKey *, Glib::VariantBase> drvopts);
- void scan_all_drivers();
+ const std::map<std::string, std::string> get_device_info(
+ const std::shared_ptr<sigrok::Device> device);
- void release_driver(struct sr_dev_driver *const driver);
+ const std::shared_ptr<sigrok::HardwareDevice> find_device_from_info(
+ const std::map<std::string, std::string> search_info);
- static bool compare_devices(boost::shared_ptr<device::Device> a,
- boost::shared_ptr<device::Device> b);
+ static std::string device_description(std::shared_ptr<sigrok::Device> device);
private:
private:
- struct sr_context *const _sr_ctx;
- std::list< boost::shared_ptr<pv::device::Device> > _devices;
+ static bool compare_devices(std::shared_ptr<sigrok::HardwareDevice> a,
+ std::shared_ptr<sigrok::HardwareDevice> b);
+
+protected:
+ std::shared_ptr<sigrok::Context> _context;
+ std::list< std::shared_ptr<sigrok::HardwareDevice> > _devices;
};
} // namespace pv
};
} // namespace pv