X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Flib%2Fnet%2FDeluge%2FDelugeManagerP.nc;h=2417de6cf5c4cd80c7e1e794a301b0a177bde083;hb=041ffc35f76c6bb25838ec4953a5963c10d9328c;hp=15dbeedc0989f9c01178414f57cebba93e275347;hpb=ec690f3f7e3fa45a9865e618f2e609683633b95f;p=tinyos-2.x.git diff --git a/tos/lib/net/Deluge/DelugeManagerP.nc b/tos/lib/net/Deluge/DelugeManagerP.nc index 15dbeedc..2417de6c 100644 --- a/tos/lib/net/Deluge/DelugeManagerP.nc +++ b/tos/lib/net/Deluge/DelugeManagerP.nc @@ -55,6 +55,12 @@ implementation message_t serialMsg; DelugeCmd delugeCmd; + uint8_t imgNum2volumeId[] = { + VOLUME_GOLDENIMAGE, + VOLUME_DELUGE1, + VOLUME_DELUGE2, + VOLUME_DELUGE3 + }; void sendReply(error_t error) { @@ -85,14 +91,14 @@ implementation case DELUGE_CMD_ONLY_DISSEMINATE: case DELUGE_CMD_DISSEMINATE_AND_REPROGRAM: if (call Resource.immediateRequest() == SUCCESS) { - call DelugeMetadata.read(request->imgNum); + call DelugeMetadata.read(imgNum2volumeId[request->imgNum]); } else { sendReply(FAIL); } break; case DELUGE_CMD_REPROGRAM: case DELUGE_CMD_REBOOT: - delugeCmd.imgNum = request->imgNum; + delugeCmd.imgNum = imgNum2volumeId[request->imgNum]; call DelayTimer.startOneShot(1024); sendReply(SUCCESS); break;