nova verzija tcp+udp->serial com

Revision:
4:7abcf4543282
Parent:
3:1196befeace0
Child:
5:c9a908749d4c
diff -r 1196befeace0 -r 7abcf4543282 doHTML.cpp
--- a/doHTML.cpp	Wed Apr 08 08:41:16 2020 +0000
+++ b/doHTML.cpp	Sat Apr 11 17:11:38 2020 +0000
@@ -1,3 +1,4 @@
+#include "mbed.h"
 #include "clubbing.h"
 #include "string.h"
 #include "dxml.h"
@@ -129,6 +130,10 @@
 //        }
 //    } 
 
+}
+
+void test_HTML(void)
+{
 extern const char *get_selected_option( const char *name_option );
 extern const char * set_selected_option( const char* name_option, const char* value_option );
 
@@ -137,11 +142,33 @@
  P_str( "selected stop bits" ,  (char*)get_selected_option( "stop_bits" ) );
  P_str( "selected data bits" ,  (char*)get_selected_option( "data_bits" ) );
 
+    {
+        extern UARTSerial *gp_scom;
+        extern void sendScom( struct UARTSerial *p_scom, char *buffer, int val);
+
+            auto c = getHTML_free( );
+        //  n = p_soc->send(c, strlen(c));
+            sendScom( gp_scom, c, strlen(c));
+            free(c);
+    }
+
+
  P_str( "select bit rate 38400", set_selected_option( "baud_rate", "38400" ) );
  P_str( "select bit parity ODD", set_selected_option( "parity", "odd" ) );
  P_str( "select stop bits 1.5", set_selected_option( "stop_bits", "1.5" ) );
  P_str( "select data bits 7", set_selected_option( "data_bits", "7" ) );
 
+    {
+        extern UARTSerial *gp_scom;
+        extern void sendScom( struct UARTSerial *p_scom, char *buffer, int val);
+
+            auto c = getHTML_free( );
+        //  n = p_soc->send(c, strlen(c));
+            sendScom( gp_scom, c, strlen(c));
+            free(c);
+    }
+
+
 P_str( "selected bit rate" ,  (char*)get_selected_option( "baud_rate" ) );
  P_str( "selected parity" ,  (char*)get_selected_option( "parity" ) );
  P_str( "selected stop bits" ,  (char*)get_selected_option( "stop_bits" ) );
@@ -187,8 +214,15 @@
                     {
     //                  printf("   k=%d\n\r",k);
                       if( !strcmp( dxml_attr( get_serial_option(serial[i],k), "value"), value_option) )
-                             { printf("   kk=%d\n\r",k); dxml_set_attr( get_serial_option(serial[i],k), "selected", "ON" );}
-                      else  {  printf("   k=%d\n\r",k); dxml_set_attr( get_serial_option(serial[i],k), "selected", "" );}
+                      { 
+                         printf("   kk=%d\n\r",k); 
+                         dxml_set_attr( get_serial_option(serial[i],k), "selected", "ON" );
+                      }
+                      else  
+                      {  
+                          printf("   k=%d\n\r",k); 
+                          dxml_set_attr( get_serial_option(serial[i],k), "selected", NULL );
+                      }
                     }
                 }
                 return value_option;