Add physical and USB pairing management
This commit is contained in:
parent
74a62f035b
commit
41c7021813
22 changed files with 1263 additions and 72 deletions
|
|
@ -6,11 +6,41 @@
|
|||
#include "switch_pro_driver.h"
|
||||
|
||||
constexpr uint8_t BLUEPAD32_INPUT_BACKEND_SLOT_COUNT = 4;
|
||||
constexpr uint8_t BLUEPAD32_PAIRING_RECORD_CAPACITY = 16;
|
||||
|
||||
enum class Bluepad32PairingTransport : uint8_t {
|
||||
kClassic = 1,
|
||||
kBle = 2,
|
||||
};
|
||||
|
||||
enum class Bluepad32PairingSnapshotStatus : uint8_t {
|
||||
kReady = 0,
|
||||
kPending = 1,
|
||||
};
|
||||
|
||||
struct Bluepad32PairingRecord {
|
||||
Bluepad32PairingTransport transport;
|
||||
uint8_t address_type;
|
||||
uint8_t address[6];
|
||||
};
|
||||
|
||||
struct Bluepad32PairingSnapshot {
|
||||
uint32_t generation;
|
||||
Bluepad32PairingSnapshotStatus status;
|
||||
uint8_t record_count;
|
||||
bool overflow;
|
||||
Bluepad32PairingRecord records[BLUEPAD32_PAIRING_RECORD_CAPACITY];
|
||||
};
|
||||
|
||||
|
||||
void bluepad32_input_backend_init();
|
||||
void bluepad32_input_backend_start();
|
||||
void bluepad32_input_backend_open_pairing_window();
|
||||
void bluepad32_input_backend_clear_pairings();
|
||||
bool bluepad32_input_backend_snapshot(uint8_t slot, SwitchInputState* out);
|
||||
void bluepad32_input_backend_request_pairing_snapshot();
|
||||
void bluepad32_input_backend_pairing_snapshot(
|
||||
Bluepad32PairingSnapshot* out);
|
||||
void bluepad32_input_backend_report_sent(uint8_t slot);
|
||||
void bluepad32_input_backend_queue_rumble(uint8_t slot,
|
||||
const SwitchRumbleOutput& rumble);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue