[Tinyos-help] Can someone please help?

Daniele ufoman1900 at libero.it
Tue Sep 13 08:29:36 PDT 2005



I have an error while make the follow component CountRadioC:

mkdir -p build/telosb

com

CountRadioC.nc:9: cannot find `CountLedsM'

make: *** [exe0] Error 1

piling CountRadioC to a telosb binary

Follow there is CountRadioC :

includes CountMsg;

configuration CountRadioC {

}

implementation {

components Main, CountRadioM, TimerC, LedsC, GenericComm;


Main.StdControl-> GenericComm;

Main.StdControl -> TimerC;

Main.StdControl -> CountLedsM;

CountRadioM.Timer -> TimerC.Timer[unique("Timer")];

CountRadioM.Leds -> LedsC;

CountRadioM.SendMsg->GenericComm.SendMsg[AM_COUNTMSG];

CountRadioM.ReceiveMsg->GenericComm.ReceiveMsg[AM_COUNTMSG];

}

While CountRadioM is: 

includes CountMsg;

module CountRadioM {

provides interface StdControl;

uses interface Timer;

uses interface Leds; 

uses interface SendMsg;

uses interface ReceiveMsg;


}

implementation 

{

uint16_t m_value;

TOS_Msg m_msg;

bool m_is_sending; 

command result_t StdControl.init() {

m_value=0;

m_is_sending=FALSE; 

call Leds.init();

return SUCCESS;

}

command result_t StdControl.start() 

{

if(TOS_LOCAL_ADDRESS == 1) 

{

call Timer.start(TIMER_REPEAT,250);

}

return SUCCESS;

}

command result_t StdControl.stop()

{

return SUCCESS;

}

void sendValue(uint16_t value) 

{ 

if(m_is_sending == FALSE) 

{

CountMsg_t* body = (CountMsg_t*)m_msg.data;

body->n=value;

body->src =TOS_LOCAL_ADDRESS;

if (call SendMsg.send(TOS_BCAST_ADDR,sizeof(CountMsg_t),&m_msg)== SUCCESS)

{

m_is_sending=TRUE;

}

}

}

event result_t Timer.fired()

{ m_value++;

call Leds.set(m_value);

sendValue(m_value);

return SUCCESS;

} 

event result_t SendMsg.sendDone(TOS_MsgPtr msg,result_t result)

{ m_is_sending=FALSE;

return SUCCESS;

}

event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr msg)

{ if (TOS_LOCAL_ADDRESS!=1) 

{CountMsg_t* body=(CountMsg_t*)msg->data;

call Leds.set(body->n);

}

return msg;

}

}

Daniele

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20050913/246e0fd2/attachment.html


More information about the Tinyos-help mailing list