From 7d06f1bfe0b925304c5b280417295efb2ac77c3d Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Mon, 3 Mar 2008 16:10:09 +0000 Subject: [PATCH] Added netsim output --- apps/shell/shell-sendtest.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/shell/shell-sendtest.c b/apps/shell/shell-sendtest.c index 9d4a500a0..f94f7e7aa 100644 --- a/apps/shell/shell-sendtest.c +++ b/apps/shell/shell-sendtest.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: shell-sendtest.c,v 1.1 2008/02/04 23:42:17 adamdunkels Exp $ + * $Id: shell-sendtest.c,v 1.2 2008/03/03 16:10:09 adamdunkels Exp $ */ /** @@ -45,6 +45,13 @@ #include #include +#if NETSIM +#include "ether.h" +#endif /* NETSIM */ +#ifndef HAVE_SNPRINTF +int snprintf(char *str, size_t size, const char *format, ...); +#endif /* HAVE_SNPRINTF */ + /*---------------------------------------------------------------------------*/ PROCESS(shell_sendtest_process, "sendtest"); SHELL_COMMAND(sendtest_command, @@ -63,7 +70,7 @@ write_chunk(struct rucb_conn *c, int offset, int flag, { char buf[100]; printf("received %d; %d\n", offset, datalen); - sprintf(buf, "%d%%", (100 * (offset + datalen)) / filesize); + sprintf(buf, "%lu%%", (100 * (offset + datalen)) / filesize); ether_set_text(buf); } #endif /* NETSIM */