You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#ifndef LOGID_BACKEND_DJ_RECEIVERMONITOR_H
|
|
|
|
#define LOGID_BACKEND_DJ_RECEIVERMONITOR_H
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include <string>
|
|
|
|
#include "Receiver.h"
|
|
|
|
#include "../hidpp/defs.h"
|
|
|
|
|
|
|
|
namespace logid {
|
|
|
|
namespace backend {
|
|
|
|
namespace dj
|
|
|
|
{
|
|
|
|
// This class will run on the RawDevice thread,
|
|
|
|
class ReceiverMonitor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ReceiverMonitor(std::string path);
|
|
|
|
|
|
|
|
void enumerate();
|
|
|
|
void run();
|
|
|
|
void stop();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void addDevice(hidpp::DeviceConnectionEvent event) = 0;
|
|
|
|
virtual void removeDevice(hidpp::DeviceIndex index) = 0;
|
|
|
|
|
|
|
|
// Internal methods for derived class
|
|
|
|
void _pair(uint8_t timeout = 0);
|
|
|
|
void _stopPairing();
|
|
|
|
|
|
|
|
void _unpair();
|
|
|
|
|
|
|
|
std::shared_ptr<Receiver> receiver() const;
|
|
|
|
private:
|
|
|
|
std::shared_ptr<Receiver> _receiver;
|
|
|
|
};
|
|
|
|
|
|
|
|
}}}
|
|
|
|
|
|
|
|
#endif //LOGID_BACKEND_DJ_RECEIVERMONITOR_H
|