Part Number: CC2640R2F
Tool/software: Code Composer Studio
Hey,
i has asked a questions about start and stop advertising using a timer in simple broadcaster. The generales responses it's juste add this :
1. Add "#define SBP_PERIODIC_EVT 0x0004" 2. Add "#define SBP_PERIODIC_EVT_PERIOD 5000" which is how often to perform periodic event (in msec). 3. Claim "static Clock_Struct periodicClock;"
4. Implement SBP_clockHandler
static void SBP_clockHandler(UArg arg)
{
// Store the event. events |= arg;
// Wake up the application. Semaphore_post(sem);
}
5. Call "Util_constructClock(&periodicClock, SBP_clockHandler,SBP_PERIODIC_EVT_PERIOD, 0, false, SBP_PERIODIC_EVT);" and "Util_startClock(&periodicClock);" in your application init function like SimpleBLEPeripheral_init.
6. Add SBP_PERIODIC_EVT event processing case in for-loop of application task function like SimpleBLEPeripheral_taskFxn.
if (events & SBP_PERIODIC_EVT)
{ events &= ~SBP_PERIODIC_EVT;
Util_startClock(&periodicClock);
// Perform your application periodic task here!!!
}
But, after many search and modification the code, i have juste add 2 lines of code in the Simple Broadcaster :
1. GAP_SetParamValue(TGAP_LIM_ADV_TIMEOUT, 180); // 180 secondes : 3 minutes of advertising
2. uint16_t gapRole_AdvertOffTime = 120 000 ; // 2 minutes of waiting
Please test this code in your code at code composer studio and tell me if it's same with your results.
Thanks You