ST SimpleMAC STM32W108 Series User Manual page 46

Table of Contents

Advertisement

Designing an application using the SimpleMAC Library APIs
ST_RadioEnableReceiveCrc(TRUE);
4.
When the address filtering mode is enabled, perform the following actions:
a)
uint16_t panid = USER_PAN_ID;
/* set the panid for filtering received packets */
ST_RadioSetPanId(panid);
b)
uint16_t nodeid = USER_NODE_ID;
/*set the nodeid (short address) for filtering received packets*/
ST_RadioSetNodeID(nodeid);
The ST_RadioDataPendingforLongIdIsrCallback and ST_RadioDataPendingforShortIdIsrCallback
callbacks are called by the library when the packet source short or long address has been
received. The library sets the frame pending bit in the outgoing acknowledgment only if the
related callback returns TRUE. The user callback implementation must check if the
receiving node has pending data for the detected sender source. This can be done by
searching the source address in a lookup table containing the sender addresses for which
there are data pending, and returning TRUE if there is pending data, and FALSE otherwise.
It is critical that these callback functions complete as quickly as possible, to ensure that the
frame pending bit is set before the acknowledgment is sent back by the library. The sender
node will be notified through the transmit callback that the frame pending bit has been
received in the acknowledgment frame. The pseudocode below gives an example of the two
callbacks:
boolean ST_RadioDataPendingShortIdIsrCallback(uint16_t shortId)
{
/* Verify there are pending data for the sender node:
look for the packet short address in a application table ...>
if <pending data>
return TRUE;
else
return FALSE;
}
boolean ST_RadioDataPendingLongIdIsrCallback(uint8_t* longId)
{
/* Verify there are pending data for the sender node:
look for the packet long address in an application table ...>
if <pending data>
return TRUE;
else
return FALSE;
}
46/54
Set the radio PAN identifier:
Set the node identifier if the user application requires filtering on the 16-bit short
address (or node identifier):
*/
*/
Doc ID 16995 Rev 10
UM0893

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SimpleMAC STM32W108 Series and is the answer not in the manual?

Questions and answers

Table of Contents