3 Replies Latest reply on Sep 22, 2015 2:33 PM by userc_19497

    Why Can't update broadcast data ?

      Hi Sir


      I add code to puart_control.c, As follows :




      I use sinffer check the package content ,

      It has not been modified.


      Can tell me why ?

        • 1. Re: Why Can't update broadcast data ?


          Can you confirm your function is being called and has the right conditions for the if statement?

          You can try putting some debug traces in the function and see if it actually gets called, because I don't see any reason why it will not change the advertisement if it is properly being called.


          Thank you.


          • 2. Re: Why Can't update broadcast data ?

            Hi James ,

            I sure it can run to if(enable){ ....}


            and I find a problem in puart_control project


            This "bleprofile_Init(bleprofile_p_cfg)" function can't called two times.


            Otherwise can't update broadcast data.


            first in puart_control_create()






            second in blecen_Create()







            Maybe you can try my test ....


            Thanks you.

            • 3. Re: Why Can't update broadcast data ?

              Hi again.

              Were you able to change the advertisement packets?

              I was able to change the advertisement with your code.


              I added your code to the original puart_control app:


              * handle advertise command from UART


              void puart_control_handle_advertise_cmd(BOOL enable)


                  if (enable)


                      BLE_ADV_FIELD adv[2];

                      adv[0].len = 2;

                      adv[0].val = ADV_FLAGS;

                      adv[0].data[0] = LE_GENERAL_DISCOVERABLE | BR_EDR_NOT_SUPPORTED;


                      adv[1].len = 2;

                      adv[1].val = 1;

                      adv[1].data[0] = 1;



                      bleprofile_Discoverable(HIGH_UNDIRECTED_DISCOVERABLE, NULL);





                      bleprofile_Discoverable(NO_DISCOVERABLE, NULL);





              This is the ADDRESS that I used.


              Then I used ClientControl app (located in puart_control) to interact with puart_control.



              This is the snippet of the advertisement packet. Notice the matching data with the code.


              I don't know why you weren't able to update the broadcast data.

              Are there any other changes you made to puart_control?

              Are you using some other app than ClientControl(WICED Smart UART Controller) to communicate with the puart_control?


              As for the bleprofile_init call, it did not make any difference.

              First I tested with the app with both bleprofile_Init and blecen_Create calls in the puart_control_create.

              Then I tried with only calling blecen_Create while commenting out the call to bleprofile_Init.

              The results were the same, and it did not make any difference.


              I just told you what I did, since I could not duplicate your problem.

              If you still have this problem, please let me know the steps you are taking to get the problem.

              Thank you.