Hello All,
I would like to read the hop count from a received packet using CTP.
Archives suggest using the THL value for this. Currently this is my
implementation, but I always get a value of 0 regardless of the number of
hops. Also the warning during compilation is shown below.

structure definition:
 typedef nx_struct EasyCollectionMsg {
   nx_uint16_t data;
   nx_uint16_t hopcount;
}

event message_t* Receive.receive(message_t* msg, void* payload, uint8_t len)
{
  call Leds.led1Toggle();
  recpkt = *(EasyCollectionMsg*)payload;

          uint8_t metric;
          call CtpPacket.getThl(&metric);
          recpkt.hopcount = metric;
          printf(" hop count: %u\n", recpkt.hopcount);

....
}

EasyCollectionC.nc:161: warning: passing argument 1 of
'EasyCollectionC__CtpPacket__getThl' from incompatible pointer type


I'm not sure why the pointer is incompatible, and why the hop count does not
get updated. Any help is appreciated.

Thanks,
Ellen

-- 
Columbia University
MS Electrical Engineering
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to