2 Replies Latest reply on Oct 2, 2020 7:21 AM by EdHa_4455331

    Pairing a Microsoft Windows App

    EdHa_4455331

      I am trying to get a Microsoft Windows App to pair with a CYBLE-416045-02 module using pin confirmation. I can successfully pair with the module using CySmart, so I am pretty sure that I have the basics correct on the module side. But my windows app goes off the rails. Of course, one of the big differences is that CySmart goes through its custom BLE dongle, while the Windows app tries to use the PCs bluethooth system.

       

      In the Windows app, I followed the guidance at Pair devices - UWP applications | Microsoft Docs and did the following:

       

      DevicePairingKinds pk = DevicePairingKinds.ConfirmPinMatch;

       

        DeviceInformation deviceInfo = btdev.DeviceInformation;
        DeviceInformationPairing devicePairing = deviceInfo.Pairing;
        DeviceInformationCustomPairing custom = devicePairing.Custom;

       

        custom.PairingRequested += pairhandle;

        DevicePairingResult result = await custom.PairAsync(pk);

        custom.PairingRequested -= pairhandle;

       

      But on the module side I get:

       

      CY_BLE_EVT_GAP_AUTH_REQ: bdHandle=1, security=3, bonding=1, ekeySize=10, pairing=1, err=0

       

      CY_BLE_EVT_GAP_SMP_NEGOTIATED_AUTH_INFO: bdHandle =1, security=3, bonding=1, ekeySize=10, pairing= 1, err=0

       

      CY_BLE_EVT_GAP_AUTH_FAILED: bdHandle=1, securitye0, bonding=50, ekeySize=2, pairing= a, err=a

       

      If I change the security levels in the module to not require pairing, all the rest of the system works as expected. I can connect, get the characteristics and read and write to them.

       

      So, has anybody out there managed to pair with a Psoc 6 module from a windows app using ANY level of pairing? And if so, how did you do it?

       

      Thanks,

       

      Ed H.

        • 1. Re: Pairing a Microsoft Windows App
          PY_21

          Hello EdHa_4455331 ,

           

          Please let me know the windows version which you are using. Are you using the custom app in your windows ? Please provide some information on the Microsoft Windows APP.
          Could you please check with the "CE212742_BLE_4.2_DataLength_Security_Privacy" code example project from the PSoC Creator and let me know the observations ?

           

          Thanks,
          P Yugandhar.

          • 2. Re: Pairing a Microsoft Windows App
            EdHa_4455331

            Thank you for your previous prompt response. I was called away for a few days with a crisis on another project.

             

            Yes, I am using a custom Windows app. I am running Windows 10 Enterprise version 10.0.17134 with Visual Studio 2017 with all the options listed below.

             

            I will also check out the code example that you have suggested. It may give me a clue. OTOH, I can successfully pair with CySmart complete with the 6-digit number popping up on both sides for confirmation. So if it works with CySmart, what is Microsoft doing that is making it go crazy? We will have to keep on digging...

             

            Ed H.

             

            Microsoft Visual Studio Enterprise 2017
            Version 15.9.17
            VisualStudio.15.Release/15.9.17+28307.905
            Microsoft .NET Framework
            Version 4.7.03056

            Installed Version: Enterprise

            Visual C++ 2017   00369-90252-57770-AA176
            Microsoft Visual C++ 2017

            Application Insights Tools for Visual Studio Package   8.14.20131.1
            Application Insights Tools for Visual Studio

            ASP.NET and Web Tools 2017   15.9.04012.0
            ASP.NET and Web Tools 2017

            C# Tools   2.10.0-beta2-63501-03+b9fb1610c87cccc8ceb74a770dba261a58e39c4a
            C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

            Common Azure Tools   1.10
            Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

            JavaScript Language Service   2.0
            JavaScript Language Service

            JavaScript Project System   2.0
            JavaScript Project System

            JavaScript UWP Project System   2.0
            JavaScript UWP Project System

            Microsoft JVM Debugger   1.0
            Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

            Microsoft MI-Based Debugger   1.0
            Provides support for connecting Visual Studio to MI compatible debuggers

            Microsoft Visual C++ Wizards   1.0
            Microsoft Visual C++ Wizards

            Microsoft Visual Studio VC Package   1.0
            Microsoft Visual Studio VC Package

            MLGen Package Extension   1.0
            MLGen Package Visual Studio Extension Detailed Info

            NuGet Package Manager   4.6.0
            NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

            ProjectServicesPackage Extension   1.0
            ProjectServicesPackage Visual Studio Extension Detailed Info

            ResourcePackage Extension   1.0
            ResourcePackage Visual Studio Extension Detailed Info

            ResourcePackage Extension   1.0
            ResourcePackage Visual Studio Extension Detailed Info

            Test Adapter for Boost.Test   1.0
            Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.

            Test Adapter for Google Test   1.0
            Enables Visual Studio's testing tools with unit tests written for Google Test.  The use terms and Third Party Notices are available in the extension installation directory.

            TypeScript Tools   15.9.30718.2001
            TypeScript Tools for Microsoft Visual Studio

            Visual Basic Tools   2.10.0-beta2-63501-03+b9fb1610c87cccc8ceb74a770dba261a58e39c4a
            Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

            Visual Studio Code Debug Adapter Host Package   1.0
            Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

            Visual Studio Tools for CMake   1.0
            Visual Studio Tools for CMake

            Visual Studio Tools for Universal Windows Apps   15.0.28307.902
            The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.