diff options
author | wwylele <wwylele@gmail.com> | 2017-02-25 20:21:52 +0100 |
---|---|---|
committer | wwylele <wwylele@gmail.com> | 2017-05-03 08:44:00 +0200 |
commit | 12bcf64ab512df5e6034429c7b2a12981df19a5e (patch) | |
tree | 01281f9034b8cddf33fd925f8d2304467d19d09b /src/core/hle/service/ir/ir_user.h | |
parent | qt: enable config for circle pad pro (diff) | |
download | yuzu-12bcf64ab512df5e6034429c7b2a12981df19a5e.tar yuzu-12bcf64ab512df5e6034429c7b2a12981df19a5e.tar.gz yuzu-12bcf64ab512df5e6034429c7b2a12981df19a5e.tar.bz2 yuzu-12bcf64ab512df5e6034429c7b2a12981df19a5e.tar.lz yuzu-12bcf64ab512df5e6034429c7b2a12981df19a5e.tar.xz yuzu-12bcf64ab512df5e6034429c7b2a12981df19a5e.tar.zst yuzu-12bcf64ab512df5e6034429c7b2a12981df19a5e.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/ir/ir_user.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/core/hle/service/ir/ir_user.h b/src/core/hle/service/ir/ir_user.h index 3849bd923..2401346e8 100644 --- a/src/core/hle/service/ir/ir_user.h +++ b/src/core/hle/service/ir/ir_user.h @@ -4,11 +4,41 @@ #pragma once +#include <functional> #include "core/hle/service/service.h" namespace Service { namespace IR { +/// An interface representing a device that can communicate with 3DS via ir:USER service +class IRDevice { +public: + /** + * A function object that implements the method to send data to the 3DS, which takes a vector of + * data to send. + */ + using SendFunc = std::function<void(const std::vector<u8>& data)>; + + explicit IRDevice(SendFunc send_func); + virtual ~IRDevice(); + + /// Called when connected with 3DS + virtual void OnConnect() = 0; + + /// Called when disconnected from 3DS + virtual void OnDisconnect() = 0; + + /// Called when data is received from the 3DS. This is invoked by the ir:USER send function. + virtual void OnReceive(const std::vector<u8>& data) = 0; + +protected: + /// Sends data to the 3DS. The actual sending method is specified in the constructor + void Send(const std::vector<u8>& data); + +private: + const SendFunc send_func; +}; + class IR_User_Interface : public Service::Interface { public: IR_User_Interface(); @@ -21,5 +51,8 @@ public: void InitUser(); void ShutdownUser(); +/// Reload input devices. Used when input configuration changed +void ReloadInputDevices(); + } // namespace IR } // namespace Service |