yes I am. it blinks the led if I put FAIL as condition On Thu, Apr 29, 2010 at 1:27 PM, avinash chaurasia < [email protected]> wrote:
> call AMSend.send(AM_BROADCAST_ADDR, &packet, sizeof(my_msg_t)) returns > different type of error messages are you sure it returns FAIL? or something > else like EOFF? > Thanks > Avinash Kumar Chaurasia > Department of Computer Science > IIT Kanpur, India > > > On Fri, Apr 30, 2010 at 12:43 AM, Roberto Pagliari < > [email protected]> wrote: > >> Hi All, >> I'm having trouble with sending packets, I just moved from tinyos 1 to >> tinyos 2. In the following code a node should blinkwhen a packet is >> received. The problem is that no packets are sent. AMSend.send, apparently, >> always returns FAIL. Does anybody know if I am missing something? >> >> Thanks >> >> >> >> event void Timer0.fired() >> { >> //dbg("BlinkC", "Timer 0 fired @ %s.\n", sim_time_string()); >> my_msg_t* rcm = (my_msg_t*)call Packet.getPayload(&packet, >> sizeof(my_msg_t)); >> if (rcm == NULL) { >> return; >> } >> // call Leds.led0Toggle(); >> rcm->color = value; >> if (call AMSend.send(AM_BROADCAST_ADDR, &packet, sizeof(my_msg_t)) == >> SUCCESS) { >> dbg("RadioCountToLedsC", "RadioCountToLedsC: packet sent.\n", >> counter); >> call Leds.led0Toggle(); >> locked = TRUE; >> } >> call Timer0.startOneShot( (call Random.rand32()) % 2048 + 100 ); >> } >> >> event message_t* Receive.receive(message_t* bufPtr, void* payload, >> uint8_t len) { >> call Leds.led1Toggle(); >> return bufPtr; >> } >> >> _______________________________________________ >> Tinyos-help mailing list >> [email protected] >> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help >> > > -- Roberto Pagliari
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
