Skip to content

Commit 4cdc3eb

Browse files
committed
Make pairing process more resilient
1 parent 91dcad7 commit 4cdc3eb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/AmtPtpHidFilter/Device.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,10 @@ PtpFilterSelfManagedIoInit(
226226

227227
status = PtpFilterConfigureMultiTouch(Device);
228228
if (!NT_SUCCESS(status)) {
229+
// If this failed, we will retry after 2 seconds (and pretend nothing happens)
229230
TraceEvents(TRACE_LEVEL_ERROR, TRACE_DEVICE, "%!FUNC! PtpFilterConfigureMultiTouch failed, Status = %!STATUS!", status);
231+
status = STATUS_SUCCESS;
232+
WdfTimerStart(deviceContext->HidTransportRecoveryTimer, WDF_REL_TIMEOUT_IN_SEC(2));
230233
goto exit;
231234
}
232235

@@ -258,9 +261,9 @@ PtpFilterSelfManagedIoRestart(
258261
status = PtpFilterConfigureMultiTouch(Device);
259262
if (!NT_SUCCESS(status)) {
260263
TraceEvents(TRACE_LEVEL_ERROR, TRACE_DEVICE, "%!FUNC! PtpFilterConfigureMultiTouch failed, Status = %!STATUS!", status);
261-
// If this failed, we will retry after 3 seconds (and pretend nothing happens)
264+
// If this failed, we will retry after 2 seconds (and pretend nothing happens)
262265
status = STATUS_SUCCESS;
263-
WdfTimerStart(deviceContext->HidTransportRecoveryTimer, WDF_REL_TIMEOUT_IN_SEC(3));
266+
WdfTimerStart(deviceContext->HidTransportRecoveryTimer, WDF_REL_TIMEOUT_IN_SEC(2));
264267
goto exit;
265268
}
266269
}

0 commit comments

Comments
 (0)