3 Replies Latest reply on Aug 28, 2019 12:12 PM by PY_21

    API Bluetooth v5

    DaGa_4352226

      Hello Community.

       

      I am trying to get the Bluetooth address of a peer address and before I used the method CyBle_GapGetPeerBdAddr(). Now with the new version of BLE the compiler show an error "implicit declaration".  I have found the API Bluetooth v4.1 which it has this method.https://www.cypress.com/file/157996/download

       

      Where can I find the API documentation of the BLE v5.0? or can someone tell me which method I should use to get the peer address of a mobile?

       

      Regards,

      David

        • 1. Re: API Bluetooth v5
          PY_21

          Hello David,

           

          Please use the API Cy_BLE_GAP_GetPeerBdAddr(), this function reads the peer Bluetooth device address identified by 'bdHandle'.

           

          PSoC6 BLE supports Bluetooth v5.0. For PSoC4 BLE and PSoC6 BLE devices macros, structures, APIs will differ. Please refer to PSoC6 BLE API documentation in BLE component PDL Documentation. In PSoC Creator, Right click on the BLE Component ->click on "Open PDL Documentation".

           

          Thanks,

          P Yugandhar.

          • 2. Re: API Bluetooth v5
            DaGa_4352226

            Hello P. Yugandhar.

             

            Thanks for your reply. Now I am calling this method when the BD got the "CY_BLE_EVT_GAP_DEVICE_CONNECTED" event but the api_result throwns me an error : "Cy_BLE_GAP_GetPeerBdAddr Error 0x160001" This error can be either CY_BLE_ERROR_NO_DEVICE_ENTITY or CY_BLE_ERROR_INVALID_PARAMETER

             

            Can you help me?

             

            Thanks a lot

            David Caraveo

            • 3. Re: API Bluetooth v5
              PY_21

              Hello David,

               

              Please add the below code in Stack event handler callback function and declare "cy_stc_ble_conn_handle_t  appConnHandle;" externally. Please refer Cy_BLE_GAP_GetPeerBdAddr() API declaration in the "CE212742_BLE_4.2_DataLength_Security_Privacy" code example in PSoC Creator.

               

              cy_stc_ble_gap_peer_addr_info_t addr =

                          {

                              .bdHandle = appConnHandle.bdHandle

                          };

               

              Thanks,

              P Yugandhar.