[Tinyos-help] send packet

Roberto Pagliari robertodemedici at gmail.com
Thu Apr 29 14:43:59 PDT 2010


are you using tinyos 2.1.1?

On Thu, Apr 29, 2010 at 1:55 PM, Roberto Pagliari <robertodemedici at gmail.com
> wrote:

> yes I am. it blinks the led if I put FAIL as condition
>
>
> On Thu, Apr 29, 2010 at 1:27 PM, avinash chaurasia <
> avinash.aviank2003 at gmail.com> 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 <
>> robertodemedici at gmail.com> 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
>>> Tinyos-help at millennium.berkeley.edu
>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>
>>
>>
>
>
> --
> Roberto Pagliari
>



-- 
Roberto Pagliari
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20100429/5cb57b1f/attachment.htm 


More information about the Tinyos-help mailing list