Transmitting Packets And Managing Transmit Callbacks; Configuring The Radiotransmitconfig Variable; 5.3.2 Setting And Transmitting A Packet; Table 29. Radiotransmitconfig Members - ST SimpleMAC STM32W108 Series User Manual

Table of Contents

Advertisement

Designing an application using the SimpleMAC Library APIs
5.3

Transmitting packets and managing transmit callbacks

5.3.1

Configuring the radioTransmitConfig variable

Before transmitting a packet, declare a variable, radioTransmitConfig, of
RadioTransmitConfig type. The RadioTransmitConfig type corresponds to a structure
containing the parameters and modes related to the packet transmission features (see
Table
29). It must be initialized prior to calling the packet transmit API.
Table 29.
boolean waitForAck
boolean checkCca
uint8_t ccaAttemptMax
uint8_t backoffExponentMin
uint8_t backoffExponentMax
uint8_t minimumBackoff
boolean appendCrc
If radioTransmitConfig.checkCca is TRUE, ST_RadioTransmit() performs CSMA-CA
backoffs and CCA verifications before transmitting a packet. Otherwise, it starts the
transmission process immediately. The STM32W108xx only supports CCA mode 1. CSMA-
CA reports busy medium if the energy level expressed in dBm exceeds this threshold.
The related radioTransmitConfig variable can be modified only when no transmit operation is
ongoing.
The pseudocode example below explains how to configure the related radioTransmitConfig
variable:
RadioTransmitConfig radioTransmitConfig = {
TRUE,
TRUE,
4,
3,
5,
0, //minimumBackoff
TRUE
};

5.3.2 Setting and transmitting a packet

The following steps are required to transmit a packet:
1.
The first field of the packet is the related length. If the radioTransmitConfig.appendCrc
is TRUE the packet length byte must also take into account the two bytes of CRC. A
packet with a two-byte payload is represented in memory as:{0x04, 0x00, 0x01, 0xc0,
0xc1} where 0xc0 and 0xc1 are the CRC bytes generated by hardware.
42/54
RadioTransmitConfig members
Member
Wait for ACK if ACK request set in FCF.
Backoff and check CCA before transmitting the packet.
Number of CCA attempts before failure. The value ranges from 0 to
5. The default value is 4.
Backoff exponent for the initial CCA attempt.The value ranges from 0
to 3. The default value is 3.
Backoff exponent for the final CCA attempt(s). The default value is 5.
Minimum number of backoffs (suggested value is 0).
Append CRC to transmitted packets.
// waitForAck;
// checkCca;
// ccaAttemptMax;
// backoffExponentMin;
// backoffExponentMax;
// appendCrc;
Doc ID 16995 Rev 10
Description
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