boo/lib/inputdev/HIDListenerBSD.cpp

26 lines
934 B
C++
Raw Normal View History

2016-01-31 08:37:23 +00:00
#include "IHIDDevice.hpp"
#include "boo/inputdev/DeviceToken.hpp"
#include "boo/inputdev/DeviceBase.hpp"
2018-12-08 05:17:51 +00:00
namespace boo {
2016-01-31 08:37:23 +00:00
2018-12-08 05:17:51 +00:00
class HIDDeviceBSD final : public IHIDDevice {
DeviceToken& m_token;
DeviceBase& m_devImp;
void _deviceDisconnected() {}
bool _sendUSBInterruptTransfer(const uint8_t* data, size_t length) { return false; }
size_t _receiveUSBInterruptTransfer(uint8_t* data, size_t length) { return 0; }
bool _sendHIDReport(const uint8_t* data, size_t length, uint16_t message) { return false; }
size_t _recieveReport(const uint8_t* data, size_t length, uint16_t message) { return 0; }
2016-01-31 08:37:23 +00:00
public:
2018-12-08 05:17:51 +00:00
HIDDeviceBSD(DeviceToken& token, DeviceBase& devImp) : m_token(token), m_devImp(devImp) {}
~HIDDeviceBSD() override = default;
2016-01-31 08:37:23 +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<HIDDeviceBSD>(token, devImp);
2016-01-31 08:37:23 +00:00
}
2018-12-08 05:17:51 +00:00
} // namespace boo