Skip to content

Commit 446fb65

Browse files
committed
Mark the Apex 5 controller as being acquired by SDL
1 parent b3dd099 commit 446fb65

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/joystick/hidapi/SDL_hidapi_flydigi.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,9 @@ static bool SDL_HIDAPI_Flydigi_SendAcquireRequest(SDL_HIDAPI_Device *device, boo
209209
FLYDIGI_V2_ACQUIRE_CONTROLLER_COMMAND,
210210
23,
211211
acquire ? 1 : 0,
212-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
212+
'S', 'D', 'L', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
213213
};
214214

215-
// Set the name of the application acquiring the controller
216-
const char *name = SDL_GetAppMetadataProperty(SDL_PROP_APP_METADATA_NAME_STRING);
217-
SDL_assert(name != NULL);
218-
SDL_strlcpy((char *)&acquireControllerCmd[6], name, sizeof(acquireControllerCmd) - 6);
219-
220215
if (SDL_hid_write(device->dev, acquireControllerCmd, sizeof(acquireControllerCmd)) < 0) {
221216
return SDL_SetError("Couldn't send acquire command");
222217
}
@@ -225,7 +220,7 @@ static bool SDL_HIDAPI_Flydigi_SendAcquireRequest(SDL_HIDAPI_Device *device, boo
225220

226221
static bool HIDAPI_DriverFlydigi_HandleAcquireResponse(Uint8 *data, int size)
227222
{
228-
if (data[5] != 1) {
223+
if (data[5] != 1 && data[6] == 0) {
229224
return SDL_SetError("Controller acquiring has been disabled");
230225
}
231226
return true;

0 commit comments

Comments
 (0)