📄 snreval80211.cc
字号:
// file: SnrEval80211.cc//// author: Marc L鯾bers// copyright: (c) by Tralafitty// Telecommunication Networks Group// TU-Berlin// email: loebbers@tkn.tu-berlin.de// part of: framework implementation developed by tkn description: - a// snrEval extension for the use with the other 802.11 modules#include "SnrEval80211.h"#include "Consts80211.h"#include <AirFrame_m.h>#define EV (ev.disabled()||!debug) ? (std::ostream&)ev : ev << logName() << "::SnrEval80211: "Define_Module( SnrEval80211);void SnrEval80211::initialize(int stage){ SnrEval::initialize(stage); if(stage==0){ EV <<"initializing stage 0\n"; if(bitrate!=1E+6 && bitrate!=2E+6 && bitrate!=5.5E+6 && bitrate!=11E+6) error("Wrong bitrate!! Please chose 1E+6, 2E+6, 5.5E+6 or 11E+6 as bitrate!!"); headerLength=192; //has to be 192; this makes sure it is! }}/** * The duration of the packet is computed, with respect to the * different bitrates of header and data. The header is sent with * 1Mbit/s and the rest with the bitrate read in in initialize(). **/double SnrEval80211::calcDuration(cMessage *frame){ EV <<"bits without header: "<<frame->length()-headerLength<<", bits header: "<<headerLength<<endl; return ((frame->length()-headerLength)/bitrate + headerLength/BITRATE_HEADER); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -