Xbee API library with support SPI connection. (use only SPI supported model. see also http://www.digi.com/support/kbase/kbaseresultdetl?id=3362 )

Dependents:   XBeeWiFi_SPI_example

Fork of XBee by Suga koubou

Revision:
9:e32c2e5390d3
Parent:
8:dd519c8ac6f7
Child:
10:eb70be6ceb6d
--- a/XBeeWiFi.cpp	Tue Dec 31 05:31:24 2013 +0000
+++ b/XBeeWiFi.cpp	Fri Jan 03 03:33:03 2014 +0000
@@ -21,8 +21,16 @@
 
 #define REVERSE_ENDIAN(x) (uint16_t)(((uint16_t)x >> 8) | ((uint16_t)x << 8))
 
+#ifdef XBEE_USE_UART
 XBeeWiFi::XBeeWiFi (PinName p_tx, PinName p_rx, PinName p_cts, PinName p_rts) : XBee(p_tx, p_rx, p_cts, p_rts) {
 }
+#endif
+
+#ifdef XBEE_USE_SPI
+XBeeWiFi::XBeeWiFi (PinName p_mosi, PinName p_miso, PinName p_sclk, PinName p_ssel, PinName p_attn, PinName p_reset) :
+    XBee(p_mosi, p_miso, p_sclk, p_ssel, p_attn, p_reset) {
+}
+#endif
 
 int XBeeWiFi::setup (int security, const char *ssid, const char *pin) {
     int len, r;
@@ -112,9 +120,11 @@
     send(atRequest);
     r = getWiResponse(AT_COMMAND_RESPONSE, atRequest.getFrameId());
 
+#ifdef XBEE_USE_UART
     if (r == 0) {
         begin(b);
     }
+#endif
     return r;
 }