mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-07-05 06:42:57 +12:00
Initial CPP implementation
This commit is contained in:
parent
ce356c6e61
commit
382c0f953d
14 changed files with 658 additions and 184 deletions
23
include/services/ir/ir_device.hpp
Normal file
23
include/services/ir/ir_device.hpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
#pragma once
|
||||
#include <functional>
|
||||
#include <span>
|
||||
|
||||
#include "helpers.hpp"
|
||||
|
||||
namespace IR {
|
||||
class Device {
|
||||
public:
|
||||
using Payload = std::span<const u8>;
|
||||
|
||||
protected:
|
||||
using SendCallback = std::function<void(Payload)>; // Callback for sending data from IR device->3DS
|
||||
SendCallback sendCallback;
|
||||
|
||||
public:
|
||||
virtual void connect() = 0;
|
||||
virtual void disconnect() = 0;
|
||||
virtual void receivePayload(Payload payload) = 0;
|
||||
|
||||
Device(SendCallback sendCallback) : sendCallback(sendCallback) {}
|
||||
};
|
||||
} // namespace IR
|
Loading…
Add table
Add a link
Reference in a new issue