[Tinyos-2-commits] CVS: tinyos-2.x/tos/interfaces LogRead.nc, 1.1.2.5, 1.1.2.6 LogWrite.nc, 1.1.2.4, 1.1.2.5

David Gay idgay at users.sourceforge.net
Wed May 31 16:34:16 PDT 2006


Update of /cvsroot/tinyos/tinyos-2.x/tos/interfaces
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9637

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	LogRead.nc LogWrite.nc 
Log Message:
specify log interfaces in more detail


Index: LogRead.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/interfaces/Attic/LogRead.nc,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -C2 -d -r1.1.2.5 -r1.1.2.6
*** LogRead.nc	31 May 2006 14:57:23 -0000	1.1.2.5
--- LogRead.nc	31 May 2006 23:34:14 -0000	1.1.2.6
***************
*** 57,61 ****
     * @param buf buffer to place read data.
     * @param len number of bytes to read.
!    * @return SUCCESS if the request was accepted, FAIL otherwise.
     */
    command error_t read(void* buf, storage_len_t len);
--- 57,64 ----
     * @param buf buffer to place read data.
     * @param len number of bytes to read.
!    * @return 
!    *   <li>SUCCESS if the request was accepted, 
!    *   <li>EOFF if the volume has not been mounted
!    *   <li>EBUSY if a request is already being processed.
     */
    command error_t read(void* buf, storage_len_t len);
***************
*** 67,72 ****
     * @param addr starting address of read.
     * @param buf buffer where read data was placed.
!    * @param len number of bytes read (correct even in case of error).
!    * @param error notification of how the operation went.
     */
    event void readDone(void* buf, storage_len_t len, error_t error);
--- 70,76 ----
     * @param addr starting address of read.
     * @param buf buffer where read data was placed.
!    * @param len number of bytes read - this may be less than requested
!    *    (even equal to 0) if the end of the log was reached
!    * @param error SUCCESS if read was possible, FAIL otherwise
     */
    event void readDone(void* buf, storage_len_t len, error_t error);
***************
*** 75,84 ****
     * Return a "cookie" representing the current read offset within the
     * log. This cookie can be used in a subsequent seek operation to
