Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

RadioState Class Reference

#include <RadioState.h>

List of all members.


Detailed Description

Class to hold the radio state of the host.

Holds the actual state of the radio. Possible states are : IDLE, RECV, TRANSMIT and SLEEP

IDLE: channel is empty (radio is in receive mode)

BUSY: channel is busy (radio is in receive mode)

TRANSMIT: the radio is transmitting

SLEEP: the radio is sleeping

Author:
Andreas Köpke
See also:
NotificationBoard


Public Types

enum  States { IDLE, RECV, TRANSMIT, SLEEP }
 possible states of the radio More...

Public Member Functions

States getState () const
 function to get the state
void setState (States s)
 set the state of the radio
int getChannelId () const
 function to get the channel
void setChannelId (int chan)
 set the radio channel
 RadioState (States s=IDLE)
 Constructor.
std::string info () const
 Enables inspection.

Private Attributes

States state
 Variable that hold the actual state.
int channelId
 Identifies the radio channel.


Member Enumeration Documentation

enum RadioState::States
 

possible states of the radio

Enumeration values:
IDLE 
RECV 
TRANSMIT 
SLEEP 
00049     {
00050       IDLE,
00051       RECV,
00052       TRANSMIT,
00053       SLEEP
00054     };


Constructor & Destructor Documentation

RadioState::RadioState States  s = IDLE  )  [inline]
 

Constructor.

00075 : cPolymorphic(), state(s), channelId(-1) {};


Member Function Documentation

int RadioState::getChannelId  )  const [inline]
 

function to get the channel

00070 { return channelId; }

States RadioState::getState  )  const [inline]
 

function to get the state

00065 { return state; }

std::string RadioState::info  )  const [inline]
 

Enables inspection.

00078                            {
00079         // FIXME add channel
00080         switch(state) {
00081             case IDLE: return "IDLE";
00082             case RECV: return "RECV";
00083             case TRANSMIT: return "TRANSMIT";
00084             case SLEEP: return "SLEEP";
00085             default: return "???";
00086         }
00087     }

void RadioState::setChannelId int  chan  )  [inline]
 

set the radio channel

00072 { channelId = chan; }

void RadioState::setState States  s  )  [inline]
 

set the state of the radio

00067 { state = s; }


Member Data Documentation

int RadioState::channelId [private]
 

Identifies the radio channel.

States RadioState::state [private]
 

Variable that hold the actual state.


The documentation for this class was generated from the following file:
Generated on Sat Apr 1 20:52:23 2006 for INET Framework for OMNeT++/OMNEST by  doxygen 1.4.1