uses interface SplitControl as SerialControl;
uses interface StdControl as RoutingControl;
uses interface StdControl as DisseminationControl;
- uses interface DisseminationValue<uint16_t> as DisseminationPeriod;
+ uses interface DisseminationValue<uint32_t> as DisseminationPeriod;
uses interface Send;
uses interface Leds;
uses interface Read<uint16_t> as ReadSensor;
void sendMessage() {
TestNetworkMsg* msg = (TestNetworkMsg*)call Send.getPayload(&packet, sizeof(TestNetworkMsg));
uint16_t metric;
- am_addr_t parent;
+ am_addr_t parent = 0;
call CtpInfo.getParent(&parent);
call CtpInfo.getEtx(&metric);
event void Timer.fired() {
- uint16_t nextInt;
+ uint32_t nextInt;
call Leds.led0Toggle();
dbg("TestNetworkC", "TestNetworkC: Timer fired.\n");
- nextInt = call Random.rand16() % SEND_INTERVAL;
+ nextInt = call Random.rand32() % SEND_INTERVAL;
nextInt += SEND_INTERVAL >> 1;
call Timer.startOneShot(nextInt);
if (!sendBusy)
}
event void DisseminationPeriod.changed() {
- const uint16_t* newVal = call DisseminationPeriod.get();
+ const uint32_t* newVal = call DisseminationPeriod.get();
call Timer.stop();
call Timer.startPeriodic(*newVal);
}