Other Parts Discussed in Thread: REMOTI, Z-STACK, CC2530
Hi,
From the SimpleApp sample code shown below, is it possible to add an additional event? Say for example
if (events & SAP_SOMETHING_ELSE)
{
// Do something
}
and SAP_SOMETHING_ELSE is defined as
#define SAP_SOMETHING_ELSE 0x0002
Also from my observation, it seems that I can define up to 16 "event flags" for each ProcessEvent function where they are defined as 0x0001, 0x0002, 0x0004, 0x0008....?
uint16 SAP_ProcessEvent(uint8 taskId, uint16 events)
{
uint8* pMsg;
(void) taskId; // unused argument
// System Events
if (events & SYS_EVENT_MSG)
{
while ((pMsg = osal_msg_receive(SAP_TaskId)) != NULL)
{
/* Deallocate */
osal_msg_deallocate((uint8 *) pMsg);
}
return events ^ SYS_EVENT_MSG;
}
// SimpleApp events
if (events & SAP_EVT_INIT)
{
// This event should only happen in initialization state
if (sapState == SAP_STATE_INIT)
{
// Configure node parameters
sapStartup();
// Start RemoTI application framework and stack
RTI_InitReq();
}
}
return 0;
}