2

I try to write a console app in C# that can do Bluetooth pairing between the PC to mobile device without user interaction in the Windows side.

I follow this answer: Pair bluetooth devices to a computer with 32feet .NET Bluetooth library

And now I can scan, and send PairRequest via InTheHand library, but after the PairRequest sends the paring cannot continue

Without user permission

enter image description here

Looking for an answer to this a lot, I'd love to hear if you think it's possible and if someone has built such a thing before.

Thanks a lot.

htshame
  • 6,599
  • 5
  • 36
  • 56
N.S
  • 29
  • 4

1 Answers1

1

That usually depends on how pairing is implemented. I am not so familiar with 32feet but you should handle all possible (legacy PIN, Numeric Comparison, Passkey Notification and Passkey Request) pairing methods.

If 32feet allows to do that the next step (in fact this is the first step) is to disable Windows Authentication Agent. If you did not disable it it will handle all pairing requests and show such dialog.

Supressing System Dialog when pairing Bluetooth devices using Win 7 or Win 10

  • Thanks for the hint! Can I do it by code? (to disable Windows Authentication Agent) – N.S Jan 24 '19 at 13:05
  • Thanks, @Mike, I'll try it. Do you have an idea that does not include a change in the PC policy? – N.S Jan 24 '19 at 13:35
  • Disabling Auth agent does not require to change PC policy. You can disable it when start pairing and re-enable back when pairing done if you wouild like to save other apps running as they expected. However if you use correct authentication handling (not one that now implemente din 32 feet) your app will handle ALL authentication requests from ALL Bluetooth actions (even if you pair device through Windows Bluetooth UI). – Mike Petrichenko Jan 24 '19 at 13:47