avrora.sim.radio
Interface Radio

All Known Implementing Classes:
CC1000Radio

public interface Radio

The Radio interface should be implemented by classes which would like to act as radios and access an instance of the RadioAir interface.


Nested Class Summary
static interface Radio.RadioController
          A RadioController is an object installed into a Microcontroller.
static interface Radio.RadioProbe
          The RadioProbe interface encapsulates the idea of a probe inserted on a radio that is notified when changes in the state of the radio occur and when packets are sent and received from this radio.
static class Radio.Transmission
          A Transmission is an object describing the data transmitted over RadioAir over some period of time.
 
Field Summary
static int MAX_BIT_RATE
           
static int NODE_HZ
           
static int TRANSFER_TIME
          Time in main clock cycles it takes for one byte to be sent over the air.
 
Method Summary
 RadioAir getAir()
           
 FiniteStateMachine getFiniteStateMachine()
          The getFiniteStateMachine() method gets a reference to the finite state machine that represents this radio's state.
 double getFrequency()
          get the current frequency
 int getPower()
          get the transmission power
 Simulator getSimulator()
          Get the Simulator on which this radio is running.
 void insertProbe(Radio.RadioProbe p)
          The insertProbe() method inserts a probe into a radio.
 boolean isListening()
           
 void removeProbe(Radio.RadioProbe p)
          The removeProbe() method removes a probe on this radio.
 void setAir(RadioAir air)
           
 

Field Detail

NODE_HZ

public static final int NODE_HZ
See Also:
Constant Field Values

MAX_BIT_RATE

public static final int MAX_BIT_RATE
See Also:
Constant Field Values

TRANSFER_TIME

public static final int TRANSFER_TIME
Time in main clock cycles it takes for one byte to be sent over the air. Much of the implementation is derived from this constant, so generalizing in the future may require some careful consideration.

See Also:
Constant Field Values
Method Detail

getSimulator

public Simulator getSimulator()
Get the Simulator on which this radio is running.


getPower

public int getPower()
get the transmission power

Returns:
transmission power

getFrequency

public double getFrequency()
get the current frequency

Returns:
frequency

isListening

public boolean isListening()

getAir

public RadioAir getAir()

setAir

public void setAir(RadioAir air)

getFiniteStateMachine

public FiniteStateMachine getFiniteStateMachine()
The getFiniteStateMachine() method gets a reference to the finite state machine that represents this radio's state. For example, there are states corresponding to "on", "off", "transmitting", and "receiving". The state names and numbers will vary by radio implementation. The FiniteStateMachine instance allows the user to instrument the state transitions in order to gather information during simulation.

Returns:
a reference to the finite state machine for this radio

insertProbe

public void insertProbe(Radio.RadioProbe p)
The insertProbe() method inserts a probe into a radio. The probe is then notified when the radio changes power, frequency, baud rate, or transmits or receives a byte.

Parameters:
p - the probe to insert on this radio

removeProbe

public void removeProbe(Radio.RadioProbe p)
The removeProbe() method removes a probe on this radio.

Parameters:
p - the probe to remove from this radio instance