Fix bluetooth reconnection events

This commit is contained in:
PixlOne
2019-09-21 13:29:12 -04:00
parent ac414bf33e
commit 0002d9f536
2 changed files with 42 additions and 3 deletions
+16 -2
View File
@@ -10,6 +10,7 @@
#include <hidpp/Dispatcher.h>
#include <hidpp/SimpleDispatcher.h>
#include <hidpp10/IReceiver.h>
#include <hidpp20/IWirelessDeviceStatus.h>
class EventListener;
class DeviceConfig;
@@ -68,15 +69,15 @@ public:
class ButtonHandler : public EventHandler
{
public:
ButtonHandler (HIDPP20::Device *hidppdev, Device *d) : _irc (HIDPP20::IReprogControls::auto_version(hidppdev)), dev (d) { }
ButtonHandler (Device *d) : dev (d), _irc (HIDPP20::IReprogControls::auto_version(d->hidpp_dev)) { }
const HIDPP20::FeatureInterface *feature () const
{
return &_irc;
}
void handleEvent (const HIDPP::Report &event);
protected:
HIDPP20::IReprogControls _irc;
Device* dev;
HIDPP20::IReprogControls _irc;
std::vector<uint16_t> states;
std::vector<uint16_t> new_states;
};
@@ -96,6 +97,19 @@ public:
protected:
Device* dev;
};
class WirelessStatusHandler : public EventHandler
{
public:
WirelessStatusHandler (Device *d) : dev (d), _iws (d->hidpp_dev) { }
const HIDPP20::FeatureInterface *feature () const
{
return &_iws;
}
void handleEvent (const HIDPP::Report &event);
protected:
Device* dev;
HIDPP20::IWirelessDeviceStatus _iws;
};
class EventListener
{