1 Reply Latest reply on Mar 9, 2020 11:56 PM by PY_21

    Multi connection functionality  HOGP

    SwSh_4126746

      CY8CKIT-062 PSoC 6 BLE Pioneer Kit - Implement multi connection functionality using HID keyboard profile.

       

      Problem Statement: We want to send keypress control to multiple devices simultaneously wherin kit will be connected to 4 devices and simulating any keypress on kit should be sent to all connected devices.

       

      Tried:

      1. Downloaded set up CY8CKIT-062-BLE Complete Setup.
      2. In PSOC creator under code example section downloaded CE215121_BLE_HID_Keyboard sample code
      3. In Topdesign.cysch file changed maximum number of BLE connections to 4

                profile.PNG

      • Kit starts advertising and connection to device1 is successful.
      • In order to make it ready for 2nd connection we pressed SW2 button but it doesn’t start advertising hence device 2,3 and 4 are not able to see kit.

       

      Kindly suggest us on how subsequent connections can be established. Also let us know if we are missing any major configuration that needs to be done.

        • 1. Re: Multi connection functionality  HOGP
          PY_21

          Hello,

           

          Please refer to the attached sample BLE_HID_Keyboard project, where I'm connecting up to four Central devices with the PSoC 6 BLE device.
          In infinite for loop, if we add the below code, the device will check for No. of active connections, states and then starts advertising.
          *************************************
          if((Cy_BLE_GetState() == CY_BLE_STATE_ON) && (Cy_BLE_GetAdvertisementState() == CY_BLE_ADV_STATE_STOPPED) && (Cy_BLE_GetNumOfActiveConn() < CY_BLE_CONN_COUNT))     
                  { 
                      apiResult = Cy_BLE_GAPP_StartAdvertisement(CY_BLE_ADVERTISING_FAST, CY_BLE_PERIPHERAL_CONFIGURATION_0_INDEX);
                  }
          *************************************

          For more information on Multi slave connection in PSoC6 BLE, please refer to the "BLE_MultiSlave" code example in PSoC Creator.

           

          Thanks,
          P Yugandhar.