inet-3.6.4/src/inet/linklayer/xmac/XMacLayer.cc
/**
 * Handle transmission over messages: either send another preambles or the data
 * packet itself.
 */
Handle transmission over messages: either send another preambles or the data
packet itself.
Handle transmission over messages : either send another preambles or the data packet itself .
void XMacLayer::receiveSignal(cComponent *source, simsignal_t signalID, long value, cObject *details)
{
    Enter_Method_Silent();
    if (signalID == IRadio::transmissionStateChangedSignal) {
        IRadio::TransmissionState newRadioTransmissionState = (IRadio::TransmissionState)value;
        if (transmissionState == IRadio::TRANSMISSION_STATE_TRANSMITTING && newRadioTransmissionState == IRadio::TRANSMISSION_STATE_IDLE) {
            if (macState == WAIT_TX_DATA_OVER)
            {
                scheduleAt(simTime(), data_tx_over);
            }
            if (macState == WAIT_ACK_TX)
            {
                scheduleAt(simTime(), ack_tx_over);
            }
        }
        transmissionState = newRadioTransmissionState;
    }else if(signalID ==IRadio::radioModeChangedSignal){
        if(macState == SEND_PREAMBLE) {
            scheduleAt(simTime(), switching_done);
        }
        else if(macState == SEND_ACK) {
            scheduleAt(simTime() + 0.5f * checkInterval, delay_for_ack_within_remote_rx);
        }
        else if(macState == SEND_DATA) {
            scheduleAt(simTime(), switching_done);
        }
    }
}
void XMacLayer :: receiveSignal ( cComponent * source , simsignal_t signalID , long value , cObject * details ) { Enter_Method_Silent ( ) ; if ( signalID == IRadio :: transmissionStateChangedSignal ) { IRadio :: TransmissionState newRadioTransmissionState = ( IRadio :: TransmissionState ) value ; if ( transmissionState == IRadio :: TRANSMISSION_STATE_TRANSMITTING && newRadioTransmissionState == IRadio :: TRANSMISSION_STATE_IDLE ) { if ( macState == WAIT_TX_DATA_OVER ) { scheduleAt ( simTime ( ) , data_tx_over ) ; } if ( macState == WAIT_ACK_TX ) { scheduleAt ( simTime ( ) , ack_tx_over ) ; } } transmissionState = newRadioTransmissionState ; } else if ( signalID == IRadio :: radioModeChangedSignal ) { if ( macState == SEND_PREAMBLE ) { scheduleAt ( simTime ( ) , switching_done ) ; } else if ( macState == SEND_ACK ) { scheduleAt ( simTime ( ) + 0.5f * checkInterval , delay_for_ack_within_remote_rx ) ; } else if ( macState == SEND_DATA ) { scheduleAt ( simTime ( ) , switching_done ) ; } } }
Handle transmission over messages: either send another preambles or the data
 packet itself.
Handle transmission over messages : either send another preambles or the data packet itself .
// Transmission of one packet is over
 // Radio switching (to RX or TX) is over, ignore switching to SLEEP.
