Hi all,

I am working on a scenario in Blip which using UDPEcho is a case. I define a
UDPMsg as a newUDPSocket() for receiving UDP packets and sending as well. In
this regard, I programmed two motes and the basestation to see how are they
working together. so here are my misunderstandings:

1- Two motes with modified UDPEcho wants to send and receive packets to each
other, there are a LED which shows the receiving and sending packets. When I
run only these two motes only sending is correct but receiving part does not
carry out but When I connected IPBasestation LEDs start working.
I have some ideas but I am not sure about them.  please help me in this
regard that I can figure out my problem.

2- When I receive a packet in one of the motes, I wanted to do some
modification on it and send it again. How can I do this? I have some similar
codes but it seems that some parts have problem which cause failure in
sending. here are my codes:

 event void UDPMsg.recvfrom(struct sockaddr_in6 *from, void *data,
                           uint16_t len, struct ip_metadata *meta) {



     nx_struct udp_report UDPMsg;
     bool busy = FALSE;


      struct sockaddr_in6 dest_sock;
      dest_sock.sin6_port = hton16(7070);
      CHECK_NODE_ID;


    call Leds.led0Toggle();
    if (!busy) {

    uint16_t Verf = stats.Etemprature; // I have tried UDPMsg.Etemprature,
but still does not  work
   //  I have added Etemprature in UDP_Report header file.

    Verf = Verf ^ 15;
       if ( Verf == (stats.Esmac23)){
        call Leds.led1Toggle();
        busy = TRUE;

        UDPMsg = stats;

        inet_pton6("fec0::3", &dest_sock.sin6_addr);
        call UDPMsg.sendto(&dest_sock, &UDPMsg, len);
        call Leds.led2Toggle();
       }
    }

   }

When I connected IPBasestation only led0 toggles in the above receiving
function. but the rest of the leds don`t work which I aaume that the
highlighted section is wrong.
I have tried sending stats without changing anything but it does not work
either.

3- actually I want to see the packets in wireshark wich when there is only
one mote I can see everything. but when I brought  second node to the
network just Echo part is working and I can see only ICMP, but not the data.
I am not sure what is going on.

Any help will highly appreciated.

Regards,
Hamidreza
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to