![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
prompt.h@132:05cd37f7e007, 2015-09-01 (annotated)
- Committer:
- klauss
- Date:
- Tue Sep 01 17:21:11 2015 +0000
- Revision:
- 132:05cd37f7e007
- Parent:
- 128:3ae1c74773a8
- Child:
- 135:2f4290590e51
Substitui??o de; send_msg -> vz_printf; debug_msg -> vz_debug
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 69:65665afbad5d | 1 | /** |
klauss | 69:65665afbad5d | 2 | * @file prompt.h |
klauss | 69:65665afbad5d | 3 | * @Synopsis Implementa as funcionalidades de prompt/prompt-eth da Header. |
klauss | 69:65665afbad5d | 4 | * @author Fernando Cola / Jhontan Casale |
klauss | 69:65665afbad5d | 5 | * @version 1 |
klauss | 69:65665afbad5d | 6 | * @date 2014-11-05 |
klauss | 69:65665afbad5d | 7 | */ |
klauss | 69:65665afbad5d | 8 | |
klauss | 17:67a6b557eda5 | 9 | #ifndef _PROMPT_H |
klauss | 17:67a6b557eda5 | 10 | #define _PROMPT_H |
klauss | 17:67a6b557eda5 | 11 | |
klauss | 128:3ae1c74773a8 | 12 | #include "bits.h" |
klauss | 44:cc4996469404 | 13 | #include "mbed.h" |
klauss | 127:e7160a463b6c | 14 | #include "debug.h" |
klauss | 128:3ae1c74773a8 | 15 | #include "flood.h" |
klauss | 128:3ae1c74773a8 | 16 | #include "vz_protocol.h" |
klauss | 74:81c47fff88a5 | 17 | #include "shared_variables.h" |
klauss | 128:3ae1c74773a8 | 18 | #include "power_source_monitoring.h" |
klauss | 127:e7160a463b6c | 19 | |
klauss | 132:05cd37f7e007 | 20 | %: include "vz_stdio.h" |
klauss | 132:05cd37f7e007 | 21 | %: include <stdlib.h> |
klauss | 44:cc4996469404 | 22 | |
klauss | 119:ee6a53069455 | 23 | const uint8_t PVERSION = 25; |
klauss | 44:cc4996469404 | 24 | |
klauss | 17:67a6b557eda5 | 25 | extern uint8_t dog; |
klauss | 69:65665afbad5d | 26 | ///< Variável de controle que ativa a mensagem de boas vindas. |
klauss | 69:65665afbad5d | 27 | |
klauss | 121:ee02790d00b7 | 28 | extern bool flood_silence; |
klauss | 69:65665afbad5d | 29 | |
klauss | 74:81c47fff88a5 | 30 | extern bool delayed_flood; |
klauss | 74:81c47fff88a5 | 31 | ///< Variável de controle do envio de pacotes de flood off |
klauss | 74:81c47fff88a5 | 32 | |
klauss | 78:1353744f01e1 | 33 | extern bool tcp_alive; |
klauss | 78:1353744f01e1 | 34 | ///< Flag que indica para não dar timeout na conexão tcp |
klauss | 78:1353744f01e1 | 35 | |
klauss | 114:472502b31a12 | 36 | extern Timer tcp_timer; |
klauss | 78:1353744f01e1 | 37 | ///< Timer responsavel por dar timeout por não utilização de recurso. |
klauss | 78:1353744f01e1 | 38 | |
klauss | 69:65665afbad5d | 39 | /** |
klauss | 69:65665afbad5d | 40 | * @Synopsis Principal função de processamento de comandos. |
klauss | 69:65665afbad5d | 41 | * |
klauss | 69:65665afbad5d | 42 | * \note Apesar de formalmente receber apenas um parâmetro, esta função verifica uma porta TCP para verificar eventual |
klauss | 69:65665afbad5d | 43 | * envio de comandos, processando qualquer comando enviado por um usuário ligado na rede. |
klauss | 69:65665afbad5d | 44 | * |
klauss | 69:65665afbad5d | 45 | * @param ethernet_pkg Uma string de comando que será analisada, caso seja um comando válido, executa-o. |
klauss | 69:65665afbad5d | 46 | * |
klauss | 69:65665afbad5d | 47 | * @return NULL, sempre retorna NULL. |
klauss | 69:65665afbad5d | 48 | * |
klauss | 69:65665afbad5d | 49 | * Exemplo: |
klauss | 69:65665afbad5d | 50 | * @code |
klauss | 69:65665afbad5d | 51 | * ... |
klauss | 69:65665afbad5d | 52 | * char * returned_prompt = prompt_process( NULL ); |
klauss | 69:65665afbad5d | 53 | * ... |
klauss | 69:65665afbad5d | 54 | * @endcode |
klauss | 69:65665afbad5d | 55 | */ |
klauss | 121:ee02790d00b7 | 56 | char * prompt_process ( char * msg_from_cb, int length ); |
klauss | 28:94aec56c6329 | 57 | |
klauss | 132:05cd37f7e007 | 58 | char * command_process ( char * debug_buf, size_t length ); |
klauss | 69:65665afbad5d | 59 | |
klauss | 44:cc4996469404 | 60 | extern char * debug_buf; |
klauss | 69:65665afbad5d | 61 | ///< Buffer de entrada dos dados via serial. |
klauss | 17:67a6b557eda5 | 62 | |
klauss | 119:ee6a53069455 | 63 | inline void reconnect_udp_prompt_process( void ) |
klauss | 119:ee6a53069455 | 64 | { |
klauss | 119:ee6a53069455 | 65 | udp_client.close(); |
klauss | 119:ee6a53069455 | 66 | udp_client.set_blocking( false, 0 ); |
klauss | 132:05cd37f7e007 | 67 | udp_client.bind( u16_UDP_PORT_LISTENER ); |
klauss | 119:ee6a53069455 | 68 | } |
klauss | 119:ee6a53069455 | 69 | |
klauss | 17:67a6b557eda5 | 70 | #endif |