[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/harvard/spaulding/src/dataStore/testDataStore TestDataStoreC.nc, 1.1.1.1, 1.2 TestDataStoreM.nc, 1.1.1.1, 1.2

Konrad Lorincz konradlorincz at users.sourceforge.net
Wed Feb 6 12:48:52 PST 2008


Update of /cvsroot/tinyos/tinyos-1.x/contrib/harvard/spaulding/src/dataStore/testDataStore
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11352/dataStore/testDataStore

Modified Files:
	TestDataStoreC.nc TestDataStoreM.nc 
Log Message:
Updated the TestDataStore code

Index: TestDataStoreC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/harvard/spaulding/src/dataStore/testDataStore/TestDataStoreC.nc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** TestDataStoreC.nc	22 Aug 2007 00:43:53 -0000	1.1.1.1
--- TestDataStoreC.nc	6 Feb 2008 20:48:50 -0000	1.2
***************
*** 28,32 ****
   */
  
! includes PrintfUART;
  
  configuration TestDataStoreC 
--- 28,32 ----
   */
  
! #include "PrintfUART.h"
  
  configuration TestDataStoreC 

Index: TestDataStoreM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/harvard/spaulding/src/dataStore/testDataStore/TestDataStoreM.nc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** TestDataStoreM.nc	22 Aug 2007 00:43:53 -0000	1.1.1.1
--- TestDataStoreM.nc	6 Feb 2008 20:48:50 -0000	1.2
***************
*** 34,39 ****
   * @version 1.0, April 25, 2005
   */
! includes PrintfUART;
! includes Block;
  
  
--- 34,39 ----
   * @version 1.0, April 25, 2005
   */
! #include "PrintfUART.h"
! #include "Block.h"
  
  
***************
*** 62,66 ****
      {
          printfUART_init();
!         printfUART("TestDateStore:StdControl.init() - called\n", "");
  
          randNbr = 0xcc;
--- 62,66 ----
      {
          printfUART_init();
!         printfUART("TestDateStore:StdControl.init() - called\n");
  
          randNbr = 0xcc;
***************
*** 72,76 ****
      command result_t StdControl.start()
      {
!         printfUART("TestDateStore:StdControl.start() - called\n", "");
          return call DataStore.init();        
      }
--- 72,76 ----
      command result_t StdControl.start()
      {
!         printfUART("TestDateStore:StdControl.start() - called\n");
          return call DataStore.init();        
      }
***************
*** 84,92 ****
      {
          if (result == SUCCESS) {
!             printfUART("DataStore.initDone() - success\n", "");
              call Timer.start(TIMER_REPEAT, TIMER_INTERVAL);    
          }
          else {
!             printfUART("DataStore.initDone() - FAILED!\n", "");
          }
      }
--- 84,92 ----
      {
          if (result == SUCCESS) {
!             printfUART("DataStore.initDone() - success\n");
              call Timer.start(TIMER_REPEAT, TIMER_INTERVAL);    
          }
          else {
!             printfUART("DataStore.initDone() - FAILED!\n");
          }
      }
***************
*** 96,100 ****
          uint16_t i = 0;
          
!         printfUART("\n\naddBlock() - called, startValue= %i\n", startValue);
  
          Block_init(blockPtr);
--- 96,100 ----
          uint16_t i = 0;
          
!         printfUART("\n\naddBlock() - called, startValue= %u\n", startValue);
  
          Block_init(blockPtr);
***************
*** 108,127 ****
          Block_print(blockPtr);
          if ( call DataStore.add(blockPtr) == SUCCESS ) 
!             { printfUART("addBlock() - successfully scheduled add(), blockPtr= 0x%x\n", blockPtr); return SUCCESS;}
          else
!             { printfUART("addBlock() - FAILED! to schedule add(), blockPtr= 0x%x\n", blockPtr); return FAIL;}
      }
  
      result_t getBlock(Block *blockPtr)
      {
!         printfUART("\n\ngetBlock() - called\n", "");
          Block_init(blockPtr);
  
          if ( call DataStore.get(blockPtr, lastBlockSqnNbrAdded) == SUCCESS )
!             { printfUART("getBlock() - successfuly scheduled get blockPtr= 0x%x, blockSqnNbr= %i\n", 
!                          blockPtr, (uint16_t)lastBlockSqnNbrAdded); return SUCCESS; }
          else
!             { printfUART("getBlock() - FAILED! to schedule get blockPtr= 0x%x, blockSqnNbr= %i\n", 
!                          blockPtr, (uint16_t)lastBlockSqnNbrAdded); return FAIL; }
      }
  
--- 108,127 ----
          Block_print(blockPtr);
          if ( call DataStore.add(blockPtr) == SUCCESS ) 
!             { printfUART("addBlock() - successfully scheduled add(), blockPtr= %p\n", blockPtr); return SUCCESS;}
          else
!             { printfUART("addBlock() - FAILED! to schedule add(), blockPtr= %p\n", blockPtr); return FAIL;}
      }
  
      result_t getBlock(Block *blockPtr)
      {
!         printfUART("\n\ngetBlock() - called\n");
          Block_init(blockPtr);
  
          if ( call DataStore.get(blockPtr, lastBlockSqnNbrAdded) == SUCCESS )
!             { printfUART("getBlock() - successfuly scheduled get blockPtr= %p, blockSqnNbr= %lu\n", 
!                          blockPtr, lastBlockSqnNbrAdded); return SUCCESS; }
          else
!             { printfUART("getBlock() - FAILED! to schedule get blockPtr= %p, blockSqnNbr= %lu\n", 
!                          blockPtr, lastBlockSqnNbrAdded); return FAIL; }
      }
  
***************
*** 130,134 ****
          ++cntTimerFired;
          call Leds.yellowToggle();
!         printfUART("\n\n\n\nTimer.fired() - cntTimerFired= %i\n", cntTimerFired);
  
          if (cntTimerFired % 3 == 0)
--- 130,134 ----
          ++cntTimerFired;
          call Leds.yellowToggle();
!         printfUART("\n\n\n\nTimer.fired() - cntTimerFired= %u\n", cntTimerFired);
  
          if (cntTimerFired % 3 == 0)
***************
*** 145,154 ****
      {
          if (result == SUCCESS) {
!             printfUART("DataStore.addDone() - successfuly added blockPtr= 0x%x\n", blockPtr);
              atomic lastBlockSqnNbrAdded = blockSqnNbr;            
          }
          else {
              call Leds.redToggle();
!             printfUART("DataStore.addDone() - WARNING failed to add blockPtr= 0x%x\n", blockPtr);
          }
          //Block_print(blockPtr);
--- 145,154 ----
      {
          if (result == SUCCESS) {
!             printfUART("DataStore.addDone() - successfuly added blockPtr= %p\n", blockPtr);
              atomic lastBlockSqnNbrAdded = blockSqnNbr;            
          }
          else {
              call Leds.redToggle();
!             printfUART("DataStore.addDone() - WARNING failed to add blockPtr= %p\n", blockPtr);
          }
          //Block_print(blockPtr);
***************
*** 160,169 ****
      {
          if (result == SUCCESS) {
!             printfUART("DataStore.getDone() - successfuly got blockPtr= 0x%x, blockSqnNbr= %i\n", 
!                         blockPtr, (uint16_t)blockSqnNbr);            
          }
          else {
!             printfUART("DataStore.getDone() - FAILED! to ger blockPtr= 0x%x, blockSqnNbr= %i\n", 
!                         blockPtr, (uint16_t)blockSqnNbr);            
              call Leds.redToggle();
          }
--- 160,169 ----
      {
          if (result == SUCCESS) {
!             printfUART("DataStore.getDone() - successfuly got blockPtr= %p, blockSqnNbr= %lu\n", 
!                         blockPtr, blockSqnNbr);            
          }
          else {
!             printfUART("DataStore.getDone() - FAILED! to ger blockPtr= %p, blockSqnNbr= %lu\n", 
!                         blockPtr, blockSqnNbr);            
              call Leds.redToggle();
          }



More information about the Tinyos-contrib-commits mailing list