From: sdhsdh Date: Sat, 19 Sep 2009 01:12:24 +0000 (+0000) Subject: - fix nwprog compile X-Git-Tag: rc_6_tinyos_2_1_1~231 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=a204747d5b2777881dcef2cab3c85252048765b2 - fix nwprog compile - bring blip (almost) up to date with rf230 --- diff --git a/tos/chips/cc2420/lowpan/CC2420TinyosNetworkC.nc b/tos/chips/cc2420/lowpan/CC2420TinyosNetworkC.nc index 67e71d1a..4c908ff6 100644 --- a/tos/chips/cc2420/lowpan/CC2420TinyosNetworkC.nc +++ b/tos/chips/cc2420/lowpan/CC2420TinyosNetworkC.nc @@ -78,7 +78,7 @@ configuration CC2420TinyosNetworkC { implementation { enum { - TINYOS_N_NETWORKS = uniqueCount(IEEE154_SEND_CLIENT), + TINYOS_N_NETWORKS = uniqueCount("RADIO_SEND_CLIENT"), }; components MainC; diff --git a/tos/chips/cc2420/lowpan/CC2420TinyosNetworkP.nc b/tos/chips/cc2420/lowpan/CC2420TinyosNetworkP.nc index 96836dff..634c08b0 100644 --- a/tos/chips/cc2420/lowpan/CC2420TinyosNetworkP.nc +++ b/tos/chips/cc2420/lowpan/CC2420TinyosNetworkP.nc @@ -65,7 +65,7 @@ implementation { enum { OWNER_NONE = 0xff, - TINYOS_N_NETWORKS = uniqueCount(IEEE154_SEND_CLIENT), + TINYOS_N_NETWORKS = uniqueCount("RADIO_SEND_COUNT"), } state; norace uint8_t resource_owner = OWNER_NONE, next_owner; diff --git a/tos/lib/net/blip/IPDispatchC.nc b/tos/lib/net/blip/IPDispatchC.nc index a90b7ed1..ec7efc06 100644 --- a/tos/lib/net/blip/IPDispatchC.nc +++ b/tos/lib/net/blip/IPDispatchC.nc @@ -50,10 +50,14 @@ configuration IPDispatchC { IPDispatchP.Boot -> MainC; +#ifdef IEEE154FRAMES_ENABLED + IPDispatchP.Ieee154Send -> MessageC; +#else components ResourceSendP; ResourceSendP.SubSend -> MessageC; - ResourceSendP.Resource -> MessageC.SendResource[unique(IEEE154_SEND_CLIENT)]; + ResourceSendP.Resource -> MessageC.SendResource[unique("RADIO_SEND_RESOURCE")]; IPDispatchP.Ieee154Send -> ResourceSendP.Ieee154Send; +#endif IPDispatchP.Ieee154Receive -> MessageC.Ieee154Receive; IPDispatchP.Packet -> MessageC.Packet; diff --git a/tos/lib/net/blip/nwprog/NWProgC.nc b/tos/lib/net/blip/nwprog/NWProgC.nc index 960c5380..330dcdb3 100644 --- a/tos/lib/net/blip/nwprog/NWProgC.nc +++ b/tos/lib/net/blip/nwprog/NWProgC.nc @@ -1,5 +1,4 @@ -#include #include "StorageVolumes.h" #include "Deluge.h" @@ -41,13 +40,8 @@ configuration NWProgC { NWProgP.BlockRead[VOLUME_DELUGE2] -> BlockReaderDeluge2; NWProgP.BlockRead[VOLUME_DELUGE3] -> BlockReaderDeluge3; -#ifdef BINARY_SHELL - components BinaryShellC; - NWProgP.ShellCommand -> BinaryShellC.BinaryCommand[BSHELL_NWPROG]; -#else components new ShellCommandC("nwprog"); NWProgP.ShellCommand -> ShellCommandC; -#endif components new TimerMilliC(); NWProgP.RebootTimer -> TimerMilliC; diff --git a/tos/lib/net/blip/nwprog/NWProgP.nc b/tos/lib/net/blip/nwprog/NWProgP.nc index ddeebb09..81afca25 100644 --- a/tos/lib/net/blip/nwprog/NWProgP.nc +++ b/tos/lib/net/blip/nwprog/NWProgP.nc @@ -1,7 +1,6 @@ #include #include -#include #include "imgNum2volumeId.h" #include "Deluge.h" #include "PrintfUART.h" @@ -20,11 +19,7 @@ module NWProgP { event void storageReady(); -#ifdef BINARY_SHELL - interface BinaryCommand as ShellCommand; -#else interface ShellCommand; -#endif } } implementation { @@ -278,45 +273,21 @@ module NWProgP { char *reply_buf = call ShellCommand.getBuffer(MAX_REPLY_LEN); if (error == SUCCESS) { if (ident->uidhash != DELUGE_INVALID_UID) { -#ifdef BINARY_SHELL - nx_struct cmd_payload *payload = (nx_struct cmd_payload *)reply_buf; - prog_req_t *rep = (prog_req_t *)payload->data; - nx_struct ShortDelugeIdent *i = (nx_struct ShortDelugeIdent *)rep->data; - rep->cmd = NWPROG_CMD_IMAGEIFO; - rep->imgno = volumeID2imgNum(imgNum); - memcpy(i->appname, ident->appname, 16); - memcpy(i->username, ident->username, 16); - memcpy(i->hostname, ident->hostname, 16); - i->timestamp = ident->timestamp; - nwprog_validvols++; - call ShellCommand.write(payload, sizeof(nx_struct cmd_payload) + - sizeof(prog_reply_t) + sizeof(nx_struct ShortDelugeIdent)); - -#else len = snprintf(reply_buf, MAX_REPLY_LEN, "image: %i\n\t[size: %li]\n\t[app: %s]\n\t[user: %s]\n\t[host: %s]\n\t[arch: %s]\n\t[time: 0x%lx]\n", volumeID2imgNum(imgNum), ident->size, (char *)ident->appname, (char *) ident->username, (char *)ident->hostname, (char *)ident->platform, (uint32_t)ident->timestamp); nwprog_validvols++; call ShellCommand.write(reply_buf, len); -#endif } } if (++nwprog_currentvol < DELUGE_NUM_VOLUMES) { call DelugeMetadata.read(imgNum2volumeId(nwprog_currentvol)); } else { -#ifdef BINARY_SHELL - nx_struct cmd_payload *payload = (nx_struct cmd_payload *)reply_buf; - prog_req_t *rep = (prog_req_t *)payload->data; - rep->cmd = NWPROG_CMD_READDONE; - rep->cmd_data.nimages = nwprog_validvols; - call ShellCommand.write(payload, sizeof(nx_struct cmd_payload) + sizeof(prog_req_t)); -#else len = snprintf(reply_buf, MAX_REPLY_LEN, "%i valid image(s)\n", nwprog_validvols); call ShellCommand.write(reply_buf, len); -#endif } } @@ -324,32 +295,6 @@ module NWProgP { call BootImage.boot(boot_image); } -#ifdef BINARY_SHELL - event void ShellCommand.dispatch(nx_struct cmd_payload *data, int len) { - nx_struct prog_req *req = (nx_struct prog_req *)data->data; - nx_struct cmd_payload *rep; - prog_reply_t *rc; - int error = NWPROG_ERROR_OK; - - switch (req->cmd) { - case NWPROG_CMD_LIST: - nwprog_currentvol = 0; - nwprog_validvols = 0; - call DelugeMetadata.read(imgNum2volumeId(nwprog_currentvol)); - return; - break; - case NWPROG_CMD_BOOT: - call ShellCommand.write(data, len); - - boot_image = imgNum2volumeId(req->imgno); - call RebootTimer.startOneShot(req->cmd_data.when); - break; - case NWPROG_CMD_REBOOT: - call BootImage.reboot(); - break; - } - } -#else event char *ShellCommand.eval(int argc, char **argv) { char *nwprog_help_str = "nwprog [list | boot [when] | reboot]\n"; if (argc >= 2) { @@ -381,7 +326,6 @@ module NWProgP { } return nwprog_help_str; } -#endif default command error_t BlockWrite.write[uint8_t imgNum](storage_addr_t addr, void* buf, storage_len_t len) { return FAIL; } default command error_t BlockWrite.erase[uint8_t imgNum]() { return FAIL; }