INET Framework for OMNeT++/OMNEST
ErrAndCollDecider.cc
Go to the documentation of this file.
00001 /* -*- mode:c++ -*- ********************************************************
00002  * file:        ErrAndCollDecider.cc
00003  *
00004  * author:      Marc Loebbers
00005  *
00006  * copyright:   (C) 2004 Telecommunication Networks Group (TKN) at
00007  *              Technische Universitaet Berlin, Germany.
00008  *
00009  *              This program is free software; you can redistribute it
00010  *              and/or modify it under the terms of the GNU General Public
00011  *              License as published by the Free Software Foundation; either
00012  *              version 2 of the License, or (at your option) any later
00013  *              version.
00014  *              For further information see file COPYING
00015  *              in the top level directory
00016  ***************************************************************************
00017  * part of:     framework implementation developed by tkn
00018  **************************************************************************/
00019 
00020 
00021 #include "ErrAndCollDecider.h"
00022 #include "AirFrame_m.h"
00023 
00024 Define_Module(ErrAndCollDecider);
00025 
00026 
00027 void ErrAndCollDecider::handleLowerMsg(AirFrame *af, SnrList& receivedList)
00028 {
00029     if (snrOverThreshold(receivedList))
00030     {
00031         if (af->hasBitError())
00032         {
00033             EV << "Message got lost due to digital channel model BAD state\n";
00034             delete af;
00035         }
00036         else
00037         {
00038             EV << "Message handed on to Mac\n";
00039             sendUp(af);
00040         }
00041     }
00042     else
00043     {
00044         EV << "COLLISION!\n";
00045         delete af;
00046     }
00047 }