Linux: Allow connecting Wiimotes via L2CAP (#1353)

This commit is contained in:
capitalistspz 2024-12-07 11:02:40 +00:00 committed by GitHub
parent 934cb54605
commit dd0af0a56f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 532 additions and 221 deletions

View file

@ -0,0 +1,22 @@
#pragma once
#include <input/api/Wiimote/WiimoteDevice.h>
#include <bluetooth/bluetooth.h>
class L2CapWiimote : public WiimoteDevice
{
public:
L2CapWiimote(int recvFd, int sendFd, bdaddr_t addr);
~L2CapWiimote() override;
bool write_data(const std::vector<uint8>& data) override;
std::optional<std::vector<uint8>> read_data() override;
bool operator==(const WiimoteDevice& o) const override;
static void AddCandidateAddress(bdaddr_t addr);
static std::vector<WiimoteDevicePtr> get_devices();
private:
int m_recvFd;
int m_sendFd;
bdaddr_t m_addr;
};