2020-07-11 19:11:13 +00:00
|
|
|
#pragma once
|
|
|
|
#include "switchcontroller.hpp"
|
|
|
|
|
|
|
|
namespace ams::controller {
|
|
|
|
|
2020-08-17 21:17:02 +00:00
|
|
|
class EmulatedSwitchController : public SwitchController {
|
2020-07-11 19:11:13 +00:00
|
|
|
|
|
|
|
public:
|
2020-08-17 21:17:02 +00:00
|
|
|
EmulatedSwitchController(ControllerType type, const bluetooth::Address *address)
|
2020-07-30 20:07:26 +00:00
|
|
|
: SwitchController(type, address) { };
|
2020-07-11 19:11:13 +00:00
|
|
|
|
2020-07-27 17:42:40 +00:00
|
|
|
const bluetooth::HidReport * handleIncomingReport(const bluetooth::HidReport *report);
|
|
|
|
const bluetooth::HidReport * handleOutgoingReport(const bluetooth::HidReport *report);
|
2020-07-11 19:11:13 +00:00
|
|
|
|
2020-07-27 17:42:40 +00:00
|
|
|
protected:
|
|
|
|
virtual Result setVibration(void);
|
|
|
|
virtual Result setPlayerLed(u8 led_mask);
|
2020-07-11 19:11:13 +00:00
|
|
|
|
2020-07-27 17:42:40 +00:00
|
|
|
Result handleSubCmdReport(const bluetooth::HidReport *report);
|
|
|
|
Result subCmdRequestDeviceInfo(const bluetooth::HidReport *report);
|
|
|
|
Result subCmdSpiFlashRead(const bluetooth::HidReport *report);
|
|
|
|
Result subCmdSpiFlashWrite(const bluetooth::HidReport *report);
|
|
|
|
Result subCmdSpiSectorErase(const bluetooth::HidReport *report);
|
|
|
|
Result subCmdSetInputReportMode(const bluetooth::HidReport *report);
|
|
|
|
Result subCmdTriggersElapsedTime(const bluetooth::HidReport *report);
|
|
|
|
Result subCmdSetShipPowerState(const bluetooth::HidReport *report);
|
|
|
|
Result subCmdSetMcuConfig(const bluetooth::HidReport *report);
|
|
|
|
Result subCmdSetMcuState(const bluetooth::HidReport *report);
|
|
|
|
Result subCmdSetPlayerLeds(const bluetooth::HidReport *report);
|
|
|
|
Result subCmdEnableImu(const bluetooth::HidReport *report);
|
|
|
|
Result subCmdEnableVibration(const bluetooth::HidReport *report);
|
|
|
|
|
2020-08-17 22:14:19 +00:00
|
|
|
Result fakeSubCmdResponse(const u8 response[], size_t size);
|
|
|
|
|
2020-07-27 17:42:40 +00:00
|
|
|
bluetooth::HidReport m_inputReport;
|
|
|
|
bluetooth::HidReport m_outputReport;
|
2020-07-11 19:11:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|