|
|
|
@ -38,6 +38,7 @@ using TriggerDevices = |
|
|
|
using BatteryDevices = |
|
|
|
std::array<std::unique_ptr<Common::Input::InputDevice>, max_emulated_controllers>; |
|
|
|
using CameraDevices = std::unique_ptr<Common::Input::InputDevice>; |
|
|
|
using RingAnalogDevice = std::unique_ptr<Common::Input::InputDevice>; |
|
|
|
using NfcDevices = std::unique_ptr<Common::Input::InputDevice>; |
|
|
|
using OutputDevices = std::array<std::unique_ptr<Common::Input::OutputDevice>, output_devices_size>; |
|
|
|
|
|
|
|
@ -47,6 +48,7 @@ using ControllerMotionParams = std::array<Common::ParamPackage, Settings::Native |
|
|
|
using TriggerParams = std::array<Common::ParamPackage, Settings::NativeTrigger::NumTriggers>; |
|
|
|
using BatteryParams = std::array<Common::ParamPackage, max_emulated_controllers>; |
|
|
|
using CameraParams = Common::ParamPackage; |
|
|
|
using RingAnalogParams = Common::ParamPackage; |
|
|
|
using NfcParams = Common::ParamPackage; |
|
|
|
using OutputParams = std::array<Common::ParamPackage, output_devices_size>; |
|
|
|
|
|
|
|
@ -58,6 +60,7 @@ using ControllerMotionValues = std::array<ControllerMotionInfo, Settings::Native |
|
|
|
using ColorValues = std::array<Common::Input::BodyColorStatus, max_emulated_controllers>; |
|
|
|
using BatteryValues = std::array<Common::Input::BatteryStatus, max_emulated_controllers>; |
|
|
|
using CameraValues = Common::Input::CameraStatus; |
|
|
|
using RingAnalogValue = Common::Input::AnalogStatus; |
|
|
|
using NfcValues = Common::Input::NfcStatus; |
|
|
|
using VibrationValues = std::array<Common::Input::VibrationStatus, max_emulated_controllers>; |
|
|
|
|
|
|
|
@ -84,6 +87,10 @@ struct CameraState { |
|
|
|
std::size_t sample{}; |
|
|
|
}; |
|
|
|
|
|
|
|
struct RingSensorForce { |
|
|
|
f32 force; |
|
|
|
}; |
|
|
|
|
|
|
|
struct NfcState { |
|
|
|
Common::Input::NfcState state{}; |
|
|
|
std::vector<u8> data{}; |
|
|
|
@ -116,6 +123,7 @@ struct ControllerStatus { |
|
|
|
BatteryValues battery_values{}; |
|
|
|
VibrationValues vibration_values{}; |
|
|
|
CameraValues camera_values{}; |
|
|
|
RingAnalogValue ring_analog_value{}; |
|
|
|
NfcValues nfc_values{}; |
|
|
|
|
|
|
|
// Data for HID serices |
|
|
|
@ -129,6 +137,7 @@ struct ControllerStatus { |
|
|
|
ControllerColors colors_state{}; |
|
|
|
BatteryLevelState battery_state{}; |
|
|
|
CameraState camera_state{}; |
|
|
|
RingSensorForce ring_analog_state{}; |
|
|
|
NfcState nfc_state{}; |
|
|
|
}; |
|
|
|
|
|
|
|
@ -141,6 +150,7 @@ enum class ControllerTriggerType { |
|
|
|
Battery, |
|
|
|
Vibration, |
|
|
|
IrSensor, |
|
|
|
RingController, |
|
|
|
Nfc, |
|
|
|
Connected, |
|
|
|
Disconnected, |
|
|
|
@ -294,6 +304,9 @@ public: |
|
|
|
/// Returns the latest camera status from the controller with parameters |
|
|
|
CameraValues GetCameraValues() const; |
|
|
|
|
|
|
|
/// Returns the latest status of analog input from the ring sensor with parameters |
|
|
|
RingAnalogValue GetRingSensorValues() const; |
|
|
|
|
|
|
|
/// Returns the latest status of button input for the hid::HomeButton service |
|
|
|
HomeButtonState GetHomeButtons() const; |
|
|
|
|
|
|
|
@ -324,6 +337,9 @@ public: |
|
|
|
/// Returns the latest camera status from the controller |
|
|
|
const CameraState& GetCamera() const; |
|
|
|
|
|
|
|
/// Returns the latest ringcon force sensor value |
|
|
|
RingSensorForce GetRingSensorForce() const; |
|
|
|
|
|
|
|
/// Returns the latest ntag status from the controller |
|
|
|
const NfcState& GetNfc() const; |
|
|
|
|
|
|
|
@ -353,6 +369,15 @@ public: |
|
|
|
*/ |
|
|
|
bool SetCameraFormat(Core::IrSensor::ImageTransferProcessorFormat camera_format); |
|
|
|
|
|
|
|
// Returns the current mapped ring device |
|
|
|
Common::ParamPackage GetRingParam() const; |
|
|
|
|
|
|
|
/** |
|
|
|
* Updates the current mapped ring device |
|
|
|
* @param param ParamPackage with ring sensor data to be mapped |
|
|
|
*/ |
|
|
|
void SetRingParam(Common::ParamPackage param); |
|
|
|
|
|
|
|
/// Returns true if the device has nfc support |
|
|
|
bool HasNfc() const; |
|
|
|
|
|
|
|
@ -435,7 +460,7 @@ private: |
|
|
|
/** |
|
|
|
* Updates the battery status of the controller |
|
|
|
* @param callback A CallbackStatus containing the battery status |
|
|
|
* @param index Button ID of the to be updated |
|
|
|
* @param index battery ID of the to be updated |
|
|
|
*/ |
|
|
|
void SetBattery(const Common::Input::CallbackStatus& callback, std::size_t index); |
|
|
|
|
|
|
|
@ -445,6 +470,12 @@ private: |
|
|
|
*/ |
|
|
|
void SetCamera(const Common::Input::CallbackStatus& callback); |
|
|
|
|
|
|
|
/** |
|
|
|
* Updates the ring analog sensor status of the ring controller |
|
|
|
* @param callback A CallbackStatus containing the force status |
|
|
|
*/ |
|
|
|
void SetRingAnalog(const Common::Input::CallbackStatus& callback); |
|
|
|
|
|
|
|
/** |
|
|
|
* Updates the nfc status of the controller |
|
|
|
* @param callback A CallbackStatus containing the nfc status |
|
|
|
@ -485,6 +516,7 @@ private: |
|
|
|
TriggerParams trigger_params; |
|
|
|
BatteryParams battery_params; |
|
|
|
CameraParams camera_params; |
|
|
|
RingAnalogParams ring_params; |
|
|
|
NfcParams nfc_params; |
|
|
|
OutputParams output_params; |
|
|
|
|
|
|
|
@ -494,6 +526,7 @@ private: |
|
|
|
TriggerDevices trigger_devices; |
|
|
|
BatteryDevices battery_devices; |
|
|
|
CameraDevices camera_devices; |
|
|
|
RingAnalogDevice ring_analog_device; |
|
|
|
NfcDevices nfc_devices; |
|
|
|
OutputDevices output_devices; |
|
|
|
|
|
|
|
|