none
Bluetooth pairing in wpf application. RRS feed

  • Question

  • I am developing a wpf application which will run under kiosk mode in windows 10. My application will provide an audio playing feature via streaming and to listen a bluetooth headset is required. I am able to send pairing request to my bluetooth headset using 32feet.net library but windows 10 prompts user to "Tap to add device" and upon tapping redirects to settings page to allow device to connect. As the application requires to be run in kiosk mode no user should interact with window settings and features. How can I bypass the tap to add device option and undergo successfull pairing of bluetooth headset without user interaction?

    • Moved by Bob Ding Friday, July 28, 2017 11:07 AM
    Friday, July 14, 2017 2:56 PM

All replies

  • Hi,

    Try this: to implement Windows Auto Pairing:

    EventHandler<BluetoothWin32AuthenticationEventArgs> handler = new EventHandler<BluetoothWin32AuthenticationEventArgs>(this.handleRequests);
                BluetoothWin32Authentication authenticator = new BluetoothWin32Authentication(handler);
    
    public void handleRequests(Object thing, BluetoothWin32AuthenticationEventArgs args)
    {
        args.Confirm = true;
    }

    Since 32feet.NET is the third-party source which is outside of this forum scope of support. I will move your thread to off-topic forum.

    Thank you for your understanding.

    Best Regards,

    Bob


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Bob Ding Monday, July 17, 2017 7:48 AM
    Monday, July 17, 2017 3:47 AM
  • Hi Bob,

    Thanks for your reply.

    Leave about 32feet.NET as you mentioned this is the third party(The only hope looks to me to achieve it). 

    How can we achieve this using Microsoft tools and technologies(Any API, library, SDK etc.)? Is Microsoft .NET so poor which will not allow though in WPF to achieve this task(to discover, pair and connecting Bluetooth devices in desktop based application without tap any toast notification which opens Device settings)?

    In Android this is quite simple to achieve.

    Thanks,

    Vipin Panwar



    Monday, July 17, 2017 12:23 PM
  • Hi,

    Please check these two links, according to links, in most cases you'll need to handle authentication, so on Win32 with the built-in Microsoft Bluetooth stack (which is the only platform that has a useable Secure Simple Pairing interface) then use BluetoothWin32Authentication with a callback function, and if creating an application that for instance sends adverts to all passing devices then just have the callback respond with e.Confirm=true. Code you can refer my first reply.

    Bluetooth Security

    Pair bluetooth devices to a computer with 32feet .NET Bluetooth library

    >>How can we achieve this using Microsoft tools and technologies(Any API, library, SDK etc.)?

    As far as I know, Microsoft stack only supports the 3 most common categories, the stack has limited support for Bluetooth applications compared to other Windows-based implementations, so there is no managed Bluetooth API in .NET.

    See: http://www.blueradios.com/Microsoft_Bluetooth_Stack.pdf

    If you want API to the full Bluetooth standard, you need the-third party source to support Bluetooth, such as: http://www.btframework.com/

    By the way, If you develop UWP application, you can allows Windows Store app and desktop apps to interact with Bluetooth by Windows Runtime API.

    Windows.​Devices.​Bluetooth Namespace

    Best Regards,

    Bob


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Bob Ding Wednesday, July 19, 2017 9:14 AM
    • Proposed as answer by Bob Ding Friday, July 21, 2017 9:21 AM
    Tuesday, July 18, 2017 2:36 AM