tes

Dependencies:   ASyncTicker EthernetInterface WebSocketClient mbed-rtos mbed MbedJSONValue xbee_lib

Revision:
5:80a7d03c94f5
Parent:
4:84abfe990493
Child:
6:c1bd3fadce09
--- a/main.cpp	Sat Feb 01 01:37:50 2014 +0000
+++ b/main.cpp	Sat Feb 01 17:30:02 2014 +0000
@@ -1,17 +1,13 @@
-
 #include "mbed.h"
 #include "EthernetInterface.h"
 #include <stdio.h>
-#include <string.h>
 #include "Websocket.h"
-#include "Updateable.h"
-#include "ASyncTicker.h"
 #include "xbee.h"
 #include "xbeeFrame.h"
 #include "MbedJSONValue.h"
 #include <ctype.h>
 #include <string>
-
+#include "btNode.h"
 #define PORT 80
 
 // status leds
@@ -26,20 +22,31 @@
 EthernetInterface ethernet;
 Websocket         ws("ws://192.168.0.4:8080/");
 
+
+btNode b(30);
+
+/* v1 depreciated
+
 xbeeFrame xbee(p9,
                p10,
                p11);
 
-const char dest_address[8] =
+
+
+char dest_address[8] =
 {
     0x00, 0x13, 0xA2, 0x00, 0x40, 0x9B, 0x6D, 0xB0
 };
 char       send_data[50]   = "xbee string";
 
+*/
+
 void pull_requests()
 {
 }
 
+
+
 void pull_updates()
 {
     // build json request string
@@ -98,7 +105,15 @@
             // data was revieved
             printf("id :  %s  string: %s (original: %s) \n\r", id, new_msg, str);
         }
-
+        
+        std::string real_msg(new_msg);
+        
+        std::string result = b.SendMessage(real_msg);
+        
+        printf("xbee response : %s\n\r\n\r", result);
+        
+        
+/* V1 DEPRECIATED
         char   to_send[100];
         char * p = to_send;
         char * r = send_data;
@@ -153,11 +168,17 @@
                 }
             }
         }
-    }
+    } 
+    */
+}
 }
 
 int main()
 {
+    
+    
+    
+    
     led_ethernet = 0;
     led_socket   = 0;