[Tinyos-help] needed help in AMSend.send

avinash chaurasia avinash.aviank2003 at gmail.com
Tue Apr 6 10:22:08 PDT 2010


I am using AMSend.Send() but it returns EOFF every time. Below is the code
snippet that i am using

command void Channel.send(uint16_t node, uint8_t *msgP) {
      //dbg("DBG_USR1","sending packet");
      int i,len=0;
      error_t err;
      if(!busy)
      {
        com_packet_t *payload =(com_packet_t *)(call
Packet.getPayload(&packet,sizeof(com_packet_t)));
        if(payload){
          payload->addr = node;
          payload->length = 29;
          len = sizeof(msgP);
          for(i=0;i<len;i++)
          payload->msgP[i] = msgP[i];
          node1 = node;
          msg1 = msgP;
        }
        counter =0;

        if ((err=call AMSend.send(AM_BROADCAST_ADDR, &packet,
sizeof(com_packet_t))) == SUCCESS) {
          busy = TRUE;
        }
        else if(err==EOFF)
        {
          dbg("DBG_USR1","EOFF\n");// this part of program always executed
        }
        else
        {
          dbg("DBG_USR1","Error\n");
        }
      }
    }
Thanks
Avinash Kumar Chaurasia



On Tue, Apr 6, 2010 at 2:36 PM, avinash chaurasia <
avinash.aviank2003 at gmail.com> wrote:

> whenever i call a function it returns value 4( i think i,e EOFF). how
> should i remove it. i using TOSSIM for simulations
> Thanks
> Avinash Kumar Chaurasia
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20100406/85d85f09/attachment-0001.htm 


More information about the Tinyos-help mailing list