]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - apps/tests/storage/Block/RandRWC.nc
The big interface switchover for Packet, Send, Receive, and AMSend.
[tinyos-2.x.git] / apps / tests / storage / Block / RandRWC.nc
index 385f8ea46d155779813a05683551e770cce38b6e..d3afad7f87a3697ab4c132f5031e52e3011c3352 100644 (file)
  *
  * @author David Gay
  */
-/*
-  address & 3:
-  0, 2: r
-  1: w
-  3: r&w
-*/
 module RandRWC {
   uses {
     interface Boot;
@@ -71,7 +65,7 @@ implementation {
   void done();
 
   void report(error_t e) {
-    uint8_t *msg = call AMSend.getPayload(&reportmsg);
+    uint8_t *msg = call AMSend.getPayload(&reportmsg, 1);
 
     msg[0] = e;
     if (call AMSend.send(AM_BROADCAST_ADDR, &reportmsg, 1) != SUCCESS)
@@ -151,7 +145,7 @@ implementation {
     if (++count == NWRITES)
       {
        call Leds.led2Toggle();
-       scheck(call BlockWrite.commit());
+       scheck(call BlockWrite.sync());
       }
     else
       {
@@ -173,7 +167,7 @@ implementation {
       }
   }
 
-  event void BlockWrite.commitDone(error_t result) {
+  event void BlockWrite.syncDone(error_t result) {
     if (scheck(result))
       done();
   }
@@ -184,14 +178,6 @@ implementation {
       nextRead();
   }
 
-  event void BlockRead.verifyDone(error_t result) {
-    if (scheck(result))
-      {
-       call Leds.led2Toggle();
-       nextRead();
-      }
-  }
-
   event void BlockRead.computeCrcDone(storage_addr_t x, storage_len_t y, uint16_t z, error_t result) {
   }
 
@@ -207,7 +193,7 @@ implementation {
        scheck(call BlockWrite.erase());
        break;
       case A_READ:
-       scheck(call BlockRead.verify());
+       nextRead();
        break;
       }
   }