| 367 | } |
| 368 | |
| 369 | static SDL_bool WriteSubcommand(SDL_DriverSwitch_Context *ctx, ESwitchSubcommandIDs ucCommandID, Uint8 *pBuf, Uint8 ucLen, SwitchSubcommandInputPacket_t **ppReply) |
| 370 | { |
| 371 | int nRetries = 5; |
| 372 | SwitchSubcommandInputPacket_t *reply = NULL; |
| 373 | |
| 374 | while (!reply && nRetries--) { |
| 375 | SwitchSubcommandOutputPacket_t commandPacket; |
| 376 | ConstructSubcommand(ctx, ucCommandID, pBuf, ucLen, &commandPacket); |
| 377 | |
| 378 | if (!WritePacket(ctx, &commandPacket, sizeof(commandPacket))) { |
| 379 | continue; |
| 380 | } |
| 381 | |
| 382 | reply = ReadSubcommandReply(ctx, ucCommandID); |
| 383 | } |
| 384 | |
| 385 | if (ppReply) { |
| 386 | *ppReply = reply; |
| 387 | } |
| 388 | return reply != NULL; |
| 389 | } |
| 390 | |
| 391 | static SDL_bool WriteProprietary(SDL_DriverSwitch_Context *ctx, ESwitchProprietaryCommandIDs ucCommand, Uint8 *pBuf, Uint8 ucLen, SDL_bool waitForReply) |
| 392 | { |
no test coverage detected