ECE 4180 final project. Used to connected with both Adafruit Huzzah WiFi and Adafruit Bluetooth LE UART.
Dependents: WirelessInterface_Demo
Revision 1:67c95e75c998, committed 2016-04-28
- Comitter:
- gboggs3
- Date:
- Thu Apr 28 22:09:33 2016 +0000
- Parent:
- 0:ee4d2deea4be
- Commit message:
- Allowed for setting up a server to accept serial passthrough communication
Changed in this revision
diff -r ee4d2deea4be -r 67c95e75c998 Huzzah.h --- a/Huzzah.h Sun Apr 24 18:20:01 2016 +0000 +++ b/Huzzah.h Thu Apr 28 22:09:33 2016 +0000 @@ -26,7 +26,7 @@ class Huzzah { public: - Huzzah(PinName tx, PinName rx, PinName rst, RawSerial dev, int baudrate = 9600); + Huzzah(PinName tx, PinName rx, PinName rst, RawSerial dev, int baudrate); void configure(char* SSID, char* PASSWORD); void reset(); void setLocalSerial(RawSerial cmd, int baud = 9600); @@ -34,12 +34,12 @@ void baudrate(int speed); RawSerial getLocalSerial(); RawSerial getSerialDev(); + void send(); + void recv(); protected: RawSerial _cmd; RawSerial _dev; - void send(); - void recv(); void ESPConfig(char* SSID, char* PASSWORD); void ESPSetBaudrate(int speed); void SendCMD();
diff -r ee4d2deea4be -r 67c95e75c998 WirelessInterface.cpp --- a/WirelessInterface.cpp Sun Apr 24 18:20:01 2016 +0000 +++ b/WirelessInterface.cpp Thu Apr 28 22:09:33 2016 +0000 @@ -100,29 +100,15 @@ _cmdbt.baudrate(speed); } - -/** -* -* -* void WirelessInterface :: recv() { - while(_dev.readable()) { - _cmd.putc(_dev.getc()); - } + _cmdwifi.recv(); +} + +void WirelessInterface :: send() +{ + _cmdwifi.send(); } -/** -* -* -* -void WirelessInterface :: send() -{ - while(_cmd.readable()) { - _dev.putc(_cmd.getc()); - } -} -*/ -
diff -r ee4d2deea4be -r 67c95e75c998 WirelessInterface.h --- a/WirelessInterface.h Sun Apr 24 18:20:01 2016 +0000 +++ b/WirelessInterface.h Thu Apr 28 22:09:33 2016 +0000 @@ -27,7 +27,7 @@ class WirelessInterface { public: - WirelessInterface(PinName tx, PinName rx, PinName rst, RawSerial dev, int baudrate = 9600); + WirelessInterface(PinName tx, PinName rx, PinName rst, RawSerial dev, int baudrate); void resetAll(); void resetWifi(); void resetBluetooth(); @@ -40,8 +40,6 @@ void baudrate(int speed); RawSerial getLocalSerial(); RawSerial getSerialDev(); - -protected: void send(); void recv();