Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of test_thread by
Revision 4:fd0d5e707091, committed 2017-01-09
- Comitter:
- RahulSitaram
- Date:
- Mon Jan 09 18:00:57 2017 +0000
- Parent:
- 3:e8db31793029
- Child:
- 5:bdabacd90f75
- Commit message:
- Meta_final raw code *USE THIS ONLY*
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Jan 09 17:42:39 2017 +0000
+++ b/main.cpp Mon Jan 09 18:00:57 2017 +0000
@@ -5,8 +5,9 @@
DigitalOut led1(LED1);
DigitalOut led2(LED2);
std::string data;
+string command;
+uint8_t wifi_ack;
char read_data;
-uint8_t wifi_ack;
Serial pc(USBTX, USBRX);
//Serial Wifi(P2_14,P2_15);
Serial Wifi(P5_0, P5_1);
@@ -17,6 +18,9 @@
void reader_thread(void const *args) {
while (true) {
+ 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()){
while(Wifi.readable()){
read_data = Wifi.getc();
@@ -48,15 +52,18 @@
wait(8);
Wifi.puts("AT+CIPSEND=0,30\r\n");
wait(8);
- 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");
- wait(8);
+ Thread thread(reader_thread);
}
+void send_command(char* eight_byte_cmd){
+ Wifi.puts("AT+CIPSTART=0,\"TCP\",\"localhost/peach/index.php?device_");
+ Wifi.puts("token=jabv5su2&device_id=gr_peach1&command4u=");
+ Wifi.puts(eight_byte_cmd);
+ Wifi.puts("\",80\r\n");
+
+ }
int main() {
setup_esp8266();
- Thread thread(reader_thread);
uint8_t data[3] = {0x47, 0x32, 0xA7};
while (true) {
wait(10);
