2.3.6 PHY_TxFrame Function
C
PHY_Retval_t PHY_TxFrame(PHY_FrameInfo_t *txFrame, PHY_CSMAMode_t csmaMode,
bool performFrameRetry)
Summary
Request to PHY to transmit frame
Description
This function is called by the upper layer (MAC/Application) to deliver a frame to the PHY to be transmitted by the transceiver.
Precondition
PHY_Init() should have been called before calling this function
Parameters
Param | Description | Comments |
---|---|---|
txFrame | Pointer to the PHY_FrameInfo_t structure or to frame array to be transmitted | |
txFrame->mpdu | Pointer to the PHY Payload. mpdu should hold the length of the payload(N) + 1 (for length field length) | |
txFrame->mpdu | Hold the phyPayload | |
csmaMode | Indicates mode of csma-ca to be performed for this frame | |
NO_CSMA_NO_IFS | Immediate Tx and SIFS(Short InterFrameSpacing) between subsequent frames | |
NO_CSMA_WITH_IFS | Immediate Tx and LIFS (Long InterFrameSpacing) between subsequent frames | |
CSMA_UNSLOTTED | Hardware CSMA will be performed before packet transmission with number of retries configured | |
CSMA_SLOTTED | Hardware CSMA will be performed | |
Beacon Enabled network - Currently not supported by PHY | ||
performFrameRetry | Indicates whether to retries are to be performed for this frame | |
true | SW retry will be performed for macMaxFrameRetries value | |
false | SW retry is disabled |
Returns
PHY_SUCCESS - If PHY has accepted the data from the MAC for frame transmission PHY_BUSY - If PHY is busy servicing the previous MAC request
Example
uint8_t txBuffer[LARGE_BUFFER_SIZE]; uint8_t txData[] = "Wireless!!!"; PHY_CSMAMode_t csmaMode = CSMA_UNSLOTTED; bool performRetry = true; PHY_FrameInfo_t txFrame; txFrame.mpdu = txBuffer; txBuffer[0] = sizeof(txData); memcpy((uint8_t *)&txBuffer[1], txData, sizeof(txData)); if(PHY_SUCCESS == PHY_TxFrame(&txFrame, csmaMode, performRetry)) { //Frame transmission initiated successfully }
Remarks
The return status of PHY_SUCCESS from PHY_TxFrame function indicate PHY layer accepted the request for initiation of transmission. The actual status of Transmission will be reported to higher layer through User callback function (PHY_TxDoneCallback). This function will give the status as SUCCESS, CSMA_FAILURE, RADIO_UNAVAILABLE or NO_ACK for the previous request.