Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
972 views
in Technique[技术] by (71.8m points)

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

I am successfully automatically pairing Bluetooth device against Win 7 and Win 10, using feet32 Library. Unfortunately a System Dialog shows up, saying "tap to pair" Under Win 7 it pairs if I Tap the Dialog or not. Under Win 10 it does not pair, if I do not touch the dialog. Actually, there is a Win 10 option, that switches off the dialog, but then no pairing takes place also. Under Win 7 handlerequests is called, under Win 10 it is not.

Under Win 7 it pairs anyway.

This is the win 7 Dialog

This is the Win 10 Dialog

Dim  pairer As New BluetoothWin32Authentication(AddressOf handleRequests ) 

Public Sub handleRequests(ByVal thing As Object, ByVal args As BluetoothWin32AuthenticationEventArgs)        
    args.Confirm = True
End Sub

Protected Function TryRemember(ByVal peer As BluetoothDeviceInfo) As Boolean
    If peer Is Nothing Then Return False        
    Return BluetoothSecurity.PairRequest(peer.DeviceAddress, Nothing )
End Function
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There is no easy way to do that. However our Bluetooth Framework can do that by using undocumented way. Works on any Windows platform.

I can not share the code but I can give you the idea. You have to disable Authentication Agent.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...