diff options
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/common_protocol.cpp')
| -rw-r--r-- | src/input_common/helpers/joycon_protocol/common_protocol.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/input_common/helpers/joycon_protocol/common_protocol.cpp b/src/input_common/helpers/joycon_protocol/common_protocol.cpp index a4d08fdaf..a329db107 100644 --- a/src/input_common/helpers/joycon_protocol/common_protocol.cpp +++ b/src/input_common/helpers/joycon_protocol/common_protocol.cpp | |||
| @@ -120,6 +120,19 @@ DriverResult JoyconCommonProtocol::SendSubCommand(SubCommand sc, std::span<const | |||
| 120 | return DriverResult::Success; | 120 | return DriverResult::Success; |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | DriverResult JoyconCommonProtocol::SendMcuCommand(SubCommand sc, std::span<const u8> buffer) { | ||
| 124 | std::vector<u8> local_buffer(MaxResponseSize); | ||
| 125 | |||
| 126 | local_buffer[0] = static_cast<u8>(OutputReport::MCU_DATA); | ||
| 127 | local_buffer[1] = GetCounter(); | ||
| 128 | local_buffer[10] = static_cast<u8>(sc); | ||
| 129 | for (std::size_t i = 0; i < buffer.size(); ++i) { | ||
| 130 | local_buffer[11 + i] = buffer[i]; | ||
| 131 | } | ||
| 132 | |||
| 133 | return SendData(local_buffer); | ||
| 134 | } | ||
| 135 | |||
| 123 | DriverResult JoyconCommonProtocol::SendVibrationReport(std::span<const u8> buffer) { | 136 | DriverResult JoyconCommonProtocol::SendVibrationReport(std::span<const u8> buffer) { |
| 124 | std::vector<u8> local_buffer(MaxResponseSize); | 137 | std::vector<u8> local_buffer(MaxResponseSize); |
| 125 | 138 | ||