Designing an application using the SimpleMAC Library APIs
If radioTransmitConfig.chechCCA equals TRUE, the CSMA-CA backoff(s) and CCA
check(s) are performed using the default energy level (-75 dBm).
Below is a pseudocode example of energy threshold setting for the CCA assessment:
int8_t ed_cca_value = USER_ED_CCA_VALUE
/* Set the energy level used for CCA assessment */
ST_RadioSetEdCcaThreshold (ed_cca_value);
5.3.3
ISR callbacks for packet transmission
If the transmission process has successfully started, the
ST_RadioTransmitCompleteIsrCallback() is called to indicate the completion status.
If the radio is busy transmitting, the ST_RadioTransmit() function returns an error and
ST_RadioTransmitCompleteIsrCallback() will not be called.
Before sending a new packet, check the ST_RadioTransmitIsrCompleteCallback() status
parameter to decide which action to perform. As an example, retransmit the packet if no
acknowledgment has been received when the packet sent has the FCF ACK request bit set
to 1.
The pseudocode below gives an example of transmit ISR callback:
void ST_RadioTransmitCompleteIsrCallback(St_Status status, uint32_t
sfdSentTime, boolean framePending)
{
switch(status) {
case ST_SUCCESS:
break;
case ST_PHY_TX_CCA_FAIL:
/* Insert here user specific action */
break;
case ST_MAC_NO_ACK_RECEIVED:
/* Insert here user specific action */
break;
case ST_PHY_ACK_RECEIVED:
if (framePending) {
}
else {
}
break;
default:
break;
}
}
44/54
/* Insert here user specific action */
/* Insert here user specific action */
/* Insert here user specific action */
Doc ID 16995 Rev 10
UM0893
Need help?
Do you have a question about the SimpleMAC STM32W108 Series and is the answer not in the manual?
Questions and answers