Simone Mentasti / Mbed 2 deprecated AcquisizioneGPS

Dependencies:   F7_Ethernet X_NUCLEO_IKS01A2 mbed-rtos mbed

Fork of Test2Boards by Simone Mentasti

Files at this revision

API Documentation at this revision

Comitter:
nirnakern
Date:
Mon Oct 01 14:33:56 2018 +0000
Parent:
2:1eb73fe8ab8f
Commit message:
First Commit;

Changed in this revision

Teseo-LIV3F/Teseo-LIV3F.cpp Show annotated file Show diff for this revision Revisions of this file
Teseo-LIV3F/Teseo-LIV3F.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Teseo-LIV3F/Teseo-LIV3F.cpp	Fri Jan 26 09:54:13 2018 +0000
+++ b/Teseo-LIV3F/Teseo-LIV3F.cpp	Mon Oct 01 14:33:56 2018 +0000
@@ -41,6 +41,18 @@
     [Teseo_LIV3F::FWUPDATE] = {
         .cmd  = "$PSTMFWUPGRADE",
     },
+    [Teseo_LIV3F::ENABLEALL] = {
+        .cmd  = "$PSTMSETPAR,201,0xBFBBFFDF",
+    },
+    [Teseo_LIV3F::ENABLEALL2] = {
+        .cmd  = "$PSTMSETPAR,228,0x3397",
+    },
+    [Teseo_LIV3F::SAVE] = {
+        .cmd  = "$PSTMSAVEPAR",
+    },
+    [Teseo_LIV3F::REBOOT] = {
+        .cmd  = "$PSTMSRR",
+    },
 };
 
 
@@ -157,6 +169,7 @@
 {
     for (int i = 0; i < len; ++i) {
         while (!_uart.writeable());
+        printf ("%c",buf[i]);
         _uart.putc(buf[i]);
         }
 }
@@ -441,7 +454,7 @@
     char crc[5];
 
     sprintf(crc, "*%02X\n\r", CRC_(teseo_cmds[c].cmd, 0));
-
+    //printf ("%s",crc);
     _uart_mutex_lock();
     _uart_interleaded = true;
     SendString(teseo_cmds[c].cmd, strlen(teseo_cmds[c].cmd));
@@ -523,6 +536,7 @@
     return 0;
 }
 
+
  void Teseo_LIV3F::RFTest(bool enable)
  {
     if (enable)
--- a/Teseo-LIV3F/Teseo-LIV3F.h	Fri Jan 26 09:54:13 2018 +0000
+++ b/Teseo-LIV3F/Teseo-LIV3F.h	Mon Oct 01 14:33:56 2018 +0000
@@ -47,6 +47,10 @@
         RFTESTOFF,
         LOWPOWER,
         FWUPDATE,
+        ENABLEALL,
+        SAVE,
+        REBOOT,
+        ENABLEALL2,
     };
     
     
--- a/main.cpp	Fri Jan 26 09:54:13 2018 +0000
+++ b/main.cpp	Mon Oct 01 14:33:56 2018 +0000
@@ -13,9 +13,9 @@
 
 /*IP E AFFINI*/
 
-const char * IP = "169.254.112.125";
+const char * IP = "192.168.1.206";//"169.254.112.125";
 const char * MASK = "255.255.255.0";
-const char * GATEWAY = "169.254.112.1";
+const char * GATEWAY = "192.168.1.1";
 
 
 
@@ -207,9 +207,15 @@
         myled2=1;
         
         myled3=1;
+        printf ("start sending command\n");
         server.sendTo(client, buffer, n);
-        
-        
+        Teseo.SendCommand(Teseo_LIV3F::ENABLEALL);
+        Teseo.SendCommand(Teseo_LIV3F::SAVE);
+        Teseo.SendCommand(Teseo_LIV3F::REBOOT);
+        Teseo.SendCommand(Teseo_LIV3F::ENABLEALL2);
+        Teseo.SendCommand(Teseo_LIV3F::SAVE);
+        Teseo.SendCommand(Teseo_LIV3F::REBOOT);
+        printf ("ends sending command\n");
         memset (&buffer[0], '\0', sizeof(buffer));
             while (1){
                 packetnumber =packetnumber+1;
@@ -218,7 +224,7 @@
                 if (Teseo._uart.readable()) {
                     int c = Teseo._uart.getc();
                     sprintf (buffer + strlen(buffer), "%c", c);
-                    serial_debug->putc(c);
+                    //serial_debug->putc(c);
                     if (c =='\n'){
                        // sprintf (outBuffer , "%d,%s",(t.read_ms()+(offset*1000)),buffer);
                          sprintf (outBuffer , "%s",buffer);