Modularizando o src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

Revision:
127:e7160a463b6c
Parent:
126:1f90756250fb
Child:
128:3ae1c74773a8
diff -r 1f90756250fb -r e7160a463b6c prompt.cpp
--- a/prompt.cpp	Wed May 20 19:50:31 2015 +0000
+++ b/prompt.cpp	Sun May 24 16:07:14 2015 +0000
@@ -263,7 +263,6 @@
             if( debug_uart3 ) pc.printf("\n\rFlood OFF\n\r");
             if( from_eth ){
                 snprintf( debug_buf, PROMPT_ETH_BUFFER_SIZE, "Flood OFF\n\r" );
-                //debug_buf[ strlen( debug_buf ) - 1 ] = '\0';
             }
             pflood = 0;
             tflood.stop();
@@ -811,7 +810,8 @@
                 "0x%02x   :: %5i  :: CB_STATS_ACK\n\r"
                 "0x%02x   :: %5i  :: DO_NOTHING\n\r\r\n"
                 
-                "0x%02x :: %5i  :: BROADCAST_EXT\n\r",
+                "0x%02x :: %5i  :: BROADCAST_EXT\n\r"
+                "NOTA - Os types TELEMETRY, CB_STATS, e FW1 ate FW6 sao repassados para o servidor como type FW\r\n",
                 BOOT, BOOT,
                 REGISTRY, REGISTRY,
                 REGISTRY_ACK, REGISTRY_ACK,
@@ -865,7 +865,8 @@
                     "0x%02x   :: %5i  :: CB_STATS_ACK\n\r"
                     "0x%02x   :: %5i  :: DO_NOTHING\n\r\r\n"
                     
-                    "0x%02x :: %5i  :: BROADCAST_EXT\n\r",
+                    "0x%02x :: %5i  :: BROADCAST_EXT\n\r"
+                    "NOTA - Os types TELEMETRY, CB_STATS, e FW1 ate FW6 sao repassados para o servidor como type FW\r\n",
                     BOOT, BOOT,
                     REGISTRY, REGISTRY,
                     REGISTRY_ACK, REGISTRY_ACK,
@@ -1731,7 +1732,7 @@
             }
         }
         
-        else if( xmemmatch( (uint8_t*)debug_buf, (uint8_t*) "dcpld ", 6 ) ) {
+            else if( xmemmatch( (uint8_t*)debug_buf, (uint8_t*) "dcpld ", 6 ) ) {
             if (xmemmatch( (uint8_t*)(debug_buf + 6 ), (uint8_t*) "on", 2 ) ) {
                 miss_match = false;
                 if( debug_uart3 && !( from_eth ) ) pc.printf( "\n\rDCPLD Debug ON\n\r" );
@@ -2175,7 +2176,11 @@
             promptcb_last_ext = ext;
             promptcb_last_port = port;
             
-            char msg[] = "bye";
+            char msg [ CB_BUFFER_SIZE ] = "";
+            
+            for ( register int i = 0; i < CB_BUFFER_SIZE; i ++ ) msg [ i ] = 0;
+            
+            strcpy( msg, "bye" );
 
             if ( debug_uart3 && !( from_eth ) ) pc.printf("\r\nSend BYE to ext=%d port=%d", ext, port );
             
@@ -2617,7 +2622,7 @@
         }
         
         
-        else if( xmemmatch( (uint8_t*)debug_buf, (uint8_t*) "_pcb",4 )) {
+        else if( xmemmatch( (uint8_t*)debug_buf, (uint8_t*) "_",4 )) {
             miss_match = false;
             debug_buf[ bufptr++ ] = 0x0D;
             debug_buf[ bufptr++ ] = 0x00;
@@ -2668,7 +2673,7 @@
             }
         }
         
-                else if (xmemmatch( (uint8_t*)debug_buf, (uint8_t*) "dout ", 5 ) ) {
+        else if (xmemmatch( (uint8_t*)debug_buf, (uint8_t*) "dout ", 5 ) ) {
             if (xmemmatch( (uint8_t*)( debug_buf + 5 ), (uint8_t*) "on", 2 ) ) {
                 miss_match = false;
                 if( debug_uart3 && !( from_eth ) ) pc.printf("\r\nOut Debug ON");
@@ -2925,15 +2930,6 @@
 
                 else if( udp_query ) {
                     udp_query_send_msg( debug_buf );
-                    /*
-                    int send = udp_client.sendTo( udp_server, debug_buf, strlen( debug_buf ) );
-
-                    if( send != strlen( debug_buf ) ) {
-                        if( debug_reconnect ) send_msg("Reconnect udp_query client");
-                        reconnect_prompt_udp_socket();
-                        miss_prompt_udp_send_pkg++;
-                    }
-                    */
                 }
             }
 
@@ -3330,10 +3326,8 @@
                 
                 if( debug_buf[ strlen( debug_buf ) - 1 ] == '\r' || debug_buf[ strlen( debug_buf ) - 1 ] == '\n' ) 
                 {
-                    //strcat( debug_buf, "> " );
                     strcpy( debug_buf, "> " );
                 } else {
-                    //strcat( debug_buf, "\n\r> " );
                     strcpy( debug_buf, "\n\r> " );
                 }
             }else{