![](/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
shared_variables.h@134:395678c651d8, 2015-09-01 (annotated)
- Committer:
- klauss
- Date:
- Tue Sep 01 19:34:34 2015 +0000
- Revision:
- 134:395678c651d8
- Parent:
- 133:3d136f5ffd66
- Child:
- 135:2f4290590e51
Implementando a fun??o que pareia os pings de mestre e escravo, contemplando do bug da radio. Vers?o sem o comando de teste.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 74:81c47fff88a5 | 1 | #ifndef __SHARED_VARIABLES_H__ |
klauss | 74:81c47fff88a5 | 2 | #define __SHARED_VARIABLES_H__ |
klauss | 74:81c47fff88a5 | 3 | |
klauss | 121:ee02790d00b7 | 4 | #include "EthernetInterface.h" |
klauss | 74:81c47fff88a5 | 5 | #include "mbed.h" |
klauss | 132:05cd37f7e007 | 6 | %: include "config_manager.h" |
klauss | 121:ee02790d00b7 | 7 | |
klauss | 132:05cd37f7e007 | 8 | extern ConfigManager * cm; |
klauss | 121:ee02790d00b7 | 9 | |
klauss | 121:ee02790d00b7 | 10 | const uint16_t EXTERN_WDT_IDLE = 630; |
klauss | 121:ee02790d00b7 | 11 | ///< Tempo maximo ( countdown em segundos ) que a Header espera por algum tick do wdt externo ( via UDP ), deixa de tickar o wdt quando chega em zero. |
klauss | 121:ee02790d00b7 | 12 | |
klauss | 121:ee02790d00b7 | 13 | const uint8_t READ = 0x01; |
klauss | 121:ee02790d00b7 | 14 | ///< Define o estado ( na main ) de que existe um dados disponivel para leitura. |
klauss | 121:ee02790d00b7 | 15 | |
klauss | 121:ee02790d00b7 | 16 | const uint8_t WAITING = 0x00; |
klauss | 121:ee02790d00b7 | 17 | ///< Define o estado ( na main ) de que esta apenas esperando por um novo pacote vindo dos CBx. |
klauss | 121:ee02790d00b7 | 18 | |
klauss | 121:ee02790d00b7 | 19 | const uint16_t CB_BUFFER_SIZE = 300; |
klauss | 121:ee02790d00b7 | 20 | ///< Indica o numero máximo de bytes recebidos ( por pacote ) do CBx. |
klauss | 74:81c47fff88a5 | 21 | |
klauss | 75:bd3c647b860b | 22 | extern bool debug_alive; |
klauss | 74:81c47fff88a5 | 23 | ///< Variável de controle que ativa o debug de impressao periódica dos cbx registrados na lógica. |
klauss | 74:81c47fff88a5 | 24 | |
klauss | 74:81c47fff88a5 | 25 | extern bool reset_cks; |
klauss | 74:81c47fff88a5 | 26 | ///< Variável de controle que reseta os contadores de cks dos pacotes. |
klauss | 74:81c47fff88a5 | 27 | |
klauss | 75:bd3c647b860b | 28 | extern bool pcks_s; |
klauss | 74:81c47fff88a5 | 29 | ///< Variável de controle que ativa a exibição dos contadores de cks dos pacotes. |
klauss | 74:81c47fff88a5 | 30 | |
klauss | 75:bd3c647b860b | 31 | extern bool pshowcb; |
klauss | 74:81c47fff88a5 | 32 | ///< Variável de controle que ativa a exibição dos CBx registrados. |
klauss | 74:81c47fff88a5 | 33 | |
klauss | 74:81c47fff88a5 | 34 | extern bool list; |
klauss | 74:81c47fff88a5 | 35 | ///< Variável de controle para listar os CBx registrados na lógica da Header. |
klauss | 126:1f90756250fb | 36 | extern bool show_last_rx; |
klauss | 74:81c47fff88a5 | 37 | ///< Variável de controle para exibição do ultima pacote recebido dos CBx |
klauss | 126:1f90756250fb | 38 | extern bool show_last_tx; |
klauss | 74:81c47fff88a5 | 39 | ///< Variável de controle para exibição do ultimo pacote enviado para o CBx. |
klauss | 74:81c47fff88a5 | 40 | extern bool stats; |
klauss | 74:81c47fff88a5 | 41 | ///< Variável de controle para exibição dos contadores de pacotes recebidos por tipo. |
klauss | 74:81c47fff88a5 | 42 | extern bool r_stats; |
klauss | 74:81c47fff88a5 | 43 | ///< Variável de controle para resetar os contadores de pacotes recebidos por tipo. |
klauss | 74:81c47fff88a5 | 44 | |
klauss | 119:ee6a53069455 | 45 | extern uint32_t boot_counter; |
klauss | 74:81c47fff88a5 | 46 | ///< Contador dos pacotes de BOOT recebidos |
klauss | 74:81c47fff88a5 | 47 | |
klauss | 119:ee6a53069455 | 48 | extern uint32_t registry_counter; |
klauss | 74:81c47fff88a5 | 49 | ///< Contador dos pacotes de REGISTRY recebidos |
klauss | 74:81c47fff88a5 | 50 | |
klauss | 119:ee6a53069455 | 51 | extern uint32_t invite_counter; |
klauss | 74:81c47fff88a5 | 52 | ///< Contador dos pacotes de INVITE recebidos |
klauss | 74:81c47fff88a5 | 53 | |
klauss | 119:ee6a53069455 | 54 | extern uint32_t audio_counter; |
klauss | 74:81c47fff88a5 | 55 | ///< Contador dos pacotes de AUDIO recebidos |
klauss | 74:81c47fff88a5 | 56 | |
klauss | 119:ee6a53069455 | 57 | extern uint32_t telemetry_counter; |
klauss | 74:81c47fff88a5 | 58 | ///< Contador dos pacotes de TELEMETRY recebidos |
klauss | 74:81c47fff88a5 | 59 | |
klauss | 119:ee6a53069455 | 60 | extern uint32_t cb_stats_counter; |
klauss | 99:e80850c51106 | 61 | |
klauss | 119:ee6a53069455 | 62 | extern uint32_t cb_bye_counter; |
klauss | 74:81c47fff88a5 | 63 | ///< Contador dos pacotes de CB_BYE recebidos |
klauss | 74:81c47fff88a5 | 64 | |
klauss | 119:ee6a53069455 | 65 | extern uint32_t prompt_counter; |
klauss | 74:81c47fff88a5 | 66 | ///< Contador dos pacotes de PROMPT recebidos |
klauss | 74:81c47fff88a5 | 67 | |
klauss | 119:ee6a53069455 | 68 | extern uint32_t flood_counter; |
klauss | 74:81c47fff88a5 | 69 | ///< Contador dos pacotes de FLOOD recebidos |
klauss | 74:81c47fff88a5 | 70 | |
klauss | 119:ee6a53069455 | 71 | extern uint32_t bootloader_cbx_counter; |
klauss | 74:81c47fff88a5 | 72 | ///< Contador dos pacotes de BOOTLOADER_CBX recebidos |
klauss | 74:81c47fff88a5 | 73 | |
klauss | 119:ee6a53069455 | 74 | extern uint32_t out_of_range; |
klauss | 79:9bc12aa305a9 | 75 | ///< Contador de pacotes recebidos fora do range. |
klauss | 79:9bc12aa305a9 | 76 | |
klauss | 119:ee6a53069455 | 77 | extern uint32_t fw_counter; |
klauss | 119:ee6a53069455 | 78 | |
klauss | 74:81c47fff88a5 | 79 | extern Serial pc; |
klauss | 74:81c47fff88a5 | 80 | ///< Objeto que possibilita a excrita ( via printf ) de texto na serial |
klauss | 74:81c47fff88a5 | 81 | |
klauss | 78:1353744f01e1 | 82 | extern volatile uint8_t status; |
klauss | 78:1353744f01e1 | 83 | |
klauss | 81:3656f00ab3db | 84 | extern uint16_t external_wdt; |
klauss | 81:3656f00ab3db | 85 | |
klauss | 74:81c47fff88a5 | 86 | extern DigitalOut led1; |
klauss | 74:81c47fff88a5 | 87 | extern DigitalOut led2; |
klauss | 74:81c47fff88a5 | 88 | extern DigitalOut led3; |
klauss | 74:81c47fff88a5 | 89 | extern DigitalOut led4; |
klauss | 74:81c47fff88a5 | 90 | extern DigitalOut CAB_LED; |
klauss | 74:81c47fff88a5 | 91 | |
klauss | 80:61d61c9eb75c | 92 | extern int max_ext; |
klauss | 80:61d61c9eb75c | 93 | extern int min_ext; |
klauss | 81:3656f00ab3db | 94 | extern uint32_t missed_pkg; |
klauss | 99:e80850c51106 | 95 | extern uint32_t cpld_pkg_tx_counter; |
klauss | 99:e80850c51106 | 96 | extern uint32_t cpld_pkg_rx_counter; |
klauss | 85:b6f2dc1d0f4f | 97 | extern uint8_t cb_new_counter; |
klauss | 85:b6f2dc1d0f4f | 98 | extern uint8_t cb_delete_counter; |
klauss | 85:b6f2dc1d0f4f | 99 | extern uint8_t sip_new_counter; |
klauss | 85:b6f2dc1d0f4f | 100 | extern uint8_t sip_delete_counter; |
klauss | 87:679ee0d594a9 | 101 | extern uint16_t rtp_header_new_counter; |
klauss | 87:679ee0d594a9 | 102 | extern uint16_t rtp_body_new_counter; |
klauss | 87:679ee0d594a9 | 103 | extern uint16_t rtp_header_delete_counter; |
klauss | 87:679ee0d594a9 | 104 | extern uint16_t rtp_body_delete_counter; |
klauss | 91:c2a86b1f8aaa | 105 | extern uint16_t call_new_counter; |
klauss | 91:c2a86b1f8aaa | 106 | extern uint16_t call_delete_counter; |
klauss | 86:bf7b0d4c3232 | 107 | extern volatile uint16_t received_cpld_pkg; |
klauss | 87:679ee0d594a9 | 108 | extern bool memory_is_over; |
klauss | 92:92df17f538a8 | 109 | extern uint16_t sip_socket_send_failure; |
klauss | 97:8985817e8847 | 110 | extern bool show_sip; |
klauss | 114:472502b31a12 | 111 | extern uint32_t delayed_pkg_to_cb; |
klauss | 119:ee6a53069455 | 112 | extern uint16_t miss_prompt_udp_send_pkg; |
klauss | 119:ee6a53069455 | 113 | extern uint16_t miss_prompt_udp_rcv_pkg; |
klauss | 132:05cd37f7e007 | 114 | extern uint16_t miss_power_source_send_pkg; |
klauss | 132:05cd37f7e007 | 115 | extern uint16_t miss_bl_udp_send_pkg; |
klauss | 109:a5b8264ffbbc | 116 | extern int print_this_cb; |
klauss | 109:a5b8264ffbbc | 117 | extern int print_hex_this_cb; |
klauss | 119:ee6a53069455 | 118 | extern uint16_t miss_prompt_udp_rcv_pkg; |
klauss | 109:a5b8264ffbbc | 119 | extern int print_this_sip; |
klauss | 119:ee6a53069455 | 120 | extern uint16_t miss_prompt_udp_send_pkg; |
klauss | 109:a5b8264ffbbc | 121 | extern int print_hex_this_sip; |
klauss | 109:a5b8264ffbbc | 122 | extern int print_this_call; |
klauss | 109:a5b8264ffbbc | 123 | extern int print_hex_this_call; |
klauss | 109:a5b8264ffbbc | 124 | extern int print_this_rtp; |
klauss | 109:a5b8264ffbbc | 125 | extern int print_hex_this_rtp; |
klauss | 109:a5b8264ffbbc | 126 | extern int frtp_target; |
klauss | 109:a5b8264ffbbc | 127 | extern int rescue_rtp_target; |
klauss | 109:a5b8264ffbbc | 128 | extern int rescue_rtp_value; |
klauss | 119:ee6a53069455 | 129 | extern uint32_t uptime; |
klauss | 119:ee6a53069455 | 130 | extern uint8_t drop_this_amount_of_ack_to_ast; |
klauss | 119:ee6a53069455 | 131 | extern bool extern_process; |
klauss | 119:ee6a53069455 | 132 | extern uint16_t string_msg_overflow; |
klauss | 119:ee6a53069455 | 133 | extern bool test_flag_unusual; |
klauss | 123:1d395b5a4cad | 134 | extern bool show_time; |
klauss | 132:05cd37f7e007 | 135 | extern bool disable_wdt_from_cbx; |
klauss | 132:05cd37f7e007 | 136 | extern bool show_invites; |
klauss | 124:c1b6c893e1c3 | 137 | extern bool dont_say_hello_again; |
klauss | 124:c1b6c893e1c3 | 138 | extern bool reverse_list; |
klauss | 124:c1b6c893e1c3 | 139 | extern bool show_hello_status; |
klauss | 124:c1b6c893e1c3 | 140 | extern bool request_clock_now; |
klauss | 124:c1b6c893e1c3 | 141 | extern bool show_wake_all_up_status; |
klauss | 124:c1b6c893e1c3 | 142 | extern bool wake_all; |
klauss | 124:c1b6c893e1c3 | 143 | extern uint16_t end_call_ext; |
klauss | 124:c1b6c893e1c3 | 144 | extern bool end_call; |
klauss | 126:1f90756250fb | 145 | extern bool do_not_refresh; |
klauss | 126:1f90756250fb | 146 | extern bool do_not_show_this_invite_pkg; |
klauss | 132:05cd37f7e007 | 147 | extern bool show_wdt_string; |
klauss | 92:92df17f538a8 | 148 | |
klauss | 121:ee02790d00b7 | 149 | const uint8_t RTP_HEADER_OFFSET = 12; |
klauss | 74:81c47fff88a5 | 150 | ///< Identifica o inicio dos dados de audio ( payload ) |
klauss | 121:ee02790d00b7 | 151 | const uint8_t RTP_HEADER_SIZE = 12; |
klauss | 74:81c47fff88a5 | 152 | ///< Indica o tamanho ( em bytes ) ocupado pelo cabeçalho rtp. |
klauss | 74:81c47fff88a5 | 153 | |
klauss | 74:81c47fff88a5 | 154 | #endif |