Implement raw DeviceMonitor
Multiple things have been done in this commit; the base of the new backend has effectively been created. This branch currently has many vital parts commented out. Therefore, this branch is currently only intended for debugging.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#include "Device.h"
|
||||
#include "Report.h"
|
||||
|
||||
using namespace logid::backend;
|
||||
using namespace logid::backend::hidpp;
|
||||
|
||||
const char* Device::InvalidDevice::what() const noexcept
|
||||
{
|
||||
switch(_reason)
|
||||
{
|
||||
case NoHIDPPReport:
|
||||
return "Invalid HID++ device";
|
||||
case InvalidRawDevice:
|
||||
return "Invalid raw device";
|
||||
}
|
||||
}
|
||||
|
||||
Device::InvalidDevice::Reason Device::InvalidDevice::code() const noexcept
|
||||
{
|
||||
return _reason;
|
||||
}
|
||||
|
||||
/// TODO: Initialize a single RawDevice for each path.
|
||||
Device::Device(std::string path, DeviceIndex index):
|
||||
raw_device (std::make_shared<raw::RawDevice>(path)), path (path), index (index)
|
||||
{
|
||||
supported_reports = getSupportedReports(raw_device->reportDescriptor());
|
||||
if(!supported_reports)
|
||||
throw InvalidDevice(InvalidDevice::NoHIDPPReport);
|
||||
}
|
||||
Reference in New Issue
Block a user