when a receiving radio is interfered by another transmission, the actual data received is corrupted.
This commit is contained in:
parent
cd8a407ee1
commit
c0e115895d
|
@ -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: SkyByteRadio.java,v 1.15 2009/11/13 08:32:01 fros4943 Exp $
|
* $Id: SkyByteRadio.java,v 1.16 2009/11/25 10:01:55 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.mspmote.interfaces;
|
package se.sics.cooja.mspmote.interfaces;
|
||||||
|
@ -173,8 +173,12 @@ public class SkyByteRadio extends Radio implements CustomDataRadio {
|
||||||
|
|
||||||
/*logger.info("Delivering buffered packet data now: " + mote.getSimulation().getSimulationTime());*/
|
/*logger.info("Delivering buffered packet data now: " + mote.getSimulation().getSimulationTime());*/
|
||||||
for (byte b: crossBufferedData) {
|
for (byte b: crossBufferedData) {
|
||||||
|
if (isInterfered()) {
|
||||||
|
cc2420.receivedByte((byte)0xFF);
|
||||||
|
} else {
|
||||||
cc2420.receivedByte(b);
|
cc2420.receivedByte(b);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
mote.requestImmediateWakeup();
|
mote.requestImmediateWakeup();
|
||||||
crossBufferedData = null;
|
crossBufferedData = null;
|
||||||
}
|
}
|
||||||
|
@ -218,8 +222,12 @@ public class SkyByteRadio extends Radio implements CustomDataRadio {
|
||||||
|
|
||||||
/* Delivering data immediately */
|
/* Delivering data immediately */
|
||||||
for (byte b: packetData) {
|
for (byte b: packetData) {
|
||||||
|
if (isInterfered()) {
|
||||||
|
cc2420.receivedByte((byte)0xFF);
|
||||||
|
} else {
|
||||||
cc2420.receivedByte(b);
|
cc2420.receivedByte(b);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
mote.requestImmediateWakeup();
|
mote.requestImmediateWakeup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,7 +243,11 @@ public class SkyByteRadio extends Radio implements CustomDataRadio {
|
||||||
public void receiveCustomData(Object data) {
|
public void receiveCustomData(Object data) {
|
||||||
if (data instanceof CC2420RadioByte) {
|
if (data instanceof CC2420RadioByte) {
|
||||||
lastIncomingByte = (CC2420RadioByte) data;
|
lastIncomingByte = (CC2420RadioByte) data;
|
||||||
|
if (isInterfered()) {
|
||||||
|
cc2420.receivedByte((byte)0xFF);
|
||||||
|
} else {
|
||||||
cc2420.receivedByte(lastIncomingByte.getPacketData()[0]);
|
cc2420.receivedByte(lastIncomingByte.getPacketData()[0]);
|
||||||
|
}
|
||||||
mote.requestImmediateWakeup();
|
mote.requestImmediateWakeup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue