X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=app%2Ftriface%2Fprotocol.c;h=b49736272ccb929199194f7eb4615a51ee247825;hb=390b6f25afb04fee925be597381e06ce5a9e8110;hp=e659888b3d9c820c7b734cbd6dc287e4ff69e97d;hpb=91bbddad1da23825fefd07447d841ba7d6b8365a;p=bertos.git diff --git a/app/triface/protocol.c b/app/triface/protocol.c old mode 100755 new mode 100644 index e659888b..b4973627 --- a/app/triface/protocol.c +++ b/app/triface/protocol.c @@ -1,6 +1,31 @@ /** * \file * * @@ -16,6 +41,12 @@ /*#* *#* $Log$ + *#* Revision 1.7 2007/01/09 09:00:16 bernie + *#* Doxygen fix. + *#* + *#* Revision 1.6 2006/09/20 13:54:04 marco + *#* Usage examples of MAKE_CMD. + *#* *#* Revision 1.5 2006/06/14 01:03:01 marco *#* Add response code. Add command ping. *#* @@ -46,7 +77,7 @@ #include #include -#include +//#include #include "cmd_ctor.h" // MAKE_CMD, REGISTER_CMD @@ -69,6 +100,7 @@ static struct RLContext rl_ctx; /** * Send a NAK asking the host to send the current message again. * + * \param ser serial port handle to output to. * \param err human-readable description of the error for debug purposes. */ INLINE void NAK(Serial *ser, const char *err) @@ -218,14 +250,15 @@ void protocol_run(Serial *ser) * */ -/* Version. */ -MAKE_CMD(ver, "", "s", -({ - args[1].s = VERS_TAG; - 0; -})) +/* Version. Example of declaring function and passing it to MAKE_CMD. */ +static int ver_fn(const char **str) +{ + *str = VERS_TAG; + return 0; +} +MAKE_CMD(ver, "", "s", ver_fn(&args[1].s)) -/* Sleep. */ +/* Sleep. Example of declaring function body directly in macro call. */ MAKE_CMD(sleep, "d", "", ({ timer_delay((mtime_t)args[1].l);