46 #include "contiki-conf.h"
63 static uint32_t last_listen, last_transmit;
64 uint32_t listen, transmit;
68 listen = energest_type_time(ENERGEST_TYPE_LISTEN);
69 e->listen += listen - last_listen;
72 transmit = energest_type_time(ENERGEST_TYPE_TRANSMIT);
73 e->transmit += transmit - last_transmit;
74 last_transmit = transmit;
80 e->listen = e->transmit = 0;
86 packetbuf_set_attr(PACKETBUF_ATTR_LISTEN_TIME,
87 packetbuf_attr(PACKETBUF_ATTR_LISTEN_TIME) + e->listen);
88 packetbuf_set_attr(PACKETBUF_ATTR_TRANSMIT_TIME,
89 packetbuf_attr(PACKETBUF_ATTR_TRANSMIT_TIME) + e->transmit);
95 e->listen += packetbuf_attr(PACKETBUF_ATTR_LISTEN_TIME);
96 e->transmit += packetbuf_attr(PACKETBUF_ATTR_TRANSMIT_TIME);