3 Replies Latest reply on Oct 27, 2016 11:50 PM by anpm

    please tell me how to set  random device address

    yoshizu_1678311

      I use PSoC Creator3.3.

         

      Please tell me how to set  (Advertiser Address Type=random )  on broadcaster role?

         

      Best Regards,yoshizu

        • 1. Re: please tell me how to set  random device address
          anpm

          Hi Yoshizu,

             

          You can set the address type as random as below:
          cyBle_discoveryModeInfo.advParam->ownAddrType = CYBLE_GAP_ADDR_TYPE_RANDOM; in the
          CYBLE_EVT_STACK_ON event before starting advertisment.

             

          This is only for setting the address type. For setting the advertising address as a random address, you can generate a random address and set using CyBle_SetDeviceAddress() API. They call the above code line of setting address type. Then start adv.

             

          Thanks,
          Anjana

          • 2. Re: please tell me how to set  random device address
            yoshizu_1678311

            Hi Anjana,

               

            When I change BD address by CyBle_SetDeviceAddress() set, then BD address is changed.

               

            But  when add  "cyBle_discoveryModeInfo.advParam->ownAddrType = CYBLE_GAP_ADDR_TYPE_RANDOM"   to source,

               

            then BD address is not changed.

               

            why?

               

            Best regards,yoshizu

            • 3. Re: please tell me how to set  random device address
              anpm

              Hi yoshizu,

                 

              Could you please make sure you have followed the below sequence:

                 

              - Make sure device is not advertising mode

                 

              - set the device address

                 

              - cyBle_discoveryModeInfo.advParam->ownAddrType = CYBLE_GAP_ADDR_TYPE_RANDOM;

                 

              - call enter discovery API

                 

              If still you are facing any issue, please share the project, I will help you to find what could be the issue.

                 

              Thanks,
              Anjana