diff --git a/src/ControlStream.c b/src/ControlStream.c index fed910c..b5b4334 100644 --- a/src/ControlStream.c +++ b/src/ControlStream.c @@ -1422,7 +1422,7 @@ int startControlStream(void) { enet_address_set_port(&address, ControlPortNumber); // Create a client - client = enet_host_create(address.address.ss_family, NULL, 1, CTRL_CHANNEL_MAX + 1, 0, 0); + client = enet_host_create(address.address.ss_family, NULL, 1, CTRL_CHANNEL_COUNT, 0, 0); if (client == NULL) { stopping = true; return -1; @@ -1431,7 +1431,7 @@ int startControlStream(void) { client->intercept = ignoreDisconnectIntercept; // Connect to the host - peer = enet_host_connect(client, &address, CTRL_CHANNEL_MAX + 1, 0); + peer = enet_host_connect(client, &address, CTRL_CHANNEL_COUNT, 0); if (peer == NULL) { stopping = true; enet_host_destroy(client); diff --git a/src/InputStream.c b/src/InputStream.c index ff0a847..6cdf196 100644 --- a/src/InputStream.c +++ b/src/InputStream.c @@ -1421,8 +1421,8 @@ int LiSendControllerMotionEvent(uint8_t controllerNumber, uint8_t motionType, fl return -1; } - // Send each controller on a separate channel - holder->channelId = CTRL_CHANNEL_GAMEPAD_BASE + controllerNumber; + // Send each controller on a separate channel specific to motion sensors + holder->channelId = CTRL_CHANNEL_SENSOR_BASE + controllerNumber; // Motion events are so rapid that we can just drop any events that are lost in transit holder->enetPacketFlags = 0; diff --git a/src/Limelight-internal.h b/src/Limelight-internal.h index e3f20b2..ba4e8e3 100644 --- a/src/Limelight-internal.h +++ b/src/Limelight-internal.h @@ -60,8 +60,9 @@ extern uint32_t SunshineFeatureFlags; #define CTRL_CHANNEL_PEN 0x04 #define CTRL_CHANNEL_TOUCH 0x05 #define CTRL_CHANNEL_UTF8 0x06 -#define CTRL_CHANNEL_GAMEPAD_BASE 0x10 // 0x10 to 0x20 by controller index -#define CTRL_CHANNEL_MAX 0x20 +#define CTRL_CHANNEL_GAMEPAD_BASE 0x10 // 0x10 to 0x1F by controller index +#define CTRL_CHANNEL_SENSOR_BASE 0x20 // 0x20 to 0x2F by controller index +#define CTRL_CHANNEL_COUNT 0x30 #ifndef UINT24_MAX #define UINT24_MAX 0xFFFFFF