Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
Diff: debug.h
- Revision:
- 132:05cd37f7e007
- Parent:
- 131:938ab88facae
- Child:
- 135:2f4290590e51
diff -r 938ab88facae -r 05cd37f7e007 debug.h --- a/debug.h Tue Jul 21 20:03:35 2015 +0000 +++ b/debug.h Tue Sep 01 17:21:11 2015 +0000 @@ -8,14 +8,13 @@ #ifndef __DEBUG_H__ #define __DEBUG_H__ -#include "shared_variables.h" +%: include "shared_variables.h" +%: include "vz_stdio.h" -extern UDPSocket udp_client; -extern bool udp_query; -extern bool tcp_session; -extern bool from_eth; +%: define MODE_TEST 1 + extern uint16_t string_msg_overflow; -extern Endpoint udp_server; + extern uint16_t miss_prompt_udp_send_pkg; extern UDPSocket eth_fw_debug; @@ -26,13 +25,13 @@ const uint8_t DEBUG_AUX_MSG_SIZE = 64; -extern char debug_msg1[ DEBUG_MSG_SIZE + DEBUG_AUX_MSG_SIZE ]; +extern char debug_msg1 [ DEBUG_MSG_SIZE + DEBUG_AUX_MSG_SIZE ]; ///< Buffer usado na composisão da mensagem enviada pela macro debug_msg -extern char debug_msg2[ DEBUG_MSG_SIZE ]; +extern char debug_msg2 [ DEBUG_MSG_SIZE ]; ///< Buffer usado na composisão da mensagem enviada pela macro debug_msg -extern char msg_[ DEBUG_MSG_SIZE ]; +extern char msg_ [ DEBUG_MSG_SIZE ]; ///< Buffer utilizado pela macro send_msg extern bool cb_session; @@ -49,12 +48,10 @@ extern bool sizes; -extern bool debug_reconnect; extern uint16_t miss_debug_fw_send_pkg; extern uint16_t miss_sip_registry_send_pkg; extern uint16_t miss_sip_invite_send_pkg; extern uint16_t miss_sip_bye_send_pkg; -extern uint16_t miss_sip_unregistry_send_pkg; extern uint16_t miss_sip_ok_send_pkg; extern uint16_t miss_sip_rcv_bye_send_pkg; extern uint16_t miss_wdt_send_pkg; @@ -84,8 +81,6 @@ ///< Variável de controle que ativa o debug dos pacotes recebidos da eth \note não implementado. extern bool debug_eth_tx; ///< Variável de controle que ativa o debug dos pacotes enviados para a eth \note não implementado. -extern bool debug_prompt_eth; -///< Variável de controle que ativa o debug do prompt eth. extern bool debug_file; ///< Variável de controle que ativa o debug do sistema de arquivos. extern bool dbl; @@ -119,13 +114,13 @@ extern bool debug_fw; extern bool debug_gp; extern bool missed_send_udp_pkg; +extern bool debug_reconnect; extern bool debug_boot; extern bool debug_fw_print; -extern bool debug_uart3; extern bool big_bug_pkg; extern bool flood_bug_pkg; -extern uint16_t miss_ftp_udp_send_pkg; +extern uint16_t miss_rtp_udp_send_pkg; extern bool reset_missed_send_udp_pkg; extern bool debug_missed; extern uint16_t deleted_sip; @@ -166,9 +161,10 @@ extern bool drop_rtp_from_cbx_pkg; extern bool drop_registry_pkg; extern bool registra; +extern bool registra4; +extern bool debug_dont_refresh; extern bool received_audio_from_cb; -extern bool debug_reconnect; -extern uint16_t miss_ftp_udp_send_pkg; +extern uint16_t miss_rtp_udp_send_pkg; extern bool debug_bootloader; extern bool debug_bind; extern bool debug_app_init; @@ -179,71 +175,8 @@ extern bool debug_sqn; extern bool test_ts; extern bool debug_pwr_src; - -/** - * @Synopsis Função usada anteriormente para formatação da string que debug, não esta mais em uso. - * - * * @param pkg Ponteiro para inicio dos dados a serem transmitidos. - * @param size Tamanho do pacote que deve ser enviado. - * - */ -int eth_fw_debug_pkgdebug_pkg( uint8_t * pkg, int size ); - -/* -#define debug_msg(...) _debug_msg(__VA_ARGS__) -#define _debug_msg(...) { \ - sprintf(debug_msg1, "%s:%d ", __FILE__, __LINE__); \ - sprintf(debug_msg2, __VA_ARGS__); \ - strcat(debug_msg1, debug_msg2); \ - if( debug_uart3 ) pc.printf( "%s\n\r> ", debug_msg1 ); \ - if( tcp_session ){ \ - strcat( debug_msg1, "\n\r" ); \ - while( !( tcp_client.send_all( debug_msg1, strlen( debug_msg1 ) ) ) ); \ - }else if( udp_request ){ \ - udp_server.sendTo( udp_client, debug_msg1, strlen( debug_msg1 ) ); \ - } \ -} -*/ -#define debug_msg(...) _debug_msg(__VA_ARGS__) -#define _debug_msg(...) { \ - snprintf( debug_msg1, DEBUG_AUX_MSG_SIZE, "%s:%d ", __FILE__, __LINE__); \ - snprintf( debug_msg2, DEBUG_MSG_SIZE, __VA_ARGS__); \ - strncat( debug_msg1, debug_msg2, DEBUG_MSG_SIZE ); \ - if( debug_uart3 && !udp_query && !from_eth ) pc.printf( "%s\n\r> ", debug_msg1 ); \ - if( tcp_session && !udp_query ){ \ - strcat( debug_msg1, "\n\r> " ); \ - while( !( tcp_client.send_all( debug_msg1, strlen( debug_msg1 ) ) ) ); \ - } \ - if( udp_query ){ \ - strcat( debug_msg1, "\n\r" ); \ - int send = udp_client.sendTo( udp_server, debug_msg1, strlen( debug_msg1 ) ); \ - if( send != strlen( debug_msg1 ) ) \ - { \ - if( debug_reconnect && debug_uart3 && !from_eth ) pc.printf("\r\nReconnect udp_query client"); \ - reconnect_prompt_udp_socket(); \ - miss_prompt_udp_send_pkg++; \ - } \ - } \ -} -#define send_msg(...) _send_msg(__VA_ARGS__) -#define _send_msg(...) { \ - int snprintf_ret = snprintf( msg_, DEBUG_MSG_SIZE, __VA_ARGS__ ); \ - if( snprintf_ret >= DEBUG_MSG_SIZE ) string_msg_overflow++; \ - if( debug_uart3 && !udp_query && !from_eth ) pc.printf( "%s\n\r> ", msg_ ); \ - if( tcp_session && !udp_query ){ \ - strcat( msg_, "\n\r> " ); \ - while( !( tcp_client.send_all( msg_, strlen( msg_ ) ) ) ); \ - } \ - if( udp_query ){ \ - strcat( msg_, "\n\r> " ); \ - int send = udp_client.sendTo( udp_server, msg_, strlen( msg_ ) ); \ - if( send != strlen( msg_ ) ) \ - { \ - if( debug_reconnect && debug_uart3 ) pc.printf ("\n\rReconnect udp_query client\n\r"); \ - reconnect_prompt_udp_socket(); \ - miss_prompt_udp_send_pkg++; \ - } \ - } \ -} +extern bool debug_print_clock; +extern bool debug_resend_invite; +extern uint16_t miss_rtp_udp_rcv_pkg; #endif \ No newline at end of file