cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Smart Bluetooth

Anonymous
Not applicable

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 Solution
ArvindS_76
Employee

There was a bug in the additional_advertisement_control.a library. This has been fixed in SDK 2.2.1. Please upgrade to this release.

View solution in original post

18 Replies
BoonT_56
Employee

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.

Anonymous
Not applicable

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,

MichaelF_56
Moderator
Moderator

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?

0 Likes
Anonymous
Not applicable

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,

MichaelF_56
Moderator
Moderator

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 Video Link : 1065 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.

Anonymous
Not applicable

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,


MichaelF_56
Moderator
Moderator

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.

0 Likes
Anonymous
Not applicable

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,

0 Likes
MichaelF_56
Moderator
Moderator

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

0 Likes
MichaelF_56
Moderator
Moderator

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

0 Likes
Anonymous
Not applicable

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.

0 Likes
BoonT_56
Employee

Not sure it helps but check out this thread:

Callback to modify single advertisments?

0 Likes
Anonymous
Not applicable

Hello asakusagiken

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

Thanks

JT

0 Likes
BoonT_56
Employee

asakusagiken

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

0 Likes
Anonymous
Not applicable

Hello,

I can edit "mybeacon" sample and it work file.

But,

As I said, I have made "some" broadcasters. And I will produce them for some years.

Do I have to rewrite the code every time when write the program? I feel it's little bit silly thing...


I think there is a bug in the latest SDK, and the compiled sample "mybeacon" was made by an old version SDK, or someting.


Please check this.


1) Make a new project.

2) Copy the code from "mybeacon".

3) Run it and check the debug monitor. Original mybeacon send count-up number to the debugmonitor, but the copied project don't send the debug. This mean here


bleprofile_notifyAdvPacketTransmissions(&advertisement_packet_transmission, 2500);


failed and the "advertisement_packet_transmission" never called.


Taka,

0 Likes
Anonymous
Not applicable

Hello, this is Taka,

The make target name of "mybeacon" sample is "xx-BCM92736TAG_Q32". And my project is "xx-BCM920737TAG_Q32".

The difference is "736" and "737".

How about this? We have to add this line in the make file when we use "bleprofile_notifyAdvPacketTransmissions()".

APP_PATCHES_AND_LIBS += additional_advertisement_control.a

and there is a bug in the 737's  additional_advertisement_control.a??

Taka,

0 Likes
ArvindS_76
Employee

There was a bug in the additional_advertisement_control.a library. This has been fixed in SDK 2.2.1. Please upgrade to this release.

View solution in original post

Anonymous
Not applicable

arvinds,

Thank you very much!

Now I understand there is no way to solve it by using additional_advertisement_control.a.

I will update the SDK.

Taka,

0 Likes