changed byte radio to supply delay meta data instead of timestamp

This commit is contained in:
fros4943 2007-04-23 11:33:07 +00:00
parent da3d423233
commit 438fa2a92d
2 changed files with 8 additions and 9 deletions

View File

@ -16,10 +16,10 @@ public interface ByteRadio extends PacketRadio {
* *
* @param b * @param b
* Byte * Byte
* @param timestamp * @param delay
* Timestamp information * Delay cycle information
*/ */
public void receiveByte(byte b, long timestamp); public void receiveByte(byte b, long delay);
/** /**
* @return Last byte transmitted by radio * @return Last byte transmitted by radio
@ -27,12 +27,11 @@ public interface ByteRadio extends PacketRadio {
public byte getLastByteTransmitted(); public byte getLastByteTransmitted();
/** /**
* Returns timestamp information of byte transmitted. This may for example be * Returns number of cycles since last byte was transmitted.
* the number of cycles since transmission started.
* *
* @return Timestamp info * @return Timestamp info
*/ */
public long getLastByteTransmittedTimestamp(); public long getLastByteTransmittedDelay();
/** /**
* @return Last byte received by radio * @return Last byte received by radio

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: AbstractRadioMedium.java,v 1.2 2007/04/23 08:25:50 fros4943 Exp $ * $Id: AbstractRadioMedium.java,v 1.3 2007/04/23 11:33:54 fros4943 Exp $
*/ */
package se.sics.cooja.radiomediums; package se.sics.cooja.radiomediums;
@ -289,11 +289,11 @@ public abstract class AbstractRadioMedium extends RadioMedium {
logger.fatal("Can't find active connection to forward byte in"); logger.fatal("Can't find active connection to forward byte in");
} else { } else {
byte b = ((ByteRadio) radio).getLastByteTransmitted(); byte b = ((ByteRadio) radio).getLastByteTransmitted();
long timestamp = ((ByteRadio) radio).getLastByteTransmittedTimestamp(); long delay = ((ByteRadio) radio).getLastByteTransmittedDelay();
for (Radio dstRadio : connection.getDestinations()) { for (Radio dstRadio : connection.getDestinations()) {
if (dstRadio instanceof ByteRadio) { if (dstRadio instanceof ByteRadio) {
((ByteRadio) dstRadio).receiveByte(b, timestamp); ((ByteRadio) dstRadio).receiveByte(b, delay);
} }
} }
} }