1 2 Previous Next 18 Replies Latest reply on May 8, 2015 2:54 AM by userc_9557 Branched to a new discussion.

    bleprofile_notifyAdvPacketTransmissions doesn't work.

    userc_9557

      Hello, this is Taka.

       

      I am making a broadcaser and have seen the sample of mybeacon.

      But the "advertisement_packet_transmission" doesn't work in my code.

      The SDK is 2.1.1 and Tag board.

       

      When I write the mybeacon sample, the call back works.

       

      I did,

       

      1) Make a project.

       

      2) Add following in the make file.

      APP_PATCHES_AND_LIBS += additional_advertisement_control.a

       

      3) Add these in the create()

      bleprofile_notifyAdvPacketTransmissions(&advertisement_packet_transmission, 2500);

       

      blecm_startAdv(

                  HCIULP_ADV_NONCONNECTABLE_EVENT,                // non-connectable undirected advertisement

                  160,                                            // adv interval 100 msec

                  HCIULP_ADV_CHANNEL_MAP_MASK,                    // all channels

                  HCIULP_PUBLIC_ADDRESS,                          // int advAdrType,

                  HCIULP_ADV_FILTER_POLICY_WHITE_LIST_NOT_USED,   // int advFilterPolicy,

                  HCIULP_PUBLIC_ADDRESS,                          // int initiatorAdrType,

                  NULL);

       

      4) Comment out the this,

      //    bleprofile_Discoverable(HIGH_UNDIRECTED_DISCOVERABLE, NULL);

       

      5) Make the callback like this.

      void advertisement_packet_transmission(UINT8 type)

      {

        ble_trace0("p1\n");

        if (type == 0)

          {

        ble_trace0("p2\n");

          }

      }

       

       

      Then write the program and advertisement starts. But the "advertisement_packet_transmission" is not occure.

      What should I do for this? or, is there a sample code for broadcaster?

      I just want to add a sensor data in the advertisement packet. Ofcourse, the sensor data is changing everytime in the packet.

        • 1. Re: bleprofile_notifyAdvPacketTransmissions doesn't work.
          BoonT_56

          You will need to submit a valid MFi license ID to us so that we can give you a patch to use the ibeacon in the sdk. 

           

          At the mean time, I think you should also peruse the hello sensor code.

          • 2. Re: bleprofile_notifyAdvPacketTransmissions doesn't work.
            userc_9557

            I don't make ibeacon. As I said, it's a kind of broadcaster. No relation of Apple.

             

            And my problem is about advertisement. I already made some device using 20373S with sensors and I know how to use sensor input or some other basic knowledge. So I don't think hello sensor sample will work for this problem.

             

            Taka,

            • 3. Re: bleprofile_notifyAdvPacketTransmissions doesn't work.
              MichaelF_56

              The myBeacon application within the SDK should do exactly what you are trying to do.

               

              It's essentially an advertiser which allows the changing of advertisement content.

               

              To demonstrate the app, work through the following steps.

              1. Plug the WICED eval board into your computer

              2. Build and download the application (to the WICED board)

              3. Monitor advertisement packets on over the air sniffer

              4. Push and hold the big white button on the tag board and check that advertisements stop

              5. Release the big white button and check that advertisements resume

               

              With no changes to this code, do you see the advertisements packets start and stop when you push and hold the white button on the TAG board?

              • 4. Re: bleprofile_notifyAdvPacketTransmissions doesn't work.
                userc_9557

                Thank you for the reply.

                 

                I know the myBeacon application do exactly what I want and I can download and run the myBeacon. I added some ble_trace for checking that the call-back runs or not in the SDK's myBeacon, and I could see the call-back run.

                 

                Then, I am making my original project, and do 1) - 5) sequence like above. But the call-back is not fired.

                 

                I used Wiced-Smart-designer to make my project, so the code is different from the myBeacon sample. But I think if following line works well,

                 

                bleprofile_notifyAdvPacketTransmissions(&advertisement_packet_transmission, 2500);


                "advertisement_packet_transmission" call back will be run every 2.5mS before the advertisemnt.

                I just make the simple code in the call-back like

                ble_trace0("p1\n");

                but, the "p1" is not showed at all.

                When I add it in the SDK's myBeacon sample, and run, then I can see the "p1" every 100mS on my terminal monitor.


                I think I have to do something more, but I have no idea what should I do more.


                Taka,

                • 5. Re: bleprofile_notifyAdvPacketTransmissions doesn't work.
                  MichaelF_56

                  I know the myBeacon application do exactly what I want and I can download and run the myBeacon. I added some ble_trace for checking that the call-back runs or not in the SDK's myBeacon, and I could see the call-back run.

                   

                  So the mybeacon example works fine.  This is a good data point.

                   

                  So if I understand correctly, you are then using Smart Designer to build your custom project, then attempting to incorporate portions of mybeacon into the Smart Designer Project to get it working.

                   

                  Many users have had issues transitioning Smart Designer projects into production worthy applications (search the forum and there are some recent cases), so if possible, could you make small changes to the mybeacon application and proceed using it?

                   

                  Smart Designer is an excellent tool to create your custom GATT DB, then import that into your project, but has its limitations when it comes to using it as a start to finish application tool.

                   

                  The WICED SMART SDK 2.x: Smart Designer Overview talks about a series of 'to-dos', or a 'to-do list' you need to manage in order to get Smart Designer functioning. That is the primary problem users have with this tool.  Even then, the sample applications are the better place to start.

                  • 6. Re: bleprofile_notifyAdvPacketTransmissions doesn't work.
                    userc_9557

                    Thank you for the reply.


                    Even the code is exactly same of myBeacon project, it won't work. If I make the different project from the SDK sample, even the code is the same, it won't work. I think the problem is not code but the compile environment.

                    Advertisement works but the call-back never occured. So, the data area of the advertisement is not changed.


                    I have tested following.


                    0) I add ble_trace0("p1\n") in myBeacon project of SDK, write program, run, then I could see the trace on my debug environment. And the data area of myBeacon counts up in every packet.


                    1) I make my original project by using WICED Smart Designer as "myBroadcast".

                    2) I erase the code in myBroadcast.c and copy the code from myBeacon.c.

                    3) I copied myBeacon.h into my project.

                    4) I copied makefile.mk to my project.

                    5) I compiled it and there is no error.

                    6) Program runs. I can see the advertisement 100mS interval, but no debug trace.


                    I can see two "additional_advertisement_control.a" at "Wiced-Smart\tier2\brcm\libraries\lib\20736" and "Wiced-Smart\tier2\brcm\libraries\lib\20737".

                    The SDK's sample of myBeacon make target is "mybeacon-BCM920736xxx". My project's make target is "myBroadcast-BCM920737".

                    I think the file "additional_advertisement_control.a" at xx\20737 has some bug or someting.

                    Or, if I use "additional_advertisement_control.a", I have to set the path or sometiong in my project.


                    I swaped xx\20737's "additional_advertisement_control.a" and xx\20736's it. But wont work.


                    Taka,


                     

                    • 7. Re: bleprofile_notifyAdvPacketTransmissions doesn't work.
                      MichaelF_56

                      Could you share your project/resources.

                       

                      Using the "Use Advanced Editor" function in the editor allows you to attach files.

                       

                      I may be able to have one of the developers take a look.

                      • 8. Re: bleprofile_notifyAdvPacketTransmissions doesn't work.
                        userc_9557

                        Thank you very much for that.

                         

                        I attached the project folder named "BLECAST_Light", That will be a light sensor, but now, this file, the code is the same of myBeacon sample program of SDK.

                         

                        Taka,

                        • 9. Re: bleprofile_notifyAdvPacketTransmissions doesn't work.
                          MichaelF_56

                          If it's the same as mybeacon, then it works correct?

                          • 10. Re: bleprofile_notifyAdvPacketTransmissions doesn't work.
                            MichaelF_56

                            We built BLECAST_Light, downloaded it to the Tag board and observed advertisements.  Works fine.

                            • 11. Re: bleprofile_notifyAdvPacketTransmissions doesn't work.
                              userc_9557

                              As I said, the project do advertise, but the call back "advertisement_packet_transmission" doesn't work.

                              You have to check the debug monitor too. Not only the advertisement.

                               

                              Original myBeacon project displays some count up numbers when 2.5mS before advertisement. This mean "advertisement_packet_transmission" works.

                               

                              But if I make another project, like i sent, there is no count up, "advertisement_packet_transmission" doesn't work.

                               

                              As I said, I want to make a broadcaster with sensor. I have to change the advertisement data every time.

                              • 13. Re: bleprofile_notifyAdvPacketTransmissions doesn't work.
                                jota_1939431

                                Hello userc_9557

                                 

                                Can you try editing mybeacon app and see if it still works?

                                 

                                Thanks

                                JT

                                • 14. Re: bleprofile_notifyAdvPacketTransmissions doesn't work.
                                  BoonT_56

                                  userc_9557

                                  Did you have a chance to try out JT's suggestion?

                                  1 2 Previous Next