#include <RadioState.h>
Public Types | |
IDLE | |
RECV | |
TRANSMIT | |
SLEEP | |
enum | State { IDLE, RECV, TRANSMIT, SLEEP } |
Public Member Functions | |
RadioState (int radioModuleId) | |
int | getRadioId () const |
State | getState () const |
void | setState (State s) |
int | getChannelNumber () const |
void | setChannelNumber (int chan) |
double | getBitrate () const |
void | setBitrate (double d) |
std::string | info () const |
Static Public Member Functions | |
static const char * | stateName (State state) |
Private Attributes | |
int | radioId |
State | state |
int | channelNumber |
double | bitrate |
enum RadioState::State |
RadioState::RadioState | ( | int | radioModuleId | ) | [inline] |
Constructor
00070 : cPolymorphic() { 00071 radioId = radioModuleId; state = IDLE; channelNumber = -1; bitrate = -1; 00072 }
double RadioState::getBitrate | ( | ) | const [inline] |
int RadioState::getChannelNumber | ( | ) | const [inline] |
int RadioState::getRadioId | ( | ) | const [inline] |
id of the radio/snrEval module -- identifies the radio in case there're more than one in the host
00075 { return radioId; }
std::string RadioState::info | ( | ) | const [inline] |
Enables inspection
00107 { 00108 std::stringstream out; 00109 out << stateName(state) << ", channel #" << channelNumber << ", " << (bitrate/1e6) << "Mbps "; 00110 return out.str(); 00111 }
void RadioState::setBitrate | ( | double | d | ) | [inline] |
void RadioState::setChannelNumber | ( | int | chan | ) | [inline] |
static const char* RadioState::stateName | ( | State | state | ) | [inline, static] |
double RadioState::bitrate [private] |
int RadioState::channelNumber [private] |
int RadioState::radioId [private] |
State RadioState::state [private] |