Skip to content

Commit 1feacc3

Browse files
committed
fix: steering SDK must actually work before activating
Don't mark steering SDK as active if LogiIsConnected returns NO or LogiPlayLeds returns FAIL. Fall through to diagnostic phases (LED SDK export dump, legacy HID) so we get useful log output.
1 parent bcd2890 commit 1feacc3

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

Common Files/LogitechLED.cpp

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,31 @@ bool LogitechLED::TrySteeringSDK()
280280
bool connected = g_IsConnected(0);
281281
Log(" LogiIsConnected(0) -> %s", connected ? "YES" : "NO");
282282

283+
// Only activate if wheel is actually connected AND LEDs respond
284+
if (!connected)
285+
{
286+
Log(" Wheel not connected - steering SDK unusable");
287+
if (g_SteeringShutdown) g_SteeringShutdown();
288+
FreeLibrary(m_steeringDll);
289+
m_steeringDll = NULL;
290+
return false;
291+
}
292+
283293
// Test LEDs
284294
g_SteeringUpdate();
285295
bool led = g_PlayLeds(0, 100.0f, 0.0f, 100.0f);
286296
Log(" LogiPlayLeds(0, 100, 0, 100) -> %s *** ALL LEDs ***", led ? "OK" : "FAIL");
287-
Sleep(1000);
288297

298+
if (!led)
299+
{
300+
Log(" PlayLeds failed - steering SDK unusable");
301+
if (g_SteeringShutdown) g_SteeringShutdown();
302+
FreeLibrary(m_steeringDll);
303+
m_steeringDll = NULL;
304+
return false;
305+
}
306+
307+
Sleep(1000);
289308
g_SteeringUpdate();
290309
g_PlayLeds(0, 0.0f, 0.0f, 100.0f);
291310

@@ -295,14 +314,11 @@ bool LogitechLED::TrySteeringSDK()
295314
return true;
296315
}
297316

298-
// All immediate inits failed - defer to first SetLEDs call
299-
// (game window will exist by then)
300-
Log(" Immediate init failed - deferring to first SetLEDs call");
301-
g_SteeringNeedsLateInit = true;
302-
m_method = METHOD_STEERING_SDK;
303-
m_available = true;
304-
Log("=== LED CONTROL PENDING (Steering Wheel SDK - deferred init) ===");
305-
return true;
317+
// All immediate inits failed
318+
Log(" Steering SDK init failed - falling through");
319+
FreeLibrary(m_steeringDll);
320+
m_steeringDll = NULL;
321+
return false;
306322
}
307323

308324
// --- Phase 1: G Hub LED SDK ---

0 commit comments

Comments
 (0)