The Ethernet-Board

Dependencies:   EthernetInterface HTTPClient MODSERIAL mbed-dev mbed-rtos wolfSSL

Fork of sose2016_tr_oauth_pop by niko gillen

Revision:
5:a837161f959a
Parent:
4:00b8d595aa33
Child:
7:5d116f2e5587
--- a/main.cpp	Thu Jun 23 21:07:49 2016 +0000
+++ b/main.cpp	Sat Jun 25 11:38:01 2016 +0000
@@ -1,14 +1,18 @@
 #include "mbed.h"
 #include "EthernetInterface.h"
 #include "HTTPClient.h"
+#include "MODSERIAL.h"
+
+#define SEND_BUF_SIZE 4096
 
 DigitalOut R(LED_RED);
 DigitalOut G(LED_GREEN);
 DigitalOut B(LED_BLUE);
 
-Serial serial(USBTX, USBRX); // tx, rx
+MODSERIAL serial(USBTX, USBRX,4096); // tx, rx
 EthernetInterface eth;
 HTTPClient http;
+
 char str[32000];
 char str2[32000];
 
@@ -52,5 +56,10 @@
           // Light Red 5s
           G=!G;wait(5);R=!R;
         }
+        
+        // Bugfix, nervous user send token multiple times!
+        memset(&str[0], 0, sizeof(str));
+        memset(&str2[0], 0, sizeof(str2));
+        serial.rxBufferFlush();
     }
 }