TODO cleanup: Add PowerSwitchLocation enum

This commit is contained in:
pixl
2020-07-13 22:42:23 -04:00
parent 944a6419b4
commit 825967b140
2 changed files with 23 additions and 3 deletions
+5 -2
View File
@@ -191,7 +191,11 @@ struct Receiver::ExtendedPairingInfo
for(uint8_t i = 0; i < 4; i++)
info.reportTypes[i] = response[i + 4];
info.powerSwitchLocation = response[8] & 0xf;
uint8_t psl = response[8] & 0xf;
if(psl > 0xc)
info.powerSwitchLocation = PowerSwitchLocation::Reserved;
else
info.powerSwitchLocation = static_cast<PowerSwitchLocation>(psl);
return info;
}
@@ -325,7 +329,6 @@ Receiver::ConnectionStatusEvent Receiver::connectionStatusEvent(Report& report)
void Receiver::listen()
{
if(!_raw_device->isListening())
///TODO: Kill RawDevice?
_raw_device->listenAsync();
if(_raw_device->eventHandlers().find("RECV_HIDPP") ==