Hi guys,

I'm new here. Currently, I'm working with IRIS motes on TinyOS 2.0.2 with
the latest cvs tree. When I tried the mote-mote radio communication function
as the tutorial mentioned, I encountered a series of compile errors.
But the application is OK if I change the command from $make iris to $make
micaz. I wonder whether it is my fault or not. The code and the compile
information are listed below:

/*BlinkToRadio.h*/
#ifndef BLINKTORADIO_H
#define BLINKTORADIO_H
enum
{
 AM_BLINKTORADIO = 6,
 TIMER_PERIOD_MILLI = 250
};
typedef nx_struct BlinkToRadioMsg
{
 nx_uint16_t nodeid;
 nx_uint16_t counter;
} BlinkToRadioMsg;
#endif
/*BlinkToRadioAppC.nc*/
#include <Timer.h>
#include "BlinkToRadio.h"
configuration BlinkToRadioAppC
{
}
implementation
{
 components MainC;
 components LedsC;
 components BlinkToRadioC as App;
 components new TimerMilliC() as Timer0;
 components ActiveMessageC;
 components new AMSenderC( AM_BLINKTORADIO );

 App.Boot -> MainC;
 App.Leds -> LedsC;
 App.Timer0 -> Timer0;
 App.Packet -> AMSenderC;
 App.AMPacket -> AMSenderC;
 App.AMSend -> AMSenderC;
 App.AMControl -> ActiveMessageC;
}
/*BlinkToRadioC.nc*/
#include <Timer.h>
#include "BlinkToRadio.h"
module BlinkToRadioC
{
 uses interface Boot;
 uses interface Leds;
 uses interface Timer<TMilli> as Timer0;
 uses interface Packet;
 uses interface AMPacket;
 uses interface AMSend;
 uses interface SplitControl as AMControl;
}
implementation
{
 bool busy = FALSE;
 message_t pkt;
 uint16_t counter = 0;

 event void Boot.booted()
 {
  call AMControl.start();
 }

 event void AMControl.startDone( error_t err )
 {
  if ( err == SUCCESS )
  {
   call Timer0.startPeriodic( TIMER_PERIOD_MILLI );
  }
  else
  {
   call AMControl.start();
  }
 }

 event void AMControl.stopDone( error_t err )
 {
 }

 event void Timer0.fired()
 {
  counter++;
  call Leds.set( counter );

  if ( !busy )
  {
   BlinkToRadioMsg *btrpkt = ( BlinkToRadioMsg * ) ( call Packet.getPayload(
&pkt, NULL ) );
   btrpkt -> nodeid = TOS_NODE_ID;
   btrpkt -> counter = counter;
   if ( call AMSend.send( AM_BROADCAST_ADDR, &pkt, sizeof( BlinkToRadioMsg )
) == SUCCESS )
   {
    busy = TRUE;
   }
  }
 }

 event void AMSend.sendDone( message_t* msg, error_t error )
 {
  if ( &pkt == msg )
  {
   busy = FALSE;
  }
 }
}
compile information:
$ make iris
mkdir -p build/iris
    compiling BlinkToRadioAppC to a iris binary
ncc -o build/iris/main.exe -Os -Wall -Wshadow -Wnesc-all -target=iris
-fnesc-cfi
le=build/iris/app.c -board=micasb -DIDENT_PROGRAM_NAME=\"BlinkToRadioApp\"
-DIDE
NT_USER_ID=\"JF_Lee\" -DIDENT_HOSTNAME=\"home-lijianfeng\"
-DIDENT_USER_HASH=0xd
2011d3dL -DIDENT_UNIX_TIME=0x47e88999L -DIDENT_UID_HASH=0xac952e29L
-fnesc-dump=
wiring -fnesc-dump='interfaces(!abstract())'
-fnesc-dump='referenced(interfacede
fs, components)' -fnesc-dumpfile=build/iris/wiring-check.xml
BlinkToRadioAppC.nc
 -lm
In file included from /opt/tinyos-2.x/tos/types/message.h:4,
                 from /opt/tinyos-2.x/tos/interfaces/Packet.nc:42,
                 from BlinkToRadioC.nc:9,
                 from BlinkToRadioAppC.nc:12:
/opt/tinyos-2.x/tos/platforms/iris/platform_message.h:74: syntax error
before `d
efpacket_footer_t'
/opt/tinyos-2.x/tos/platforms/iris/platform_message.h:74: warning: no
semicolon
at end of struct or union
/opt/tinyos-2.x/tos/platforms/iris/platform_message.h:75: warning: type
defaults
 to `int' in declaration of `message_footer_t'
/opt/tinyos-2.x/tos/platforms/iris/platform_message.h:75: warning: data
definiti
on has no type or storage class
In file included from /opt/tinyos-2.x/tos/chips/rf230/DefaultPacketC.nc:42,
                 from /opt/tinyos-2.x/tos/chips/rf230/DefaultMacC.nc:47,
                 from /opt/tinyos-2.x
