This might be a missing include... can you try putting a #include <stdio.h> at 
the top of UDPShellP?  If that fixes it, I'll check it in for the release.

Thanks,
Steve

On Feb 21, 2010, at 9:45 PM, Omprakash Gnawali wrote:

> ---------- Forwarded message ----------
> From: Aldo Javier <[email protected]>
> Date: Thu, Feb 4, 2010 at 2:11 PM
> Subject: [Tinyos-help]  [blip-users] Problems adding commands to UDP-Shell
> To: [email protected]
> 
> 
> Hi all,
> I'm trying to use the UDPbased-Shell, the idea is to add a new simple
> command to the defaults, this have to return a measure of the
> temperature sensor... . Following the BLIP tutorial I did...
> 
> -the configuration file:
> 
> configuration TemperaturaAppC
> {
> }
> 
> implementation
> {
>   components MainC;
> //   components UDPShellC;
>   components TemperaturaC;
>   components new ShellCommandC("temp");
>   components new SensirionSht11C() as Sensor;
> 
>   TemperaturaC.Boot -> MainC;
>   TemperaturaC.Temperature -> Sensor.Temperature;
>   TemperaturaC.Temp -> ShellCommandC;
> }
> 
> -the main module:
> 
> module TemperaturaC
> {
>   uses
>   {
>      interface Boot;
>      interface Read<uint16_t> as Temperature;
>      interface ShellCommand as Temp;
>   }
> }
> 
> implementation
> {
>   uint8_t lectNum;
>   uint8_t *plectNum = &lectNum;
>   char lectStr;
>   char *plectStr = &lectStr;
> 
>   task void LeerTempTask();
> 
>   event void Boot.booted()
>   {
>   }
> 
>   event char *Temp.eval(int argc, char **argv)
>   {
>      char *retorno = call Temp.getBuffer(28);
>      if( retorno != NULL )
>      {
>         strncpy(retorno, "La temperatura medida es:/n", 28);
>         post LeerTempTask();
>      }
>      return retorno;
>   }
> 
>   event void Temperature.readDone(error_t result, uint16_t val)
>   {
>      if( result == SUCCESS )
>      {
>         lectNum = -38.4 + 0.0098*val;
>         plectStr = (char*) plectNum;
>         call Temp.write(plectStr, 1);
>      }
>      else post LeerTempTask();
>   }
> 
>   task void LeerTempTask()
>   {
>      call Temperature.read();
>   }
> }
> 
> -the makefile:
> 
> COMPONENT=TemperaturaAppC
> include $(MAKERULES)
> 
> Then when making:
> 
> r...@aldo-laptop:/opt/tinyos-2.x/apps_practicas/comand_shell# make
> telosb blip
> mkdir -p build/telosb
>    compiling TemperaturaAppC to a telosb binary
> ncc -o build/telosb/main.exe  -Os -O -DPACKET_LINK -DDEF_MEMCPY
> -DENABLE_SPI0_DMA -DBLIP_MULTICAST -DCC2420_HW_ACKNOWLEDGEMENTS
> -DTOSH_DATA_LENGTH=102 -I/opt/tinyos-2.x/tos/lib/net/
> -I/opt/tinyos-2.x/support/sdk/c/blip/lib6lowpan/
> -I/opt/tinyos-2.x/support/sdk/c/blip/libtcp/
> -I/opt/tinyos-2.x/tos/lib/net/blip/
> -I/opt/tinyos-2.x/tos/lib/net/blip/interfaces/
> -I/opt/tinyos-2.x/tos/lib/net/blip/nwprog/
> -I/opt/tinyos-2.x/tos/lib/net/blip/shell/
> -I/opt/tinyos-2.x/tos/lib/net/blip/serial/
> -I/opt/tinyos-2.x/tos/lib/net/blip/platform/
> /opt/tinyos-2.x/support/sdk/c/blip/lib6lowpan/lib6lowpan.c
> /opt/tinyos-2.x/support/sdk/c/blip/lib6lowpan/lib6lowpanIP.c
> /opt/tinyos-2.x/support/sdk/c/blip/lib6lowpan/lib6lowpanFrag.c
> /opt/tinyos-2.x/support/sdk/c/blip/lib6lowpan/in_cksum.c
> /opt/tinyos-2.x/support/sdk/c/blip/lib6lowpan/ip_malloc.c
> /opt/tinyos-2.x/tos/lib/net/blip/table.c -mdisable-hwmul
> -fnesc-separator=__ -Wall -Wshadow -Wnesc-all -target=telosb
> -fnesc-cfile=build/telosb/app.c -board= -DDEFINED_TOS_AM_GROUP=0x22
> -DIDENT_APPNAME=\"TemperaturaAppC\" -DIDENT_USERNAME=\"root\"
> -DIDENT_HOSTNAME=\"aldo-laptop\" -DIDENT_USERHASH=0x8964ff76L
> -DIDENT_TIMESTAMP=0x4b6b4409L -DIDENT_UIDHASH=0x8962e2afL
> TemperaturaAppC.nc -lm
> In file included
> from /opt/tinyos-2.x/tos/lib/net/blip/shell/ShellCommandC.nc:10,
>                 from TemperaturaAppC.nc:18:
> In component `UDPShellP':
> /opt/tinyos-2.x/tos/lib/net/blip/shell/UDPShellP.nc: In function
> `action_uptime':
> /opt/tinyos-2.x/tos/lib/net/blip/shell/UDPShellP.nc:182: implicit
> declaration of function `snprintf'
> /opt/tinyos-2.x/tos/lib/net/blip/shell/UDPShellP.nc: In function
> `UDP.recvfrom':
> /opt/tinyos-2.x/tos/lib/net/blip/shell/UDPShellP.nc:257: implicit
> declaration of function `snprintf'
> /opt/tinyos-2.x/tos/lib/net/blip/shell/UDPShellP.nc: In function
> `ICMPPing.pingReply':
> /opt/tinyos-2.x/tos/lib/net/blip/shell/UDPShellP.nc:266: implicit
> declaration of function `snprintf'
> /opt/tinyos-2.x/tos/lib/net/blip/shell/UDPShellP.nc: In function
> `ICMPPing.pingDone':
> /opt/tinyos-2.x/tos/lib/net/blip/shell/UDPShellP.nc:274: implicit
> declaration of function `snprintf'
> make: *** [exe0] Error 1
> 
> It do not recognize snprintf function used in UDPShell.nc, this module
> is used in the UDPEcho to, and it make that without problems...
> 
> Any ideas for why is this happening?
> 
> Thanks in advance...
> 
> Aldo Javier.
> 
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to