File 07-add_getpaireddevices_command_to_ireceiver.patch of Package hidpp
Add GetPairedDevices command to IReceiver
diff --git a/src/libhidpp/hidpp/Device.h b/src/libhidpp/hidpp/Device.h
index 1469eb0..24f0803 100644
--- a/src/libhidpp/hidpp/Device.h
+++ b/src/libhidpp/hidpp/Device.h
@@ -94,7 +94,7 @@ public:
*/
std::tuple<unsigned int, unsigned int> protocolVersion ();
- const inline bool forceLongReports()
+ inline bool forceLongReports()
{
return force_long_reports;
}
diff --git a/src/libhidpp/hidpp10/IReceiver.cpp b/src/libhidpp/hidpp10/IReceiver.cpp
index 1dc8df2..b78ddcd 100644
--- a/src/libhidpp/hidpp10/IReceiver.cpp
+++ b/src/libhidpp/hidpp10/IReceiver.cpp
@@ -24,6 +24,7 @@
#include <misc/Endian.h>
#include <stdexcept>
#include <cassert>
+#include <hidpp/Dispatcher.h>
using namespace HIDPP10;
@@ -40,6 +41,12 @@ IReceiver::IReceiver (Device *dev):
{
}
+void IReceiver::getPairedDevices ()
+{
+ HIDPP::Report report (HIDPP::Report::ShortDJ, HIDPP::DefaultDevice, GetPairedDevices, 0);
+ _dev->dispatcher()->sendCommandWithoutResponse(report);
+}
+
void IReceiver::getDeviceInformation (unsigned int device,
uint8_t *destination_id,
uint8_t *report_interval,
diff --git a/src/libhidpp/hidpp10/IReceiver.h b/src/libhidpp/hidpp10/IReceiver.h
index c6e19dc..26daa69 100644
--- a/src/libhidpp/hidpp10/IReceiver.h
+++ b/src/libhidpp/hidpp10/IReceiver.h
@@ -31,6 +31,12 @@ class Device;
class IReceiver
{
public:
+
+ enum Command : uint8_t {
+ SwitchAndKeepAlive = 0x80,
+ GetPairedDevices = 0x81
+ };
+
enum InformationType: uint8_t {
DeviceInformation = 0x20,
ExtendedDeviceInformation = 0x30,
@@ -105,6 +111,8 @@ public:
IReceiver (Device *dev);
+ void getPairedDevices ();
+
void getDeviceInformation (unsigned int device,
uint8_t *destination_id,
uint8_t *report_interval,