]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/interfaces/BlockWrite.nc
Add an async version of ReadRef.
[tinyos-2.x.git] / tos / interfaces / BlockWrite.nc
index c229848db92500e6f369d78dbe817312dcde92c3..5ecd3d11dbc0ae07ae50a1a5669b472299215d1f 100644 (file)
@@ -44,9 +44,11 @@ interface BlockWrite {
    * Initiate a write operation within a given volume. On SUCCESS, the
    * <code>writeDone</code> event will signal completion of the
    * operation.
+   * <p>
+   * Between two erases, no byte may be written more than once.
    * 
    * @param addr starting address to begin write.
-   * @param buf buffer to write data from.
+   * @param 'void* COUNT(len) buf' buffer to write data from.
    * @param len number of bytes to write.
    * @return 
    *   <li>SUCCESS if the request was accepted, 
@@ -57,11 +59,11 @@ interface BlockWrite {
 
   /**
    * Signals the completion of a write operation. However, data is not
-   * guaranteed to survive a power-cycle unless a commit operation has
+   * guaranteed to survive a power-cycle unless a sync operation has
    * been completed.
    *
    * @param addr starting address of write.
-   * @param buf buffer that written data was read from.
+   * @param 'void* COUNT(len) buf' buffer that written data was read from.
    * @param len number of bytes written.
    * @param error SUCCESS if the operation was successful, FAIL if
    *   it failed
@@ -89,25 +91,23 @@ interface BlockWrite {
   event void eraseDone(error_t error);
 
   /**
-   * Initiate a commit operation and finialize any additional writes
-   * to the volume. A verify operation from <code>BlockRead</code> can
-   * be done to check if the data has been modified since. A commit
-   * operation must be issued to ensure that data is stored in
-   * non-volatile storage. On SUCCES, the <code>commitDone</code>
-   * event will signal completion of the operation.
+   * Initiate a sync operation to finalize writes to the volume. A
+   * sync operation must be issued to ensure that data is stored in
+   * non-volatile storage. On SUCCES, the <code>syncDone</code> event
+   * will signal completion of the operation.
    *
    * @return 
    *   <li>SUCCESS if the request was accepted, 
    *   <li>EBUSY if a request is already being processed.
    */
-  command error_t commit();
+  command error_t sync();
 
   /**
-   * Signals the completion of a commit operation. All written data is
+   * Signals the completion of a sync operation. All written data is
    * flushed to non-volatile storage after this event.
    *
    * @param error SUCCESS if the operation was successful, FAIL if
    *   it failed
    */
-  event void commitDone(error_t error);
+  event void syncDone(error_t error);
 }