#include <RadioState.h>
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
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. | |
|
|
possible states of the radio
|
|
|
Constructor.
|
|
|
function to get the channel
00070 { return channelId; }
|
|
|
function to get the state
00065 { return state; }
|
|
|
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 }
|
|
|
set the radio channel
00072 { channelId = chan; }
|
|
|
set the state of the radio
00067 { state = s; }
|
|
|
Identifies the radio channel.
|
|
|
Variable that hold the actual state.
|
1.4.1