!    * return to the same place in the log (if it hasn't been overwritten)
     * @return Cookie representing current offset. 
!    *   <code>SEEK_BEGINNING</code> will be returned if:
     *   <li> a write in a circular log overwrote the previous read position
     *   <li> seek was passed a cookie representing a position before the
     *        current beginning of a circular log
     */
    command storage_cookie_t currentOffset();
--- 79,94 ----
     * Return a "cookie" representing the current read offset within the
     * log. This cookie can be used in a subsequent seek operation to
!    * return to the same place in the log (if it hasn't been overwritten).
!    * The result is undefined if the log has not been mounted.
!    *
     * @return Cookie representing current offset. 
!    *   <code>SEEK_BEGINNING</code> will be returned if:<ul>
     *   <li> a write in a circular log overwrote the previous read position
     *   <li> seek was passed a cookie representing a position before the
     *        current beginning of a circular log
+    *   </ul>
+    *   Note that <code>SEEK_BEGINNING</code> can also be returned at
+    *   other times (just after erasing a log, just after mounting a
+    *   log volume, etc).
     */
    command storage_cookie_t currentOffset();
***************
*** 91,94 ****
--- 101,109 ----
     * If the specified position has been overwritten, the read position
     * will be set to the beginning of the log.
+    *
+    * @return 
+    *   <li>SUCCESS if the request was accepted, 
+    *   <li>EOFF if the volume has not been mounted
+    *   <li>EBUSY if a request is already being processed.
     */
    command error_t seek(storage_cookie_t offset);
***************
*** 96,101 ****
    /**
     * Report success of seek operation. If <code>SUCCESS</code> is returned,
!    * the read position has been changed as requested. Otherwise, the read
!    * position is unchanged.
     *
     * @param error SUCCESS if the seek was succesful, EINVAL if the cookie
--- 111,116 ----
    /**
     * Report success of seek operation. If <code>SUCCESS</code> is returned,
!    * the read position has been changed as requested. If other values are
!    * returned, the read position is undefined.
     *
     * @param error SUCCESS if the seek was succesful, EINVAL if the cookie
***************
*** 105,111 ****
    
    /**
!    * Report volume size in bytes. Note that use of <code>sync</code>,
!    * failures and general overhead may reduce the number of bytes
!    * available to the log.
     *
     * @return Volume size.
--- 120,127 ----
    
    /**
!    * Report approximate log capacity in bytes. Note that use of
!    * <code>sync</code>, failures and general overhead may reduce the number
!    * of bytes available to the log. The result is undefined if the log has
!    * not been mounted.
     *
     * @return Volume size.

Index: LogWrite.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/interfaces/Attic/LogWrite.nc,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** LogWrite.nc	31 May 2006 14:57:23 -0000	1.1.2.4
--- LogWrite.nc	31 May 2006 23:34:14 -0000	1.1.2.5
***************
*** 48,52 ****
     * @param buf buffer to write data from.
     * @param len number of bytes to write.
!    * @return SUCCESS if the request was accepted, FAIL otherwise.
     */
    command error_t append(void* buf, storage_len_t len);
--- 48,55 ----
     * @param buf buffer to write data from.
     * @param len number of bytes to write.
!    * @return 
!    *   <li>SUCCESS if the request was accepted, 
!    *   <li>EOFF if the volume has not been mounted
!    *   <li>EBUSY if a request is already being processed.
     */
    command error_t append(void* buf, storage_len_t len);
***************
*** 58,63 ****
     *
     * @param buf buffer that written data was read from.
!    * @param len number of bytes actually written.
!    * @param error notification of how the operation went.
     */
    event void appendDone(void* buf, storage_len_t len, error_t error);
--- 61,67 ----
     *
     * @param buf buffer that written data was read from.
!    * @param len number of bytes actually written (valid even in case of error)
!    * @param error SUCCESS if append was possible, ESIZE if the (linear) log
!    *    is full and FAIL for other errors.
     */
    event void appendDone(void* buf, storage_len_t len, error_t error);
***************
*** 67,71 ****
     * log. This cookie can be used in a subsequent seek operation (see
     * <code>LogRead</code> to start reading from this place in the log (if
!    * it hasn't been overwritten).
     *
     * @return Cookie representing current offset. 
--- 71,76 ----
     * log. This cookie can be used in a subsequent seek operation (see
     * <code>LogRead</code> to start reading from this place in the log (if
!    * it hasn't been overwritten). The result is undefined if the log has
!    * not been mounted.
     *
     * @return Cookie representing current offset. 
***************
*** 78,82 ****
     * operation.
     *
!    * @return SUCCESS if the request was accepted, FAIL otherwise.
     */
    command error_t erase();
--- 83,90 ----
     * operation.
     *
!    * @return 
!    *   <li>SUCCESS if the request was accepted, 
!    *   <li>EOFF if the volume has not been mounted
!    *   <li>EBUSY if a request is already being processed.
     */
    command error_t erase();
***************
*** 85,89 ****
     * Signals the completion of an erase operation.
     *
!    * @param error notification of how the operation went.
     */
    event void eraseDone(error_t error);
--- 93,97 ----
     * Signals the completion of an erase operation.
     *
!    * @param error SUCCESS if the log was erased, FAIL otherwise.
     */
    event void eraseDone(error_t error);
***************
*** 94,98 ****
     * <code>commitDone</code> event will signal completion of the operation.
     *
!    * @return SUCCESS if the request was accepted, FAIL otherwise.
     */
    command error_t sync();
--- 102,109 ----
     * <code>commitDone</code> event will signal completion of the operation.
     *
!    * @return 
!    *   <li>SUCCESS if the request was accepted, 
!    *   <li>EOFF if the volume has not been mounted
!    *   <li>EBUSY if a request is already being processed.
     */
    command error_t sync();
***************
*** 101,105 ****
     * Signals the successful or unsuccessful completion of a sync operation. 
     *
!    * @param error notification of how the operation went.
     */
    event void syncDone(error_t error);
--- 112,116 ----
     * Signals the successful or unsuccessful completion of a sync operation. 
     *
!    * @param error SUCCESS if the log was synchronised, FAIL otherwise.
     */
    event void syncDone(error_t error);



More information about the Tinyos-2-commits mailing list