wrapping tr1001 custom data byte delivery in MspMoteTimeEvent
This commit is contained in:
parent
cb34e9760f
commit
b832479e34
1 changed files with 15 additions and 8 deletions
|
@ -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: TR1001Radio.java,v 1.18 2010/02/03 19:15:56 fros4943 Exp $
|
* $Id: TR1001Radio.java,v 1.19 2010/02/03 19:30:32 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.mspmote.interfaces;
|
package se.sics.cooja.mspmote.interfaces;
|
||||||
|
@ -183,13 +183,20 @@ public class TR1001Radio extends Radio implements USARTListener, CustomDataRadio
|
||||||
|
|
||||||
receivedByte = isInterfered ? CORRUPTED_DATA : (Byte) data;
|
receivedByte = isInterfered ? CORRUPTED_DATA : (Byte) data;
|
||||||
|
|
||||||
if (radioUSART.isReceiveFlagCleared()) {
|
final byte finalByte = receivedByte;
|
||||||
/*logger.info("----- TR1001 RECEIVED BYTE -----");*/
|
mote.getSimulation().scheduleEvent(new MspMoteTimeEvent(mote, 0) {
|
||||||
radioUSART.byteReceived(receivedByte);
|
public void execute(long t) {
|
||||||
} else {
|
super.execute(t);
|
||||||
logger.warn(mote.getSimulation().getSimulationTime() + ": ----- TR1001 RECEIVED BYTE DROPPED -----");
|
|
||||||
}
|
if (radioUSART.isReceiveFlagCleared()) {
|
||||||
mote.requestImmediateWakeup();
|
/*logger.info("----- TR1001 RECEIVED BYTE -----");*/
|
||||||
|
radioUSART.byteReceived(finalByte);
|
||||||
|
} else {
|
||||||
|
logger.warn(mote.getSimulation().getSimulationTime() + ": ----- TR1001 RECEIVED BYTE DROPPED -----");
|
||||||
|
}
|
||||||
|
mote.requestImmediateWakeup();
|
||||||
|
}
|
||||||
|
}, mote.getSimulation().getSimulationTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* USART listener support */
|
/* USART listener support */
|
||||||
|
|
Loading…
Add table
Reference in a new issue