![](/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
Diff: shared_variables.cpp
- Revision:
- 113:db67ae00550e
- Parent:
- 109:a5b8264ffbbc
- Child:
- 114:472502b31a12
--- a/shared_variables.cpp Mon Apr 13 12:16:21 2015 +0000 +++ b/shared_variables.cpp Thu Apr 16 12:57:13 2015 +0000 @@ -6,6 +6,8 @@ bool reset_cks = false; +bool human_session = false; + TCPSocketServer tcp_server; TCPSocketConnection tcp_client; @@ -14,9 +16,11 @@ bool debug_alive = false; -UDPSocket udp_server; +Endpoint udp_server; -Endpoint udp_client; +UDPSocket udp_client; + +bool udp_query = false; bool pcks_s = false; @@ -30,27 +34,29 @@ bool stats = false; -uint16_t boot_counter = 0; +uint32_t boot_counter = 0; -uint16_t registry_counter = 0; +uint32_t registry_counter = 0; + +uint32_t invite_counter = 0; -uint16_t invite_counter = 0; +uint32_t audio_counter = 0; -uint16_t audio_counter = 0; +uint32_t telemetry_counter = 0; -uint16_t telemetry_counter = 0; +uint32_t cb_stats_counter = 0; -uint16_t cb_stats_counter = 0; +uint32_t cb_bye_counter = 0; -uint16_t cb_bye_counter = 0; +uint32_t prompt_counter = 0; -uint16_t prompt_counter = 0; +uint32_t flood_counter = 0; -uint16_t flood_counter = 0; +uint32_t out_of_range = 0; -uint16_t out_of_range = 0; +uint32_t fw_counter = 0; -uint16_t bootloader_cbx_counter = 0; +uint32_t bootloader_cbx_counter = 0; int max_ext = 0; @@ -92,6 +98,9 @@ uint32_t delayed_pkg_to_cb = 0; uint32_t cpld_pkg_tx_counter = 0; uint32_t cpld_pkg_rx_counter = 0; +uint16_t miss_prompt_udp_send_pkg = 0; +uint16_t miss_prompt_udp_rcv_pkg = 0; +bool extern_process = false; int print_this_cb = 0; int print_hex_this_cb = 0; int print_this_sip = 0; @@ -102,4 +111,22 @@ int print_hex_this_rtp = 0; int frtp_target = 0; int rescue_rtp_target = 0; -int rescue_rtp_value = 0; \ No newline at end of file +int rescue_rtp_value = 0; + +// inicializa o contador de uptime da header +uint32_t uptime = 0; + +void udp_query_send_msg( char * msg ) +{ + if( ( msg != NULL ) && ( strlen( msg ) > 0 ) ) + { + int send = udp_client.sendTo( udp_server, msg, strlen( msg ) ); + + if( send != strlen( msg ) ) + { + if( debug_reconnect ) send_msg("Reconnect UDP_request client"); + reconnect_prompt_udp_socket(); + miss_prompt_udp_send_pkg++; + } + } +} \ No newline at end of file