Code APP3

Dependencies:   mbed EthernetInterface WebSocketClient mbed-rtos BufferedSerial

Fork of APP3_Lab by Jean-Philippe Fournier

Revision:
6:9ed8153f1328
Parent:
5:9e6a09a38785
Child:
13:5f21dd134bd2
--- a/parser.cpp	Sat Sep 30 18:36:28 2017 +0000
+++ b/parser.cpp	Sat Sep 30 19:09:52 2017 +0000
@@ -1,6 +1,6 @@
 #include "parser.h"
 
-char PanID[10] = {0};
+unsigned int PanID;
 char URL[255] = {0};
 
 LocalFileSystem local("local");
@@ -16,9 +16,11 @@
     else
     {
         pc.printf("Config file opened. \n\r");
-        fscanf(fp,"%s",&PanID); // read PanId
-        fscanf(fp,"%s",&URL); // read URL        
-        pc.printf("PanId : %s\r\n",PanID); // Display PanId
+        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);
     }