btdrv-mitm: rearrange some report definitions

This commit is contained in:
ndeadly 2020-07-21 12:13:28 +02:00
parent b9747b5f95
commit 494dbf5e2f
2 changed files with 75 additions and 78 deletions

View file

@ -61,6 +61,12 @@ namespace ams::controller {
uint16_t gyro_3;
} __attribute__ ((__packed__));
struct SwitchOutputReport0x01;
struct SwitchOutputReport0x03;
struct SwitchOutputReport0x10;
struct SwitchOutputReport0x11;
struct SwitchOutputReport0x12;
struct SwitchInputReport0x21 {
uint8_t timer;
uint8_t conn_info : 4;
@ -99,28 +105,21 @@ namespace ams::controller {
struct SwitchInputReport0x33;
struct SwitchInputReport0x3f;
struct SwitchOutputReport0x01;
struct SwitchOutputReport0x03;
struct SwitchOutputReport0x10;
struct SwitchOutputReport0x11;
struct SwitchOutputReport0x12;
struct SwitchReportData {
uint8_t id;
union {
SwitchInputReport0x21 input0x21;
SwitchInputReport0x30 input0x30;
//SwitchInputReport0x31 input0x31;
//SwitchInputReport0x32 input0x32;
//SwitchInputReport0x33 input0x33;
//SwitchInputReport0x3f input0x3f;
/*
SwitchOutputReport0x01 output0x01;
SwitchOutputReport0x03 output0x03;
SwitchOutputReport0x10 output0x10;
SwitchOutputReport0x11 output0x11;
SwitchOutputReport0x12 output0x12;
*/
//SwitchOutputReport0x01 output0x01;
//SwitchOutputReport0x03 output0x03;
//SwitchOutputReport0x10 output0x10;
//SwitchOutputReport0x11 output0x11;
//SwitchOutputReport0x12 output0x12;
SwitchInputReport0x21 input0x21;
SwitchInputReport0x30 input0x30;
//SwitchInputReport0x31 input0x31;
//SwitchInputReport0x32 input0x32;
//SwitchInputReport0x33 input0x33;
//SwitchInputReport0x3f input0x3f;
};
} __attribute__ ((__packed__));

View file

@ -31,6 +31,51 @@ namespace ams::controller {
uint8_t xyz[3];
} __attribute__ ((__packed__));
struct WiiOutputReport0x10 {
uint8_t rumble;
} __attribute__ ((__packed__));
struct WiiOutputReport0x11 {
uint8_t leds;
} __attribute__ ((__packed__));
struct WiiOutputReport0x12 {
uint8_t _unk;
uint8_t report_mode;
} __attribute__ ((__packed__));
struct WiiOutputReport0x14 {
uint8_t : 5;
uint8_t speaker_enable : 1;
uint8_t : 0;
} __attribute__ ((__packed__));
struct WiiOutputReport0x15 {
uint8_t _unk;
} __attribute__ ((__packed__));
struct WiiOutputReport0x16 {
uint32_t address;
uint8_t size;
uint8_t data[16];
} __attribute__ ((__packed__));
struct WiiOutputReport0x17 {
uint32_t address;
uint16_t size;
} __attribute__ ((__packed__));
struct WiiOutputReport0x18 {
uint8_t size;
uint8_t speaker_data[20];
} __attribute__ ((__packed__));
struct WiiOutputReport0x19 {
uint8_t : 5;
uint8_t speaker_mute : 1;
uint8_t : 0;
} __attribute__ ((__packed__));
struct WiiInputReport0x20 {
WiiButtonData buttons;
uint8_t led : 4;
@ -101,67 +146,9 @@ namespace ams::controller {
uint8_t extension[21];
} __attribute__ ((__packed__));
struct WiiOutputReport0x10 {
uint8_t rumble;
} __attribute__ ((__packed__));
struct WiiOutputReport0x11 {
uint8_t leds;
} __attribute__ ((__packed__));
struct WiiOutputReport0x12 {
uint8_t _unk;
uint8_t report_mode;
} __attribute__ ((__packed__));
struct WiiOutputReport0x14 {
uint8_t : 5;
uint8_t speaker_enable : 1;
uint8_t : 0;
} __attribute__ ((__packed__));
struct WiiOutputReport0x15 {
uint8_t _unk;
} __attribute__ ((__packed__));
struct WiiOutputReport0x16 {
uint32_t address;
uint8_t size;
uint8_t data[16];
} __attribute__ ((__packed__));
struct WiiOutputReport0x17 {
uint32_t address;
uint16_t size;
} __attribute__ ((__packed__));
struct WiiOutputReport0x18 {
uint8_t size;
uint8_t speaker_data[20];
} __attribute__ ((__packed__));
struct WiiOutputReport0x19 {
uint8_t : 5;
uint8_t speaker_mute : 1;
uint8_t : 0;
} __attribute__ ((__packed__));
struct WiiReportData {
uint8_t id;
union {
WiiInputReport0x20 input0x20;
WiiInputReport0x21 input0x21;
WiiInputReport0x22 input0x22;
WiiInputReport0x30 input0x30;
WiiInputReport0x31 input0x31;
WiiInputReport0x32 input0x32;
WiiInputReport0x33 input0x33;
WiiInputReport0x34 input0x34;
WiiInputReport0x35 input0x35;
WiiInputReport0x36 input0x36;
WiiInputReport0x37 input0x37;
WiiInputReport0x3d input0x3d;
WiiOutputReport0x10 output0x10;
WiiOutputReport0x11 output0x11;
WiiOutputReport0x12 output0x12;
@ -171,7 +158,18 @@ namespace ams::controller {
WiiOutputReport0x17 output0x17;
WiiOutputReport0x18 output0x18;
WiiOutputReport0x19 output0x19;
WiiInputReport0x20 input0x20;
WiiInputReport0x21 input0x21;
WiiInputReport0x22 input0x22;
WiiInputReport0x30 input0x30;
WiiInputReport0x31 input0x31;
WiiInputReport0x32 input0x32;
WiiInputReport0x33 input0x33;
WiiInputReport0x34 input0x34;
WiiInputReport0x35 input0x35;
WiiInputReport0x36 input0x36;
WiiInputReport0x37 input0x37;
WiiInputReport0x3d input0x3d;
};
} __attribute__ ((__packed__));