2019-10-31 18:00:42 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "switch.h"
|
|
|
|
#include "IController.h"
|
|
|
|
#include "SwitchControllerHandler.h"
|
|
|
|
#include "SwitchVirtualGamepadHandler.h"
|
|
|
|
|
|
|
|
//Wrapper for HDL functions for switch versions [7.0.0+]
|
|
|
|
class SwitchHDLHandler : public SwitchVirtualGamepadHandler
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
u64 m_hdlHandle;
|
|
|
|
HiddbgHdlsDeviceInfo m_deviceInfo;
|
|
|
|
HiddbgHdlsState m_hdlState;
|
|
|
|
|
|
|
|
public:
|
|
|
|
//Initialize the class with specified controller
|
|
|
|
SwitchHDLHandler(std::unique_ptr<IController> &&controller);
|
|
|
|
~SwitchHDLHandler();
|
|
|
|
|
|
|
|
//Initialize controller handler, HDL state
|
2019-11-13 11:27:43 +00:00
|
|
|
virtual Result Initialize() override;
|
|
|
|
virtual void Exit() override;
|
2019-10-31 18:00:42 +00:00
|
|
|
|
|
|
|
//This will be called periodically by the input threads
|
2019-11-13 11:27:43 +00:00
|
|
|
virtual void UpdateInput() override;
|
2019-10-31 18:00:42 +00:00
|
|
|
//This will be called periodically by the output threads
|
2019-11-13 11:27:43 +00:00
|
|
|
virtual void UpdateOutput() override;
|
2019-10-31 18:00:42 +00:00
|
|
|
|
|
|
|
//Separately init and close the HDL state
|
|
|
|
Result InitHdlState();
|
|
|
|
Result ExitHdlState();
|
|
|
|
|
|
|
|
//Fills out the HDL state with the specified button data
|
|
|
|
void FillHdlState(const NormalizedButtonData &data);
|
|
|
|
//Passes the HDL state to HID so that it could register the inputs
|
|
|
|
Result UpdateHdlState();
|
|
|
|
};
|