Merge pull request #1056 from tim-ist/packet_sync

[Cooja/cc2420] Check the frame preamble and MPDU length before parsing an outgoing packet
This commit is contained in:
Fredrik Österlind 2015-09-07 14:36:15 +02:00
commit dde83500c9
4 changed files with 55 additions and 51 deletions

View file

@ -76,7 +76,8 @@ public abstract class AbstractApplicationMote extends AbstractWakeupMote impleme
if (radio.getLastPacketReceived() != null)
receivedPacket(radio.getLastPacketReceived());
} else if (radio.getLastEvent() == Radio.RadioEvent.TRANSMISSION_FINISHED) {
sentPacket(radio.getLastPacketTransmitted());
if (radio.getLastPacketTransmitted() != null)
sentPacket(radio.getLastPacketTransmitted());
}
}
};

View file

@ -517,10 +517,12 @@ public class RadioLogger extends VisPlugin {
return;
}
final RadioConnectionLog loggedConn = new RadioConnectionLog();
loggedConn.packet = conn.getSource().getLastPacketTransmitted();
if (loggedConn.packet == null)
return;
loggedConn.startTime = conn.getStartTime();
loggedConn.endTime = simulation.getSimulationTime();
loggedConn.connection = conn;
loggedConn.packet = conn.getSource().getLastPacketTransmitted();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {