Hi Senol,
AMPacket.isForMe(msg) returns a bool (and not error_t). Try this:
if(call AMPacket.isForMe(msg)) {
Cheers,
Urs
Senol Zafer ERDOGAN schrieb:
> Hi,
>
> i try to send a mail to a specific mote (mote0x1) and i use a sample code as
> follows:
>
> event void Timer0.fired() {
>
> if (call AMSend.send(0x1, &pkt, sizeof(message_t)) == SUCCESS) {
>
> call Leds.led2Toggle();
>
> }
>
> }
>
>
>
> and then when a Mote receives the message it checks the message and then if
> its for me, i will do something and its code as follows:
>
> event message_t* Receive.receive(message_t* msg, void* payload, uint8_t len) {
>
> if((call AMPacket.isForMe(msg))==SUCCESS)
>
> {
>
> call Leds.led1Toggle();
>
> }
>
> report_received();
>
> return msg;
>
> }
>
> and in command promt:
>
> #make tmote install,0x1
>
> #make tmote install,0x4
>
> one of them is mote0x1 and the other one is mote0x4
>
> these codes are compiled but when they work, Leds.led1Toggle() command isnt
> called. i couldnt find where i made a mistake.
>
> Thank you,
>
> Senol
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help