2018-10-07 02:49:22 +00:00
|
|
|
#include "IHIDDevice.hpp"
|
|
|
|
|
2018-12-08 05:17:51 +00:00
|
|
|
namespace boo {
|
2018-10-07 02:49:22 +00:00
|
|
|
|
2018-12-08 05:17:51 +00:00
|
|
|
class HIDDeviceNX : public IHIDDevice {
|
|
|
|
DeviceToken& m_token;
|
|
|
|
std::shared_ptr<DeviceBase> m_devImp;
|
|
|
|
std::string_view m_devPath;
|
2018-10-07 02:49:22 +00:00
|
|
|
|
|
|
|
public:
|
2018-12-08 05:17:51 +00:00
|
|
|
HIDDeviceNX(DeviceToken& token, const std::shared_ptr<DeviceBase>& devImp)
|
|
|
|
: m_token(token), m_devImp(devImp), m_devPath(token.getDevicePath()) {}
|
2018-10-07 02:49:22 +00:00
|
|
|
|
2019-08-16 07:05:00 +00:00
|
|
|
void _deviceDisconnected() override {}
|
|
|
|
bool _sendUSBInterruptTransfer(const uint8_t* data, size_t length) override { return false; }
|
|
|
|
size_t _receiveUSBInterruptTransfer(uint8_t* data, size_t length) override { return 0; }
|
|
|
|
std::vector<uint8_t> _getReportDescriptor() override { return {}; }
|
|
|
|
bool _sendHIDReport(const uint8_t* data, size_t length, HIDReportType tp, uint32_t message) override { return false; }
|
|
|
|
size_t _receiveHIDReport(uint8_t* data, size_t length, HIDReportType tp, uint32_t message) override { return 0; }
|
|
|
|
void _startThread() override {}
|
2018-10-07 02:49:22 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:17:51 +00:00
|
|
|
std::shared_ptr<IHIDDevice> IHIDDeviceNew(DeviceToken& token, const std::shared_ptr<DeviceBase>& devImp) {
|
|
|
|
return std::make_shared<HIDDeviceNX>(token, devImp);
|
2018-10-07 02:49:22 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:17:51 +00:00
|
|
|
} // namespace boo
|