]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
- fix nwprog compile
authorsdhsdh <sdhsdh>
Sat, 19 Sep 2009 01:12:24 +0000 (01:12 +0000)
committersdhsdh <sdhsdh>
Sat, 19 Sep 2009 01:12:24 +0000 (01:12 +0000)
 - bring blip (almost) up to date with rf230

tos/chips/cc2420/lowpan/CC2420TinyosNetworkC.nc
tos/chips/cc2420/lowpan/CC2420TinyosNetworkP.nc
tos/lib/net/blip/IPDispatchC.nc
tos/lib/net/blip/nwprog/NWProgC.nc
tos/lib/net/blip/nwprog/NWProgP.nc

index 67e71d1ab089cf906a7b22c8ecc02a80187114e8..4c908ff606e0236f4201c20ef844ff9f7e70bcfc 100644 (file)
@@ -78,7 +78,7 @@ configuration CC2420TinyosNetworkC {
 implementation {
 
   enum {
-    TINYOS_N_NETWORKS = uniqueCount(IEEE154_SEND_CLIENT),
+    TINYOS_N_NETWORKS = uniqueCount("RADIO_SEND_CLIENT"),
   };
 
   components MainC;
index 96836dffa5770139c44782fc6c6533dd7b92ba24..634c08b0bac859b627332cb31cfb5d2663aa371b 100644 (file)
@@ -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;
index a90b7ed1f2489f52d5cf52fc95e8de60b8faf26b..ec7efc06ad693f3de34a598437d42b3074fd017f 100644 (file)
@@ -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;
index 960c538046cf6ebd7db5251c6026e3992a42fd51..330dcdb3f572fb54ba20bdcad0ea33d334110abe 100644 (file)
@@ -1,5 +1,4 @@
 
-#include <BinaryShell.h>
 #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;
index ddeebb096468068626c76f03aef1b3130fddb95c..81afca25bd238cd9ab64e36f82ecf2fc2eff0ab9 100644 (file)
@@ -1,7 +1,6 @@
 
 #include <Storage.h>
 #include <Shell.h>
-#include <BinaryShell.h>
 #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 <imgno> [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; }