Code APP3
Dependencies: mbed EthernetInterface WebSocketClient mbed-rtos BufferedSerial
Fork of APP3_Lab by
Diff: parser.cpp
- Revision:
- 3:a07b74f94890
- Child:
- 4:ed53c87777f6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/parser.cpp Sat Sep 30 18:20:19 2017 +0000 @@ -0,0 +1,18 @@ +void ReadFile() +{ + FILE *fp = fopen("/config.txt", "r"); // Ouvrir config.txt pour lecture seulement + if(fp == NULL) + { + pc.printf("Failed to find configuration file. \n\r") + return -1; + } + else + { + pc.printf("Config file opened. \n\r"); + fscanf(set,"%s",A); // read PanId + fscanf(set,"%s",B); // read URL + printf(fp,"PanId : %s\r\n",A); // Display PanId + printf(fp,"ServeurURL : %s\r\n",B); // Display URL + fclose(fp); + } +} \ No newline at end of file