[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/rincon/apps/Blackbook5/interfaces SectorMap.nc, 1.1, 1.2 NodeBooter.nc, 1.1, 1.2 Fileio.nc, 1.1, 1.2 NodeShop.nc, 1.1, 1.2 BFileRead.nc, 1.1, 1.2 BDictionary.nc, 1.1, 1.2 BFileWrite.nc, 1.1, 1.2 NodeMap.nc, 1.1, 1.2 Checkpoint.nc, 1.1, 1.2 WriteAlloc.nc, 1.1, 1.2

dmm rincon at users.sourceforge.net
Thu Sep 28 10:32:29 PDT 2006


Update of /cvsroot/tinyos/tinyos-1.x/contrib/rincon/apps/Blackbook5/interfaces
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14770/contrib/rincon/apps/Blackbook5/interfaces

Modified Files:
	SectorMap.nc NodeBooter.nc Fileio.nc NodeShop.nc BFileRead.nc 
	BDictionary.nc BFileWrite.nc NodeMap.nc Checkpoint.nc 
	WriteAlloc.nc 
Log Message:
Updated to Blackbook v.5.2

Index: SectorMap.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/rincon/apps/Blackbook5/interfaces/SectorMap.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SectorMap.nc	18 May 2006 22:34:20 -0000	1.1
--- SectorMap.nc	28 Sep 2006 17:31:45 -0000	1.2
***************
*** 70,73 ****
--- 70,87 ----
    
    /**
+    * Obtain the largest sector that is not in use
+    * on the flash.  This will allow us to see exactly
+    * how much space exists for the next flashnode without
+    * affecting the global variable that decides which sector
+    * that may be.  This is especially useful for dictating the
+    * size of a file that is part of a continuous-write operation
+    * and the file size needs to fit exactly in one sector.
+    *
+    * @return the largest available sector that will be written to
+    *      when a SectorMap.nextLargestIdleSector() command is called
+    */
+   command flashsector *viewNextLargestIdleSector();
+   
+   /**
     * Get the flashsector at the specified address in flash.
     * @return the flashsector that exists at the given address
***************
*** 92,106 ****
    
    /**
!    * Document the existence of a node in a sector on flash.
!    * @param focusedNode - the node to document
     */
!   command void documentNode(node *focusedNode);
    
    /**
!    * Remove a valid node from its sector.
!    * The node must be finalized before removing it.
     * This helps the garbage collector know which sectors to erase.
     */
!   command void removeNode(node *focusedNode);
    
    /**
--- 106,120 ----
    
    /**
!    * Document the existence of a flashnode in a sector on flash.
!    * @param focusedNode - the flashnode to document
     */
!   command void documentNode(flashnode *focusedNode);
    
    /**
!    * Remove a valid flashnode from its sector.
!    * The flashnode must be finalized before removing it.
     * This helps the garbage collector know which sectors to erase.
     */
!   command void removeNode(flashnode *focusedNode);
    
    /**
***************
*** 111,117 ****
    
    /**
!    * @return TRUE if the given node is within the bounds of the given sector
     */
!   command bool isInSector(flashsector *focusedSector, node *focusedNode);
    
    /**
--- 125,131 ----
    
    /**
!    * @return TRUE if the given flashnode is within the bounds of the given sector
     */
!   command bool isInSector(flashsector *focusedSector, flashnode *focusedNode);
    
    /**

Index: NodeBooter.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/rincon/apps/Blackbook5/interfaces/NodeBooter.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NodeBooter.nc	18 May 2006 22:34:20 -0000	1.1
--- NodeBooter.nc	28 Sep 2006 17:31:45 -0000	1.2
***************
*** 62,66 ****
  
    /**
!    * Request to add a node to the file system.
     * It is the responsibility of the calling function
     * to properly setup:
--- 62,66 ----
  
    /**
!    * Request to add a flashnode to the file system.
     * It is the responsibility of the calling function
     * to properly setup:
***************
*** 73,80 ****
     * 
     * Unless manually linked, state and nextNode are handled by NodeMap.
!    * @return a pointer to an empty node if one is available
     *     NULL if no more exist
     */
!   command node *requestAddNode();
    
    /**
--- 73,80 ----
     * 
     * Unless manually linked, state and nextNode are handled by NodeMap.
!    * @return a pointer to an empty flashnode if one is available
     *     NULL if no more exist
     */
!   command flashnode *requestAddNode();
    
    /**

Index: Fileio.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/rincon/apps/Blackbook5/interfaces/Fileio.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Fileio.nc	18 May 2006 22:34:20 -0000	1.1
--- Fileio.nc	28 Sep 2006 17:31:45 -0000	1.2
***************
*** 37,41 ****
  
    /**
!    * Write data to the node belonging to the given file
     * at the given address in the file
     * @param focusedFile - the file to write to
--- 37,41 ----
  
    /**
!    * Write data to the flashnode belonging to the given file
     * at the given address in the file
     * @param focusedFile - the file to write to
***************
*** 48,52 ****
    
    /**
!    * Read data from the node belonging to the given file
     * at the given address in the file
     * @param focusedFile - the file to read from
--- 48,52 ----
    
    /**
!    * Read data from the flashnode belonging to the given file
     * at the given address in the file
     * @param focusedFile - the file to read from
***************
*** 65,69 ****
    
    /**
!    * Data was appended to the node in the flash.
     * @param writeBuffer - pointer to the buffer containing the data written
     * @param amountWritten - the amount of data appended to the node.
--- 65,69 ----
    
    /**
!    * Data was appended to the flashnode in the flash.
     * @param writeBuffer - pointer to the buffer containing the data written
     * @param amountWritten - the amount of data appended to the node.

Index: NodeShop.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/rincon/apps/Blackbook5/interfaces/NodeShop.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NodeShop.nc	18 May 2006 22:34:20 -0000	1.1
--- NodeShop.nc	28 Sep 2006 17:31:46 -0000	1.2
***************
*** 64,76 ****
     * Write the nodemeta to flash for the given node
     * @param focusedFile - the file to write the nodemeta for
!    * @param focusedNode - the node to write the nodemeta for
     * @param name - pointer to the name of the file if this is the first node
     */
!   command result_t writeNodemeta(file *focusedFile, node *focusedNode, filename *name);
    
    /**
!    * Delete a node on flash. This will not erase the
     * data from flash, but it will simply mark the magic
!    * number of the node to make it invalid.
     * 
     * After the command is called and executed, a metaDeleted
--- 64,76 ----
     * Write the nodemeta to flash for the given node
     * @param focusedFile - the file to write the nodemeta for
!    * @param focusedNode - the flashnode to write the nodemeta for
     * @param name - pointer to the name of the file if this is the first node
     */
!   command result_t writeNodemeta(file *focusedFile, flashnode *focusedNode, filename *name);
    
    /**
!    * Delete a flashnode on flash. This will not erase the
     * data from flash, but it will simply mark the magic
!    * number of the flashnode to make it invalid.
     * 
     * After the command is called and executed, a metaDeleted
***************
*** 79,94 ****
     * @return SUCCESS if the magic number will be marked
     */
!   command result_t deleteNode(node *focusedNode);
    
    /**
!    * Get the CRC of a node on flash.
     *
     * After the command is called and executed, a crcCalculated
     * event will be signaled.
     *
!    * @param focusedNode - the node to read and calculate a CRC for
     * @return SUCCESS if the CRC will be calculated.
     */
!   command result_t getCrc(node *focusedNode, file *focusedFile);
  
    /**
--- 79,94 ----
     * @return SUCCESS if the magic number will be marked
     */
!   command result_t deleteNode(flashnode *focusedNode);
    
    /**
!    * Get the CRC of a flashnode on flash.
     *
     * After the command is called and executed, a crcCalculated
     * event will be signaled.
     *
!    * @param focusedNode - the flashnode to read and calculate a CRC for
     * @return SUCCESS if the CRC will be calculated.
     */
!   command result_t getCrc(flashnode *focusedNode, file *focusedFile);
  
    /**
***************
*** 103,110 ****
    /** 
     * The node's metadata was written to flash
!    * @param focusedNode - the node that metadata was written for
     * @param result - SUCCESS if it was written
     */
!   event void metaWritten(node *focusedNode, result_t result);
    
    /**
--- 103,110 ----
    /** 
     * The node's metadata was written to flash
!    * @param focusedNode - the flashnode that metadata was written for
     * @param result - SUCCESS if it was written
     */
!   event void metaWritten(flashnode *focusedNode, result_t result);
    
    /**
***************
*** 117,130 ****
    
    /**
!    * A node was deleted from flash by marking its magic number
     * invalid in the metadata.
!    * @param focusedNode - the node that was deleted.
!    * @param result - SUCCESS if the node was deleted successfully.
     */
!   event void metaDeleted(node *focusedNode, result_t result);
   
    /**
!    * A crc was calculated from node data on flash
!    * @param dataCrc - the crc of the data read from the node on flash.
     * @param result - SUCCESS if the crc is valid
     */
--- 117,130 ----
    
    /**
!    * A flashnode was deleted from flash by marking its magic number
     * invalid in the metadata.
!    * @param focusedNode - the flashnode that was deleted.
!    * @param result - SUCCESS if the flashnode was deleted successfully.
     */
!   event void metaDeleted(flashnode *focusedNode, result_t result);
   
    /**
!    * A crc was calculated from flashnode data on flash
!    * @param dataCrc - the crc of the data read from the flashnode on flash.
     * @param result - SUCCESS if the crc is valid
     */

Index: BFileRead.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/rincon/apps/Blackbook5/interfaces/BFileRead.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** BFileRead.nc	18 May 2006 22:34:20 -0000	1.1
--- BFileRead.nc	28 Sep 2006 17:31:46 -0000	1.2
***************
*** 39,42 ****
--- 39,47 ----
  
    /**
+    * @return TRUE if the given parameterized interface has a file open
+    */
+   command bool isOpen();
+   
+   /**
     * Close any currently opened file
     */
***************
*** 86,98 ****
    command uint32_t getRemaining();
  
-   /**
-    * Find if a given fileName is available for reading
-    * and if the current client does not have other files
-    * open for reading that would prevent this one from being opened
-    * @param fileName - name of the file
-    * @return TRUE if the specified file can be opened for reading
-    */
-   //command bool canOpen(char *fileName);
- 
  
  
--- 91,94 ----

Index: BDictionary.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/rincon/apps/Blackbook5/interfaces/BDictionary.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** BDictionary.nc	18 May 2006 22:34:20 -0000	1.1
--- BDictionary.nc	28 Sep 2006 17:31:47 -0000	1.2
***************
*** 42,45 ****
--- 42,50 ----
    
    /**
+    * @return TRUE if the given parameterized interface has a file open
+    */
+   command bool isOpen();
+   
+   /**
     * Close any opened Dictionary files
     * @return SUCCESS if the open Dictionary file was closed.
***************
*** 48,51 ****
--- 53,70 ----
    
    /**
+    * Because Dictionary files are special, and NodeMap does not give an
+    * accurate reflection of what's going on with Dictionary file sizes,
+    * this command will return the size of the Dictionary file up to the
+    * point where valid data ends.
+    * @return the size of the valid data in the open dictionary file
+    */
+   command uint32_t getFileLength();
+   
+   /**
+    * @return SUCCESS if the event totalKeys will be signaled
+    */
+   command result_t getTotalKeys();
+   
+   /**
     * Insert a key-value pair into the opened Dictionary file.
     * This will invalidate any old key-value pairs using the
***************
*** 157,160 ****
--- 176,184 ----
     */
    event void fileIsDictionary(bool isDictionary, result_t result);
+   
+   /**
+    * @param totalKeys the total keys in the open dictionary file
+    */
+   event void totalKeys(uint16_t totalKeys);
  }
  

