
Primitives
Simple Media Access Controller (SMAC) for the HCS08 Reference Manual, Rev. 2.0
3-2
Freescale Semiconductor
•
Declare a pointer of the txPacket_t structure type
•
Assign that pointer variable the pointer to the array selected for transmitting.
•
Assign the appropriate value to the
u8DataLength
element of the txPacket_t structure
•
Use the txPacket_t pointer as the argument when calling MCPSDataRequest
uint8_t TxDataBuffer[TX_DATA_BUFFER_SIZE];
txPacket_t *TxPacket;
...
TxPacket = (txPacket_t*)TxDataBuffer;
TxPacket->u8DataLength = MAX_DATA_LENGTH;
DataRequestResult = MCPSDataRequest(TxPacket);
...
3.1.2
MLMELinkQuality
Link quality is a relative measure of the strength or quality of a received packet. A value called a Link
Quality Indicator (LQI) is returned by the transceiver as a result of a received packet.
This function returns an integer byte value for the link quality that is valid for the last received packet. This
binary value can be translated into a measurement of received signal strength in dBm via the equation:
dBm = - (Link Quality[7:0]/2)
dec
Prototype
uint8_t MLMELinkQuality(void);
Arguments
None
Returns
UINT8
8 bit value representing the link quality value
Usage
•
Call MLMERXEnableRequest to enable the receive function
•
Wait for a MCPSDataIndication that a valid packet has been received
•
....
•
Call MLMELinkQuality.
NOTE
•
The value of the link quality is valid and preserved until the next
received packet.
•
This format does not meet IEEE 802.15.4 Standard requirement.