我想计算 RPL Contiki 3 中模拟 Z1 微尘的剩余电池电量。我使用 energest 模块打印以下值:
all_cpu = energest_type_time(ENERGEST_TYPE_CPU);
all_lpm = energest_type_time(ENERGEST_TYPE_LPM);
all_transmit = energest_type_time(ENERGEST_TYPE_TRANSMIT);
all_listen = energest_type_time(ENERGEST_TYPE_LISTEN);
all_idle_transmit = compower_idle_activity.transmit;
all_idle_listen = compower_idle_activity.listen;
cpu = all_cpu - last_cpu;
lpm = all_lpm - last_lpm;
transmit = all_transmit - last_transmit;
listen = all_listen - last_listen;
idle_transmit = compower_idle_activity.transmit - last_idle_transmit;
idle_listen = compower_idle_activity.listen - last_idle_listen;
last_cpu = energest_type_time(ENERGEST_TYPE_CPU);
last_lpm = energest_type_time(ENERGEST_TYPE_LPM);
last_transmit = energest_type_time(ENERGEST_TYPE_TRANSMIT);
last_listen = energest_type_time(ENERGEST_TYPE_LISTEN);
last_idle_listen = compower_idle_activity.listen;
last_idle_transmit = compower_idle_activity.transmit;
我应该对这些值使用什么公式来计算模拟节点中的剩余电池?
谢谢