input_common: Address byte review
This commit is contained in:
parent
4a307a7b3a
commit
340f15d1fa
16 changed files with 224 additions and 247 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue