]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/net/blip/shell/ShellCommand.nc
Merge TinyOS 2.1.1 into master.
[tinyos-2.x.git] / tos / lib / net / blip / shell / ShellCommand.nc
diff --git a/tos/lib/net/blip/shell/ShellCommand.nc b/tos/lib/net/blip/shell/ShellCommand.nc
new file mode 100644 (file)
index 0000000..075c55c
--- /dev/null
@@ -0,0 +1,25 @@
+
+interface ShellCommand {
+
+  /*
+   * evaluate the command that this command provides
+   * @argc the number of arguments
+   * @argv the arguments
+   * @return a string to send back as the reply to the shell client.
+   *         if NULL, nothing is sent.
+   */
+  event char *eval(int argc, char **argv);
+
+  /*
+   * request a buffer.  The result of this command may be returned
+   * from 'eval', but otherwise the buffer may not be used outside of
+   * the context it is called from.
+   */
+  command char *getBuffer(uint16_t len);
+
+  /*
+   * write a string to the shell buffer; if no client is connected it
+   * will fail silently
+   */
+  command void write(char *str, int len);
+}