Why WiFiDirect return OperationAlreadyInProgress when pairing?

quanwen du 41 Reputation points
2020-06-29T09:11:21.03+00:00

Hello,

When we refer to the UWP WiFi Direct Sample to develop app to pair with phone, the interface DeviceInformationCustomPairing.PairAsync() sometimes returns OperationAlreadyInProgress.

Can you share under which conditions the interface will return OperationAlreadyInProgress? is it due the previous WiFiDirect connection is not closed politely? if so, how can we do to void OperationAlreadyInProgress error?

Thanks a lot!

Developer technologies | Universal Windows Platform (UWP)
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2020-06-30T03:35:07.933+00:00

    Hello,

    Welcome to Microsoft Q&A!

    From the document - DevicePairingResultStatus Enum, the OperationAlreadyInProgress state means The device object is already attempting to pair or unpair. When the pairing process is not finished and the pairing method is called again, this result will be returned.

    Please do not call the pairing method multiple times in a short time. Make sure the target device's pairing process is finished before calling the pairing method again.

    Thank you.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.