Code APP3
Dependencies: mbed EthernetInterface WebSocketClient mbed-rtos BufferedSerial
Fork of APP3_Lab by
parser.cpp
- Committer:
- JayMcGee
- Date:
- 2017-09-30
- Revision:
- 10:edcf07f33583
- Parent:
- 6:9ed8153f1328
- Child:
- 13:5f21dd134bd2
File content as of revision 10:edcf07f33583:
#include "parser.h" unsigned int PanID; char URL[255] = {0}; LocalFileSystem local("local"); void ReadFile() { Serial pc(USBTX, USBRX); // tx, rx FILE *fp = fopen("/local/config.txt", "r"); // Ouvrir config.txt pour lecture seulement if(fp == NULL) { pc.printf("Failed to find configuration file. \n\r"); } else { pc.printf("Config file opened. \n\r"); if (fscanf(fp,"0x%x", &PanID) > 0) { pc.printf("PanId : 0x%x value : %u\r\n", PanID, PanID); // Display PanId } fscanf(fp,"%s",URL); // read URL pc.printf("ServeurURL : %s\r\n",URL); // Display URL fclose(fp); } }