radiosimple.cc
来自「基于Oment++的无线传感器网络仿真」· CC 代码 · 共 48 行
CC
48 行
#include "CommonIncludes.h"#include "RadioSimple.h"Define_Module_Like( RadioSimple, RadioModule )RadioSimple::RadioSimple(const char *name, cModule *parentModule, unsigned stacksize) : RadioBase(name, parentModule, stacksize){// printf("\n\t RadioSimple");}void RadioSimple::initialize(){ //printf("\n\t In RadioSimple:initialize."); //ev << "\n\t In RadioSimple:initialize."; cModule *pNode = parentModule(); pCoOrdinator = pNode->submodule("CoOrdinator"); if (NULL == pCoOrdinator) { printf("\n\t In RadioSimple: CoOrdinatorModule not found."); return; } // Fill the PowerRating Table according to the State double dPowerRating = par("PowerRating"); double tx = par("txCur"); double rx = par("rxCur"); double idle = par("idleCur"); SetPowerRating(INITIALIZED, dPowerRating); SetPowerRating(TRANSMIT,tx); SetPowerRating(RECEIVE,rx); SetPowerRating(IDLE,idle); //printf("\n\t In RadioSimple txCur= %f ,rxCur= %f, idle= %f \n\n",tx,rx,idle); // Register the current state with the Battery bool bSuccess = RegisterWithBattery(); if(true == bSuccess) SetState(INITIALIZED);}void RadioSimple::handleMessage(cMessage *cMsg){ //printf("\n\t In RadioSimple::handleMessage"); //ev << "\n\t In RadioSimple::handleMessage";}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?