Download XMesh User's Manual

Transcript
XMesh User’s Manual
10.2.2 XOTAPLiteM
The XOtapLoader programmed can be wired into the user’s application as follows: In the
Application component file, add the following wiring:
implementation {
……
……
MyAppM.XOtapLoader -> MULTIHOPROUTER;
}
In the Application module file add the following component interface and the command:
module MyAppM {
provides {
…
…;
}
uses {
…
interface XOtapLoader;
…
}
Also add the command response command to check with the application if it can be interrupted
before rebooting to another image. If the application is in the middle of a state, it can properly
complete its actions and leave the mote in a known state before resetting:
event result_t XOtapLoader.boot_request(uint8_t imgId) {
call XOtapLoader.boot(imgId);
return SUCCESS;
}
Once the mote receives the boot command and the application gives a go-ahead on the reboot, it
will schedule the reboot time based on how far away it is from the base, in other words, the
closer it is to the base, the longer it should delay for the reboot, so that children won’t lose
pending downstream messages due to the reboot of their parents. The Table 10-2 shows the delay
time for the reboot.
Table 10-2. Delay times for reboot
Hop_count
Page 84
Delay (sec)
≥5
2
4
4
3
6
2
8
1
10
Doc.# 7430-0108-01 Rev. D