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

View file

@ -31,6 +31,51 @@ namespace ams::controller {
uint8_t xyz[3]; uint8_t xyz[3];
} __attribute__ ((__packed__)); } __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 { struct WiiInputReport0x20 {
WiiButtonData buttons; WiiButtonData buttons;
uint8_t led : 4; uint8_t led : 4;
@ -101,54 +146,18 @@ namespace ams::controller {
uint8_t extension[21]; uint8_t extension[21];
} __attribute__ ((__packed__)); } __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 { struct WiiReportData {
uint8_t id; uint8_t id;
union { union {
WiiOutputReport0x10 output0x10;
WiiOutputReport0x11 output0x11;
WiiOutputReport0x12 output0x12;
WiiOutputReport0x14 output0x14;
WiiOutputReport0x15 output0x15;
WiiOutputReport0x16 output0x16;
WiiOutputReport0x17 output0x17;
WiiOutputReport0x18 output0x18;
WiiOutputReport0x19 output0x19;
WiiInputReport0x20 input0x20; WiiInputReport0x20 input0x20;
WiiInputReport0x21 input0x21; WiiInputReport0x21 input0x21;
WiiInputReport0x22 input0x22; WiiInputReport0x22 input0x22;
@ -161,17 +170,6 @@ namespace ams::controller {
WiiInputReport0x36 input0x36; WiiInputReport0x36 input0x36;
WiiInputReport0x37 input0x37; WiiInputReport0x37 input0x37;
WiiInputReport0x3d input0x3d; WiiInputReport0x3d input0x3d;
WiiOutputReport0x10 output0x10;
WiiOutputReport0x11 output0x11;
WiiOutputReport0x12 output0x12;
WiiOutputReport0x14 output0x14;
WiiOutputReport0x15 output0x15;
WiiOutputReport0x16 output0x16;
WiiOutputReport0x17 output0x17;
WiiOutputReport0x18 output0x18;
WiiOutputReport0x19 output0x19;
}; };
} __attribute__ ((__packed__)); } __attribute__ ((__packed__));