]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
New Write and WriteNow interfaces.
authorR. Steve McKown <rsmckown@gmail.com>
Fri, 17 Sep 2010 01:35:25 +0000 (19:35 -0600)
committerR. Steve McKown <rsmckown@gmail.com>
Fri, 17 Sep 2010 01:42:02 +0000 (19:42 -0600)
tos/interfaces/Write.nc [new file with mode: 0644]
tos/interfaces/WriteNow.nc [new file with mode: 0644]

diff --git a/tos/interfaces/Write.nc b/tos/interfaces/Write.nc
new file mode 100644 (file)
index 0000000..d46948e
--- /dev/null
@@ -0,0 +1,39 @@
+/* Copyright (c) 2006-2010 by Sporian Microsystems, Inc.
+ * All Rights Reserved.
+ *
+ * This document is the proprietary and confidential property of Sporian
+ * Microsystems, Inc.  All use, distribution, reproduction or re-distribution
+ * is disallowed without the prior express written consent of Sporian
+ * Microsystems, Inc.
+ */
+
+/**
+ * The Write interface is intended for split-phase low-rate or
+ * high-latency writing of small values. The type of the value is
+ * given as a template argument. Because this interface is
+ * split-phase, these values may be backed by hardware, or a
+ * long-running computation.  This interface is the output analog
+ * of the standard Read interface.
+ *
+ * @param val_t the type of the object that will be written
+ *
+ * @author R. Steve McKown <rsmckown@gmail.com>
+ */
+
+
+interface Write<val_t> {
+  /**
+   * Initiate a write of the provided value.
+   *
+   * @param val The value to write.
+   * @return SUCCESS if <code>writeDone()</code> will later be signalled,
+   * EBUSY if a write is already in progress, or FAIL for other errors.
+   */
+  command error_t write(val_t val);
+
+  /**
+   * Signalled upon completion of the write operation initiated by the previous
+   * <code>write()</code> command.
+   */
+  event void writeDone(error_t error);
+}
diff --git a/tos/interfaces/WriteNow.nc b/tos/interfaces/WriteNow.nc
new file mode 100644 (file)
index 0000000..caaadff
--- /dev/null
@@ -0,0 +1,42 @@
+/* Copyright (c) 2006-2010 by Sporian Microsystems, Inc.
+ * All Rights Reserved.
+ *
+ * This document is the proprietary and confidential property of Sporian
+ * Microsystems, Inc.  All use, distribution, reproduction or re-distribution
+ * is disallowed without the prior express written consent of Sporian
+ * Microsystems, Inc.
+ */
+
+/**
+ * The Write interface is intended for split-phase low-rate or
+ * high-latency writing of small values. The type of the value is
+ * given as a template argument. Because this interface is
+ * split-phase, these values may be backed by hardware, or a
+ * long-running computation.  This interface is the output analog
+ * of the standard Read interface.
+ *
+ * This interface is equivalent to the Write interface, except that its
+ * operations are defined async.
+ *
+ * @param val_t the type of the object that will be written
+ *
+ * @author R. Steve McKown <rsmckown@gmail.com>
+ */
+
+
+interface WriteNow<val_t> {
+  /**
+   * Initiate a write of the provided value.
+   *
+   * @param val The value to write.
+   * @return SUCCESS if <code>writeDone()</code> will later be signalled,
+   * EBUSY if a write is already in progress, or FAIL for other errors.
+   */
+  async command error_t write(val_t val);
+
+  /**
+   * Signalled upon completion of the write operation initiated by the previous
+   * <code>write()</code> command.
+   */
+  async event void writeDone(error_t error);
+}