Modularizando o src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

Revision:
116:39a41ebb675c
Parent:
114:472502b31a12
Child:
117:e9facba9db27
--- a/prompt.h	Thu Apr 23 13:57:54 2015 +0000
+++ b/prompt.h	Thu Apr 23 20:24:09 2015 +0000
@@ -12,7 +12,6 @@
 #include <stdint.h>
 #include "mbed.h"
 #include "EthernetInterface.h"
-#include "telemetry.h" // used for __TELEMETRY_SERVER_IP__ and __TELEMETRY_SERVER_PORT__
 #include "utils.h" // need for convert_ext_to_port()
 #include "flood.h"
 #include "shared_variables.h"
@@ -21,15 +20,17 @@
 #include "file_system_manager.h"
 #include "fw.h"
 
-#define PVERSION 25
+const uint8_t PVERSION = 25;
+const uint8_t PROMPT_UDP_COMMAND_SIZE = 64;
+const uint8_t PERSISTENT_TCP_IDLE_MAX_TIME = 30;
 
-#define TCP_IDLE_MAX_TIME 360//90
+const uint16_t TCP_IDLE_MAX_TIME = 360;
 ///< Define o tempo maximo de espera por um novo comando via eth, dado que já estamos em uma sessão TCP.
 
-#define TCP_ALIVE_IDLE_MAX_TIME 360
+const uint16_t TCP_ALIVE_IDLE_MAX_TIME = 360;
 ///< Define o tempo maximo de espera por um novo comando via eth dado que já estamos em uma sessão TCP e a flag tcp_alive esta on.
 
-#define DEBUGBUFSIZE 50
+const uint16_t  DEBUGBUFSIZE = __PROMPT_ETH_BUFFER_SIZE__;
 ///< Define o tamanho do buffer de entrada de dados.
 
 extern uint8_t dog;
@@ -48,8 +49,7 @@
 
 extern FILE *fudpport;      ///< arquivo de porta udp que a header escuta
 extern FILE *ftcpport;      ///< arquivo de porta tcp que a header escuta
-extern FILE *ftip;          ///< arquivo de IP do servidor para envio de telemetria
-extern FILE *ftport;        ///< arquivo de Porta UDP do servidor para envio de telemetria
+extern FILE *fshift_port;
 
 extern bool flood_silence;
 extern bool delayed_flood;
@@ -78,7 +78,7 @@
  * ...
  * @endcode
  */
-char * prompt_process( char * ethernet_pkg );
+char * prompt_process( char * msg_from_cb, int length );
 
 /**
  * @Synopsis Init file system and check if files exist
@@ -107,4 +107,11 @@
 extern char * debug_buf;
 ///< Buffer de entrada dos dados via serial.
 
+inline void reconnect_udp_prompt_process( void )
+{
+  udp_client.close();
+  udp_client.set_blocking( false, 0 );
+  udp_client.bind( UDP_PORT_LISTENER );
+}
+
 #endif
\ No newline at end of file