![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Exclusive code for server communication
Fork of test_thread by
Diff: main.cpp
- Revision:
- 5:bdabacd90f75
- Parent:
- 4:fd0d5e707091
--- a/main.cpp Mon Jan 09 18:00:57 2017 +0000 +++ b/main.cpp Sat Jan 14 06:42:58 2017 +0000 @@ -21,16 +21,15 @@ Wifi.printf("GET reneproj.esy.es/"); Wifi.printf("peach/index.php?device_token=jabv5su2&device"); Wifi.printf("_id=gr_peach1&command4u=00 HTTP/1.1\r\n"); - if(Wifi.readable()){ + } +} +void read_from_wifi(){ + if(Wifi.readable()){ while(Wifi.readable()){ read_data = Wifi.getc(); pc.putc(read_data); } } - } -} -void send_to_device(string command){ - } void setup_esp8266(){ @@ -63,8 +62,8 @@ } int main() { + Wifi.attach(&read_from_wifi); setup_esp8266(); - uint8_t data[3] = {0x47, 0x32, 0xA7}; while (true) { wait(10); }