input_common: Address byte review

This commit is contained in:
german77 2023-01-13 23:29:05 -06:00 committed by Narr the Reg
parent 4a307a7b3a
commit 340f15d1fa
16 changed files with 224 additions and 247 deletions

View file

@ -74,12 +74,19 @@ public:
*/
DriverResult SendSubCommand(SubCommand sc, std::span<const u8> buffer, std::vector<u8>& output);
/**
* Sends a sub command to the device and waits for it's reply and ignores the output
* @param sc sub command to be send
* @param buffer data to be send
*/
DriverResult SendSubCommand(SubCommand sc, std::span<const u8> buffer);
/**
* Sends a mcu command to the device
* @param sc sub command to be send
* @param buffer data to be send
*/
DriverResult SendMcuCommand(SubCommand sc, std::span<const u8> buffer);
DriverResult SendMCUCommand(SubCommand sc, std::span<const u8> buffer);
/**
* Sends vibration data to the joycon
@ -150,4 +157,17 @@ private:
std::shared_ptr<JoyconHandle> hidapi_handle;
};
class ScopedSetBlocking {
public:
explicit ScopedSetBlocking(JoyconCommonProtocol* self) : m_self{self} {
m_self->SetBlocking();
}
~ScopedSetBlocking() {
m_self->SetNonBlocking();
}
private:
JoyconCommonProtocol* m_self{};
};
} // namespace InputCommon::Joycon