Index: BFileWrite.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/rincon/apps/Blackbook5/interfaces/BFileWrite.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** BFileWrite.nc	18 May 2006 22:34:20 -0000	1.1
--- BFileWrite.nc	28 Sep 2006 17:31:47 -0000	1.2
***************
*** 40,43 ****
--- 40,48 ----
  
    /**
+    * @return TRUE if the given parameterized interface has a file open
+    */
+   command bool isOpen();
+   
+   /**
     * Close any currently opened write file.
     */
***************
*** 77,80 ****
--- 82,86 ----
    
  
+ 
    /**
     * Signaled when a file has been opened, with the results

Index: NodeMap.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/rincon/apps/Blackbook5/interfaces/NodeMap.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NodeMap.nc	18 May 2006 22:34:20 -0000	1.1
--- NodeMap.nc	28 Sep 2006 17:31:48 -0000	1.2
***************
*** 88,104 ****
    
    /**
!    * Get the node and offset into the node that represents
     * an address in a file
     * @param focusedFile - the file to find the address in
     * @param fileAddress - the address to find
     * @param returnOffset - pointer to a location to store the offset into the node
!    * @return the node that contains the file address in the file.
     */
!   command node *getAddressInFile(file *focusedFile, uint32_t fileAddress, uint16_t *returnOffset); 
    
    /**
     * @return the node's position in a file, 0xFF if not valid
     *
!   command uint8_t getElementNumber(node *focusedNode);
    
    /**
--- 88,104 ----
    
    /**
!    * Get the flashnode and offset into the flashnode that represents
     * an address in a file
     * @param focusedFile - the file to find the address in
     * @param fileAddress - the address to find
     * @param returnOffset - pointer to a location to store the offset into the node
!    * @return the flashnode that contains the file address in the file.
     */
