XBee-mbed library http://mbed.org/users/okini3939/notebook/xbee-mbed/

Dependents:   device_server_udp led_sender_post XBee_API_ex1 XBee_API_ex2 ... more

Files at this revision

API Documentation at this revision

Comitter:
okini3939
Date:
Wed Dec 18 02:24:33 2013 +0000
Parent:
5:547cfff7adf7
Child:
7:b36422ef864f
Commit message:
add XBee_conf.h

Changed in this revision

XBee.cpp Show annotated file Show diff for this revision Revisions of this file
XBee.h Show annotated file Show diff for this revision Revisions of this file
XBeeWiFi.cpp Show annotated file Show diff for this revision Revisions of this file
XBeeWiFi.h Show annotated file Show diff for this revision Revisions of this file
XBee_conf.h Show annotated file Show diff for this revision Revisions of this file
--- a/XBee.cpp	Tue Mar 13 09:11:35 2012 +0000
+++ b/XBee.cpp	Wed Dec 18 02:24:33 2013 +0000
@@ -28,6 +28,8 @@
 //#define DEBUG
 #include "dbg.h"
 
+#include "XBee_conf.h"
+
 #include "mbed.h"
 #include "XBee.h"
 
--- a/XBee.h	Tue Mar 13 09:11:35 2012 +0000
+++ b/XBee.h	Wed Dec 18 02:24:33 2013 +0000
@@ -25,6 +25,8 @@
  * @brief XBee library for mbed
  */
 
+#include "XBee_conf.h"
+
 #ifndef XBee_h
 #define XBee_h
 
--- a/XBeeWiFi.cpp	Tue Mar 13 09:11:35 2012 +0000
+++ b/XBeeWiFi.cpp	Wed Dec 18 02:24:33 2013 +0000
@@ -8,6 +8,9 @@
  * @brief XBee Wi-Fi library for mbed
  */
 
+#include "XBee_conf.h"
+#ifdef ENABLE_XBEE_WIFI
+
 //#define DEBUG
 #include "dbg.h"
 
@@ -18,7 +21,6 @@
 
 #define REVERSE_ENDIAN(x) (uint16_t)(((uint16_t)x >> 8) | ((uint16_t)x << 8))
 
-#ifdef USE_WIFICLASS
 XBeeWiFi::XBeeWiFi (PinName p_tx, PinName p_rx, PinName p_cts, PinName p_rts) : XBee(p_tx, p_rx, p_cts, p_rts) {
 }
 
@@ -455,8 +457,6 @@
 }
 #endif
 
-#endif
-
 
 IPv4TransmitRequest::IPv4TransmitRequest() : PayloadRequest(IPv4_TRANSMIT_REQUEST, DEFAULT_FRAME_ID, NULL, 0) {
 }
@@ -593,3 +593,6 @@
 uint16_t IPV4RxFrame::getDataLength() {
     return getPacketLength() - getDataOffset() - 1;
 }
+
+#endif
+
--- a/XBeeWiFi.h	Tue Mar 13 09:11:35 2012 +0000
+++ b/XBeeWiFi.h	Wed Dec 18 02:24:33 2013 +0000
@@ -8,6 +8,9 @@
  * @brief XBee Wi-Fi library for mbed
  */
 
+#include "XBee_conf.h"
+#ifdef ENABLE_XBEE_WIFI
+
 #ifndef XBeeWiFi_h
 #define XBeeWiFi_h
 
@@ -16,9 +19,6 @@
 #include "XBee.h"
 #include <inttypes.h>
 
-#define USE_WIFICLASS
-#define USE_WIFIDNS
-
 // the non-variable length of the frame data (not including frame id or api id or variable data size (e.g. payload, at command set value)
 #define IPv4_TRANSMIT_REQUEST_API_LENGTH 10
 
@@ -98,7 +98,6 @@
 } __attribute__((packed)); 
 
 
-#ifdef USE_WIFICLASS
 /**
  * Primary interface for communicating with an XBee Wi-Fi.
  */
@@ -136,7 +135,6 @@
     IpAddr _nameserver;
     int _nameport;
 };
-#endif
 
 /**
  * Represents a Wi-Fi TX packet that corresponds to Api Id: IPv4_TRANSMIT_REQUEST
@@ -204,3 +202,4 @@
 };
 
 #endif //XBeeWiFi_h
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/XBee_conf.h	Wed Dec 18 02:24:33 2013 +0000
@@ -0,0 +1,8 @@
+#ifndef XBee_conf_h
+#define XBee_conf_h
+
+#define ENABLE_XBEE_WIFI
+
+#undef USE_WIFIDNS
+
+#endif