avrora.sim.radio
Interface RadioAir

All Known Implementing Classes:
FreeSpaceAir, SimpleAir

public interface RadioAir

Interface for the RadioAir. An implementation of this interface should provide the policies through which radio transmission is handled. Radios should transmit via the transmit method. The air should deliver packets to the radio through the receive() method in the Radio interface.


Method Summary
 void addRadio(Radio r)
          The addRadio() method adds a new radio to this radio model.
 Synchronizer getSynchronizer()
          The getSynchronizer() method gets the synchronizer for this air implementation.
 byte readChannel(Radio r)
          The readChannel() method reads the value of the channel at the current time so that the last 8 bits transmitted (where the bits are 0 if there are no transmissions) are returned.
 void removeRadio(Radio r)
          The removeRadio() method removes a radio from this radio model.
 int sampleRSSI(Radio r)
          The sampleRSSI() method is called by a radio when it wants to sample the RSSI value of the air around it at the current time.
 void transmit(Radio r, Radio.Transmission f)
          The transmit() method is called by a radio when it begins to transmit a packet over the air.
 

Method Detail

addRadio

public void addRadio(Radio r)
The addRadio() method adds a new radio to this radio model.

Parameters:
r - the radio to add to this air implementation

removeRadio

public void removeRadio(Radio r)
The removeRadio() method removes a radio from this radio model.

Parameters:
r - the radio to remove from this air implementation

transmit

public void transmit(Radio r,
                     Radio.Transmission f)
The transmit() method is called by a radio when it begins to transmit a packet over the air. The radio packet should be delivered to those radios in range which are listening, according to the radio model.

Parameters:
r - the radio transmitting this packet
f - the radio packet transmitted into the air

sampleRSSI

public int sampleRSSI(Radio r)
The sampleRSSI() method is called by a radio when it wants to sample the RSSI value of the air around it at the current time. The air may need to block (i.e. wait for neighbors) because this thread may be ahead of other threads in global time. The underlying air implementation should use a Synchronizer for this purpose.

Parameters:
r - the radio sampling the RSSI value
Returns:
an integer value representing the received signal strength indicator

readChannel

public byte readChannel(Radio r)
The readChannel() method reads the value of the channel at the current time so that the last 8 bits transmitted (where the bits are 0 if there are no transmissions) are returned.

Parameters:
r - the radio sampling the channel
Returns:
the last 8 bits transmitted in the channel

getSynchronizer

public Synchronizer getSynchronizer()
The getSynchronizer() method gets the synchronizer for this air implementation.

Returns:
a reference to the synchronizer for this radio model.