!   command flashnode *getAddressInFile(file *focusedFile, uint32_t fileAddress, uint16_t *returnOffset); 
    
    /**
     * @return the node's position in a file, 0xFF if not valid
     *
!   command uint8_t getElementNumber(flashnode *focusedNode);
    
    /**
***************
*** 106,110 ****
     * @return the node's position in the given file, 0xFF if not valid
     *
!   command uint8_t getElementNumberFromFile(node *focusedNode, file *focusedFile);
    
    /**
--- 106,110 ----
     * @return the node's position in the given file, 0xFF if not valid
     *
!   command uint8_t getElementNumberFromFile(flashnode *focusedNode, file *focusedFile);
    
    /**
***************
*** 116,120 ****
     * @return the file associated with the given node, NULL if n/a.
     */
!   command file *getFileFromNode(node *focusedNode);
    
    /**
--- 116,120 ----
     * @return the file associated with the given node, NULL if n/a.
     */
!   command file *getFileFromNode(flashnode *focusedNode);
    
    /**
***************
*** 128,135 ****
    
    /**
!    * Get a node at a given index
!    * @return the node if it exists, NULL if it doesn't.
     */
!   command node *getNodeAtIndex(uint8_t index);
    
    /** 
--- 128,135 ----
    
    /**
!    * Get a flashnode at a given index
!    * @return the flashnode if it exists, NULL if it doesn't.
     */
