X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=app%2Ftriface%2Fprotocol.c;h=8be3d3c96b113eb0981f1ed4a0301a7ddb93a090;hb=f1f5aee73d919e1ffc86d2d36ea9aa428d8c5287;hp=e659888b3d9c820c7b734cbd6dc287e4ff69e97d;hpb=91bbddad1da23825fefd07447d841ba7d6b8365a;p=bertos.git diff --git a/app/triface/protocol.c b/app/triface/protocol.c index e659888b..8be3d3c9 100755 --- a/app/triface/protocol.c +++ b/app/triface/protocol.c @@ -16,6 +16,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 +52,7 @@ #include #include -#include +//#include #include "cmd_ctor.h" // MAKE_CMD, REGISTER_CMD @@ -69,6 +75,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 +225,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);