4 Replies Latest reply on Sep 3, 2019 3:51 AM by PY_21

    BLE Device Addresses

    StSc_1311791

      When my central receives a scan from the client, it has the client's address in a CYBLE_GAPC_ADV_REPORT_T data structure.  My central can connect to the client using this address.  But in my client code, I get (I assume) my client's address by calling CyBle_GetDeviceAddress.  THese two addressed don't match, why?

        • 1. Re: BLE Device Addresses
          PY_21

          Hello,

           

          Could you please let me know how you configured your client device whether it is GAP peripheral or central.

          Can you please share your project ?

           

          Thanks,

          P Yugandhar.

          • 2. Re: BLE Device Addresses
            StSc_1311791

            Thanks for your reply.  I have two CY8CKIT-042-BLE kits.  I also have two projects, one is a client and one as central.

            The Client configuration:

                 Profile:Custom

                 Profile role: Server (GATT Server)

                 GAP role: Periferal

            The Central configuration:

                 Profile:Custom

                 Profile role:Client(GATT Client)

                 GAP role: Central

             

            My central is able to connect to the client and read/write data from/to the client.  Everything works.  My question is a curiosity question.  When I call  routine CyBle_GetDeviceAddress() on the client, I get a different address than advReport->peerBdAddr my Central receives in the following code snippet in the callback routine when receiving a scan result.

             

            case CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT:

                 advReport = (CYBLE_GAPC_ADV_REPORT_T *) eventParam;

             

            The advReport->peerBdAddr address is what my central uses to connect to the client.

             

            Again, everything works but I don't understand why the address obtained by call CyBle_GetDeviceAddress() on the client is not the address obtained by the Central from the scan.

             

            I don't think sharing my projects would add any more useful information.

            • 3. Re: BLE Device Addresses
              StSc_1311791

              If routine CyBle_GetDeviceAddress() is called while the client is advertising, the address returned matches what is in the advertising packet received by the Central.

              • 4. Re: BLE Device Addresses
                PY_21

                Note: BLE device with GATT role as server and GAP role as Peripheral is a Peripheral device with server configuration.

                 

                Thanks,

                P Yugandhar.