!   command flashnode *getNodeAtIndex(uint8_t index);
    
    /** 
***************
*** 144,151 ****
    
    /**
!    * @return TRUE if there exists another node belonging
     * to the same file with the same element number
     */
!   command bool hasDuplicate(node *focusedNode);
    
  }
--- 144,151 ----
    
    /**
!    * @return TRUE if there exists another flashnode belonging
     * to the same file with the same element number
     */
!   command bool hasDuplicate(flashnode *focusedNode);
    
  }

Index: Checkpoint.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/rincon/apps/Blackbook5/interfaces/Checkpoint.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Checkpoint.nc	18 May 2006 22:34:20 -0000	1.1
--- Checkpoint.nc	28 Sep 2006 17:31:48 -0000	1.2
***************
*** 43,50 ****
    /**
     * Update a node.
!    * @param focusedNode - the node to save or delete
     * @return SUCCESS if the information will be updated
     */
!   command result_t update(node *focusedNode);
    
    /**
--- 43,50 ----
    /**
     * Update a node.
!    * @param focusedNode - the flashnode to save or delete
     * @return SUCCESS if the information will be updated
     */
!   command result_t update(flashnode *focusedNode);
    
    /**
***************
*** 52,61 ****
     * from the Checkpoint.
     *
!    * If the node cannot be recovered, it is deleted.
     *
!    * @param focusedNode - the node to recover, with client set to its element number
     * @return SUCCESS if recovery will proceed
     */
!   command result_t recover(node *focusedNode);
    
    
--- 52,61 ----
     * from the Checkpoint.
     *
!    * If the flashnode cannot be recovered, it is deleted.
     *
!    * @param focusedNode - the flashnode to recover, with client set to its element number
     * @return SUCCESS if recovery will proceed
     */
!   command result_t recover(flashnode *focusedNode);
    
    
***************
*** 67,82 ****
    
    /**
!    * The given node was updated in the Checkpoint
!    * @param focusedNode - the node that was updated
     * @param result - SUCCESS if everything's ok
     */
!   event void updated(node *focusedNode, result_t result);
    
    /** 
!    * A node was recovered.
     * @param result - SUCCESS if it was recovered correctly.
     *                 FAIL if it should be deleted.
     */
!   event void recovered(node *recoveredNode, result_t result);
    
  }
--- 67,82 ----
    
    /**
!    * The given flashnode was updated in the Checkpoint
!    * @param focusedNode - the flashnode that was updated
     * @param result - SUCCESS if everything's ok
     */
!   event void updated(flashnode *focusedNode, result_t result);
    
    /** 
!    * A flashnode was recovered.
     * @param result - SUCCESS if it was recovered correctly.
     *                 FAIL if it should be deleted.
     */
!   event void recovered(flashnode *recoveredNode, result_t result);
    
  }

Index: WriteAlloc.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/rincon/apps/Blackbook5/interfaces/WriteAlloc.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** WriteAlloc.nc	18 May 2006 22:34:20 -0000	1.1
--- WriteAlloc.nc	28 Sep 2006 17:31:49 -0000	1.2
***************
*** 40,48 ****
     * The write open process completed
     * @param openFile - the file that was opened for writing 
!    * @param writeNode - the node to write to
     * @param appendAddress - the next address in the file to append to
     * @param result - SUCCESS if the file was correctly opened
     */
!   event void openedForWriting(file *openFile, node *writeNode, uint32_t totalSize, result_t result);
    
  }
--- 40,48 ----
     * The write open process completed
     * @param openFile - the file that was opened for writing 
!    * @param writeNode - the flashnode to write to
     * @param appendAddress - the next address in the file to append to
     * @param result - SUCCESS if the file was correctly opened
     */
!   event void openedForWriting(file *openFile, flashnode *writeNode, uint32_t totalSize, result_t result);
    
  }



More information about the Tinyos-contrib-commits mailing list