iBeacons on the TI CC2541
Setting a Timer
The easiest way I found to set a timer is to call
This call is used for setting the timeout value for turning the advertising back on in the code. We are going to modify it so that we can turn the advertising off. I don’t know the framework good enough to start adding tasks. Instead we are going to modify GAPRole_ProcessEvent( uint8 task_id, uint16 events )
to take a new message that tells it to turn off the radio. In my case I called it STOP_ADVERTISING_EVT. This needs to run the following commands:
{
...
}
else if (events & STOP_ADVERTISING_EVT)
{
VOID GAP_EndDiscoverable(gapRole_TaskID);
gapRole_AdvEnabled = FALSE;
return ( events ^ STOP_ADVERTISING_EVT );
}
Wrap Up
This should help you as you work on making the example project match what you are actually doing. Don’t expect this to be a one day project. There’s a lot (remove the static typing from this variable, include this header, etc.). I left out in the name of brevity here. Hopefully I’ll get another post out to go along with this. Until next time.
-
[…] good news is that I was able to leverage the code I wrote for the CC2541 previously. This project was a little more complicated. It has to take commands over the asynchronous […]
[…] good news is that I was able to leverage the code I wrote for the CC2541 previously. This project was a little more complicated. It has to take commands over the asynchronous […]
Leave a Reply to Glenn Cancel reply
Can you put batter level data from battery service in advertisement data?
etc: battery level:%88 So is it possible to put that data in advertisement also?
Could you upload the firmware source somewhere? The tutorial page originally linked to has disappeared. If you also have a backup copy of the tutorial page, that would be great also.
Hi Chad, do you have a copy of the radius networks CC2541 iBeacon project for the CC2541DK-MINI dev kit? Your links doesn’t work any more (they’ve moved the project/taken it down).
Many thanks