jist.swans.radio
Interface RadioInterface

All Superinterfaces:
JistAPI.Proxiable, JistAPI.Timeless
All Known Implementing Classes:
RadioNoise, RadioNoiseAdditive, RadioNoiseIndep

public interface RadioInterface
extends JistAPI.Proxiable

Defines the interface of all Radio entity implementations.

Since:
SWANS1.0
Version:
$Id: RadioInterface.java,v 1.16 2004/04/13 22:28:55 barr Exp $
Author:
Rimon Barr <barr+jist@cs.cornell.edu>

Method Summary
 void endReceive(java.lang.Double power)
          End message reception.
 void endTransmit()
          End message transmission.
 void receive(Message msg, java.lang.Double power, java.lang.Long duration)
          Start receiving message.
 void setSleepMode(boolean sleep)
          Put radio you in sleep/awake mode.
 void transmit(Message msg, long delay, long duration)
          Start transmitting message.
 

Method Detail

transmit

void transmit(Message msg,
              long delay,
              long duration)
Start transmitting message. Puts radio into transmission mode and contacts other radios that receive the signal. Called from mac entity.

Parameters:
msg - message object to transmit
delay - time to the wire
duration - time on the wire

endTransmit

void endTransmit()
End message transmission. Putting the radio back into idle (or possibly receiving) mode. Called from mac entity.


receive

void receive(Message msg,
             java.lang.Double power,
             java.lang.Long duration)
Start receiving message. Puts radio into receive or sensing mode depending on the message power and the state of the radio. A radio that is currently transmitting will ignore incoming messages. Called from field entity.

Parameters:
msg - incoming message
power - signal strength of incoming message (units: mW)
duration - time until end of transmission (units: simtime)

endReceive

void endReceive(java.lang.Double power)
End message reception. Puts the radio back into sensing or idle mode, and sends the received message to upper layers for processing, if no error has occurred during the reception. Called from field entity.

Parameters:
power - signal strength of incoming message (units: mW)

setSleepMode

void setSleepMode(boolean sleep)
Put radio you in sleep/awake mode.

Parameters:
sleep - sleep/awake switch