]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/rf2xx/layers/PacketLinkLayerP.nc
Use BareSend/BareReceive instead of Send/Receive to avoid duplication of payload...
[tinyos-2.x.git] / tos / chips / rf2xx / layers / PacketLinkLayerP.nc
index 1bf501f245bd53874b0607b00474fc0481581695..b8f284e6795e08bd8c68be20277848e463d338f2 100644 (file)
 
 module PacketLinkLayerP {
   provides {
-    interface Send;
+    interface BareSend as Send;
     interface PacketLink;
     interface RadioPacket;
   }
 
   uses {
-    interface Send as SubSend;
+    interface BareSend as SubSend;
     interface PacketAcknowledgements;
     interface Timer<TMilli> as DelayTimer;
     interface RadioPacket as SubPacket;
@@ -79,9 +79,6 @@ implementation {
   /** The message currently being sent */
   message_t *currentSendMsg;
 
-  /** Length of the current send message */
-  uint8_t currentSendLen;
-
   /** The length of the current send message */
   uint16_t totalRetries;
 
@@ -146,7 +143,7 @@ implementation {
    * a broadcast address message, the receiving end does not
    * signal receive() more than once for that message.
    */
-  command error_t Send.send(message_t *msg, uint8_t len) {
+  command error_t Send.send(message_t *msg) {
     error_t error = EBUSY;
     if(currentSendMsg == NULL) {
 
@@ -154,9 +151,8 @@ implementation {
         call PacketAcknowledgements.requestAck(msg);
       }
 
-      if((error = call SubSend.send(msg, len)) == SUCCESS) {
+      if((error = call SubSend.send(msg)) == SUCCESS) {
         currentSendMsg = msg;
-        currentSendLen = len;
         totalRetries = 0;
       }
     }
@@ -172,15 +168,6 @@ implementation {
     return FAIL;
   }
 
-
-  command uint8_t Send.maxPayloadLength() {
-    return call SubSend.maxPayloadLength();
-  }
-
-  command void *Send.getPayload(message_t* msg, uint8_t len) {
-    return call SubSend.getPayload(msg, len);
-  }
-
   /***************** SubSend Events ***************/
   event void SubSend.sendDone(message_t* msg, error_t error) {
     totalRetries++;
@@ -222,7 +209,7 @@ implementation {
       call PacketAcknowledgements.requestAck(currentSendMsg);
     }
 
-    if(call SubSend.send(currentSendMsg, currentSendLen) != SUCCESS) {
+    if(call SubSend.send(currentSendMsg) != SUCCESS) {
       post send();
     }
   }