Fix controller arrival packet to actually contain the controller that arrived

This commit is contained in:
Cameron Gutman
2023-06-25 14:27:43 -05:00
parent 44c8b95400
commit 8c447137d6
2 changed files with 2 additions and 2 deletions

View File

@@ -152,8 +152,8 @@ typedef struct _SS_PEN_PACKET {
#define SS_CONTROLLER_ARRIVAL_MAGIC 0x55000004
typedef struct _SS_CONTROLLER_ARRIVAL_PACKET {
NV_INPUT_HEADER header;
uint8_t controllerNumber;
uint8_t type;
uint8_t zero[1]; // Alignment/reserved
uint16_t capabilities;
uint32_t supportedButtonFlags;
} SS_CONTROLLER_ARRIVAL_PACKET, *PSS_CONTROLLER_ARRIVAL_PACKET;

View File

@@ -1253,8 +1253,8 @@ int LiSendControllerArrivalEvent(uint8_t controllerNumber, uint16_t activeGamepa
holder->packet.controllerArrival.header.size = BE32(sizeof(SS_CONTROLLER_ARRIVAL_PACKET) - sizeof(uint32_t));
holder->packet.controllerArrival.header.magic = LE32(SS_CONTROLLER_ARRIVAL_MAGIC);
holder->packet.controllerArrival.controllerNumber = controllerNumber;
holder->packet.controllerArrival.type = type;
memset(holder->packet.controllerArrival.zero, 0, sizeof(holder->packet.controllerArrival.zero));
holder->packet.controllerArrival.capabilities = LE16(capabilities);
holder->packet.controllerArrival.supportedButtonFlags = LE32(supportedButtonFlags);