X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fchips%2Fcc2420%2Flpl%2FDefaultLplP.nc;h=3ada9db65353e9e75ee182fecf2c558124f87ac0;hb=aa7578fd1472c62c1d22d0801fe0f55b36093bdf;hp=1a68ec15c03a5699739e79a64f2dbeb843622caf;hpb=da0cfeda9689aa64cfce0aa209f51803dcb11c21;p=tinyos-2.x.git diff --git a/tos/chips/cc2420/lpl/DefaultLplP.nc b/tos/chips/cc2420/lpl/DefaultLplP.nc index 1a68ec15..3ada9db6 100644 --- a/tos/chips/cc2420/lpl/DefaultLplP.nc +++ b/tos/chips/cc2420/lpl/DefaultLplP.nc @@ -54,7 +54,7 @@ module DefaultLplP { uses { interface Send as SubSend; interface CC2420Transmit as Resend; - interface RadioBackoff[am_id_t amId]; + interface RadioBackoff; interface Receive as SubReceive; interface AMPacket; interface SplitControl as SubControl; @@ -230,7 +230,7 @@ implementation { return 0; } - return (DUTY_ON_TIME * (10000 - dutyCycle)) / dutyCycle; + return ((uint32_t)DUTY_ON_TIME * (10000 - dutyCycle)) / dutyCycle; } /** @@ -245,7 +245,7 @@ implementation { return 10000; } - return getActualDutyCycle((DUTY_ON_TIME * 10000) + return getActualDutyCycle(((uint32_t)DUTY_ON_TIME * 10000) / (sleepInterval + DUTY_ON_TIME)); } @@ -283,7 +283,7 @@ implementation { return SUCCESS; } - return FAIL; + return EBUSY; } command error_t Send.cancel(message_t *msg) { @@ -308,23 +308,23 @@ implementation { /***************** RadioBackoff Events ****************/ - async event void RadioBackoff.requestInitialBackoff[am_id_t amId](message_t *msg) { + async event void RadioBackoff.requestInitialBackoff(message_t *msg) { if((call CC2420PacketBody.getMetadata(msg))->rxInterval > ONE_MESSAGE) { - call RadioBackoff.setInitialBackoff[amId]( call Random.rand16() + call RadioBackoff.setInitialBackoff( call Random.rand16() % (0x4 * CC2420_BACKOFF_PERIOD) + CC2420_MIN_BACKOFF); } } - async event void RadioBackoff.requestCongestionBackoff[am_id_t amId](message_t *msg) { + async event void RadioBackoff.requestCongestionBackoff(message_t *msg) { if((call CC2420PacketBody.getMetadata(msg))->rxInterval > ONE_MESSAGE) { - call RadioBackoff.setCongestionBackoff[amId]( call Random.rand16() + call RadioBackoff.setCongestionBackoff( call Random.rand16() % (0x3 * CC2420_BACKOFF_PERIOD) + CC2420_MIN_BACKOFF); } } - async event void RadioBackoff.requestCca[am_id_t amId](message_t *msg) { + async event void RadioBackoff.requestCca(message_t *msg) { }