/*================================================================================================= * @fn txComplete * * @brief Transmit has completed. Perform needed maintenance and return status of * the transmit via callback function. * * @param status - status of the transmit that just went out * * @return none *================================================================================================= */ static void txComplete(uint8 status) { /* reset the retransmit flag */ txRetransmitFlag = 0; /* update tx state; turn off receiver if nothing is keeping it on */ macTxActive = MAC_TX_ACTIVE_NO_ACTIVITY; /* If no ACK is pending go to sleep sooner than wait for high level mac * to clear MAC_RX_POLL bit and then go to sleep */ if (status != MAC_ACK_PENDING) { macRxEnableFlags &= ~MAC_RX_POLL; } /* turn off receive if allowed */ macRxOffRequest(); /* update transmit power in case there was a change */ macRadioUpdateTxPower(); /* * Channel cannot change during transmit so update it here. (Channel *can* change during * a receive. The update function resets receive logic and any partially received * frame is purged.) */ macRadioUpdateChannel(); /* return status of transmit via callback function */ macTxCompleteCallback(status); }
/*================================================================================================= * @fn txComplete * * @brief Transmit has completed. Perform needed maintenance and return status of * the transmit via callback function. * * @param status - status of the transmit that just went out * * @return none *================================================================================================= */ static void txComplete(uint8 status) { /* * Unless receive is active, update power here. Power is *always* updated at end of receive. */ if (!macRxActive) { macRadioUpdateTxPower(); } /* * Channel cannot change during transmit so update it here. (Channel *can* change during * a receive. The update function resets receive logic and any partially received * frame is purged.) */ macRadioUpdateChannel(); /* reset the retransmit flag */ txRetransmitFlag = FALSE; /* update tx state; turn off receiver if nothing is keeping it on */ macTxActive = FALSE; /* turn off receive if allowed */ macRxOffRequest(); /* return status of transmit via callback function */ macTxCompleteCallback(status); }
/*================================================================================================= * @fn txComplete * * @brief Transmit has completed. Perform needed maintenance and return status of * the transmit via callback function. * * @param status - status of the transmit that just went out * * @return none *================================================================================================= */ static void txComplete(uint8 status) { /* reset the retransmit flag */ txRetransmitFlag = 0; /* update tx state; turn off receiver if nothing is keeping it on */ macTxActive = MAC_TX_ACTIVE_NO_ACTIVITY; if(pMacPib->rf4cepowerSavings) { /* mark receive as inactive */ macRxActive = MAC_RX_ACTIVE_NO_ACTIVITY; } /* In general, the MAC_RX_POLL is controlled by high level MAC. The flag is * cleared here when no ACK is pending to allow the RX to be turned off sooner * in order to save power. */ if (status != MAC_ACK_PENDING) { macRxEnableFlags &= ~MAC_RX_POLL; } /* turn off receive if allowed */ macRxOffRequest(); /* update transmit power in case there was a change */ macRadioUpdateTxPower(); /* * Channel cannot change during transmit so update it here. (Channel *can* change during * a receive. The update function resets receive logic and any partially received * frame is purged.) */ macRadioUpdateChannel(); /* return status of transmit via callback function */ macTxCompleteCallback(status); }
/************************************************************************************************** * @fn macRadioSetChannel * * @brief Set radio channel. * * @param channel - channel number, valid range is 11 through 26. Allow * channels 27 and 28 for some Japanese customers. * * @return none ************************************************************************************************** */ MAC_INTERNAL_API void macRadioSetChannel(uint8 channel) { halIntState_t s; MAC_ASSERT((channel >= 11) && (channel <= 28)); /* illegal channel */ /* critical section to make sure transmit does not start while updating channel */ HAL_ENTER_CRITICAL_SECTION(s); /* set requested channel */ reqChannel = channel; /* * If transmit is not active, update the radio hardware immediately. If transmit is active, * the channel will be updated at the end of the current transmit. */ if (!macTxActive) { macRadioUpdateChannel(); } HAL_EXIT_CRITICAL_SECTION(s); }
/*================================================================================================= * @fn txComplete * * @brief Transmit has completed. Perform needed maintenance and return status of * the transmit via callback function. * * @param status - status of the transmit that just went out * * @return none *================================================================================================= */ static void txComplete(uint8 status) { /* reset the retransmit flag */ txRetransmitFlag = 0; /* update tx state; turn off receiver if nothing is keeping it on */ macTxActive = MAC_TX_ACTIVE_NO_ACTIVITY; /* turn off receive if allowed */ macRxOffRequest(); /* update transmit power in case there was a change */ macRadioUpdateTxPower(); /* * Channel cannot change during transmit so update it here. (Channel *can* change during * a receive. The update function resets receive logic and any partially received * frame is purged.) */ macRadioUpdateChannel(); /* return status of transmit via callback function */ macTxCompleteCallback(status); }