diff -purN /Users/jsloan/Desktop/Platinum/Applications/WiFly/Client.cpp /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/Client.cpp --- /Users/jsloan/Desktop/Platinum/Applications/WiFly/Client.cpp 2010-12-16 04:30:12.000000000 -0700 +++ /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/Client.cpp 1969-12-31 17:00:00.000000000 -0700 @@ -1,205 +0,0 @@ - -#include "WiFly.h" -#include "Client.h" - -Client::Client(uint8_t *ip, uint16_t port) : - _WiFly (WiFly), - stream (ParsedStream(SpiSerial)) { - // TODO: Find out why neither of the following work as expected. - // (The result of `read()` is always -1. ) - //stream (ParsedStream(_WiFly.uart)) { - //stream (ParsedStream(WiFly.uart)) { - /* - */ - _ip = ip; - _port = port; - _domain = NULL; - - isOpen = false; -} - - -Client::Client(const char* domain, uint16_t port) : - _WiFly (WiFly), - stream (ParsedStream(SpiSerial)) { - // TODO: Find out why neither of the following work as expected. - // (The result of `read()` is always -1. ) - //stream (ParsedStream(_WiFly.uart)) { - //stream (ParsedStream(WiFly.uart)) { - /* - */ - _ip = NULL; - _port = port; - _domain = domain; - - isOpen = false; -} - - -void Client::write(byte value) { - /* - */ - _WiFly.uart.write(value); -} - - -void Client::write(const char *str) { - /* - */ - _WiFly.uart.write(str); -} - - -void Client::write(const uint8_t *buffer, size_t size) { - /* - */ - _WiFly.uart.write(buffer, size); -} - - -boolean Client::connect() { - /* - */ - - // Handle case when Null object returned from Server.available() - if (!this) { - return false; - } - - // TODO: Implement this better - - stream.reset(); - - if ((_ip == NULL) && (_domain == NULL)) { - // This is a connection started by the Server class - // so the connection is already established. - } else { - // TODO: Track state more? - _WiFly.enterCommandMode(); - - _WiFly.sendCommand("open ", true, "" /* TODO: Remove this dummy value */); - - if (_ip != NULL) { - for (int index = 0; /* break inside loop*/ ; index++) { - _WiFly.uart.print(_ip[index], DEC); - if (index == 3) { - break; - } - _WiFly.uart.print('.'); - } - } else if (_domain != NULL) { - _WiFly.uart.print(_domain); - } else { - while (1) { - // This should never happen - } - } - - _WiFly.uart.print(" "); - - _WiFly.uart.print(_port, DEC); - - _WiFly.sendCommand("", false, "*OPEN*"); - - // TODO: Handle connect failure - } - - isOpen = true; - - return true; -} - - -int Client::available() { - /* - */ - if (!isOpen) { - return 0; - } - - return stream.available(); -} - - -int Client::read() { - /* - */ - if (!isOpen) { - return -1; - } - - return stream.read(); -} - - -void Client::flush(void) { - /* - */ - if (!isOpen) { - return; - } - - while (stream.available() > 0) { - stream.read(); - } -} - - -bool Client::connected() { - /* - */ - // TODO: Set isOpen to false once we know the stream is closed? - return isOpen && !stream.closed(); -} - - -void Client::stop() { - /* - */ - // TODO: Work out if there's some unintended compatibility issues - // related to interactions between `stop()`, `connected()` and - // `available()`. - - // This stop implementation is suboptimal. We need to handle the case - // of a server connection differently to a client connection. - // We also need to handle better detecting if the connection is already - // closed. - // In the interests of getting something out the door--that somewhat - // works--this is what we're going with at the moment. - - _WiFly.enterCommandMode(); - _WiFly.uart.println("close"); - // We ignore the response which could be "*CLOS*" or could be an - // error if the connection is no longer open. - - _WiFly.uart.println("exit"); // TODO: Fix this hack which is a workaround for the fact the closed connection isn't detected properly, it seems. Even with this there's a delay between reconnects needed. - _WiFly.waitForResponse("EXIT"); - _WiFly.skipRemainderOfResponse(); - // As a result of this, unwanted data gets sent to /dev/null rather than - // confusing the WiFly which tries to interpret it as commands. - - stream.reset(); - - // This doesn't really work because the object gets copied in the - // WeClient example code. - isOpen = false; - // _port = 0; - - // So instead we mark any server connection as inactive. - // TODO: Only do this if this was a server client connection - _WiFly.serverConnectionActive = false; -} - - -Client::operator bool() { - /* - */ - // NOTE: Inkeeping with the Ethernet Client class - // we use _ip == NULL, _domain == NULL, _port = 0 to - // indicate Server.available() found no connection. - // We use _ip == NULL, _domain == NULL, _port !=0 to - // indicate a server connection from a client. - return !((_ip == NULL) && (_domain == NULL) && (_port == 0)); -} - -// TODO: Add == and != operators for compatibility with Ethernet Client? diff -purN /Users/jsloan/Desktop/Platinum/Applications/WiFly/Client.h /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/Client.h --- /Users/jsloan/Desktop/Platinum/Applications/WiFly/Client.h 2010-12-16 04:30:12.000000000 -0700 +++ /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/Client.h 1969-12-31 17:00:00.000000000 -0700 @@ -1,51 +0,0 @@ - -// Based on interface defined in Ethernet's Client.h - -#ifndef __WIFLY_CLIENT_H__ -#define __WIFLY_CLIENT_H__ - -#include "Print.h" - -#include "ParsedStream.h" - -#include "WiFlyDevice.h" - -// TODO: Call this 'WiFlyClient' instead? -class Client : public Print { - public: - Client(uint8_t *ip, uint16_t port); - Client(const char* domain, uint16_t port); - - boolean connect(); - - void write(byte value); - void write(const char *str); - void write(const uint8_t *buffer, size_t size); - - int available(); - int read(); - void flush(void); - - bool connected(); - void stop(); - - operator bool(); - - private: - WiFlyDevice& _WiFly; - - uint8_t *_ip; - uint16_t _port; - - const char *_domain; - - bool isOpen; - - ParsedStream stream; - - // TODO: Work out why alternate instantiation code in - // Server.available() doesn't work and thus requires this: - friend class Server; -}; - -#endif diff -purN /Users/jsloan/Desktop/Platinum/Applications/WiFly/Server.cpp /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/Server.cpp --- /Users/jsloan/Desktop/Platinum/Applications/WiFly/Server.cpp 2010-12-16 04:30:12.000000000 -0700 +++ /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/Server.cpp 1969-12-31 17:00:00.000000000 -0700 @@ -1,65 +0,0 @@ -#include "WiFly.h" - -// NOTE: Arbitrary cast to avoid constructor ambiguity. -// TODO: Handle this a different way so we're not using -// NULL pointers all over the place? -#define NO_CLIENT Client ((uint8_t*) NULL, 0) - -Server::Server(uint16_t port) : activeClient(NO_CLIENT){ - /* - */ - _port = port; - - // TODO: Handle this better. - // NOTE: This only works if the server object was created globally. - WiFly.serverPort = port; -} - -void Server::begin() { - /* - */ - // TODO: Send command to enable server functionality. -} - -#define TOKEN_MATCH_OPEN "*OPEN*" - -Client& Server::available() { - /* - */ - - // TODO: Ensure no active non-server client connection. - - if (!WiFly.serverConnectionActive) { - activeClient._port = 0; - } - - // TODO: Ensure begin() has been called. - - // Return active server connection if present - if (!activeClient) { - // TODO: Handle this better - if (WiFly.uart.available() >= strlen(TOKEN_MATCH_OPEN)) { - if (WiFly.responseMatched(TOKEN_MATCH_OPEN)) { - // The following values indicate that the connection was - // created when acting as a server. - - // TODO: Work out why this alternate instantiation code doesn't work: - //activeClient = Client((uint8_t*) NULL, _port); - - activeClient._port = _port; - activeClient._domain = NULL; - activeClient._ip = NULL; - - activeClient.connect(); - WiFly.serverConnectionActive = true; - } else { - // Ignore other feedback from the WiFly module. - // TODO: Should we check we're not ditching a connect accidentally? - //WiFly.skipRemainderOfResponse(); - WiFly.uart.flush(); - } - } - } - - return activeClient; -} diff -purN /Users/jsloan/Desktop/Platinum/Applications/WiFly/Server.h /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/Server.h --- /Users/jsloan/Desktop/Platinum/Applications/WiFly/Server.h 2010-12-16 04:30:12.000000000 -0700 +++ /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/Server.h 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -#ifndef __SERVER_H__ -#define __SERVER_H__ - -#include - -class Server { // TODO: Should subclass Print to be consistent - public: - Server (uint16_t port); - Client& available(); - - void begin(); - - private: - uint16_t _port; - Client activeClient; -}; - -#endif diff -purN /Users/jsloan/Desktop/Platinum/Applications/WiFly/SpiUart.cpp /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/SpiUart.cpp --- /Users/jsloan/Desktop/Platinum/Applications/WiFly/SpiUart.cpp 2010-12-16 04:30:12.000000000 -0700 +++ /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/SpiUart.cpp 2012-01-30 14:42:49.000000000 -0700 @@ -189,7 +189,7 @@ int SpiUartDevice::read() { } -void SpiUartDevice::write(byte value) { +size_t SpiUartDevice::write(byte value) { /* Write byte to UART. @@ -198,25 +198,30 @@ void SpiUartDevice::write(byte value) { while (readRegister(TXLVL) == 0) { // Wait for space in TX buffer }; - writeRegister(THR, value); + writeRegister(THR, value); + + return 1; } -void SpiUartDevice::write(const char *str) { +size_t SpiUartDevice::write(const char *str) { /* Write string to UART. */ - write((const uint8_t *) str, strlen(str)); + size_t result = write((const uint8_t *) str, strlen(str)); while (readRegister(TXLVL) < 64) { // Wait for empty TX buffer (slow) // (But apparently still not slow enough to ensure delivery.) }; + + return result; } #if ENABLE_BULK_TRANSFERS -void SpiUartDevice::write(const uint8_t *buffer, size_t size) { +size_t SpiUartDevice::write(const uint8_t *buffer, size_t size) { + size_t result = size; /* Write buffer to UART. @@ -233,6 +238,8 @@ void SpiUartDevice::write(const uint8_t transfer_bulk(buffer, size); deselect(); + + return result; } #endif diff -purN /Users/jsloan/Desktop/Platinum/Applications/WiFly/SpiUart.h /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/SpiUart.h --- /Users/jsloan/Desktop/Platinum/Applications/WiFly/SpiUart.h 2010-12-16 04:30:12.000000000 -0700 +++ /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/SpiUart.h 2012-01-30 14:38:57.000000000 -0700 @@ -59,10 +59,10 @@ class SpiUartDevice : public SpiDevice, void begin(unsigned long baudrate = BAUD_RATE_DEFAULT); byte available(); int read(); - void write(byte value); - void write(const char *str); + size_t write(byte value); + size_t write(const char *str); #if ENABLE_BULK_TRANSFERS - void write(const uint8_t *buffer, size_t size); + size_t write(const uint8_t *buffer, size_t size); #else using Print::write; #endif diff -purN /Users/jsloan/Desktop/Platinum/Applications/WiFly/WiFly.h /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/WiFly.h --- /Users/jsloan/Desktop/Platinum/Applications/WiFly/WiFly.h 2010-12-16 04:30:12.000000000 -0700 +++ /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/WiFly.h 2012-02-01 08:43:04.000000000 -0700 @@ -5,8 +5,8 @@ #include "WiFlyDevice.h" -#include "Client.h" -#include "Server.h" +#include "WiFlyClient.h" +#include "WiFlyServer.h" #define WEP_MODE false #define WPA_MODE true diff -purN /Users/jsloan/Desktop/Platinum/Applications/WiFly/WiFlyClient.cpp /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/WiFlyClient.cpp --- /Users/jsloan/Desktop/Platinum/Applications/WiFly/WiFlyClient.cpp 1969-12-31 17:00:00.000000000 -0700 +++ /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/WiFlyClient.cpp 2012-02-01 10:45:27.000000000 -0700 @@ -0,0 +1,245 @@ +#include "WiFly.h" +#include + +WiFlyClient::WiFlyClient() +: Client() +, _WiFly(WiFly) +, _ip(INADDR_NONE) +, _port(0) +, _domain(NULL) +, isOpen(false) +, stream(ParsedStream(SpiSerial)) +{ +} + +WiFlyClient::WiFlyClient(const uint8_t *ip, uint16_t port) : + _WiFly (WiFly), + stream (ParsedStream(SpiSerial)) { + // TODO: Find out why neither of the following work as expected. + // (The result of `read()` is always -1. ) + //stream (ParsedStream(_WiFly.uart)) { + //stream (ParsedStream(WiFly.uart)) { + /* + */ + _ip = ip; + _port = port; + _domain = NULL; + + isOpen = false; +} + + +WiFlyClient::WiFlyClient(const char* domain, uint16_t port) : + _WiFly (WiFly), + stream (ParsedStream(SpiSerial)) { + // TODO: Find out why neither of the following work as expected. + // (The result of `read()` is always -1. ) + //stream (ParsedStream(_WiFly.uart)) { + //stream (ParsedStream(WiFly.uart)) { + /* + */ + _ip = INADDR_NONE; + _port = port; + _domain = domain; + + isOpen = false; +} + + +size_t WiFlyClient::write(byte value) { + /* + */ + return _WiFly.uart.write(value); +} + + +size_t WiFlyClient::write(const char *str) { + /* + */ + return _WiFly.uart.write(str); +} + + +size_t WiFlyClient::write(const uint8_t *buffer, size_t size) { + /* + */ + return _WiFly.uart.write(buffer, size); +} + + +boolean WiFlyClient::connect() { + /* + */ + + // Handle case when Null object returned from Server.available() + if (!this) { + return false; + } + + // TODO: Implement this better + + stream.reset(); + + if ((_ip == INADDR_NONE) && (_domain == NULL)) { + // This is a connection started by the Server class + // so the connection is already established. + } else { + // TODO: Track state more? + _WiFly.enterCommandMode(); + + _WiFly.sendCommand("open ", true, "" /* TODO: Remove this dummy value */); + + if (!(_ip == INADDR_NONE)) { + for (int index = 0; /* break inside loop*/ ; index++) { + _WiFly.uart.print(_ip[index], DEC); + if (index == 3) { + break; + } + _WiFly.uart.print('.'); + } + } else if (_domain != NULL) { + _WiFly.uart.print(_domain); + } else { + while (1) { + // This should never happen + } + } + + _WiFly.uart.print(" "); + + _WiFly.uart.print(_port, DEC); + + _WiFly.sendCommand("", false, "*OPEN*"); + + // TODO: Handle connect failure + } + + isOpen = true; + + return true; +} + + +int WiFlyClient::available() { + /* + */ + if (!isOpen) { + return 0; + } + + return stream.available(); +} + + +int WiFlyClient::read() { + /* + */ + if (!isOpen) { + return -1; + } + + return stream.read(); +} + + +void WiFlyClient::flush(void) { + /* + */ + if (!isOpen) { + return; + } + + while (stream.available() > 0) { + stream.read(); + } +} + + +uint8_t WiFlyClient::connected() { + /* + */ + // TODO: Set isOpen to false once we know the stream is closed? + return (isOpen && !stream.closed()) ? !0 : 0; +} + + +void WiFlyClient::stop() { + /* + */ + // TODO: Work out if there's some unintended compatibility issues + // related to interactions between `stop()`, `connected()` and + // `available()`. + + // This stop implementation is suboptimal. We need to handle the case + // of a server connection differently to a client connection. + // We also need to handle better detecting if the connection is already + // closed. + // In the interests of getting something out the door--that somewhat + // works--this is what we're going with at the moment. + + _WiFly.enterCommandMode(); + _WiFly.uart.println("close"); + // We ignore the response which could be "*CLOS*" or could be an + // error if the connection is no longer open. + + _WiFly.uart.println("exit"); // TODO: Fix this hack which is a workaround for the fact the closed connection isn't detected properly, it seems. Even with this there's a delay between reconnects needed. + _WiFly.waitForResponse("EXIT"); + _WiFly.skipRemainderOfResponse(); + // As a result of this, unwanted data gets sent to /dev/null rather than + // confusing the WiFly which tries to interpret it as commands. + + stream.reset(); + + // This doesn't really work because the object gets copied in the + // Welient example code. + isOpen = false; + // _port = 0; + + // So instead we mark any server connection as inactive. + // TODO: Only do this if this was a server client connection + _WiFly.serverConnectionActive = false; +} + + +WiFlyClient::operator bool() { + /* + */ + // NOTE: Inkeeping with the Ethernet Client class + // we use _ip == NULL, _domain == NULL, _port = 0 to + // indicate Server.available() found no connection. + // We use _ip == NULL, _domain == NULL, _port !=0 to + // indicate a server connection from a client. + return !((_ip == INADDR_NONE) && (_domain == NULL) && (_port == 0)); +} + +// TODO: Add == and != operators for compatibility with Ethernet Client? + +int WiFlyClient::connect(IPAddress ip, uint16_t port) { + _ip = ip; + _port = port; + _domain = NULL; + return connect() ? 1 : 0; +} + +int WiFlyClient::connect(const char *host, uint16_t port) { + _ip = INADDR_NONE; + _port = port; + _domain = host; + return connect() ? 1 : 0; +} + +int WiFlyClient::read(uint8_t *buf, size_t size) { + int rc = 0; + int ch; + while ((size--) > 0) { + ch = stream.read(); + if (ch < 0) { break; } + *(buf++) = ch; + ++rc; + } + return rc; +} + +int WiFlyClient::peek() { + return -1; +} diff -purN /Users/jsloan/Desktop/Platinum/Applications/WiFly/WiFlyClient.h /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/WiFlyClient.h --- /Users/jsloan/Desktop/Platinum/Applications/WiFly/WiFlyClient.h 1969-12-31 17:00:00.000000000 -0700 +++ /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/WiFlyClient.h 2012-02-01 10:39:11.000000000 -0700 @@ -0,0 +1,55 @@ + +// Based on interface defined in Ethernet's Client.h + +#ifndef __WIFLY_CLIENT_H__ +#define __WIFLY_CLIENT_H__ + +#include "Client.h" +#include "ParsedStream.h" +#include "WiFlyDevice.h" +#include "IPAddress.h" + +class WiFlyClient : public Client { + public: + WiFlyClient(); + WiFlyClient(const uint8_t *ip, uint16_t port); + WiFlyClient(const char* domain, uint16_t port); + + boolean connect(); + + size_t write(uint8_t); + size_t write(const char *str); + size_t write(const uint8_t *buffer, size_t size); + + int available(); + int read(); + void flush(); + + void stop(); + + operator bool(); + + uint8_t connected(); + int connect(IPAddress ip, uint16_t port); + int connect(const char *host, uint16_t port); + int read(uint8_t *buf, size_t size); + int peek(); + + private: + WiFlyDevice& _WiFly; + + IPAddress _ip; + uint16_t _port; + + const char *_domain; + + bool isOpen; + + ParsedStream stream; + + // TODO: Work out why alternate instantiation code in + // Server.available() doesn't work and thus requires this: + friend class WiFlyServer; +}; + +#endif diff -purN /Users/jsloan/Desktop/Platinum/Applications/WiFly/WiFlyDevice.h /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/WiFlyDevice.h --- /Users/jsloan/Desktop/Platinum/Applications/WiFly/WiFlyDevice.h 2010-12-16 04:30:12.000000000 -0700 +++ /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/WiFlyDevice.h 2012-02-01 08:47:24.000000000 -0700 @@ -58,8 +58,8 @@ class WiFlyDevice { boolean softwareReboot(boolean isAfterBoot); boolean hardwareReboot(); - friend class Client; - friend class Server; + friend class WiFlyClient; + friend class WiFlyServer; }; #endif diff -purN /Users/jsloan/Desktop/Platinum/Applications/WiFly/WiFlyServer.cpp /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/WiFlyServer.cpp --- /Users/jsloan/Desktop/Platinum/Applications/WiFly/WiFlyServer.cpp 1969-12-31 17:00:00.000000000 -0700 +++ /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/WiFlyServer.cpp 2012-02-01 10:46:12.000000000 -0700 @@ -0,0 +1,65 @@ +#include "WiFly.h" + +// NOTE: Arbitrary cast to avoid constructor ambiguity. +// TODO: Handle this a different way so we're not using +// NULL pointers all over the place? +#define NO_CLIENT WiFlyClient () + +WiFlyServer::WiFlyServer(uint16_t port) : activeClient(NO_CLIENT){ + /* + */ + _port = port; + + // TODO: Handle this better. + // NOTE: This only works if the server object was created globally. + WiFly.serverPort = port; +} + +void WiFlyServer::begin() { + /* + */ + // TODO: Send command to enable server functionality. +} + +#define TOKEN_MATCH_OPEN "*OPEN*" + +WiFlyClient& WiFlyServer::available() { + /* + */ + + // TODO: Ensure no active non-server client connection. + + if (!WiFly.serverConnectionActive) { + activeClient._port = 0; + } + + // TODO: Ensure begin() has been called. + + // Return active server connection if present + if (!activeClient) { + // TODO: Handle this better + if (WiFly.uart.available() >= strlen(TOKEN_MATCH_OPEN)) { + if (WiFly.responseMatched(TOKEN_MATCH_OPEN)) { + // The following values indicate that the connection was + // created when acting as a server. + + // TODO: Work out why this alternate instantiation code doesn't work: + //activeClient = Client((uint8_t*) NULL, _port); + + activeClient._port = _port; + activeClient._domain = NULL; + activeClient._ip = INADDR_NONE; + + activeClient.connect(); + WiFly.serverConnectionActive = true; + } else { + // Ignore other feedback from the WiFly module. + // TODO: Should we check we're not ditching a connect accidentally? + //WiFly.skipRemainderOfResponse(); + WiFly.uart.flush(); + } + } + } + + return activeClient; +} diff -purN /Users/jsloan/Desktop/Platinum/Applications/WiFly/WiFlyServer.h /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/WiFlyServer.h --- /Users/jsloan/Desktop/Platinum/Applications/WiFly/WiFlyServer.h 1969-12-31 17:00:00.000000000 -0700 +++ /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/WiFlyServer.h 2012-02-01 10:32:22.000000000 -0700 @@ -0,0 +1,21 @@ +#ifndef __SERVER_H__ +#define __SERVER_H__ + +#include "Print.h" +#include "Server.h" +#include "WiFlyClient.h" +#include + +class WiFlyServer : public Server { + public: + WiFlyServer (uint16_t port); + WiFlyClient& available(); + + void begin(); + + private: + uint16_t _port; + WiFlyClient activeClient; +}; + +#endif diff -purN /Users/jsloan/Desktop/Platinum/Applications/WiFly/_Spi.h /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/_Spi.h --- /Users/jsloan/Desktop/Platinum/Applications/WiFly/_Spi.h 2010-12-16 04:30:12.000000000 -0700 +++ /Applications/Arduino.app/Contents/Resources/Java/Libraries/WiFly/_Spi.h 2012-01-30 14:48:57.000000000 -0700 @@ -5,10 +5,7 @@ #ifndef ___SPI_H__ #define ___SPI_H__ -#include - -#include - +#include "Arduino.h" // TODO: Do we want to use this instead: class SpiDevice {