Skip to content

Commit

Permalink
Make pairing process more resilient
Browse files Browse the repository at this point in the history
  • Loading branch information
imbushuo committed Jun 2, 2021
1 parent 91dcad7 commit 4cdc3eb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/AmtPtpHidFilter/Device.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@ PtpFilterSelfManagedIoInit(

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

Expand Down Expand Up @@ -258,9 +261,9 @@ PtpFilterSelfManagedIoRestart(
status = PtpFilterConfigureMultiTouch(Device);
if (!NT_SUCCESS(status)) {
TraceEvents(TRACE_LEVEL_ERROR, TRACE_DEVICE, "%!FUNC! PtpFilterConfigureMultiTouch failed, Status = %!STATUS!", status);
// If this failed, we will retry after 3 seconds (and pretend nothing happens)
// If this failed, we will retry after 2 seconds (and pretend nothing happens)
status = STATUS_SUCCESS;
WdfTimerStart(deviceContext->HidTransportRecoveryTimer, WDF_REL_TIMEOUT_IN_SEC(3));
WdfTimerStart(deviceContext->HidTransportRecoveryTimer, WDF_REL_TIMEOUT_IN_SEC(2));
goto exit;
}
}
Expand Down

0 comments on commit 4cdc3eb

Please sign in to comment.