Hi, I'm using the smartrf06 board with cc2650EM-7ID package and trying to make a custom Broadcaster project. I'm also using ble stack v2.1.1 SimpleBLEBroadcaster with IAR for my application.
Firstly, my broadcaster sets the necessary configurations for negative edge pin wake up in the init function and goes to shutdown. After it wakes up with a negative edge, it starts broadcasting a data. Until now my application works perfectly. The next step is to trigger an interrupt if a negative edge is captured and change the broadcasting data. I was able to implement the callback of the hardware interrupt with the following code and also added HCI_EXT_AdvEventNoticeCmd function to update data in taskFxn function.
g_pinHandle = PIN_open(&g_pinState, alertIO); PIN_registerIntCb(g_pinHandle, alertHwiFxn); PIN_setConfig(g_pinHandle, PIN_BM_IRQ, Board_KEY_UP | PIN_IRQ_NEGEDGE); HCI_EXT_AdvEventNoticeCmd(selfEntity, ALERT_EVENT); // Start the Device VOID GAPRole_StartDevice(&simpleBLEBroadcaster_BroadcasterCBs);
I've tested this and the hardware interrupt works fine triggering the following event that I defined before:
#define ALERT_EVENT 0x0010 static void alertHwiFxn(PIN_Handle hPin, PIN_Id pinId) { g_events.hdr.event |= ALERT_EVENT; Semaphore_post(sem); }
Lastly I'm checking if the event is triggered inside taskFxn for loop with the following code:
if(g_events.hdr.event & ALERT_EVENT) { // Clear event g_events.hdr.event &= ~ALERT_EVENT; g_status = GAPRole_SetParameter(GAPROLE_ADVERT_DATA, sizeof(alertData), alertData); if(g_status == SUCCESS){ GPIOPinToggle(1<<IOID_25); } }
I can see that the LED toggles every time I press the button but the broadcasting data doesn't change. I've read similar questions on the forum but couldn't find a solution that updates the data. Can someone tell me what am I doing wrong or missing here.
Thank you for your help.