Well, now that I'm at it, should have send it in the first place
configuration EasyDisseminationAppC {}
implementation {
components EasyDisseminationC, DisseminationC;
components MainC;
EasyDisseminationC.Boot -> MainC;
EasyDisseminationC.DisseminationControl -> DisseminationC;
components ActiveMessageC;
EasyDisseminationC.RadioControl -> ActiveMessageC.SplitControl;
components new DisseminatorC(uint16_t, 0x1234) as Diss16C;
EasyDisseminationC.Value -> Diss16C;
EasyDisseminationC.Update -> Diss16C;
components LedsC;
EasyDisseminationC.Leds -> LedsC;
components new TimerMilliC();
EasyDisseminationC.Timer -> TimerMilliC;
}
/***************** EasyDisseminationC *********************************/
#include <Timer.h>
module EasyDisseminationC {
uses interface Boot;
uses interface DisseminationValue<uint16_t> as Value;
uses interface DisseminationUpdate<uint16_t> as Update;
uses interface Leds;
uses interface Timer<TMilli>;
uses interface StdControl as DisseminationControl;
uses interface SplitControl as RadioControl;
}
implementation {
uint16_t counter;
task void ShowCounter() {
call Leds.set(counter);
}
event void Boot.booted() {
counter = 0;
call RadioControl.start();
}
event void RadioControl.startDone(error_t err) {
if (err != SUCCESS) { call RadioControl.start(); return; }
call DisseminationControl.start();
if ( TOS_NODE_ID == 0 ) {
call Value.set( &counter );
call Timer.startPeriodic(2000);
}
}
event void RadioControl.stopDone(error_t err) {
}
event void Timer.fired() {
/* rest unchanged */
[...]
Hugo
On 6/7/07, Hugo Sousa <[EMAIL PROTECTED]> wrote:
Found out why the errors, there is no component (and interface) to
turn on the radio in the EasyDissemination example; from what I see in
the nesdoc 2.0.0 Dissemination was a bit different from what is now,
and was able to turn on the radio. The EasyDissemination example
hasn't been updated.
Regards,
Hugo
On 6/5/07, Hugo Sousa <[EMAIL PROTECTED]> wrote:
> I get these errors (no errors or warnings present with "make micaz")
>
> In file included from /opt/tinyos-2.x/tos/lib/net/TrickleTimerMilliC.nc:50,
> from /opt/tinyos-2.x/tos/lib/net/DisseminationTimerP.nc:49,
> from /opt/tinyos-2.x/tos/lib/net/DisseminatorC.nc:66,
> from EasyDisseminationAppC.nc:8:
> In component `TrickleTimerImplP':
> /opt/tinyos-2.x/tos/lib/net/TrickleTimerImplP.nc: In function `adjustTimer':
> /opt/tinyos-2.x/tos/lib/net/TrickleTimerImplP.nc:215: warning: declaration of
`t
> ime' shadows global declaration
> /usr/include/time.h:49: warning: location of shadowed declaration
> /opt/tinyos-2.x/tos/lib/net/TrickleTimerImplP.nc: In function `generateTime':
> /opt/tinyos-2.x/tos/lib/net/TrickleTimerImplP.nc:247: warning: declaration of
`t
> ime' shadows global declaration
> /usr/include/time.h:49: warning: location of shadowed declaration
> In component `TossimPacketModelC':
> /opt/tinyos-2.x/tos/lib/tossim/TossimPacketModelC.nc: In function
`startDoneTask
> .runTask':
> /opt/tinyos-2.x/tos/lib/tossim/TossimPacketModelC.nc:85: Control.startDone
not c
> onnected
> /opt/tinyos-2.x/tos/lib/tossim/TossimPacketModelC.nc: In function
`stopDoneTask.
> runTask':
> /opt/tinyos-2.x/tos/lib/tossim/TossimPacketModelC.nc:90: Control.stopDone not
co
> nnected
> make: *** [sim-exe] Error 1
>
> What is the problem?
>
> Another thing, I couldn't compile the program with the makefile
> provided, I had to chage
> CFLAGS += -I$(TOSDIR)/lib/net
> to
> PFLAGS += -I$(TOSDIR)/lib/net
>
> Thanks in advance,
>
> Hugo Sousa
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help