/tos/platforms/iris/ActiveMessageC.nc:45,
                 from BlinkToRadioAppC.nc:14:
In component `DefaultPacketP':
/opt/tinyos-2.x/tos/chips/rf230/DefaultPacketP.nc:89: conflicting types for
`Pac
ket.getPayload'
/opt/tinyos-2.x/tos/interfaces/Packet.nc:108: previous declaration of
`Packet.ge
tPayload'
In file included from /opt/tinyos-2.x/tos/chips/rf230/DefaultMacC.nc:63,
                 from /opt/tinyos-2.x
/tos/platforms/iris/ActiveMessageC.nc:45,
                 from BlinkToRadioAppC.nc:14:
In component `ActiveMessageLayerC':
/opt/tinyos-2.x/tos/chips/rf230/ActiveMessageLayerC.nc:81: conflicting types
for
 `AMSend.getPayload'
/opt/tinyos-2.x/tos/interfaces/AMSend.nc:125: previous declaration of
`AMSend.ge
tPayload'
/opt/tinyos-2.x/tos/chips/rf230/ActiveMessageLayerC.nc: In function
`AMSend.getP
ayload':
/opt/tinyos-2.x/tos/chips/rf230/ActiveMessageLayerC.nc:82: too many
arguments to
 function `SubSend.getPayload'
/opt/tinyos-2.x/tos/chips/rf230/ActiveMessageLayerC.nc: At top level:
/opt/tinyos-2.x/tos/chips/rf230/ActiveMessageLayerC.nc:41:
`Snoop.payloadLength'
 not implemented
/opt/tinyos-2.x/tos/chips/rf230/ActiveMessageLayerC.nc:41:
`Snoop.getPayload' no
t implemented
/opt/tinyos-2.x/tos/chips/rf230/ActiveMessageLayerC.nc:41:
`Receive.payloadLengt
h' not implemented
/opt/tinyos-2.x/tos/chips/rf230/ActiveMessageLayerC.nc:41:
`Receive.getPayload'
not implemented
In file included from /opt/tinyos-2.x
/tos/chips/rf230/MessageBufferLayerC.nc:44,
                 from /opt/tinyos-2.x/tos/chips/rf230/DefaultMacC.nc:64,
                 from /opt/tinyos-2.x
/tos/platforms/iris/ActiveMessageC.nc:45,
                 from BlinkToRadioAppC.nc:14:
In component `MessageBufferLayerP':
/opt/tinyos-2.x/tos/chips/rf230/MessageBufferLayerP.nc:230: conflicting
types fo
r `Send.getPayload'
/opt/tinyos-2.x/tos/interfaces/Send.nc:114: previous declaration of
`Send.getPay
load'
/opt/tinyos-2.x/tos/chips/rf230/MessageBufferLayerP.nc: In function
`Send.getPay
load':
/opt/tinyos-2.x/tos/chips/rf230/MessageBufferLayerP.nc:231: warning: passing
arg
ument 2 of `Packet.getPayload' makes pointer from integer without a cast
/opt/tinyos-2.x/tos/chips/rf230/MessageBufferLayerP.nc: In function
`deliverTask
.runTask':
/opt/tinyos-2.x/tos/chips/rf230/MessageBufferLayerP.nc:283: warning: passing
arg
ument 2 of `Packet.getPayload' makes pointer from integer without a cast
/opt/tinyos-2.x/tos/chips/rf230/MessageBufferLayerP.nc: At top level:
/opt/tinyos-2.x/tos/chips/rf230/MessageBufferLayerP.nc:48:
`Receive.payloadLengt
h' not implemented
/opt/tinyos-2.x/tos/chips/rf230/MessageBufferLayerP.nc:48:
`Receive.getPayload'
not implemented
In file included from /opt/tinyos-2.x/tos/chips/rf230/UniqueLayerC.nc:43,
                 from /opt/tinyos-2.x/tos/chips/rf230/DefaultMacC.nc:65,
                 from /opt/tinyos-2.x
/tos/platforms/iris/ActiveMessageC.nc:45,
                 from BlinkToRadioAppC.nc:14:
In component `UniqueLayerP':
/opt/tinyos-2.x/tos/chips/rf230/UniqueLayerP.nc:80: conflicting types for
`Send.
getPayload'
/opt/tinyos-2.x/tos/interfaces/Send.nc:114: previous declaration of
`Send.getPay
load'
/opt/tinyos-2.x/tos/chips/rf230/UniqueLayerP.nc: In function
`Send.getPayload':
/opt/tinyos-2.x/tos/chips/rf230/UniqueLayerP.nc:81: too many arguments to
functi
on `SubSend.getPayload'
In component `ActiveMessageC':
/opt/tinyos-2.x/tos/platforms/iris/ActiveMessageC.nc: At top level:
/opt/tinyos-2.x/tos/platforms/iris/ActiveMessageC.nc:57: no match
make: *** [exe0] Error 1
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to