UDPversion

Dependencies:   XBee mbed NetServicesMin

Revision:
1:3a46d2725374
Parent:
0:84a3b029656e
--- a/main.cpp	Sat Apr 14 03:53:45 2012 +0000
+++ b/main.cpp	Sun Apr 15 10:49:08 2012 +0000
@@ -1,4 +1,7 @@
 #include "mbed.h"
+
+Serial pc(USBTX, USBRX);
+
 #include "xbee_lib.h"
 #include "EthernetNetIf.h"
 #include "config.h"
@@ -8,18 +11,16 @@
 
 #include "leds.h"
 
-Serial pc(USBTX, USBRX);
+#include "data_models.h"
 
 volatile PrefServer pref;
+volatile PrefSender spref;
+volatile PrefReciever rpref;
 
 EthernetNetIf eth ;   
 
 Ticker connectCheck;
 
-//#ifdef _SERVER_TEST_MODE_
-
-#include "data_models.h"
-
 DigitalIn  recSw(p20);
 Timeout chatter;
 bool isPressed;
@@ -66,7 +67,7 @@
 }
 
 
-//#endif
+
 
 
 
@@ -76,10 +77,7 @@
     
     pc.baud(115200);
 
-//    #ifdef _SERVER_TEST_MODE_
-    testModeInit();
-//    #endif
-    
+   
     uint8_t tmpip[4]={kSserverIp};
     uint8_t tmpsubnet[4]={kSubnetMask};
     uint8_t tmprt[4]={kRouterIp};
@@ -90,6 +88,12 @@
         IpAddr(kRouterIp),     // Default Gateway
         IpAddr(kRouterIp)      // DNS Server
     ) ;
+    
+    #ifdef _SERVER_TEST_MODE_
+    pc.printf("*.*.*.*.*.*.*.   T E S T  M O D E *.*.*.*.*.*.*.*.*.*.\n");
+    testModeInit(); 
+    #endif
+    
 
     if( eth.setup() != ETH_OK )
     {
@@ -127,14 +131,14 @@
         Net::poll();
        
         
-  //      #ifdef _SERVER_TEST_MODE_
+        #ifdef _SERVER_TEST_MODE_
         if(!recSw){
             testSendRecieveData();
             wait(0.5);
         }
-  //     #else
+       #else
         xbeeRecieveRouting();
-  //       #endif
+         #endif
         if(healthiPad)  ledTcpConnect(false);
         else            ledTcpConnect(true);