Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
prompt.cpp@133:3d136f5ffd66, 2015-09-01 (annotated)
- Committer:
- klauss
- Date:
- Tue Sep 01 19:33:11 2015 +0000
- Revision:
- 133:3d136f5ffd66
- Parent:
- 132:05cd37f7e007
- Child:
- 134:395678c651d8
Implementando a fun??o que pareia os pings de mestre e escravo, contemplando do bug da radio. Vers?o com o comando de teste.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 44:cc4996469404 | 1 | #include "prompt.h" |
klauss | 45:c80574f24dc3 | 2 | |
klauss | 60:b4ec6beb3be3 | 3 | bool flood_silence = false; |
klauss | 65:0b653cfe95db | 4 | bool delayed_flood = false; |
klauss | 63:0d95da692bb4 | 5 | |
klauss | 132:05cd37f7e007 | 6 | int start_ext =0; |
klauss | 132:05cd37f7e007 | 7 | int end_ext = 0; |
klauss | 132:05cd37f7e007 | 8 | int ext_count = 0; |
klauss | 132:05cd37f7e007 | 9 | |
klauss | 78:1353744f01e1 | 10 | Timer tcp_timer; |
klauss | 78:1353744f01e1 | 11 | bool tcp_alive = false; |
klauss | 132:05cd37f7e007 | 12 | bool serial_pc_pending = false; |
klauss | 132:05cd37f7e007 | 13 | |
klauss | 132:05cd37f7e007 | 14 | volatile char b = 0; |
klauss | 132:05cd37f7e007 | 15 | uint8_t bufret = 0; |
klauss | 19:ab2088e0dec6 | 16 | |
klauss | 58:af7e8788f106 | 17 | char __debug_buf__[ DEBUGBUFSIZE ]; |
klauss | 35:96885a7931f0 | 18 | char * debug_buf = __debug_buf__; |
klauss | 58:af7e8788f106 | 19 | char last_cmd[ DEBUGBUFSIZE ]; |
klauss | 58:af7e8788f106 | 20 | char tmp_cmd[ DEBUGBUFSIZE ] = "help"; |
klauss | 30:8dfb6d8de53d | 21 | char last_debug_buf[ DEBUGBUFSIZE ] = "help"; |
klauss | 119:ee6a53069455 | 22 | char eth_buffer[ PROMPT_ETH_BUFFER_SIZE ]; |
klauss | 132:05cd37f7e007 | 23 | char eth_udp_buffer[ PROMPT_ETH_BUFFER_SIZE ]; |
klauss | 119:ee6a53069455 | 24 | char gp_buff[ DEBUGBUFSIZE ]; |
klauss | 132:05cd37f7e007 | 25 | uint8_t prompt_write_buffer [ CB_BUFFER_SIZE ]; |
klauss | 19:ab2088e0dec6 | 26 | |
klauss | 119:ee6a53069455 | 27 | uint16_t bufptr = 0; |
klauss | 119:ee6a53069455 | 28 | uint16_t last_bufptr = 0; |
klauss | 119:ee6a53069455 | 29 | |
klauss | 132:05cd37f7e007 | 30 | Timer flood_timeout; |
klauss | 132:05cd37f7e007 | 31 | Timer flood_silence_timer; |
klauss | 132:05cd37f7e007 | 32 | uint8_t id_msg = 0x10; |
klauss | 119:ee6a53069455 | 33 | |
klauss | 132:05cd37f7e007 | 34 | char * |
klauss | 132:05cd37f7e007 | 35 | prompt_process ( char * msg_from_cb, int length ) |
klauss | 119:ee6a53069455 | 36 | { |
klauss | 132:05cd37f7e007 | 37 | char eth_buffer [ PROMPT_ETH_BUFFER_SIZE ]; |
klauss | 132:05cd37f7e007 | 38 | |
klauss | 123:1d395b5a4cad | 39 | if ( id_msg < 0x11 ) id_msg = 0x11; |
klauss | 132:05cd37f7e007 | 40 | |
klauss | 132:05cd37f7e007 | 41 | if( flood_timeout.read() > 60 ) { |
klauss | 45:c80574f24dc3 | 42 | pflood = 0; |
klauss | 45:c80574f24dc3 | 43 | flood_timeout.stop(); |
klauss | 45:c80574f24dc3 | 44 | flood_timeout.reset(); |
klauss | 45:c80574f24dc3 | 45 | } |
klauss | 132:05cd37f7e007 | 46 | |
klauss | 132:05cd37f7e007 | 47 | if( tcp_timer.read() >= TCP_IDLE_MAX_TIME ) { |
klauss | 119:ee6a53069455 | 48 | tcp_alive = false; |
klauss | 119:ee6a53069455 | 49 | tcp_timer.stop(); |
klauss | 119:ee6a53069455 | 50 | tcp_timer.reset(); |
klauss | 119:ee6a53069455 | 51 | tcp_session = false; |
klauss | 119:ee6a53069455 | 52 | debug_buf = __debug_buf__; |
klauss | 119:ee6a53069455 | 53 | bufptr = last_bufptr; |
klauss | 119:ee6a53069455 | 54 | bufret = 0; |
klauss | 119:ee6a53069455 | 55 | from_eth = false; |
klauss | 119:ee6a53069455 | 56 | tcp_client.close(); |
klauss | 119:ee6a53069455 | 57 | return( NULL ); |
klauss | 132:05cd37f7e007 | 58 | } |
klauss | 132:05cd37f7e007 | 59 | |
klauss | 132:05cd37f7e007 | 60 | if( udp_query ) { |
klauss | 132:05cd37f7e007 | 61 | if( msg_from_cb != NULL ) { |
klauss | 119:ee6a53069455 | 62 | last_bufptr = bufptr; |
klauss | 119:ee6a53069455 | 63 | if( ( length > 2 ) && ( msg_from_cb[ length - 2 ] == '\r' ) ) msg_from_cb[ length - 2 ] = 0; |
klauss | 132:05cd37f7e007 | 64 | |
klauss | 119:ee6a53069455 | 65 | if( ( length > 1 ) && ( msg_from_cb[ length - 1 ] == '\n' ) ) msg_from_cb[ length - 1 ] = 0; |
klauss | 119:ee6a53069455 | 66 | |
klauss | 119:ee6a53069455 | 67 | if( ( length == 1 ) && msg_from_cb[ 0 ] == 0x0A ) strcpy( msg_from_cb, "\r" ); |
klauss | 132:05cd37f7e007 | 68 | |
klauss | 119:ee6a53069455 | 69 | bufptr = strlen( msg_from_cb ); |
klauss | 119:ee6a53069455 | 70 | debug_buf = msg_from_cb; |
klauss | 119:ee6a53069455 | 71 | from_eth = true; |
klauss | 119:ee6a53069455 | 72 | bufret = 1; |
klauss | 117:e9facba9db27 | 73 | } |
klauss | 132:05cd37f7e007 | 74 | } else { |
klauss | 132:05cd37f7e007 | 75 | if ( !tcp_server.accept ( tcp_client ) ) { |
klauss | 119:ee6a53069455 | 76 | tcp_session = true; |
klauss | 126:1f90756250fb | 77 | tcp_timer.start (); |
klauss | 119:ee6a53069455 | 78 | last_bufptr = bufptr; |
klauss | 126:1f90756250fb | 79 | for ( register int i = 0; i < PROMPT_ETH_BUFFER_SIZE; i++ ) eth_buffer [ i ] = 0; |
klauss | 119:ee6a53069455 | 80 | } |
klauss | 132:05cd37f7e007 | 81 | if ( tcp_session && !udp_query ) { |
klauss | 126:1f90756250fb | 82 | tcp_client.set_blocking ( false, 0 ); |
klauss | 126:1f90756250fb | 83 | int n = tcp_client.receive ( eth_buffer, sizeof ( eth_buffer ) - 1 ); |
klauss | 132:05cd37f7e007 | 84 | if( n > 0 ) { |
klauss | 126:1f90756250fb | 85 | tcp_timer.reset (); |
klauss | 132:05cd37f7e007 | 86 | |
klauss | 117:e9facba9db27 | 87 | if( ( n > 2 ) && ( eth_buffer[ n - 2 ] == '\r' ) ) eth_buffer[ n - 2 ] = 0; |
klauss | 132:05cd37f7e007 | 88 | |
klauss | 117:e9facba9db27 | 89 | if( ( n > 1 ) && ( eth_buffer[ n - 1 ] == '\n' ) ) eth_buffer[ n - 1 ] = 0; |
klauss | 132:05cd37f7e007 | 90 | |
klauss | 132:05cd37f7e007 | 91 | if( ( n == 1 ) && eth_buffer[ 0 ] == 0x0A ) strcpy( eth_buffer, "\r> " ); |
klauss | 132:05cd37f7e007 | 92 | |
klauss | 105:a930035b6556 | 93 | bufptr = strlen( eth_buffer ); |
klauss | 105:a930035b6556 | 94 | debug_buf = eth_buffer; |
klauss | 105:a930035b6556 | 95 | from_eth = true; |
klauss | 105:a930035b6556 | 96 | bufret = 1; |
klauss | 132:05cd37f7e007 | 97 | |
klauss | 132:05cd37f7e007 | 98 | if ( n > 2 ) |
klauss | 119:ee6a53069455 | 99 | { |
klauss | 132:05cd37f7e007 | 100 | char tmp[] = "> "; |
klauss | 132:05cd37f7e007 | 101 | |
klauss | 132:05cd37f7e007 | 102 | while ( !( tcp_client.send_all ( tmp, strlen ( tmp ) ) ) ); |
klauss | 132:05cd37f7e007 | 103 | } |
klauss | 132:05cd37f7e007 | 104 | |
klauss | 132:05cd37f7e007 | 105 | if( !( strcmp( eth_buffer, "quit" ) ) ) { |
klauss | 119:ee6a53069455 | 106 | tcp_timer.stop(); |
klauss | 105:a930035b6556 | 107 | tcp_timer.reset(); |
klauss | 105:a930035b6556 | 108 | debug_buf = __debug_buf__; |
klauss | 105:a930035b6556 | 109 | bufptr = last_bufptr; |
klauss | 105:a930035b6556 | 110 | from_eth = false; |
klauss | 105:a930035b6556 | 111 | tcp_session = false; |
klauss | 105:a930035b6556 | 112 | tcp_client.close(); |
klauss | 105:a930035b6556 | 113 | bufret = 0; |
klauss | 105:a930035b6556 | 114 | return( NULL ); |
klauss | 105:a930035b6556 | 115 | } |
klauss | 119:ee6a53069455 | 116 | } else { |
klauss | 48:195c97f12e8e | 117 | debug_buf = __debug_buf__; |
klauss | 48:195c97f12e8e | 118 | bufptr = last_bufptr; |
klauss | 57:78f7191a8b69 | 119 | from_eth = false; |
klauss | 45:c80574f24dc3 | 120 | } |
klauss | 119:ee6a53069455 | 121 | } |
klauss | 117:e9facba9db27 | 122 | } |
klauss | 119:ee6a53069455 | 123 | |
klauss | 132:05cd37f7e007 | 124 | if( ( !from_eth ) && ( !udp_query ) ) { |
klauss | 119:ee6a53069455 | 125 | if( pc.readable() ) { |
klauss | 117:e9facba9db27 | 126 | b = pc.getc(); |
klauss | 119:ee6a53069455 | 127 | if( b == 0x0D ) { |
klauss | 119:ee6a53069455 | 128 | // enter |
klauss | 117:e9facba9db27 | 129 | bufret = 1; |
klauss | 132:05cd37f7e007 | 130 | if ( debug_uart3 ) serial_pc_pending = true; |
klauss | 132:05cd37f7e007 | 131 | |
klauss | 132:05cd37f7e007 | 132 | // formatação manual da saída |
klauss | 132:05cd37f7e007 | 133 | if ( bufptr > 0 ) serial_pc.printf ( "%s","\r\n> " ); |
klauss | 119:ee6a53069455 | 134 | } else { |
klauss | 117:e9facba9db27 | 135 | pc.putc( b ); |
klauss | 119:ee6a53069455 | 136 | if( b == 0x08 || b == 0x7F ) { |
klauss | 119:ee6a53069455 | 137 | // BS | DEL |
klauss | 119:ee6a53069455 | 138 | if( bufptr > 0 ) { |
klauss | 119:ee6a53069455 | 139 | __debug_buf__[ --bufptr ] = 0; |
klauss | 119:ee6a53069455 | 140 | } |
klauss | 119:ee6a53069455 | 141 | } else if( b == 0x09 ) { |
klauss | 117:e9facba9db27 | 142 | // ignore tab |
klauss | 119:ee6a53069455 | 143 | } else { |
klauss | 119:ee6a53069455 | 144 | __debug_buf__[ bufptr ] = b; |
klauss | 117:e9facba9db27 | 145 | bufptr++; |
klauss | 117:e9facba9db27 | 146 | } |
klauss | 119:ee6a53069455 | 147 | last_bufptr = bufptr; |
klauss | 117:e9facba9db27 | 148 | } |
klauss | 116:39a41ebb675c | 149 | } |
klauss | 53:bb492a8f115a | 150 | } |
klauss | 132:05cd37f7e007 | 151 | |
klauss | 132:05cd37f7e007 | 152 | if ( flood_silence ) |
klauss | 132:05cd37f7e007 | 153 | { |
klauss | 132:05cd37f7e007 | 154 | if ( flood_silence_timer.read_ms () > 250 ) |
klauss | 132:05cd37f7e007 | 155 | { |
klauss | 113:db67ae00550e | 156 | char cmd[ 16 ] = "flood off"; |
klauss | 113:db67ae00550e | 157 | int str_end = strlen( cmd ); |
klauss | 113:db67ae00550e | 158 | cmd[ str_end ] = 0x0D; |
klauss | 113:db67ae00550e | 159 | cmd[ str_end + 1 ] = 0x00; |
klauss | 119:ee6a53069455 | 160 | |
klauss | 113:db67ae00550e | 161 | int port = convert_ext_to_port( ext_count ); |
klauss | 132:05cd37f7e007 | 162 | |
klauss | 132:05cd37f7e007 | 163 | send2callboxes( build_cb_package( ext_count, port, PROMPT, cmd, id_msg++, CB_BUFFER_SIZE - VZ_HEADER_OFFSET, prompt_write_buffer ) ); |
klauss | 132:05cd37f7e007 | 164 | |
klauss | 132:05cd37f7e007 | 165 | vz_printf ("Silence sent to ext=%d port=%d", ext_count, port ); |
klauss | 132:05cd37f7e007 | 166 | |
klauss | 132:05cd37f7e007 | 167 | flood_silence_timer.reset(); |
klauss | 119:ee6a53069455 | 168 | |
klauss | 119:ee6a53069455 | 169 | // importante para o uso da funçao silence |
klauss | 119:ee6a53069455 | 170 | if( ++ext_count > end_ext ) { |
klauss | 113:db67ae00550e | 171 | flood_silence = false; |
klauss | 113:db67ae00550e | 172 | flood_silence_timer.stop(); |
klauss | 113:db67ae00550e | 173 | flood_silence_timer.reset(); |
klauss | 119:ee6a53069455 | 174 | |
klauss | 119:ee6a53069455 | 175 | if( debug_uart3 && !( from_eth ) ) pc.printf("\r\n> " ); |
klauss | 119:ee6a53069455 | 176 | if( tcp_session && !udp_query ) { |
klauss | 119:ee6a53069455 | 177 | snprintf( eth_buffer, PROMPT_ETH_BUFFER_SIZE, "\r\n> " ); |
klauss | 113:db67ae00550e | 178 | tcp_client.send_all( eth_buffer, strlen( eth_buffer ) ); |
klauss | 119:ee6a53069455 | 179 | } else if( udp_query ) { |
klauss | 119:ee6a53069455 | 180 | snprintf( eth_buffer, PROMPT_ETH_BUFFER_SIZE, "\r\n> " ); |
klauss | 119:ee6a53069455 | 181 | udp_query_send_msg( eth_buffer ); |
klauss | 113:db67ae00550e | 182 | } |
klauss | 31:bb5fb28a77df | 183 | } |
klauss | 53:bb492a8f115a | 184 | } |
klauss | 48:195c97f12e8e | 185 | } |
klauss | 132:05cd37f7e007 | 186 | |
klauss | 132:05cd37f7e007 | 187 | if ( delayed_flood ) |
klauss | 132:05cd37f7e007 | 188 | { |
klauss | 65:0b653cfe95db | 189 | tflood.start(); |
klauss | 65:0b653cfe95db | 190 | tflood.reset(); |
klauss | 65:0b653cfe95db | 191 | floodcount =0; |
klauss | 65:0b653cfe95db | 192 | pflood = 1; |
klauss | 65:0b653cfe95db | 193 | flood_timeout.start(); |
klauss | 65:0b653cfe95db | 194 | delayed_flood = false; |
klauss | 132:05cd37f7e007 | 195 | if( debug_uart3 ) pc.printf("\n\rFlood ON\n\r" ); |
klauss | 132:05cd37f7e007 | 196 | if( from_eth ) { |
klauss | 119:ee6a53069455 | 197 | snprintf( debug_buf, PROMPT_ETH_BUFFER_SIZE, "Flood On\n\r" ); |
klauss | 65:0b653cfe95db | 198 | } |
klauss | 65:0b653cfe95db | 199 | } |
klauss | 132:05cd37f7e007 | 200 | |
klauss | 132:05cd37f7e007 | 201 | char * tmp_return = NULL; |
klauss | 132:05cd37f7e007 | 202 | |
klauss | 132:05cd37f7e007 | 203 | if ( bufret == 1 ) |
klauss | 132:05cd37f7e007 | 204 | { |
klauss | 132:05cd37f7e007 | 205 | tmp_return = command_process ( debug_buf, bufptr ); |
klauss | 132:05cd37f7e007 | 206 | |
klauss | 132:05cd37f7e007 | 207 | if( b == 0x0D || bufret == 1 || bufptr > DEBUGBUFSIZE ) { |
klauss | 132:05cd37f7e007 | 208 | bufret = 0; |
klauss | 132:05cd37f7e007 | 209 | |
klauss | 132:05cd37f7e007 | 210 | if( debug_uart3 && !( from_eth ) ) pc.putc(0x0A); |
klauss | 132:05cd37f7e007 | 211 | if( debug_uart3 && !( from_eth ) ) pc.putc(0x0D); |
klauss | 132:05cd37f7e007 | 212 | if( debug_uart3 && !( from_eth ) ) pc.printf("> " ); |
klauss | 132:05cd37f7e007 | 213 | |
klauss | 132:05cd37f7e007 | 214 | if( from_eth ) { |
klauss | 132:05cd37f7e007 | 215 | if( strlen( debug_buf ) > 0 ) { |
klauss | 132:05cd37f7e007 | 216 | |
klauss | 132:05cd37f7e007 | 217 | if( debug_buf[ strlen( debug_buf ) - 1 ] == '\r' || debug_buf[ strlen( debug_buf ) - 1 ] == '\n' ) { |
klauss | 132:05cd37f7e007 | 218 | strcpy( debug_buf, "> " ); |
klauss | 132:05cd37f7e007 | 219 | } else { |
klauss | 132:05cd37f7e007 | 220 | strcpy( debug_buf, "\n\r> " ); |
klauss | 132:05cd37f7e007 | 221 | } |
klauss | 132:05cd37f7e007 | 222 | } else { |
klauss | 132:05cd37f7e007 | 223 | |
klauss | 132:05cd37f7e007 | 224 | } |
klauss | 132:05cd37f7e007 | 225 | |
klauss | 132:05cd37f7e007 | 226 | if( tcp_session && !udp_query ) { |
klauss | 132:05cd37f7e007 | 227 | tcp_client.send_all( debug_buf, strlen( debug_buf ) ); |
klauss | 132:05cd37f7e007 | 228 | } else if( udp_query ) { |
klauss | 132:05cd37f7e007 | 229 | |
klauss | 132:05cd37f7e007 | 230 | udp_query_send_msg( debug_buf ); |
klauss | 132:05cd37f7e007 | 231 | |
klauss | 132:05cd37f7e007 | 232 | } |
klauss | 132:05cd37f7e007 | 233 | for( register uint16_t i = 0; i < PROMPT_ETH_BUFFER_SIZE; i++ ) eth_buffer[ i ] = 0; |
klauss | 132:05cd37f7e007 | 234 | |
klauss | 132:05cd37f7e007 | 235 | debug_buf = __debug_buf__; |
klauss | 132:05cd37f7e007 | 236 | |
klauss | 132:05cd37f7e007 | 237 | bufptr = last_bufptr; |
klauss | 132:05cd37f7e007 | 238 | |
klauss | 132:05cd37f7e007 | 239 | } else { |
klauss | 132:05cd37f7e007 | 240 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 241 | last_bufptr = 0; |
klauss | 132:05cd37f7e007 | 242 | for( register int i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf[ i ] = 0; |
klauss | 132:05cd37f7e007 | 243 | } |
klauss | 132:05cd37f7e007 | 244 | } |
klauss | 132:05cd37f7e007 | 245 | } |
klauss | 132:05cd37f7e007 | 246 | |
klauss | 132:05cd37f7e007 | 247 | return ( tmp_return ); |
klauss | 132:05cd37f7e007 | 248 | } |
klauss | 132:05cd37f7e007 | 249 | |
klauss | 132:05cd37f7e007 | 250 | char * |
klauss | 132:05cd37f7e007 | 251 | command_process ( char * debug_buf, size_t bufptr ) |
klauss | 132:05cd37f7e007 | 252 | { |
klauss | 132:05cd37f7e007 | 253 | bool miss_match = true; |
klauss | 132:05cd37f7e007 | 254 | |
klauss | 132:05cd37f7e007 | 255 | { |
klauss | 132:05cd37f7e007 | 256 | static unsigned int promptcb_last_ext = 0; |
klauss | 132:05cd37f7e007 | 257 | static unsigned int promptcb_last_port = 0; |
klauss | 132:05cd37f7e007 | 258 | static char promptcb_last_cmd [ 300 ]; |
klauss | 114:472502b31a12 | 259 | |
klauss | 60:b4ec6beb3be3 | 260 | |
klauss | 124:c1b6c893e1c3 | 261 | // removendo espacos em branco no inicio da string |
klauss | 124:c1b6c893e1c3 | 262 | uint16_t shift_blank_spaces = 0; |
klauss | 132:05cd37f7e007 | 263 | for ( register uint16_t i = 0; i < DEBUGBUFSIZE; i++ ) { |
klauss | 124:c1b6c893e1c3 | 264 | if ( debug_buf [ i ] == 0x20 ) shift_blank_spaces++; |
klauss | 132:05cd37f7e007 | 265 | |
klauss | 124:c1b6c893e1c3 | 266 | if ( debug_buf [ i ] != 0x20 ) break; |
klauss | 124:c1b6c893e1c3 | 267 | } |
klauss | 124:c1b6c893e1c3 | 268 | debug_buf += shift_blank_spaces; |
klauss | 124:c1b6c893e1c3 | 269 | |
klauss | 58:af7e8788f106 | 270 | strcpy( tmp_cmd, debug_buf ); |
klauss | 132:05cd37f7e007 | 271 | if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "." ) ) { |
klauss | 45:c80574f24dc3 | 272 | miss_match = false; |
klauss | 58:af7e8788f106 | 273 | strcpy( debug_buf, last_cmd ); |
klauss | 58:af7e8788f106 | 274 | strcpy( tmp_cmd, debug_buf ); |
klauss | 132:05cd37f7e007 | 275 | } else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "+" ) ) { |
klauss | 59:e1e300880d2d | 276 | miss_match = false; |
klauss | 59:e1e300880d2d | 277 | strcpy( debug_buf, "flood on" ); |
klauss | 59:e1e300880d2d | 278 | strcpy( tmp_cmd, debug_buf ); |
klauss | 132:05cd37f7e007 | 279 | } else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "-" ) ) { |
klauss | 59:e1e300880d2d | 280 | miss_match = false; |
klauss | 59:e1e300880d2d | 281 | strcpy( debug_buf, "flood off" ); |
klauss | 59:e1e300880d2d | 282 | strcpy( tmp_cmd, debug_buf ); |
klauss | 132:05cd37f7e007 | 283 | } else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "++ ", 3 ) ) { |
klauss | 59:e1e300880d2d | 284 | miss_match = false; |
klauss | 65:0b653cfe95db | 285 | delayed_flood = true; |
klauss | 59:e1e300880d2d | 286 | int ext = atoi( debug_buf + 3 ); |
klauss | 59:e1e300880d2d | 287 | sprintf( debug_buf, "pcb %i flood on", ext ); |
klauss | 132:05cd37f7e007 | 288 | } else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "-- ", 3 ) ) { |
klauss | 59:e1e300880d2d | 289 | miss_match = false; |
klauss | 59:e1e300880d2d | 290 | int ext = atoi( debug_buf + 3 ); |
klauss | 132:05cd37f7e007 | 291 | if( debug_uart3 ) pc.printf("\n\rFlood OFF\n\r" ); |
klauss | 132:05cd37f7e007 | 292 | if( from_eth ) { |
klauss | 119:ee6a53069455 | 293 | snprintf( debug_buf, PROMPT_ETH_BUFFER_SIZE, "Flood OFF\n\r" ); |
klauss | 59:e1e300880d2d | 294 | } |
klauss | 59:e1e300880d2d | 295 | pflood = 0; |
klauss | 59:e1e300880d2d | 296 | tflood.stop(); |
klauss | 59:e1e300880d2d | 297 | flood_timeout.reset(); |
klauss | 132:05cd37f7e007 | 298 | sprintf( debug_buf, "pcb %i flood off", ext ); |
klauss | 45:c80574f24dc3 | 299 | } |
klauss | 132:05cd37f7e007 | 300 | |
klauss | 48:195c97f12e8e | 301 | //tratamento dos enters |
klauss | 132:05cd37f7e007 | 302 | if( !bufptr ) { |
klauss | 45:c80574f24dc3 | 303 | miss_match = false; |
klauss | 132:05cd37f7e007 | 304 | } else if( bufptr == 1 ) { |
klauss | 48:195c97f12e8e | 305 | if( debug_buf[ 0 ] == 0x0D || debug_buf[ 0 ] == 0x0D ) miss_match = false; |
klauss | 48:195c97f12e8e | 306 | } |
klauss | 132:05cd37f7e007 | 307 | |
klauss | 132:05cd37f7e007 | 308 | if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "show_configs" ) ) { |
klauss | 45:c80574f24dc3 | 309 | miss_match = false; |
klauss | 132:05cd37f7e007 | 310 | if( debug_uart3 ) pc.printf("\n\r" ); |
klauss | 45:c80574f24dc3 | 311 | files('s'); |
klauss | 45:c80574f24dc3 | 312 | } |
klauss | 132:05cd37f7e007 | 313 | |
klauss | 132:05cd37f7e007 | 314 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "rx" ) ) { |
klauss | 62:07e5bdc9f8f7 | 315 | miss_match = false; |
klauss | 126:1f90756250fb | 316 | show_last_rx = true; |
klauss | 62:07e5bdc9f8f7 | 317 | } |
klauss | 132:05cd37f7e007 | 318 | |
klauss | 132:05cd37f7e007 | 319 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "tx" ) ) { |
klauss | 63:0d95da692bb4 | 320 | miss_match = false; |
klauss | 126:1f90756250fb | 321 | show_last_tx = true; |
klauss | 63:0d95da692bb4 | 322 | } |
klauss | 132:05cd37f7e007 | 323 | |
klauss | 132:05cd37f7e007 | 324 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "stats" ) ) { |
klauss | 63:0d95da692bb4 | 325 | miss_match = false; |
klauss | 63:0d95da692bb4 | 326 | stats = true; |
klauss | 132:05cd37f7e007 | 327 | } |
klauss | 132:05cd37f7e007 | 328 | |
klauss | 132:05cd37f7e007 | 329 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "reset_stats" ) ) { |
klauss | 63:0d95da692bb4 | 330 | miss_match = false; |
klauss | 63:0d95da692bb4 | 331 | r_stats = true; |
klauss | 63:0d95da692bb4 | 332 | } |
klauss | 132:05cd37f7e007 | 333 | |
klauss | 132:05cd37f7e007 | 334 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "rtp" ) ) { |
klauss | 114:472502b31a12 | 335 | miss_match = false; |
klauss | 114:472502b31a12 | 336 | dshow_rtp = true; |
klauss | 114:472502b31a12 | 337 | } |
klauss | 132:05cd37f7e007 | 338 | |
klauss | 132:05cd37f7e007 | 339 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "callrtp" ) ) { |
klauss | 45:c80574f24dc3 | 340 | miss_match = false; |
klauss | 114:472502b31a12 | 341 | dcallshow_rtp = true; |
klauss | 114:472502b31a12 | 342 | } |
klauss | 132:05cd37f7e007 | 343 | |
klauss | 132:05cd37f7e007 | 344 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "format" ) ) { |
klauss | 114:472502b31a12 | 345 | miss_match = false; |
klauss | 119:ee6a53069455 | 346 | |
klauss | 132:05cd37f7e007 | 347 | if( from_eth ) { |
klauss | 119:ee6a53069455 | 348 | char msg[ 32 ]; |
klauss | 132:05cd37f7e007 | 349 | snprintf( msg, 32, "Not Allowed\n\r" ); |
klauss | 132:05cd37f7e007 | 350 | |
klauss | 119:ee6a53069455 | 351 | if( tcp_session && !udp_query ) { |
klauss | 119:ee6a53069455 | 352 | tcp_client.send_all( msg, strlen( msg ) ); |
klauss | 119:ee6a53069455 | 353 | } else if( udp_query ) { |
klauss | 119:ee6a53069455 | 354 | udp_query_send_msg( msg ); |
klauss | 119:ee6a53069455 | 355 | } |
klauss | 119:ee6a53069455 | 356 | } else { |
klauss | 132:05cd37f7e007 | 357 | if ( debug_uart3 ) pc.printf("\n\rFormatando o sistema de arquivos... espere o sistema reiniciar\n\r" ); |
klauss | 62:07e5bdc9f8f7 | 358 | files('e'); |
klauss | 62:07e5bdc9f8f7 | 359 | files('w'); |
klauss | 62:07e5bdc9f8f7 | 360 | __disable_irq(); |
klauss | 62:07e5bdc9f8f7 | 361 | NVIC_SystemReset(); |
klauss | 42:480335bdde12 | 362 | } |
klauss | 45:c80574f24dc3 | 363 | } |
klauss | 45:c80574f24dc3 | 364 | |
klauss | 132:05cd37f7e007 | 365 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "ipset ", 6 ) ) |
klauss | 132:05cd37f7e007 | 366 | { |
klauss | 45:c80574f24dc3 | 367 | miss_match = false; |
klauss | 132:05cd37f7e007 | 368 | cm -> set_header_ip ( debug_buf + 6 ); |
klauss | 45:c80574f24dc3 | 369 | } |
klauss | 132:05cd37f7e007 | 370 | |
klauss | 132:05cd37f7e007 | 371 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "extset ", 7 ) ) |
klauss | 132:05cd37f7e007 | 372 | { |
klauss | 45:c80574f24dc3 | 373 | miss_match = false; |
klauss | 132:05cd37f7e007 | 374 | cm -> set_header_ext ( atoi ( debug_buf + 7 ) ); |
klauss | 45:c80574f24dc3 | 375 | } |
klauss | 132:05cd37f7e007 | 376 | |
klauss | 132:05cd37f7e007 | 377 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "serextset ", 10 ) ) |
klauss | 132:05cd37f7e007 | 378 | { |
klauss | 45:c80574f24dc3 | 379 | miss_match = false; |
klauss | 132:05cd37f7e007 | 380 | cm -> set_server_ext ( atoi ( debug_buf + 10 ) ); |
klauss | 45:c80574f24dc3 | 381 | } |
klauss | 132:05cd37f7e007 | 382 | |
klauss | 132:05cd37f7e007 | 383 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "shift_port ", 11 ) ) |
klauss | 132:05cd37f7e007 | 384 | { |
klauss | 119:ee6a53069455 | 385 | miss_match = false; |
klauss | 132:05cd37f7e007 | 386 | cm -> set_shift_port( atoi ( debug_buf + 11 ) ); |
klauss | 119:ee6a53069455 | 387 | } |
klauss | 45:c80574f24dc3 | 388 | |
klauss | 132:05cd37f7e007 | 389 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "maskset ", 8 ) ) |
klauss | 132:05cd37f7e007 | 390 | { |
klauss | 45:c80574f24dc3 | 391 | miss_match = false; |
klauss | 132:05cd37f7e007 | 392 | cm -> set_net_mask ( debug_buf + 8 ); |
klauss | 45:c80574f24dc3 | 393 | } |
klauss | 45:c80574f24dc3 | 394 | |
klauss | 132:05cd37f7e007 | 395 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "gatewayset ", 11 ) ) |
klauss | 132:05cd37f7e007 | 396 | { |
klauss | 45:c80574f24dc3 | 397 | miss_match = false; |
klauss | 132:05cd37f7e007 | 398 | cm -> set_gateway ( debug_buf + 11 ); |
klauss | 45:c80574f24dc3 | 399 | } |
klauss | 45:c80574f24dc3 | 400 | |
klauss | 132:05cd37f7e007 | 401 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "msipport ",9 ) ) |
klauss | 132:05cd37f7e007 | 402 | { |
klauss | 45:c80574f24dc3 | 403 | miss_match = false; |
klauss | 132:05cd37f7e007 | 404 | cm -> set_header_sip_port ( atoi ( debug_buf + 9 ) ); |
klauss | 45:c80574f24dc3 | 405 | } |
klauss | 45:c80574f24dc3 | 406 | |
klauss | 132:05cd37f7e007 | 407 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "serverip ",9 ) ) |
klauss | 132:05cd37f7e007 | 408 | { |
klauss | 81:3656f00ab3db | 409 | miss_match = false; |
klauss | 132:05cd37f7e007 | 410 | cm -> set_server_ip ( debug_buf + 9 ); |
klauss | 81:3656f00ab3db | 411 | } |
klauss | 132:05cd37f7e007 | 412 | |
klauss | 132:05cd37f7e007 | 413 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "maxext ", 7 ) ) |
klauss | 132:05cd37f7e007 | 414 | { |
klauss | 81:3656f00ab3db | 415 | miss_match = false; |
klauss | 132:05cd37f7e007 | 416 | cm -> set_max_ext ( atoi ( debug_buf + 7 ) ); |
klauss | 81:3656f00ab3db | 417 | } |
klauss | 45:c80574f24dc3 | 418 | |
klauss | 132:05cd37f7e007 | 419 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "minext ", 7 ) ) |
klauss | 132:05cd37f7e007 | 420 | { |
klauss | 99:e80850c51106 | 421 | miss_match = false; |
klauss | 132:05cd37f7e007 | 422 | cm -> set_min_ext ( atoi ( debug_buf + 7 ) ); |
klauss | 99:e80850c51106 | 423 | } |
klauss | 114:472502b31a12 | 424 | |
klauss | 132:05cd37f7e007 | 425 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "ssport ", 7 ) ) |
klauss | 132:05cd37f7e007 | 426 | { |
klauss | 113:db67ae00550e | 427 | miss_match = false; |
klauss | 132:05cd37f7e007 | 428 | cm -> set_server_port ( atoi ( debug_buf + 7 ) ); |
klauss | 132:05cd37f7e007 | 429 | } |
klauss | 132:05cd37f7e007 | 430 | |
klauss | 132:05cd37f7e007 | 431 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "fw_ip ", 6 ) ) |
klauss | 132:05cd37f7e007 | 432 | { |
klauss | 132:05cd37f7e007 | 433 | miss_match = false; |
klauss | 132:05cd37f7e007 | 434 | cm -> set_fw_server_ip ( debug_buf + 6 ); |
klauss | 132:05cd37f7e007 | 435 | } |
klauss | 132:05cd37f7e007 | 436 | |
klauss | 132:05cd37f7e007 | 437 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "fw_port ", 8 ) ) |
klauss | 132:05cd37f7e007 | 438 | { |
klauss | 132:05cd37f7e007 | 439 | miss_match = false; |
klauss | 132:05cd37f7e007 | 440 | cm -> set_fw_server_port ( atoi ( debug_buf + 8 ) ); |
klauss | 45:c80574f24dc3 | 441 | } |
klauss | 133:3d136f5ffd66 | 442 | |
klauss | 133:3d136f5ffd66 | 443 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "set_acceptable_delay ", 21 ) ) |
klauss | 133:3d136f5ffd66 | 444 | { |
klauss | 133:3d136f5ffd66 | 445 | miss_match = false; |
klauss | 133:3d136f5ffd66 | 446 | cm -> set_acceptable_delay ( atoi ( debug_buf + 21 ) ); |
klauss | 133:3d136f5ffd66 | 447 | } |
klauss | 45:c80574f24dc3 | 448 | |
klauss | 132:05cd37f7e007 | 449 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dconfig" ) ) |
klauss | 132:05cd37f7e007 | 450 | { |
klauss | 45:c80574f24dc3 | 451 | miss_match = false; |
klauss | 132:05cd37f7e007 | 452 | cm -> restore_defaults_settings (); |
klauss | 132:05cd37f7e007 | 453 | } |
klauss | 132:05cd37f7e007 | 454 | |
klauss | 132:05cd37f7e007 | 455 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "reset" ) ) |
klauss | 132:05cd37f7e007 | 456 | { |
klauss | 132:05cd37f7e007 | 457 | miss_match = false; |
klauss | 132:05cd37f7e007 | 458 | |
klauss | 132:05cd37f7e007 | 459 | vz_printf ( "Job is done" ); |
klauss | 132:05cd37f7e007 | 460 | |
klauss | 48:195c97f12e8e | 461 | __disable_irq(); |
klauss | 132:05cd37f7e007 | 462 | |
klauss | 45:c80574f24dc3 | 463 | NVIC_SystemReset(); |
klauss | 45:c80574f24dc3 | 464 | } |
klauss | 132:05cd37f7e007 | 465 | |
klauss | 132:05cd37f7e007 | 466 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "test" ) ) |
klauss | 132:05cd37f7e007 | 467 | { |
klauss | 45:c80574f24dc3 | 468 | miss_match = false; |
klauss | 132:05cd37f7e007 | 469 | char msg[] = "This is another test"; |
klauss | 132:05cd37f7e007 | 470 | vz_printf ("-->%s<--", msg ); |
klauss | 132:05cd37f7e007 | 471 | vz_printf ("-->%d<--", 28 ); |
klauss | 45:c80574f24dc3 | 472 | } |
klauss | 132:05cd37f7e007 | 473 | |
klauss | 132:05cd37f7e007 | 474 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dog" ) ) |
klauss | 132:05cd37f7e007 | 475 | { |
klauss | 132:05cd37f7e007 | 476 | miss_match = false; |
klauss | 132:05cd37f7e007 | 477 | |
klauss | 133:3d136f5ffd66 | 478 | vz_printf ( "MUUUUUUUuuuuUUUUUU - I'm not a dog!!!!" ); |
klauss | 133:3d136f5ffd66 | 479 | } |
klauss | 133:3d136f5ffd66 | 480 | |
klauss | 133:3d136f5ffd66 | 481 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "5000" ) ) |
klauss | 133:3d136f5ffd66 | 482 | { |
klauss | 133:3d136f5ffd66 | 483 | miss_match = false; |
klauss | 133:3d136f5ffd66 | 484 | |
klauss | 133:3d136f5ffd66 | 485 | dont_refresh_5000 = !dont_refresh_5000; |
klauss | 133:3d136f5ffd66 | 486 | |
klauss | 133:3d136f5ffd66 | 487 | if ( dont_refresh_5000 ) vz_printf ( "dont refresh 5000" ); |
klauss | 133:3d136f5ffd66 | 488 | |
klauss | 133:3d136f5ffd66 | 489 | else vz_printf ( "refresh 5000" ); |
klauss | 132:05cd37f7e007 | 490 | } |
klauss | 133:3d136f5ffd66 | 491 | |
klauss | 133:3d136f5ffd66 | 492 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "5001" ) ) |
klauss | 133:3d136f5ffd66 | 493 | { |
klauss | 133:3d136f5ffd66 | 494 | miss_match = false; |
klauss | 133:3d136f5ffd66 | 495 | |
klauss | 133:3d136f5ffd66 | 496 | dont_refresh_5001 = !dont_refresh_5001; |
klauss | 133:3d136f5ffd66 | 497 | |
klauss | 133:3d136f5ffd66 | 498 | if ( dont_refresh_5001 ) vz_printf ( "dont refresh 5001" ); |
klauss | 133:3d136f5ffd66 | 499 | |
klauss | 133:3d136f5ffd66 | 500 | else vz_printf ( "refresh 5001" ); |
klauss | 133:3d136f5ffd66 | 501 | } |
klauss | 133:3d136f5ffd66 | 502 | |
klauss | 133:3d136f5ffd66 | 503 | |
klauss | 133:3d136f5ffd66 | 504 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "get_acceptable_delay" ) ) |
klauss | 133:3d136f5ffd66 | 505 | { |
klauss | 133:3d136f5ffd66 | 506 | miss_match = false; |
klauss | 133:3d136f5ffd66 | 507 | |
klauss | 133:3d136f5ffd66 | 508 | vz_printf ( "get_acceptable_delay :: %u", cm -> get_acceptable_delay () ); |
klauss | 133:3d136f5ffd66 | 509 | } |
klauss | 133:3d136f5ffd66 | 510 | |
klauss | 132:05cd37f7e007 | 511 | |
klauss | 132:05cd37f7e007 | 512 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "request_clock" ) ) |
klauss | 132:05cd37f7e007 | 513 | { |
klauss | 124:c1b6c893e1c3 | 514 | miss_match = false; |
klauss | 124:c1b6c893e1c3 | 515 | request_clock_now = true; |
klauss | 124:c1b6c893e1c3 | 516 | } |
klauss | 132:05cd37f7e007 | 517 | |
klauss | 132:05cd37f7e007 | 518 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "hello" ) ) |
klauss | 132:05cd37f7e007 | 519 | { |
klauss | 124:c1b6c893e1c3 | 520 | miss_match = false; |
klauss | 124:c1b6c893e1c3 | 521 | show_hello_status = true; |
klauss | 124:c1b6c893e1c3 | 522 | } |
klauss | 132:05cd37f7e007 | 523 | |
klauss | 132:05cd37f7e007 | 524 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "date" ) ) |
klauss | 132:05cd37f7e007 | 525 | { |
klauss | 119:ee6a53069455 | 526 | miss_match = false; |
klauss | 132:05cd37f7e007 | 527 | vz_printf (" %s %s", __DATE__, __TIME__ ); |
klauss | 119:ee6a53069455 | 528 | } |
klauss | 132:05cd37f7e007 | 529 | |
klauss | 132:05cd37f7e007 | 530 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "clock" ) ) |
klauss | 132:05cd37f7e007 | 531 | { |
klauss | 119:ee6a53069455 | 532 | miss_match = false; |
klauss | 119:ee6a53069455 | 533 | show_current_time = true; |
klauss | 119:ee6a53069455 | 534 | } |
klauss | 132:05cd37f7e007 | 535 | |
klauss | 132:05cd37f7e007 | 536 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "overflow" ) ) |
klauss | 132:05cd37f7e007 | 537 | { |
klauss | 119:ee6a53069455 | 538 | miss_match = false; |
klauss | 132:05cd37f7e007 | 539 | vz_printf ( "Overflow messages :: %d", string_msg_overflow ); |
klauss | 119:ee6a53069455 | 540 | } |
klauss | 132:05cd37f7e007 | 541 | |
klauss | 132:05cd37f7e007 | 542 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dep" ) ) |
klauss | 126:1f90756250fb | 543 | { |
klauss | 105:a930035b6556 | 544 | miss_match = false; |
klauss | 132:05cd37f7e007 | 545 | |
klauss | 109:a5b8264ffbbc | 546 | drop_entendi_pkg = !drop_entendi_pkg; |
klauss | 132:05cd37f7e007 | 547 | |
klauss | 132:05cd37f7e007 | 548 | if ( drop_entendi_pkg ) { |
klauss | 132:05cd37f7e007 | 549 | vz_debug ("Entendi pkgs will be droped" ); |
klauss | 132:05cd37f7e007 | 550 | } else { |
klauss | 132:05cd37f7e007 | 551 | vz_debug ("Entendi pkgs don't will be droped" ); |
klauss | 109:a5b8264ffbbc | 552 | } |
klauss | 105:a930035b6556 | 553 | } |
klauss | 132:05cd37f7e007 | 554 | |
klauss | 132:05cd37f7e007 | 555 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dita" ) ) |
klauss | 126:1f90756250fb | 556 | { |
klauss | 97:8985817e8847 | 557 | miss_match = false; |
klauss | 132:05cd37f7e007 | 558 | |
klauss | 109:a5b8264ffbbc | 559 | drop_invite_to_ast_pkg = !drop_invite_to_ast_pkg; |
klauss | 132:05cd37f7e007 | 560 | |
klauss | 132:05cd37f7e007 | 561 | if ( drop_invite_to_ast_pkg ) { |
klauss | 132:05cd37f7e007 | 562 | vz_debug ("Invite pkgs to ast will be droped" ); |
klauss | 132:05cd37f7e007 | 563 | } else { |
klauss | 132:05cd37f7e007 | 564 | vz_debug ("Invite pkgs to ast don't will be droped" ); |
klauss | 64:5b011d5707d2 | 565 | } |
klauss | 64:5b011d5707d2 | 566 | } |
klauss | 132:05cd37f7e007 | 567 | |
klauss | 132:05cd37f7e007 | 568 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "refresh_on" ) ) |
klauss | 126:1f90756250fb | 569 | { |
klauss | 126:1f90756250fb | 570 | miss_match = false; |
klauss | 132:05cd37f7e007 | 571 | |
klauss | 132:05cd37f7e007 | 572 | vz_printf ( "Refresh function :: Enable" ); |
klauss | 132:05cd37f7e007 | 573 | |
klauss | 126:1f90756250fb | 574 | do_not_refresh = false; |
klauss | 126:1f90756250fb | 575 | } |
klauss | 132:05cd37f7e007 | 576 | |
klauss | 132:05cd37f7e007 | 577 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "refresh_off" ) ) |
klauss | 126:1f90756250fb | 578 | { |
klauss | 109:a5b8264ffbbc | 579 | miss_match = false; |
klauss | 132:05cd37f7e007 | 580 | |
klauss | 132:05cd37f7e007 | 581 | vz_printf ( "Refresh function :: Disable" ); |
klauss | 132:05cd37f7e007 | 582 | |
klauss | 132:05cd37f7e007 | 583 | do_not_refresh = true; |
klauss | 132:05cd37f7e007 | 584 | } |
klauss | 132:05cd37f7e007 | 585 | |
klauss | 132:05cd37f7e007 | 586 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dop" ) ) |
klauss | 132:05cd37f7e007 | 587 | { |
klauss | 132:05cd37f7e007 | 588 | miss_match = false; |
klauss | 132:05cd37f7e007 | 589 | |
klauss | 109:a5b8264ffbbc | 590 | drop_ok_pkg = !drop_ok_pkg; |
klauss | 132:05cd37f7e007 | 591 | |
klauss | 132:05cd37f7e007 | 592 | if ( drop_ok_pkg ) { |
klauss | 132:05cd37f7e007 | 593 | vz_debug ( "Ok pkgs will be droped" ); |
klauss | 132:05cd37f7e007 | 594 | } else { |
klauss | 132:05cd37f7e007 | 595 | vz_debug ( "Ok pkgs don't will be droped" ); |
klauss | 45:c80574f24dc3 | 596 | } |
klauss | 132:05cd37f7e007 | 597 | } |
klauss | 132:05cd37f7e007 | 598 | |
klauss | 132:05cd37f7e007 | 599 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dip" ) ) |
klauss | 126:1f90756250fb | 600 | { |
klauss | 60:b4ec6beb3be3 | 601 | miss_match = false; |
klauss | 132:05cd37f7e007 | 602 | |
klauss | 109:a5b8264ffbbc | 603 | drop_invite_pkg = !drop_invite_pkg; |
klauss | 132:05cd37f7e007 | 604 | |
klauss | 132:05cd37f7e007 | 605 | if ( drop_invite_pkg ) { |
klauss | 132:05cd37f7e007 | 606 | vz_debug ( "invite pkgs from cbx will be droped" ); |
klauss | 132:05cd37f7e007 | 607 | } else { |
klauss | 132:05cd37f7e007 | 608 | vz_debug ( "invite pkgs from cbx don't will be droped" ); |
klauss | 109:a5b8264ffbbc | 609 | } |
klauss | 132:05cd37f7e007 | 610 | |
klauss | 109:a5b8264ffbbc | 611 | } |
klauss | 132:05cd37f7e007 | 612 | |
klauss | 132:05cd37f7e007 | 613 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "drp" ) ) |
klauss | 126:1f90756250fb | 614 | { |
klauss | 119:ee6a53069455 | 615 | miss_match = false; |
klauss | 132:05cd37f7e007 | 616 | |
klauss | 119:ee6a53069455 | 617 | drop_registry_pkg = !drop_registry_pkg; |
klauss | 132:05cd37f7e007 | 618 | |
klauss | 132:05cd37f7e007 | 619 | if ( drop_registry_pkg ) { |
klauss | 132:05cd37f7e007 | 620 | vz_debug ( "registrys pkgs from cbx will be droped" ); |
klauss | 132:05cd37f7e007 | 621 | } else { |
klauss | 132:05cd37f7e007 | 622 | vz_debug ( "registrys pkgs from cbx don't will be droped" ); |
klauss | 119:ee6a53069455 | 623 | } |
klauss | 132:05cd37f7e007 | 624 | |
klauss | 119:ee6a53069455 | 625 | } |
klauss | 132:05cd37f7e007 | 626 | |
klauss | 132:05cd37f7e007 | 627 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "rafc" ) ) |
klauss | 126:1f90756250fb | 628 | { |
klauss | 119:ee6a53069455 | 629 | miss_match = false; |
klauss | 132:05cd37f7e007 | 630 | |
klauss | 119:ee6a53069455 | 631 | received_audio_from_cb = !received_audio_from_cb; |
klauss | 119:ee6a53069455 | 632 | |
klauss | 132:05cd37f7e007 | 633 | if ( received_audio_from_cb ) { |
klauss | 132:05cd37f7e007 | 634 | vz_debug ( "audio pkgs from cbx will printed" ); |
klauss | 132:05cd37f7e007 | 635 | } else { |
klauss | 132:05cd37f7e007 | 636 | vz_debug ( "audio pkgs from cbx don't will printed" ); |
klauss | 109:a5b8264ffbbc | 637 | } |
klauss | 132:05cd37f7e007 | 638 | |
klauss | 45:c80574f24dc3 | 639 | } |
klauss | 105:a930035b6556 | 640 | |
klauss | 132:05cd37f7e007 | 641 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dap" ) ) |
klauss | 126:1f90756250fb | 642 | { |
klauss | 109:a5b8264ffbbc | 643 | miss_match = false; |
klauss | 132:05cd37f7e007 | 644 | |
klauss | 132:05cd37f7e007 | 645 | drop_ack_pkg = !drop_ack_pkg; |
klauss | 132:05cd37f7e007 | 646 | |
klauss | 132:05cd37f7e007 | 647 | if ( drop_ack_pkg ) { |
klauss | 132:05cd37f7e007 | 648 | vz_debug ( "ack pkgs will be droped" ); |
klauss | 132:05cd37f7e007 | 649 | } else { |
klauss | 132:05cd37f7e007 | 650 | vz_debug ( "ack pkgs don't will be droped" ); |
klauss | 78:1353744f01e1 | 651 | } |
klauss | 114:472502b31a12 | 652 | } |
klauss | 132:05cd37f7e007 | 653 | |
klauss | 132:05cd37f7e007 | 654 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "drfa" ) ) |
klauss | 126:1f90756250fb | 655 | { |
klauss | 109:a5b8264ffbbc | 656 | miss_match = false; |
klauss | 132:05cd37f7e007 | 657 | |
klauss | 132:05cd37f7e007 | 658 | drop_rtp_from_ast_pkg = !drop_rtp_from_ast_pkg; |
klauss | 132:05cd37f7e007 | 659 | |
klauss | 132:05cd37f7e007 | 660 | if ( drop_rtp_from_ast_pkg ) { |
klauss | 132:05cd37f7e007 | 661 | vz_debug ( "rtp pkgs from ast will be droped" ); |
klauss | 132:05cd37f7e007 | 662 | } else { |
klauss | 132:05cd37f7e007 | 663 | vz_debug ( "rtp pkgs from ast don't will be droped" ); |
klauss | 109:a5b8264ffbbc | 664 | } |
klauss | 119:ee6a53069455 | 665 | } |
klauss | 132:05cd37f7e007 | 666 | |
klauss | 132:05cd37f7e007 | 667 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "drfc" ) ) |
klauss | 126:1f90756250fb | 668 | { |
klauss | 119:ee6a53069455 | 669 | miss_match = false; |
klauss | 126:1f90756250fb | 670 | |
klauss | 132:05cd37f7e007 | 671 | drop_rtp_from_cbx_pkg = !drop_rtp_from_cbx_pkg; |
klauss | 132:05cd37f7e007 | 672 | |
klauss | 132:05cd37f7e007 | 673 | if ( drop_rtp_from_cbx_pkg ) { |
klauss | 132:05cd37f7e007 | 674 | vz_debug ( "rtp pkgs from cbx will be droped" ); |
klauss | 132:05cd37f7e007 | 675 | } else { |
klauss | 132:05cd37f7e007 | 676 | vz_debug ( "rtp pkgs from cbx don't will be droped" ); |
klauss | 132:05cd37f7e007 | 677 | } |
klauss | 132:05cd37f7e007 | 678 | } |
klauss | 132:05cd37f7e007 | 679 | |
klauss | 132:05cd37f7e007 | 680 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "uptime" ) ) |
klauss | 132:05cd37f7e007 | 681 | { |
klauss | 132:05cd37f7e007 | 682 | miss_match = false; |
klauss | 132:05cd37f7e007 | 683 | |
klauss | 126:1f90756250fb | 684 | uint32_t local_uptime = uptime; |
klauss | 132:05cd37f7e007 | 685 | uint16_t h = local_uptime / ( 60 * 60 ); |
klauss | 126:1f90756250fb | 686 | uint16_t m = ( local_uptime - ( h * 60 * 60 ) ) / 60; |
klauss | 126:1f90756250fb | 687 | uint16_t s = ( local_uptime - ( ( h * 60 * 60 ) + m * 60 ) ); |
klauss | 132:05cd37f7e007 | 688 | vz_printf ( "\r\n%ih%im%is", h, m, s ); |
klauss | 109:a5b8264ffbbc | 689 | } |
klauss | 132:05cd37f7e007 | 690 | |
klauss | 132:05cd37f7e007 | 691 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "wake" ) ) |
klauss | 132:05cd37f7e007 | 692 | { |
klauss | 124:c1b6c893e1c3 | 693 | miss_match = false; |
klauss | 124:c1b6c893e1c3 | 694 | show_wake_all_up_status = true; |
klauss | 124:c1b6c893e1c3 | 695 | } |
klauss | 132:05cd37f7e007 | 696 | |
klauss | 132:05cd37f7e007 | 697 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "wake_on" ) ) |
klauss | 132:05cd37f7e007 | 698 | { |
klauss | 124:c1b6c893e1c3 | 699 | miss_match = false; |
klauss | 132:05cd37f7e007 | 700 | |
klauss | 132:05cd37f7e007 | 701 | vz_printf ( "Function wake_all_up : Enable" ); |
klauss | 132:05cd37f7e007 | 702 | |
klauss | 124:c1b6c893e1c3 | 703 | wake_all = true; |
klauss | 124:c1b6c893e1c3 | 704 | } |
klauss | 124:c1b6c893e1c3 | 705 | |
klauss | 132:05cd37f7e007 | 706 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "get_wdt_string" ) ) |
klauss | 132:05cd37f7e007 | 707 | { |
klauss | 124:c1b6c893e1c3 | 708 | miss_match = false; |
klauss | 132:05cd37f7e007 | 709 | show_wdt_string = true; |
klauss | 132:05cd37f7e007 | 710 | } |
klauss | 132:05cd37f7e007 | 711 | |
klauss | 132:05cd37f7e007 | 712 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "wake_off" ) ) |
klauss | 132:05cd37f7e007 | 713 | { |
klauss | 132:05cd37f7e007 | 714 | miss_match = false; |
klauss | 132:05cd37f7e007 | 715 | |
klauss | 132:05cd37f7e007 | 716 | vz_printf ("Function wake_all_up : Disable" ); |
klauss | 132:05cd37f7e007 | 717 | |
klauss | 124:c1b6c893e1c3 | 718 | wake_all = false; |
klauss | 124:c1b6c893e1c3 | 719 | } |
klauss | 132:05cd37f7e007 | 720 | |
klauss | 132:05cd37f7e007 | 721 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "ifconfig" ) ) |
klauss | 132:05cd37f7e007 | 722 | { |
klauss | 132:05cd37f7e007 | 723 | miss_match = false; |
klauss | 132:05cd37f7e007 | 724 | |
klauss | 132:05cd37f7e007 | 725 | vz_printf ("Configs :: " ); |
klauss | 132:05cd37f7e007 | 726 | char buffer[ 128 ]; |
klauss | 132:05cd37f7e007 | 727 | |
klauss | 132:05cd37f7e007 | 728 | cm -> get_header_ip ( buffer ); |
klauss | 132:05cd37f7e007 | 729 | vz_printf ("Header IP :: %s", buffer ); |
klauss | 132:05cd37f7e007 | 730 | |
klauss | 132:05cd37f7e007 | 731 | vz_printf ("Header ext :: %u", cm -> get_ext () ); |
klauss | 132:05cd37f7e007 | 732 | |
klauss | 132:05cd37f7e007 | 733 | vz_printf ("Header port :: %u", cm -> get_port () ); |
klauss | 132:05cd37f7e007 | 734 | |
klauss | 132:05cd37f7e007 | 735 | cm -> get_server_ip ( buffer ); |
klauss | 132:05cd37f7e007 | 736 | vz_printf ("Server IP :: %s", buffer ); |
klauss | 132:05cd37f7e007 | 737 | |
klauss | 132:05cd37f7e007 | 738 | vz_printf ("Server ext :: %u", cm -> get_server_ext () ); |
klauss | 132:05cd37f7e007 | 739 | |
klauss | 132:05cd37f7e007 | 740 | vz_printf ("Server port :: %u", cm -> get_server_port () ); |
klauss | 132:05cd37f7e007 | 741 | |
klauss | 132:05cd37f7e007 | 742 | cm -> get_net_mask ( buffer ); |
klauss | 132:05cd37f7e007 | 743 | vz_printf ("Mascara de rede :: %s", buffer ); |
klauss | 132:05cd37f7e007 | 744 | |
klauss | 132:05cd37f7e007 | 745 | cm -> get_gateway ( buffer ); |
klauss | 132:05cd37f7e007 | 746 | vz_printf ("Gateway IP :: %s", buffer ); |
klauss | 132:05cd37f7e007 | 747 | |
klauss | 132:05cd37f7e007 | 748 | vz_printf ("UDP Port :: %u", cm -> get_udp_port_listener () ); |
klauss | 132:05cd37f7e007 | 749 | |
klauss | 132:05cd37f7e007 | 750 | vz_printf ("TCP Port :: %u", cm -> get_tcp_port_listener () ); |
klauss | 132:05cd37f7e007 | 751 | |
klauss | 132:05cd37f7e007 | 752 | cm -> get_fw_server_ip ( buffer ); |
klauss | 132:05cd37f7e007 | 753 | vz_printf ("FW Server IP :: %s", buffer ); |
klauss | 132:05cd37f7e007 | 754 | |
klauss | 132:05cd37f7e007 | 755 | vz_printf ("FW Server Port :: %u", cm -> get_fw_server_port () ); |
klauss | 132:05cd37f7e007 | 756 | |
klauss | 132:05cd37f7e007 | 757 | vz_printf ("Max Ext :: %u", cm -> get_max_ext () ); |
klauss | 132:05cd37f7e007 | 758 | |
klauss | 132:05cd37f7e007 | 759 | vz_printf ("Min Ext :: %u", cm -> get_min_ext () ); |
klauss | 132:05cd37f7e007 | 760 | |
klauss | 132:05cd37f7e007 | 761 | vz_printf ("Shift Port :: %u", cm -> get_shift_port () ); |
klauss | 132:05cd37f7e007 | 762 | |
klauss | 132:05cd37f7e007 | 763 | cm -> get_clock_server_ip ( buffer ); |
klauss | 132:05cd37f7e007 | 764 | vz_printf ("Clock Server IP :: %s", buffer ); |
klauss | 132:05cd37f7e007 | 765 | |
klauss | 132:05cd37f7e007 | 766 | %: ifdef MODE_TEST |
klauss | 132:05cd37f7e007 | 767 | vz_printf ("on MODE_TEST" ); |
klauss | 132:05cd37f7e007 | 768 | %: endif |
klauss | 132:05cd37f7e007 | 769 | } |
klauss | 132:05cd37f7e007 | 770 | |
klauss | 132:05cd37f7e007 | 771 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "sizes" ) ) |
klauss | 132:05cd37f7e007 | 772 | { |
klauss | 119:ee6a53069455 | 773 | miss_match = false; |
klauss | 119:ee6a53069455 | 774 | sizes = true; |
klauss | 119:ee6a53069455 | 775 | } |
klauss | 132:05cd37f7e007 | 776 | |
klauss | 132:05cd37f7e007 | 777 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "ftq" ) ) |
klauss | 132:05cd37f7e007 | 778 | { |
klauss | 109:a5b8264ffbbc | 779 | miss_match = false; |
klauss | 132:05cd37f7e007 | 780 | |
klauss | 132:05cd37f7e007 | 781 | vz_printf ( "FTQ On" ); |
klauss | 132:05cd37f7e007 | 782 | |
klauss | 132:05cd37f7e007 | 783 | big_bug_pkg = true; |
klauss | 109:a5b8264ffbbc | 784 | } |
klauss | 132:05cd37f7e007 | 785 | |
klauss | 132:05cd37f7e007 | 786 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "ktq" ) ) |
klauss | 132:05cd37f7e007 | 787 | { |
klauss | 109:a5b8264ffbbc | 788 | miss_match = false; |
klauss | 132:05cd37f7e007 | 789 | |
klauss | 132:05cd37f7e007 | 790 | vz_printf ( "FTQ!!!" ); |
klauss | 132:05cd37f7e007 | 791 | |
klauss | 124:c1b6c893e1c3 | 792 | flood_bug_pkg = !flood_bug_pkg; |
klauss | 109:a5b8264ffbbc | 793 | } |
klauss | 132:05cd37f7e007 | 794 | |
klauss | 132:05cd37f7e007 | 795 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "wdt_pkg_cbx_disable" ) ) |
klauss | 132:05cd37f7e007 | 796 | { |
klauss | 132:05cd37f7e007 | 797 | miss_match = false; |
klauss | 132:05cd37f7e007 | 798 | |
klauss | 132:05cd37f7e007 | 799 | vz_printf ( "wdt_pkg_cbx status :: disable" ); |
klauss | 132:05cd37f7e007 | 800 | |
klauss | 132:05cd37f7e007 | 801 | disable_wdt_from_cbx = true; |
klauss | 132:05cd37f7e007 | 802 | } |
klauss | 132:05cd37f7e007 | 803 | |
klauss | 132:05cd37f7e007 | 804 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "wdt_pkg_cbx_enable" ) ) |
klauss | 132:05cd37f7e007 | 805 | { |
klauss | 132:05cd37f7e007 | 806 | miss_match = false; |
klauss | 132:05cd37f7e007 | 807 | |
klauss | 132:05cd37f7e007 | 808 | vz_printf ( "wdt_pkg_cbx status :: enable" ); |
klauss | 132:05cd37f7e007 | 809 | |
klauss | 132:05cd37f7e007 | 810 | disable_wdt_from_cbx = false; |
klauss | 132:05cd37f7e007 | 811 | } |
klauss | 132:05cd37f7e007 | 812 | |
klauss | 132:05cd37f7e007 | 813 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "wdt_pkg_cbx_status" ) ) |
klauss | 132:05cd37f7e007 | 814 | { |
klauss | 132:05cd37f7e007 | 815 | miss_match = false; |
klauss | 132:05cd37f7e007 | 816 | |
klauss | 132:05cd37f7e007 | 817 | vz_printf ( "wdt_pkg_cbx status :: %s", ( disable_wdt_from_cbx ) ? "disable" : "enable" ); |
klauss | 132:05cd37f7e007 | 818 | } |
klauss | 132:05cd37f7e007 | 819 | |
klauss | 132:05cd37f7e007 | 820 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "ls", 2 ) ) |
klauss | 124:c1b6c893e1c3 | 821 | { |
klauss | 109:a5b8264ffbbc | 822 | miss_match = false; |
klauss | 124:c1b6c893e1c3 | 823 | reverse_list = false; |
klauss | 109:a5b8264ffbbc | 824 | list = true; |
klauss | 132:05cd37f7e007 | 825 | |
klauss | 124:c1b6c893e1c3 | 826 | if ( strlen ( debug_buf ) != 2 ) |
klauss | 124:c1b6c893e1c3 | 827 | { |
klauss | 132:05cd37f7e007 | 828 | if ( strstr ( ( debug_buf + 2 ), "r" ) ) |
klauss | 124:c1b6c893e1c3 | 829 | { |
klauss | 124:c1b6c893e1c3 | 830 | reverse_list = true; |
klauss | 124:c1b6c893e1c3 | 831 | } |
klauss | 132:05cd37f7e007 | 832 | |
klauss | 124:c1b6c893e1c3 | 833 | |
klauss | 132:05cd37f7e007 | 834 | if ( strstr ( ( debug_buf + 2 ), "l" ) ) |
klauss | 124:c1b6c893e1c3 | 835 | { |
klauss | 124:c1b6c893e1c3 | 836 | list = false; |
klauss | 124:c1b6c893e1c3 | 837 | long_list = true; |
klauss | 124:c1b6c893e1c3 | 838 | } |
klauss | 132:05cd37f7e007 | 839 | |
klauss | 132:05cd37f7e007 | 840 | if ( strstr ( ( debug_buf + 2 ), "t" ) ) |
klauss | 124:c1b6c893e1c3 | 841 | { |
klauss | 124:c1b6c893e1c3 | 842 | long_list = true; |
klauss | 124:c1b6c893e1c3 | 843 | list = false; |
klauss | 124:c1b6c893e1c3 | 844 | show_time = true; |
klauss | 124:c1b6c893e1c3 | 845 | } |
klauss | 132:05cd37f7e007 | 846 | |
klauss | 132:05cd37f7e007 | 847 | if ( strstr ( ( debug_buf + 2 ), "i" ) ) |
klauss | 132:05cd37f7e007 | 848 | { |
klauss | 132:05cd37f7e007 | 849 | long_list = true; |
klauss | 132:05cd37f7e007 | 850 | list = false; |
klauss | 132:05cd37f7e007 | 851 | show_invites = true; |
klauss | 132:05cd37f7e007 | 852 | } |
klauss | 124:c1b6c893e1c3 | 853 | } |
klauss | 109:a5b8264ffbbc | 854 | } |
klauss | 132:05cd37f7e007 | 855 | |
klauss | 132:05cd37f7e007 | 856 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "drtp ", 5 ) ) |
klauss | 132:05cd37f7e007 | 857 | { |
klauss | 132:05cd37f7e007 | 858 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 5 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 859 | { |
klauss | 114:472502b31a12 | 860 | miss_match = false; |
klauss | 132:05cd37f7e007 | 861 | |
klauss | 132:05cd37f7e007 | 862 | vz_printf ( "Rtp Debug On" ); |
klauss | 132:05cd37f7e007 | 863 | |
klauss | 114:472502b31a12 | 864 | debug_rtp = true; |
klauss | 114:472502b31a12 | 865 | } |
klauss | 132:05cd37f7e007 | 866 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 5 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 867 | { |
klauss | 114:472502b31a12 | 868 | miss_match = false; |
klauss | 132:05cd37f7e007 | 869 | |
klauss | 132:05cd37f7e007 | 870 | vz_printf ( "Rtp Debug Off" ); |
klauss | 132:05cd37f7e007 | 871 | |
klauss | 114:472502b31a12 | 872 | debug_rtp = false; |
klauss | 114:472502b31a12 | 873 | } |
klauss | 107:cf1e43414adb | 874 | } |
klauss | 132:05cd37f7e007 | 875 | |
klauss | 132:05cd37f7e007 | 876 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "print_v_cb" ) ) |
klauss | 132:05cd37f7e007 | 877 | { |
klauss | 109:a5b8264ffbbc | 878 | miss_match = false; |
klauss | 109:a5b8264ffbbc | 879 | print_v_cb = true; |
klauss | 109:a5b8264ffbbc | 880 | } |
klauss | 132:05cd37f7e007 | 881 | |
klauss | 132:05cd37f7e007 | 882 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "print_v_call" ) ) |
klauss | 132:05cd37f7e007 | 883 | { |
klauss | 109:a5b8264ffbbc | 884 | miss_match = false; |
klauss | 109:a5b8264ffbbc | 885 | print_v_call = true; |
klauss | 109:a5b8264ffbbc | 886 | } |
klauss | 132:05cd37f7e007 | 887 | |
klauss | 132:05cd37f7e007 | 888 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "tt" ) ) |
klauss | 132:05cd37f7e007 | 889 | { |
klauss | 109:a5b8264ffbbc | 890 | miss_match = false; |
klauss | 109:a5b8264ffbbc | 891 | main_test = !main_test; |
klauss | 109:a5b8264ffbbc | 892 | } |
klauss | 132:05cd37f7e007 | 893 | |
klauss | 132:05cd37f7e007 | 894 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "registra" ) ) |
klauss | 132:05cd37f7e007 | 895 | { |
klauss | 112:6ae726539ab9 | 896 | miss_match = false; |
klauss | 112:6ae726539ab9 | 897 | registra = true; |
klauss | 112:6ae726539ab9 | 898 | } |
klauss | 132:05cd37f7e007 | 899 | |
klauss | 132:05cd37f7e007 | 900 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "registra4" ) ) |
klauss | 132:05cd37f7e007 | 901 | { |
klauss | 132:05cd37f7e007 | 902 | miss_match = false; |
klauss | 132:05cd37f7e007 | 903 | registra4 = true; |
klauss | 132:05cd37f7e007 | 904 | } |
klauss | 132:05cd37f7e007 | 905 | |
klauss | 132:05cd37f7e007 | 906 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "show_sip" ) ) |
klauss | 132:05cd37f7e007 | 907 | { |
klauss | 114:472502b31a12 | 908 | miss_match = false; |
klauss | 114:472502b31a12 | 909 | show_sip = true; |
klauss | 114:472502b31a12 | 910 | } |
klauss | 132:05cd37f7e007 | 911 | |
klauss | 132:05cd37f7e007 | 912 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "reset_cks" ) ) |
klauss | 132:05cd37f7e007 | 913 | { |
klauss | 114:472502b31a12 | 914 | miss_match = false; |
klauss | 114:472502b31a12 | 915 | reset_cks = true; |
klauss | 114:472502b31a12 | 916 | } |
klauss | 132:05cd37f7e007 | 917 | |
klauss | 114:472502b31a12 | 918 | //replaced by ls |
klauss | 132:05cd37f7e007 | 919 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "status" ) ) |
klauss | 132:05cd37f7e007 | 920 | { |
klauss | 109:a5b8264ffbbc | 921 | miss_match = false; |
klauss | 114:472502b31a12 | 922 | list = true; |
klauss | 114:472502b31a12 | 923 | } |
klauss | 132:05cd37f7e007 | 924 | |
klauss | 132:05cd37f7e007 | 925 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "wdt" ) ) |
klauss | 132:05cd37f7e007 | 926 | { |
klauss | 114:472502b31a12 | 927 | miss_match = false; |
klauss | 114:472502b31a12 | 928 | debug_wdt = true; |
klauss | 114:472502b31a12 | 929 | } |
klauss | 132:05cd37f7e007 | 930 | |
klauss | 132:05cd37f7e007 | 931 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "eth" ) ) |
klauss | 132:05cd37f7e007 | 932 | { |
klauss | 114:472502b31a12 | 933 | miss_match = false; |
klauss | 114:472502b31a12 | 934 | debug_eth = true; |
klauss | 114:472502b31a12 | 935 | } |
klauss | 132:05cd37f7e007 | 936 | |
klauss | 132:05cd37f7e007 | 937 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "deleted" ) ) |
klauss | 132:05cd37f7e007 | 938 | { |
klauss | 119:ee6a53069455 | 939 | miss_match = false; |
klauss | 132:05cd37f7e007 | 940 | vz_printf ( "::deleted_sip [ %5i ]::", deleted_sip ); |
klauss | 119:ee6a53069455 | 941 | } |
klauss | 132:05cd37f7e007 | 942 | |
klauss | 132:05cd37f7e007 | 943 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "types" ) ) |
klauss | 132:05cd37f7e007 | 944 | { |
klauss | 114:472502b31a12 | 945 | miss_match = false; |
klauss | 119:ee6a53069455 | 946 | |
klauss | 132:05cd37f7e007 | 947 | vz_printf ( |
klauss | 126:1f90756250fb | 948 | " hex :: dec :: Type \n\r" |
klauss | 126:1f90756250fb | 949 | "0x%02x :: %5i :: BOOT\n\r" |
klauss | 126:1f90756250fb | 950 | "0x%02x :: %5i :: REGISTRY\n\r" |
klauss | 126:1f90756250fb | 951 | "0x%02x :: %5i :: REGISTRY_ACK\n\r" |
klauss | 126:1f90756250fb | 952 | "0x%02x :: %5i :: INVITE\n\r" |
klauss | 126:1f90756250fb | 953 | "0x%02x :: %5i :: INVITE_ACK\n\r" |
klauss | 126:1f90756250fb | 954 | "0x%02x :: %5i :: AUDIO\n\r" |
klauss | 126:1f90756250fb | 955 | "0x%02x :: %5i :: TELEMETRY\n\r" |
klauss | 126:1f90756250fb | 956 | "0x%02x :: %5i :: BOOTLOADER_CBX\n\r" |
klauss | 126:1f90756250fb | 957 | "0x%02x :: %5i :: CB_BYE\n\r" |
klauss | 126:1f90756250fb | 958 | "0x%02x :: %5i :: CB_BYE_ACK\n\r" |
klauss | 126:1f90756250fb | 959 | "0x%02x :: %5i :: PROMPT\n\r" |
klauss | 126:1f90756250fb | 960 | "0x%02x :: %5i :: FLOOD\n\r" |
klauss | 126:1f90756250fb | 961 | "0x%02x :: %5i :: FW\n\r" |
klauss | 126:1f90756250fb | 962 | "0x%02x :: %5i :: FW1\n\r" |
klauss | 126:1f90756250fb | 963 | "0x%02x :: %5i :: FW2\n\r" |
klauss | 126:1f90756250fb | 964 | "0x%02x :: %5i :: FW3\n\r" |
klauss | 126:1f90756250fb | 965 | "0x%02x :: %5i :: FW4\n\r" |
klauss | 126:1f90756250fb | 966 | "0x%02x :: %5i :: FW5\n\r" |
klauss | 126:1f90756250fb | 967 | "0x%02x :: %5i :: FW6\n\r" |
klauss | 126:1f90756250fb | 968 | "0x%02x :: %5i :: CB_STATS\n\r" |
klauss | 126:1f90756250fb | 969 | "0x%02x :: %5i :: CB_STATS_ACK\n\r" |
klauss | 129:d73538fbc017 | 970 | "0x%02x :: %5i :: DO_NOTHING\n\r\n\r" |
klauss | 132:05cd37f7e007 | 971 | |
klauss | 127:e7160a463b6c | 972 | "0x%02x :: %5i :: BROADCAST_EXT\n\r" |
klauss | 129:d73538fbc017 | 973 | "NOTA - Os types TELEMETRY, CB_STATS, e FW1 ate FW6 sao repassados para o servidor como type FW\n\r", |
klauss | 126:1f90756250fb | 974 | BOOT, BOOT, |
klauss | 126:1f90756250fb | 975 | REGISTRY, REGISTRY, |
klauss | 126:1f90756250fb | 976 | REGISTRY_ACK, REGISTRY_ACK, |
klauss | 126:1f90756250fb | 977 | INVITE, INVITE, |
klauss | 126:1f90756250fb | 978 | INVITE_ACK, INVITE_ACK, |
klauss | 126:1f90756250fb | 979 | AUDIO, AUDIO, |
klauss | 126:1f90756250fb | 980 | TELEMETRY, TELEMETRY, |
klauss | 126:1f90756250fb | 981 | BOOTLOADER_CBX, BOOTLOADER_CBX, |
klauss | 126:1f90756250fb | 982 | CB_BYE, CB_BYE, |
klauss | 126:1f90756250fb | 983 | CB_BYE_ACK, CB_BYE_ACK, |
klauss | 126:1f90756250fb | 984 | PROMPT, PROMPT, |
klauss | 126:1f90756250fb | 985 | FLOOD, FLOOD, |
klauss | 126:1f90756250fb | 986 | FW, FW, |
klauss | 126:1f90756250fb | 987 | FW1, FW1, |
klauss | 126:1f90756250fb | 988 | FW2, FW2, |
klauss | 126:1f90756250fb | 989 | FW3, FW3, |
klauss | 126:1f90756250fb | 990 | FW4, FW4, |
klauss | 126:1f90756250fb | 991 | FW5, FW5, |
klauss | 126:1f90756250fb | 992 | FW6, FW6, |
klauss | 126:1f90756250fb | 993 | CB_STATS, CB_STATS, |
klauss | 126:1f90756250fb | 994 | CB_STATS_ACK, CB_STATS_ACK, |
klauss | 126:1f90756250fb | 995 | DO_NOTHING, DO_NOTHING, |
klauss | 126:1f90756250fb | 996 | BROADCAST_EXT, BROADCAST_EXT |
klauss | 126:1f90756250fb | 997 | ); |
klauss | 105:a930035b6556 | 998 | } |
klauss | 119:ee6a53069455 | 999 | |
klauss | 132:05cd37f7e007 | 1000 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "protocol" ) ) |
klauss | 132:05cd37f7e007 | 1001 | { |
klauss | 132:05cd37f7e007 | 1002 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1003 | vz_printf ( "| E | E | P | P | C | C | T | [ Seq_num | Audio ] | 14[ Clock | Audio ] | [ TS | Audio ] | ... |\n\r \n\rE = Ext = Ramal\n\r \n\rP = Port = Porta\n\r \n\rC = Checksum\n\r \n\rT = Type = Tipo\n\r \n\rSeq_num = Sequence Number = Numero de sequencia\n\r \n\rClock = 14 bytes to sync\n\r \n\r... = demais CB_BUFFER_SIZE - __VZ_HEADER_OFFSET__ bytes" ); |
klauss | 132:05cd37f7e007 | 1004 | } |
klauss | 119:ee6a53069455 | 1005 | |
klauss | 132:05cd37f7e007 | 1006 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "flood ", 6 ) ) |
klauss | 132:05cd37f7e007 | 1007 | { |
klauss | 132:05cd37f7e007 | 1008 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 6 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1009 | { |
klauss | 109:a5b8264ffbbc | 1010 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1011 | |
klauss | 132:05cd37f7e007 | 1012 | vz_printf ( "Flood On" ); |
klauss | 132:05cd37f7e007 | 1013 | |
klauss | 132:05cd37f7e007 | 1014 | tflood.start (); |
klauss | 132:05cd37f7e007 | 1015 | tflood.reset (); |
klauss | 109:a5b8264ffbbc | 1016 | floodcount =0; |
klauss | 109:a5b8264ffbbc | 1017 | pflood = 1; |
klauss | 132:05cd37f7e007 | 1018 | flood_timeout.start (); |
klauss | 109:a5b8264ffbbc | 1019 | } |
klauss | 132:05cd37f7e007 | 1020 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 6 ), ( uint8_t * ) "more", 4 ) ) |
klauss | 132:05cd37f7e007 | 1021 | { |
klauss | 109:a5b8264ffbbc | 1022 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1023 | |
klauss | 132:05cd37f7e007 | 1024 | vz_printf ( "Flood On" ); |
klauss | 132:05cd37f7e007 | 1025 | |
klauss | 132:05cd37f7e007 | 1026 | tflood.start (); |
klauss | 132:05cd37f7e007 | 1027 | tflood.reset (); |
klauss | 109:a5b8264ffbbc | 1028 | floodcount = 0; |
klauss | 109:a5b8264ffbbc | 1029 | pflood = 1; |
klauss | 109:a5b8264ffbbc | 1030 | } |
klauss | 132:05cd37f7e007 | 1031 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 6 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1032 | { |
klauss | 104:62646ef786a3 | 1033 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1034 | |
klauss | 132:05cd37f7e007 | 1035 | vz_printf ( "Flood Off" ); |
klauss | 132:05cd37f7e007 | 1036 | |
klauss | 109:a5b8264ffbbc | 1037 | pflood = 0; |
klauss | 132:05cd37f7e007 | 1038 | tflood.stop (); |
klauss | 132:05cd37f7e007 | 1039 | flood_timeout.reset (); |
klauss | 109:a5b8264ffbbc | 1040 | } |
klauss | 132:05cd37f7e007 | 1041 | |
klauss | 132:05cd37f7e007 | 1042 | } |
klauss | 132:05cd37f7e007 | 1043 | |
klauss | 132:05cd37f7e007 | 1044 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "silence ", 8 ) ) |
klauss | 132:05cd37f7e007 | 1045 | { |
klauss | 132:05cd37f7e007 | 1046 | miss_match = false; |
klauss | 119:ee6a53069455 | 1047 | |
klauss | 109:a5b8264ffbbc | 1048 | char *ref, *split; |
klauss | 119:ee6a53069455 | 1049 | |
klauss | 132:05cd37f7e007 | 1050 | strcpy ( promptcb_last_cmd, debug_buf ); |
klauss | 119:ee6a53069455 | 1051 | |
klauss | 132:05cd37f7e007 | 1052 | if( !( strcmp ( debug_buf + 8, "-h" ) && strcmp ( debug_buf + 8, "--help" ) ) ) { |
klauss | 132:05cd37f7e007 | 1053 | vz_printf ( "Usage :: silence start_ext end_ext | start_ext must be greater than end_ext\n\rObs : ( end_ext - start_ext ) < 50 " ); |
klauss | 119:ee6a53069455 | 1054 | } else { |
klauss | 109:a5b8264ffbbc | 1055 | ref = debug_buf; |
klauss | 119:ee6a53069455 | 1056 | |
klauss | 132:05cd37f7e007 | 1057 | split = strtok ( debug_buf + 8, " " ); |
klauss | 119:ee6a53069455 | 1058 | |
klauss | 132:05cd37f7e007 | 1059 | start_ext = atoi ( split ); |
klauss | 119:ee6a53069455 | 1060 | |
klauss | 132:05cd37f7e007 | 1061 | split += strlen ( split ) + 1; |
klauss | 119:ee6a53069455 | 1062 | |
klauss | 132:05cd37f7e007 | 1063 | end_ext = atoi ( split ); |
klauss | 119:ee6a53069455 | 1064 | |
klauss | 109:a5b8264ffbbc | 1065 | debug_buf = ref; |
klauss | 119:ee6a53069455 | 1066 | |
klauss | 132:05cd37f7e007 | 1067 | if ( start_ext < end_ext && ( end_ext - start_ext ) < 50 ) |
klauss | 132:05cd37f7e007 | 1068 | { |
klauss | 132:05cd37f7e007 | 1069 | if ( start_ext % 2 ) start_ext --; |
klauss | 132:05cd37f7e007 | 1070 | if ( !( end_ext % 2 ) ) end_ext ++; |
klauss | 119:ee6a53069455 | 1071 | |
klauss | 109:a5b8264ffbbc | 1072 | ext_count = start_ext; |
klauss | 132:05cd37f7e007 | 1073 | flood_silence_timer.start (); |
klauss | 119:ee6a53069455 | 1074 | } else { |
klauss | 132:05cd37f7e007 | 1075 | vz_printf ( "Usage Error :: silence start_ext end_ext | start_ext must be greater than end_ext\n\rObs : ( end_ext - start_ext ) < 50 " ); |
klauss | 104:62646ef786a3 | 1076 | } |
klauss | 132:05cd37f7e007 | 1077 | |
klauss | 109:a5b8264ffbbc | 1078 | flood_silence = true; |
klauss | 104:62646ef786a3 | 1079 | } |
klauss | 104:62646ef786a3 | 1080 | } |
klauss | 132:05cd37f7e007 | 1081 | |
klauss | 132:05cd37f7e007 | 1082 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "debug ", 6 ) ) |
klauss | 132:05cd37f7e007 | 1083 | { |
klauss | 132:05cd37f7e007 | 1084 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 6 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1085 | { |
klauss | 109:a5b8264ffbbc | 1086 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1087 | |
klauss | 132:05cd37f7e007 | 1088 | vz_printf ( "Debug ON" ); |
klauss | 132:05cd37f7e007 | 1089 | |
klauss | 109:a5b8264ffbbc | 1090 | debug_alive = true; |
klauss | 109:a5b8264ffbbc | 1091 | } |
klauss | 132:05cd37f7e007 | 1092 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 6), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1093 | { |
klauss | 109:a5b8264ffbbc | 1094 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1095 | |
klauss | 132:05cd37f7e007 | 1096 | vz_printf ( "Debug Off\n\r" ); |
klauss | 132:05cd37f7e007 | 1097 | |
klauss | 109:a5b8264ffbbc | 1098 | debug_alive = false; |
klauss | 109:a5b8264ffbbc | 1099 | } |
klauss | 132:05cd37f7e007 | 1100 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 6 ), ( uint8_t * ) "show", 4 ) ) |
klauss | 132:05cd37f7e007 | 1101 | { |
klauss | 132:05cd37f7e007 | 1102 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1103 | |
klauss | 132:05cd37f7e007 | 1104 | vz_printf ( "dsip \n\r" |
klauss | 132:05cd37f7e007 | 1105 | "debug_alive \n\r" |
klauss | 132:05cd37f7e007 | 1106 | "debug_prompt \n\r" |
klauss | 132:05cd37f7e007 | 1107 | "debug_vector \n\r" |
klauss | 132:05cd37f7e007 | 1108 | "debug_cb \n\r" |
klauss | 132:05cd37f7e007 | 1109 | "debug_main \n\r" |
klauss | 132:05cd37f7e007 | 1110 | "dcks \n\r" |
klauss | 132:05cd37f7e007 | 1111 | "debug_cb_rx \n\r" |
klauss | 132:05cd37f7e007 | 1112 | "debug_cb_tx* \n\r" |
klauss | 132:05cd37f7e007 | 1113 | "debug_eth_rx* \n\r" |
klauss | 132:05cd37f7e007 | 1114 | "debug_eth_tx* \n\r" |
klauss | 132:05cd37f7e007 | 1115 | "debug_file" |
klauss | 132:05cd37f7e007 | 1116 | ); |
klauss | 132:05cd37f7e007 | 1117 | } |
klauss | 132:05cd37f7e007 | 1118 | } |
klauss | 132:05cd37f7e007 | 1119 | |
klauss | 132:05cd37f7e007 | 1120 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dsip ", 5 ) ) |
klauss | 132:05cd37f7e007 | 1121 | { |
klauss | 132:05cd37f7e007 | 1122 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 5 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1123 | { |
klauss | 100:09a23fcd3bdf | 1124 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1125 | |
klauss | 132:05cd37f7e007 | 1126 | vz_printf ( "Sip Debug On" ); |
klauss | 132:05cd37f7e007 | 1127 | |
klauss | 132:05cd37f7e007 | 1128 | debug_sip = true; |
klauss | 132:05cd37f7e007 | 1129 | } |
klauss | 132:05cd37f7e007 | 1130 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 5 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1131 | { |
klauss | 132:05cd37f7e007 | 1132 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1133 | |
klauss | 132:05cd37f7e007 | 1134 | vz_printf ( "Sip Debug Off" ); |
klauss | 109:a5b8264ffbbc | 1135 | |
klauss | 132:05cd37f7e007 | 1136 | debug_sip = false; |
klauss | 132:05cd37f7e007 | 1137 | } |
klauss | 132:05cd37f7e007 | 1138 | } |
klauss | 132:05cd37f7e007 | 1139 | |
klauss | 132:05cd37f7e007 | 1140 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "ddrefresh ", 10 ) ) |
klauss | 132:05cd37f7e007 | 1141 | { |
klauss | 132:05cd37f7e007 | 1142 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 10 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1143 | { |
klauss | 132:05cd37f7e007 | 1144 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1145 | |
klauss | 132:05cd37f7e007 | 1146 | vz_printf ( "Don't Refresh Debug On" ); |
klauss | 132:05cd37f7e007 | 1147 | |
klauss | 132:05cd37f7e007 | 1148 | debug_dont_refresh = true; |
klauss | 132:05cd37f7e007 | 1149 | } |
klauss | 132:05cd37f7e007 | 1150 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 10 ), ( uint8_t * ) "off",3 ) ) |
klauss | 132:05cd37f7e007 | 1151 | { |
klauss | 132:05cd37f7e007 | 1152 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1153 | |
klauss | 132:05cd37f7e007 | 1154 | vz_printf ( "Don't Refresh Debug Off" ); |
klauss | 132:05cd37f7e007 | 1155 | |
klauss | 132:05cd37f7e007 | 1156 | debug_dont_refresh = false; |
klauss | 109:a5b8264ffbbc | 1157 | } |
klauss | 109:a5b8264ffbbc | 1158 | } |
klauss | 114:472502b31a12 | 1159 | |
klauss | 132:05cd37f7e007 | 1160 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "drajada ", 8 ) ) |
klauss | 126:1f90756250fb | 1161 | { |
klauss | 132:05cd37f7e007 | 1162 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 8 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1163 | { |
klauss | 109:a5b8264ffbbc | 1164 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1165 | |
klauss | 132:05cd37f7e007 | 1166 | vz_printf ( "Debug Rajada on" ); |
klauss | 132:05cd37f7e007 | 1167 | |
klauss | 132:05cd37f7e007 | 1168 | debug_resend_invite = true; |
klauss | 109:a5b8264ffbbc | 1169 | } |
klauss | 132:05cd37f7e007 | 1170 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 8 ), ( uint8_t * ) "off",3 ) ) |
klauss | 132:05cd37f7e007 | 1171 | { |
klauss | 109:a5b8264ffbbc | 1172 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1173 | |
klauss | 132:05cd37f7e007 | 1174 | vz_printf ( "Debug Rajada off" ); |
klauss | 132:05cd37f7e007 | 1175 | |
klauss | 132:05cd37f7e007 | 1176 | debug_resend_invite = false; |
klauss | 109:a5b8264ffbbc | 1177 | } |
klauss | 109:a5b8264ffbbc | 1178 | } |
klauss | 132:05cd37f7e007 | 1179 | |
klauss | 126:1f90756250fb | 1180 | else if ( xmemmatch ( ( uint8_t * ) debug_buf, ( uint8_t * ) "dsqn ", 5 ) ) |
klauss | 126:1f90756250fb | 1181 | { |
klauss | 132:05cd37f7e007 | 1182 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 5 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 126:1f90756250fb | 1183 | { |
klauss | 126:1f90756250fb | 1184 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1185 | |
klauss | 132:05cd37f7e007 | 1186 | vz_printf ( "Sequence Number Debug On" ); |
klauss | 132:05cd37f7e007 | 1187 | |
klauss | 126:1f90756250fb | 1188 | debug_sqn = true; |
klauss | 126:1f90756250fb | 1189 | } |
klauss | 132:05cd37f7e007 | 1190 | |
klauss | 132:05cd37f7e007 | 1191 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 5 ), ( uint8_t * ) "off",3 ) ) |
klauss | 126:1f90756250fb | 1192 | { |
klauss | 126:1f90756250fb | 1193 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1194 | |
klauss | 132:05cd37f7e007 | 1195 | vz_printf ( "Sequence Number Debug Off" ); |
klauss | 132:05cd37f7e007 | 1196 | |
klauss | 126:1f90756250fb | 1197 | debug_sqn = false; |
klauss | 126:1f90756250fb | 1198 | } |
klauss | 126:1f90756250fb | 1199 | } |
klauss | 132:05cd37f7e007 | 1200 | |
klauss | 132:05cd37f7e007 | 1201 | else if ( xmemmatch ( ( uint8_t * ) debug_buf, ( uint8_t * ) "test_ts ", 8 ) ) |
klauss | 126:1f90756250fb | 1202 | { |
klauss | 132:05cd37f7e007 | 1203 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 8 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 126:1f90756250fb | 1204 | { |
klauss | 126:1f90756250fb | 1205 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1206 | |
klauss | 132:05cd37f7e007 | 1207 | vz_printf ( "TS testing On" ); |
klauss | 132:05cd37f7e007 | 1208 | |
klauss | 126:1f90756250fb | 1209 | test_ts = true; |
klauss | 126:1f90756250fb | 1210 | } |
klauss | 132:05cd37f7e007 | 1211 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 8 ), ( uint8_t * ) "off",3 ) ) |
klauss | 126:1f90756250fb | 1212 | { |
klauss | 126:1f90756250fb | 1213 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1214 | |
klauss | 132:05cd37f7e007 | 1215 | vz_printf ( "TS testing Off" ); |
klauss | 132:05cd37f7e007 | 1216 | |
klauss | 126:1f90756250fb | 1217 | test_ts = false; |
klauss | 126:1f90756250fb | 1218 | } |
klauss | 126:1f90756250fb | 1219 | } |
klauss | 132:05cd37f7e007 | 1220 | |
klauss | 132:05cd37f7e007 | 1221 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dhello ", 7 ) ) |
klauss | 132:05cd37f7e007 | 1222 | { |
klauss | 132:05cd37f7e007 | 1223 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 7 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1224 | { |
klauss | 124:c1b6c893e1c3 | 1225 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1226 | |
klauss | 132:05cd37f7e007 | 1227 | vz_printf ( "Hello Debug On" ); |
klauss | 132:05cd37f7e007 | 1228 | |
klauss | 124:c1b6c893e1c3 | 1229 | debug_hello = true; |
klauss | 124:c1b6c893e1c3 | 1230 | } |
klauss | 132:05cd37f7e007 | 1231 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 7 ), ( uint8_t * ) "off",3 ) ) |
klauss | 132:05cd37f7e007 | 1232 | { |
klauss | 124:c1b6c893e1c3 | 1233 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1234 | |
klauss | 132:05cd37f7e007 | 1235 | vz_printf ( "Hello Debug Off" ); |
klauss | 132:05cd37f7e007 | 1236 | |
klauss | 124:c1b6c893e1c3 | 1237 | debug_hello = false; |
klauss | 124:c1b6c893e1c3 | 1238 | } |
klauss | 124:c1b6c893e1c3 | 1239 | } |
klauss | 132:05cd37f7e007 | 1240 | |
klauss | 132:05cd37f7e007 | 1241 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dmissedwdt ", 11 ) ) |
klauss | 132:05cd37f7e007 | 1242 | { |
klauss | 132:05cd37f7e007 | 1243 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 11 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1244 | { |
klauss | 122:480c44b0e205 | 1245 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1246 | |
klauss | 132:05cd37f7e007 | 1247 | vz_printf ( "Wdt missed Debug On" ); |
klauss | 132:05cd37f7e007 | 1248 | |
klauss | 122:480c44b0e205 | 1249 | dmissed_wdt = true; |
klauss | 122:480c44b0e205 | 1250 | } |
klauss | 132:05cd37f7e007 | 1251 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 11 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1252 | { |
klauss | 122:480c44b0e205 | 1253 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1254 | |
klauss | 132:05cd37f7e007 | 1255 | vz_printf ( "Wdt missed Debug Off" ); |
klauss | 132:05cd37f7e007 | 1256 | |
klauss | 122:480c44b0e205 | 1257 | dmissed_wdt = false; |
klauss | 122:480c44b0e205 | 1258 | } |
klauss | 122:480c44b0e205 | 1259 | } |
klauss | 132:05cd37f7e007 | 1260 | |
klauss | 132:05cd37f7e007 | 1261 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dclock ", 7 ) ) |
klauss | 132:05cd37f7e007 | 1262 | { |
klauss | 132:05cd37f7e007 | 1263 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 7 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1264 | { |
klauss | 119:ee6a53069455 | 1265 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1266 | |
klauss | 132:05cd37f7e007 | 1267 | vz_printf( "Clock Debug On" ); |
klauss | 132:05cd37f7e007 | 1268 | |
klauss | 119:ee6a53069455 | 1269 | debug_clock = true; |
klauss | 119:ee6a53069455 | 1270 | } |
klauss | 132:05cd37f7e007 | 1271 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 7 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1272 | { |
klauss | 119:ee6a53069455 | 1273 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1274 | |
klauss | 132:05cd37f7e007 | 1275 | vz_printf( "Clock Debug Off" ); |
klauss | 132:05cd37f7e007 | 1276 | |
klauss | 119:ee6a53069455 | 1277 | debug_clock = false; |
klauss | 119:ee6a53069455 | 1278 | } |
klauss | 119:ee6a53069455 | 1279 | } |
klauss | 119:ee6a53069455 | 1280 | |
klauss | 132:05cd37f7e007 | 1281 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dprintclock ", 12 ) ) |
klauss | 132:05cd37f7e007 | 1282 | { |
klauss | 132:05cd37f7e007 | 1283 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 12 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1284 | { |
klauss | 132:05cd37f7e007 | 1285 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1286 | |
klauss | 132:05cd37f7e007 | 1287 | vz_printf ( "Clock Debug <VZ PKG PRINT> On" ); |
klauss | 132:05cd37f7e007 | 1288 | |
klauss | 132:05cd37f7e007 | 1289 | debug_print_clock = true; |
klauss | 132:05cd37f7e007 | 1290 | } |
klauss | 132:05cd37f7e007 | 1291 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 12 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1292 | { |
klauss | 119:ee6a53069455 | 1293 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1294 | |
klauss | 132:05cd37f7e007 | 1295 | vz_printf ( "Clock Debug <VZ PKG PRINT> Off" ); |
klauss | 132:05cd37f7e007 | 1296 | |
klauss | 132:05cd37f7e007 | 1297 | debug_print_clock = false; |
klauss | 132:05cd37f7e007 | 1298 | } |
klauss | 132:05cd37f7e007 | 1299 | } |
klauss | 132:05cd37f7e007 | 1300 | |
klauss | 132:05cd37f7e007 | 1301 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dlength ", 8 ) ) |
klauss | 132:05cd37f7e007 | 1302 | { |
klauss | 132:05cd37f7e007 | 1303 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 8 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1304 | { |
klauss | 132:05cd37f7e007 | 1305 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1306 | |
klauss | 132:05cd37f7e007 | 1307 | vz_printf ( "String length debug On" ); |
klauss | 132:05cd37f7e007 | 1308 | |
klauss | 119:ee6a53069455 | 1309 | debug_string_length = true; |
klauss | 119:ee6a53069455 | 1310 | } |
klauss | 132:05cd37f7e007 | 1311 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 8 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1312 | { |
klauss | 119:ee6a53069455 | 1313 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1314 | |
klauss | 132:05cd37f7e007 | 1315 | vz_printf ( "String length debug Off" ); |
klauss | 132:05cd37f7e007 | 1316 | |
klauss | 119:ee6a53069455 | 1317 | debug_string_length = false; |
klauss | 119:ee6a53069455 | 1318 | } |
klauss | 119:ee6a53069455 | 1319 | } |
klauss | 132:05cd37f7e007 | 1320 | |
klauss | 132:05cd37f7e007 | 1321 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dbind ", 6 ) ) |
klauss | 132:05cd37f7e007 | 1322 | { |
klauss | 132:05cd37f7e007 | 1323 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 6 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1324 | { |
klauss | 109:a5b8264ffbbc | 1325 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1326 | |
klauss | 132:05cd37f7e007 | 1327 | vz_printf ( "UDP Bind Debug On" ); |
klauss | 132:05cd37f7e007 | 1328 | |
klauss | 119:ee6a53069455 | 1329 | debug_bind = true; |
klauss | 119:ee6a53069455 | 1330 | } |
klauss | 132:05cd37f7e007 | 1331 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 6 ), ( uint8_t * ) "off",3 ) ) |
klauss | 132:05cd37f7e007 | 1332 | { |
klauss | 119:ee6a53069455 | 1333 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1334 | |
klauss | 132:05cd37f7e007 | 1335 | vz_printf ( "UDP Bind Debug Off" ); |
klauss | 132:05cd37f7e007 | 1336 | |
klauss | 119:ee6a53069455 | 1337 | debug_bind = false; |
klauss | 119:ee6a53069455 | 1338 | } |
klauss | 119:ee6a53069455 | 1339 | } |
klauss | 132:05cd37f7e007 | 1340 | |
klauss | 132:05cd37f7e007 | 1341 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dresetrtp ", 10 ) ) |
klauss | 132:05cd37f7e007 | 1342 | { |
klauss | 132:05cd37f7e007 | 1343 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 10 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1344 | { |
klauss | 119:ee6a53069455 | 1345 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1346 | |
klauss | 132:05cd37f7e007 | 1347 | vz_printf ( "Reset RTP Debug On" ); |
klauss | 132:05cd37f7e007 | 1348 | |
klauss | 119:ee6a53069455 | 1349 | debug_reset_rtp = true; |
klauss | 119:ee6a53069455 | 1350 | } |
klauss | 132:05cd37f7e007 | 1351 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 10 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1352 | { |
klauss | 119:ee6a53069455 | 1353 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1354 | |
klauss | 132:05cd37f7e007 | 1355 | vz_printf ( "Reset RTP Debug Off" ); |
klauss | 132:05cd37f7e007 | 1356 | |
klauss | 119:ee6a53069455 | 1357 | debug_reset_rtp = false; |
klauss | 119:ee6a53069455 | 1358 | } |
klauss | 119:ee6a53069455 | 1359 | } |
klauss | 132:05cd37f7e007 | 1360 | |
klauss | 132:05cd37f7e007 | 1361 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "duart ", 6 ) ) |
klauss | 132:05cd37f7e007 | 1362 | { |
klauss | 132:05cd37f7e007 | 1363 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 6 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1364 | { |
klauss | 119:ee6a53069455 | 1365 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1366 | |
klauss | 132:05cd37f7e007 | 1367 | vz_printf ( "Enable UART3 usage" ); |
klauss | 132:05cd37f7e007 | 1368 | |
klauss | 100:09a23fcd3bdf | 1369 | debug_uart3 = true; |
klauss | 100:09a23fcd3bdf | 1370 | } |
klauss | 132:05cd37f7e007 | 1371 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 6 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1372 | { |
klauss | 100:09a23fcd3bdf | 1373 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1374 | |
klauss | 132:05cd37f7e007 | 1375 | vz_printf ( "Disable UART3 usage" ); |
klauss | 132:05cd37f7e007 | 1376 | |
klauss | 100:09a23fcd3bdf | 1377 | debug_uart3 = false; |
klauss | 100:09a23fcd3bdf | 1378 | } |
klauss | 100:09a23fcd3bdf | 1379 | } |
klauss | 132:05cd37f7e007 | 1380 | |
klauss | 132:05cd37f7e007 | 1381 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dprint ", 7 ) ) |
klauss | 132:05cd37f7e007 | 1382 | { |
klauss | 132:05cd37f7e007 | 1383 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 7 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1384 | { |
klauss | 114:472502b31a12 | 1385 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1386 | |
klauss | 132:05cd37f7e007 | 1387 | vz_printf ( "Debug print On" ); |
klauss | 132:05cd37f7e007 | 1388 | |
klauss | 114:472502b31a12 | 1389 | print_values = true; |
klauss | 114:472502b31a12 | 1390 | } |
klauss | 132:05cd37f7e007 | 1391 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 7 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1392 | { |
klauss | 98:43b45f26b430 | 1393 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1394 | |
klauss | 132:05cd37f7e007 | 1395 | vz_printf ( "Debug print Off" ); |
klauss | 132:05cd37f7e007 | 1396 | |
klauss | 114:472502b31a12 | 1397 | print_values = false; |
klauss | 114:472502b31a12 | 1398 | } |
klauss | 114:472502b31a12 | 1399 | } |
klauss | 132:05cd37f7e007 | 1400 | |
klauss | 132:05cd37f7e007 | 1401 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dmissed ", 8 ) ) |
klauss | 132:05cd37f7e007 | 1402 | { |
klauss | 132:05cd37f7e007 | 1403 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 8 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1404 | { |
klauss | 119:ee6a53069455 | 1405 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1406 | |
klauss | 132:05cd37f7e007 | 1407 | vz_printf ( "Debug Missed On" ); |
klauss | 132:05cd37f7e007 | 1408 | |
klauss | 119:ee6a53069455 | 1409 | debug_missed = true; |
klauss | 119:ee6a53069455 | 1410 | } |
klauss | 132:05cd37f7e007 | 1411 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 8 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1412 | { |
klauss | 119:ee6a53069455 | 1413 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1414 | |
klauss | 132:05cd37f7e007 | 1415 | vz_printf ( "Debug Missed Off" ); |
klauss | 132:05cd37f7e007 | 1416 | |
klauss | 119:ee6a53069455 | 1417 | debug_missed = false; |
klauss | 119:ee6a53069455 | 1418 | } |
klauss | 119:ee6a53069455 | 1419 | } |
klauss | 132:05cd37f7e007 | 1420 | |
klauss | 132:05cd37f7e007 | 1421 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dreconnect ", 11 ) ) |
klauss | 132:05cd37f7e007 | 1422 | { |
klauss | 132:05cd37f7e007 | 1423 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 11 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1424 | { |
klauss | 114:472502b31a12 | 1425 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1426 | |
klauss | 132:05cd37f7e007 | 1427 | vz_printf ( "Reconnecet Debug On" ); |
klauss | 132:05cd37f7e007 | 1428 | |
klauss | 119:ee6a53069455 | 1429 | debug_reconnect = true; |
klauss | 119:ee6a53069455 | 1430 | } |
klauss | 132:05cd37f7e007 | 1431 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 11 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1432 | { |
klauss | 119:ee6a53069455 | 1433 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1434 | |
klauss | 132:05cd37f7e007 | 1435 | vz_printf ( "Reconnecet Debug Off" ); |
klauss | 132:05cd37f7e007 | 1436 | |
klauss | 119:ee6a53069455 | 1437 | debug_reconnect = false; |
klauss | 119:ee6a53069455 | 1438 | } |
klauss | 119:ee6a53069455 | 1439 | } |
klauss | 132:05cd37f7e007 | 1440 | |
klauss | 132:05cd37f7e007 | 1441 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dmatch ", 7 ) ) |
klauss | 132:05cd37f7e007 | 1442 | { |
klauss | 132:05cd37f7e007 | 1443 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 7 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1444 | { |
klauss | 119:ee6a53069455 | 1445 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1446 | |
klauss | 132:05cd37f7e007 | 1447 | vz_printf ( "Port Match Debug On" ); |
klauss | 132:05cd37f7e007 | 1448 | |
klauss | 98:43b45f26b430 | 1449 | debug_port_match = true; |
klauss | 98:43b45f26b430 | 1450 | } |
klauss | 132:05cd37f7e007 | 1451 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 7 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1452 | { |
klauss | 98:43b45f26b430 | 1453 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1454 | |
klauss | 132:05cd37f7e007 | 1455 | vz_printf ( "Port Match Debug Off" ); |
klauss | 132:05cd37f7e007 | 1456 | |
klauss | 98:43b45f26b430 | 1457 | debug_port_match = false; |
klauss | 98:43b45f26b430 | 1458 | } |
klauss | 98:43b45f26b430 | 1459 | } |
klauss | 132:05cd37f7e007 | 1460 | |
klauss | 132:05cd37f7e007 | 1461 | |
klauss | 132:05cd37f7e007 | 1462 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dmuted ", 7 ) ) |
klauss | 132:05cd37f7e007 | 1463 | { |
klauss | 132:05cd37f7e007 | 1464 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 7 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1465 | { |
klauss | 81:3656f00ab3db | 1466 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1467 | |
klauss | 132:05cd37f7e007 | 1468 | vz_printf ( "Muted Debug On" ); |
klauss | 132:05cd37f7e007 | 1469 | |
klauss | 81:3656f00ab3db | 1470 | debug_muted = true; |
klauss | 81:3656f00ab3db | 1471 | } |
klauss | 132:05cd37f7e007 | 1472 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 7 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1473 | { |
klauss | 81:3656f00ab3db | 1474 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1475 | |
klauss | 132:05cd37f7e007 | 1476 | vz_printf ( "Muted Debug Off" ); |
klauss | 132:05cd37f7e007 | 1477 | |
klauss | 81:3656f00ab3db | 1478 | debug_muted = false; |
klauss | 81:3656f00ab3db | 1479 | } |
klauss | 81:3656f00ab3db | 1480 | } |
klauss | 132:05cd37f7e007 | 1481 | |
klauss | 132:05cd37f7e007 | 1482 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dwdt ", 5 ) ) |
klauss | 132:05cd37f7e007 | 1483 | { |
klauss | 132:05cd37f7e007 | 1484 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 5 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1485 | { |
klauss | 81:3656f00ab3db | 1486 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1487 | |
klauss | 132:05cd37f7e007 | 1488 | vz_printf ( "Wdt Debug On" ); |
klauss | 132:05cd37f7e007 | 1489 | |
klauss | 81:3656f00ab3db | 1490 | wdt_show = true; |
klauss | 81:3656f00ab3db | 1491 | } |
klauss | 132:05cd37f7e007 | 1492 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 5 ), ( uint8_t * ) "off",3 ) ) |
klauss | 132:05cd37f7e007 | 1493 | { |
klauss | 81:3656f00ab3db | 1494 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1495 | |
klauss | 132:05cd37f7e007 | 1496 | vz_printf ( "Wdt Debug Off" ); |
klauss | 132:05cd37f7e007 | 1497 | |
klauss | 81:3656f00ab3db | 1498 | wdt_show = false; |
klauss | 81:3656f00ab3db | 1499 | } |
klauss | 81:3656f00ab3db | 1500 | } |
klauss | 132:05cd37f7e007 | 1501 | |
klauss | 132:05cd37f7e007 | 1502 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "drefresh ", 9 ) ) |
klauss | 132:05cd37f7e007 | 1503 | { |
klauss | 132:05cd37f7e007 | 1504 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 9 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1505 | { |
klauss | 81:3656f00ab3db | 1506 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1507 | |
klauss | 132:05cd37f7e007 | 1508 | vz_printf ( "Refresh Debug On" ); |
klauss | 132:05cd37f7e007 | 1509 | |
klauss | 81:3656f00ab3db | 1510 | debug_refresh= true; |
klauss | 81:3656f00ab3db | 1511 | } |
klauss | 132:05cd37f7e007 | 1512 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 9 ), ( uint8_t * ) "off",3 ) ) |
klauss | 132:05cd37f7e007 | 1513 | { |
klauss | 81:3656f00ab3db | 1514 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1515 | |
klauss | 132:05cd37f7e007 | 1516 | vz_printf ( "Refresh Debug Off" ); |
klauss | 132:05cd37f7e007 | 1517 | |
klauss | 81:3656f00ab3db | 1518 | debug_refresh = false; |
klauss | 81:3656f00ab3db | 1519 | } |
klauss | 81:3656f00ab3db | 1520 | } |
klauss | 132:05cd37f7e007 | 1521 | |
klauss | 132:05cd37f7e007 | 1522 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dping ", 6 ) ) |
klauss | 132:05cd37f7e007 | 1523 | { |
klauss | 132:05cd37f7e007 | 1524 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 6 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1525 | { |
klauss | 78:1353744f01e1 | 1526 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1527 | |
klauss | 132:05cd37f7e007 | 1528 | vz_printf ( "Ping Debug On" ); |
klauss | 132:05cd37f7e007 | 1529 | |
klauss | 78:1353744f01e1 | 1530 | debug_ping = true; |
klauss | 78:1353744f01e1 | 1531 | } |
klauss | 132:05cd37f7e007 | 1532 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 6 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1533 | { |
klauss | 78:1353744f01e1 | 1534 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1535 | |
klauss | 132:05cd37f7e007 | 1536 | vz_printf ( "Ping Debug Off" ); |
klauss | 132:05cd37f7e007 | 1537 | |
klauss | 78:1353744f01e1 | 1538 | debug_ping= false; |
klauss | 78:1353744f01e1 | 1539 | } |
klauss | 78:1353744f01e1 | 1540 | } |
klauss | 132:05cd37f7e007 | 1541 | |
klauss | 132:05cd37f7e007 | 1542 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dwu ", 4 ) ) |
klauss | 132:05cd37f7e007 | 1543 | { |
klauss | 132:05cd37f7e007 | 1544 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 4 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1545 | { |
klauss | 78:1353744f01e1 | 1546 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1547 | |
klauss | 132:05cd37f7e007 | 1548 | vz_printf ( "Wake Up Debug On" ); |
klauss | 132:05cd37f7e007 | 1549 | |
klauss | 78:1353744f01e1 | 1550 | debug_wake = true; |
klauss | 78:1353744f01e1 | 1551 | } |
klauss | 132:05cd37f7e007 | 1552 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 4 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1553 | { |
klauss | 78:1353744f01e1 | 1554 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1555 | |
klauss | 132:05cd37f7e007 | 1556 | vz_printf ( "Wake Up Debug Off" ); |
klauss | 132:05cd37f7e007 | 1557 | |
klauss | 78:1353744f01e1 | 1558 | debug_wake = false; |
klauss | 78:1353744f01e1 | 1559 | } |
klauss | 78:1353744f01e1 | 1560 | } |
klauss | 132:05cd37f7e007 | 1561 | |
klauss | 132:05cd37f7e007 | 1562 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "tcp_alive ", 10 ) ) |
klauss | 132:05cd37f7e007 | 1563 | { |
klauss | 132:05cd37f7e007 | 1564 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 10 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1565 | { |
klauss | 78:1353744f01e1 | 1566 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1567 | |
klauss | 132:05cd37f7e007 | 1568 | vz_printf ( "TCP don't drop mode on" ); |
klauss | 132:05cd37f7e007 | 1569 | |
klauss | 78:1353744f01e1 | 1570 | tcp_alive = true; |
klauss | 78:1353744f01e1 | 1571 | } |
klauss | 132:05cd37f7e007 | 1572 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 10 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1573 | { |
klauss | 78:1353744f01e1 | 1574 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1575 | |
klauss | 132:05cd37f7e007 | 1576 | vz_printf ( "TCP don't drop mode off" ); |
klauss | 132:05cd37f7e007 | 1577 | |
klauss | 78:1353744f01e1 | 1578 | tcp_alive = false; |
klauss | 78:1353744f01e1 | 1579 | } |
klauss | 78:1353744f01e1 | 1580 | } |
klauss | 132:05cd37f7e007 | 1581 | |
klauss | 132:05cd37f7e007 | 1582 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "daging ",7 ) ) |
klauss | 132:05cd37f7e007 | 1583 | { |
klauss | 132:05cd37f7e007 | 1584 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 7 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1585 | { |
klauss | 78:1353744f01e1 | 1586 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1587 | |
klauss | 132:05cd37f7e007 | 1588 | vz_printf ( "Aging Debug On" ); |
klauss | 132:05cd37f7e007 | 1589 | |
klauss | 78:1353744f01e1 | 1590 | debug_aging = true; |
klauss | 78:1353744f01e1 | 1591 | } |
klauss | 132:05cd37f7e007 | 1592 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 7 ), ( uint8_t * ) "off",3 ) ) |
klauss | 132:05cd37f7e007 | 1593 | { |
klauss | 78:1353744f01e1 | 1594 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1595 | |
klauss | 132:05cd37f7e007 | 1596 | vz_printf ( "Aging Debug Off" ); |
klauss | 132:05cd37f7e007 | 1597 | |
klauss | 78:1353744f01e1 | 1598 | debug_aging = false; |
klauss | 78:1353744f01e1 | 1599 | } |
klauss | 78:1353744f01e1 | 1600 | } |
klauss | 132:05cd37f7e007 | 1601 | |
klauss | 132:05cd37f7e007 | 1602 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dcpld ", 6 ) ) |
klauss | 132:05cd37f7e007 | 1603 | { |
klauss | 132:05cd37f7e007 | 1604 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 6 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1605 | { |
klauss | 78:1353744f01e1 | 1606 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1607 | |
klauss | 132:05cd37f7e007 | 1608 | vz_printf ( "DCPLD Debug On" ); |
klauss | 132:05cd37f7e007 | 1609 | |
klauss | 78:1353744f01e1 | 1610 | debug_cpld = true; |
klauss | 119:ee6a53069455 | 1611 | debug_cb_rx = true; |
klauss | 119:ee6a53069455 | 1612 | debug_cb_tx = true; |
klauss | 78:1353744f01e1 | 1613 | } |
klauss | 132:05cd37f7e007 | 1614 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 6 ), ( uint8_t * ) "off",3 ) ) |
klauss | 132:05cd37f7e007 | 1615 | { |
klauss | 78:1353744f01e1 | 1616 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1617 | |
klauss | 132:05cd37f7e007 | 1618 | vz_printf ( "DCPLD Debug Off" ); |
klauss | 132:05cd37f7e007 | 1619 | |
klauss | 78:1353744f01e1 | 1620 | debug_cpld = false; |
klauss | 119:ee6a53069455 | 1621 | debug_cb_rx = false; |
klauss | 119:ee6a53069455 | 1622 | debug_cb_tx = false; |
klauss | 78:1353744f01e1 | 1623 | } |
klauss | 78:1353744f01e1 | 1624 | } |
klauss | 132:05cd37f7e007 | 1625 | |
klauss | 132:05cd37f7e007 | 1626 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dtxshow ", 8 ) ) |
klauss | 132:05cd37f7e007 | 1627 | { |
klauss | 132:05cd37f7e007 | 1628 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 8 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1629 | { |
klauss | 124:c1b6c893e1c3 | 1630 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1631 | |
klauss | 132:05cd37f7e007 | 1632 | vz_printf ( "DCPLD Show TX Debug On" ); |
klauss | 132:05cd37f7e007 | 1633 | |
klauss | 124:c1b6c893e1c3 | 1634 | debug_show_tx_cpld = true; |
klauss | 124:c1b6c893e1c3 | 1635 | } |
klauss | 132:05cd37f7e007 | 1636 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 8 ), ( uint8_t * ) "off",3 ) ) |
klauss | 132:05cd37f7e007 | 1637 | { |
klauss | 124:c1b6c893e1c3 | 1638 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1639 | |
klauss | 132:05cd37f7e007 | 1640 | vz_printf ( "DCPLD Show TX Debug Off" ); |
klauss | 132:05cd37f7e007 | 1641 | |
klauss | 124:c1b6c893e1c3 | 1642 | debug_show_tx_cpld = false; |
klauss | 124:c1b6c893e1c3 | 1643 | } |
klauss | 124:c1b6c893e1c3 | 1644 | } |
klauss | 132:05cd37f7e007 | 1645 | |
klauss | 132:05cd37f7e007 | 1646 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dshowcpld ", 10 ) ) |
klauss | 132:05cd37f7e007 | 1647 | { |
klauss | 132:05cd37f7e007 | 1648 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 10 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1649 | { |
klauss | 119:ee6a53069455 | 1650 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1651 | |
klauss | 132:05cd37f7e007 | 1652 | vz_printf ( "DCPLD Show Debug On" ); |
klauss | 132:05cd37f7e007 | 1653 | |
klauss | 124:c1b6c893e1c3 | 1654 | debug_show_tx_cpld = true; |
klauss | 124:c1b6c893e1c3 | 1655 | debug_show_rx_cpld = true; |
klauss | 119:ee6a53069455 | 1656 | } |
klauss | 132:05cd37f7e007 | 1657 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 10 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1658 | { |
klauss | 113:db67ae00550e | 1659 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1660 | vz_printf ( "DCPLD Show Debug Off" ); |
klauss | 132:05cd37f7e007 | 1661 | |
klauss | 124:c1b6c893e1c3 | 1662 | debug_show_tx_cpld = false; |
klauss | 124:c1b6c893e1c3 | 1663 | debug_show_rx_cpld = false; |
klauss | 119:ee6a53069455 | 1664 | } |
klauss | 119:ee6a53069455 | 1665 | } |
klauss | 132:05cd37f7e007 | 1666 | |
klauss | 119:ee6a53069455 | 1667 | |
klauss | 132:05cd37f7e007 | 1668 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "drxshow ", 8 ) ) |
klauss | 132:05cd37f7e007 | 1669 | { |
klauss | 132:05cd37f7e007 | 1670 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 8 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1671 | { |
klauss | 124:c1b6c893e1c3 | 1672 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1673 | |
klauss | 132:05cd37f7e007 | 1674 | vz_printf ( "DCPLD Show RX Debug On" ); |
klauss | 132:05cd37f7e007 | 1675 | |
klauss | 124:c1b6c893e1c3 | 1676 | debug_show_rx_cpld = true; |
klauss | 124:c1b6c893e1c3 | 1677 | } |
klauss | 132:05cd37f7e007 | 1678 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 8 ), ( uint8_t * ) "off",3 ) ) |
klauss | 132:05cd37f7e007 | 1679 | { |
klauss | 124:c1b6c893e1c3 | 1680 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1681 | |
klauss | 132:05cd37f7e007 | 1682 | vz_printf ( "DCPLD Show RX Debug Off" ); |
klauss | 132:05cd37f7e007 | 1683 | |
klauss | 124:c1b6c893e1c3 | 1684 | debug_show_rx_cpld = false; |
klauss | 124:c1b6c893e1c3 | 1685 | } |
klauss | 124:c1b6c893e1c3 | 1686 | } |
klauss | 132:05cd37f7e007 | 1687 | |
klauss | 132:05cd37f7e007 | 1688 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dcks_err ", 9 ) ) |
klauss | 132:05cd37f7e007 | 1689 | { |
klauss | 132:05cd37f7e007 | 1690 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 9 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1691 | { |
klauss | 119:ee6a53069455 | 1692 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1693 | |
klauss | 132:05cd37f7e007 | 1694 | vz_printf ( "CKS_ERR Debug On" ); |
klauss | 132:05cd37f7e007 | 1695 | |
klauss | 78:1353744f01e1 | 1696 | debug_cks_err = true; |
klauss | 78:1353744f01e1 | 1697 | } |
klauss | 132:05cd37f7e007 | 1698 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 9 ), ( uint8_t *) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1699 | { |
klauss | 78:1353744f01e1 | 1700 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1701 | |
klauss | 132:05cd37f7e007 | 1702 | vz_printf ( "CKS_ERR Debug Off" ); |
klauss | 132:05cd37f7e007 | 1703 | |
klauss | 78:1353744f01e1 | 1704 | debug_cks_err = false; |
klauss | 78:1353744f01e1 | 1705 | } |
klauss | 78:1353744f01e1 | 1706 | } |
klauss | 132:05cd37f7e007 | 1707 | |
klauss | 132:05cd37f7e007 | 1708 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * )"dinvite ", 8 ) ) |
klauss | 132:05cd37f7e007 | 1709 | { |
klauss | 132:05cd37f7e007 | 1710 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 8 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1711 | { |
klauss | 78:1353744f01e1 | 1712 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1713 | |
klauss | 132:05cd37f7e007 | 1714 | vz_printf ( "Invite Debug ON" ); |
klauss | 132:05cd37f7e007 | 1715 | |
klauss | 81:3656f00ab3db | 1716 | debug_invite = true; |
klauss | 78:1353744f01e1 | 1717 | } |
klauss | 132:05cd37f7e007 | 1718 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 8 ), ( uint8_t * ) "off",3 ) ) |
klauss | 132:05cd37f7e007 | 1719 | { |
klauss | 78:1353744f01e1 | 1720 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1721 | |
klauss | 132:05cd37f7e007 | 1722 | vz_printf ( "Invite Debug ON" ); |
klauss | 132:05cd37f7e007 | 1723 | |
klauss | 132:05cd37f7e007 | 1724 | debug_invite = false; |
klauss | 45:c80574f24dc3 | 1725 | } |
klauss | 45:c80574f24dc3 | 1726 | } |
klauss | 132:05cd37f7e007 | 1727 | |
klauss | 132:05cd37f7e007 | 1728 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dparallel ", 10 ) ) |
klauss | 132:05cd37f7e007 | 1729 | { |
klauss | 132:05cd37f7e007 | 1730 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 10 ), ( uint8_t * )"on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1731 | { |
klauss | 72:895ca792c647 | 1732 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1733 | |
klauss | 132:05cd37f7e007 | 1734 | vz_printf ( "Parallel Write Debug On" ); |
klauss | 132:05cd37f7e007 | 1735 | |
klauss | 72:895ca792c647 | 1736 | dparallel = true; |
klauss | 72:895ca792c647 | 1737 | } |
klauss | 132:05cd37f7e007 | 1738 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 10 ), ( uint8_t *)"off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1739 | { |
klauss | 72:895ca792c647 | 1740 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1741 | |
klauss | 132:05cd37f7e007 | 1742 | vz_printf ( "Parallel Write Debug Off" ); |
klauss | 132:05cd37f7e007 | 1743 | |
klauss | 72:895ca792c647 | 1744 | dparallel = false; |
klauss | 72:895ca792c647 | 1745 | } |
klauss | 132:05cd37f7e007 | 1746 | } |
klauss | 132:05cd37f7e007 | 1747 | |
klauss | 132:05cd37f7e007 | 1748 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dtelos ", 7 ) ) |
klauss | 132:05cd37f7e007 | 1749 | { |
klauss | 132:05cd37f7e007 | 1750 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 7 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1751 | { |
klauss | 53:bb492a8f115a | 1752 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1753 | |
klauss | 132:05cd37f7e007 | 1754 | vz_printf ( "Telemetry Debug On" ); |
klauss | 132:05cd37f7e007 | 1755 | |
klauss | 53:bb492a8f115a | 1756 | debug_telemetry = true; |
klauss | 53:bb492a8f115a | 1757 | } |
klauss | 132:05cd37f7e007 | 1758 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 7 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 1759 | { |
klauss | 53:bb492a8f115a | 1760 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1761 | |
klauss | 132:05cd37f7e007 | 1762 | vz_printf ( "Telemetry Debug Off" ); |
klauss | 132:05cd37f7e007 | 1763 | |
klauss | 53:bb492a8f115a | 1764 | debug_telemetry = false; |
klauss | 53:bb492a8f115a | 1765 | } |
klauss | 53:bb492a8f115a | 1766 | } |
klauss | 132:05cd37f7e007 | 1767 | |
klauss | 132:05cd37f7e007 | 1768 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dcks ", 5 ) ) |
klauss | 124:c1b6c893e1c3 | 1769 | { |
klauss | 132:05cd37f7e007 | 1770 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 5 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 1771 | { |
klauss | 45:c80574f24dc3 | 1772 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1773 | |
klauss | 132:05cd37f7e007 | 1774 | vz_printf ( "CKS Debug On" ); |
klauss | 132:05cd37f7e007 | 1775 | |
klauss | 78:1353744f01e1 | 1776 | debug_cks = true; |
klauss | 45:c80574f24dc3 | 1777 | } |
klauss | 132:05cd37f7e007 | 1778 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 5 ), ( uint8_t * )"off",3 ) ) |
klauss | 132:05cd37f7e007 | 1779 | { |
klauss | 45:c80574f24dc3 | 1780 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1781 | |
klauss | 132:05cd37f7e007 | 1782 | vz_printf ( "CKS Debug Off" ); |
klauss | 132:05cd37f7e007 | 1783 | |
klauss | 78:1353744f01e1 | 1784 | debug_cks = false; |
klauss | 45:c80574f24dc3 | 1785 | } |
klauss | 45:c80574f24dc3 | 1786 | } |
klauss | 132:05cd37f7e007 | 1787 | |
klauss | 132:05cd37f7e007 | 1788 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "cc ", 3 ) ) |
klauss | 124:c1b6c893e1c3 | 1789 | { |
klauss | 124:c1b6c893e1c3 | 1790 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1791 | |
klauss | 124:c1b6c893e1c3 | 1792 | int ext,port; |
klauss | 124:c1b6c893e1c3 | 1793 | char *split, *ref, *cmd; |
klauss | 124:c1b6c893e1c3 | 1794 | |
klauss | 124:c1b6c893e1c3 | 1795 | ref = debug_buf; |
klauss | 124:c1b6c893e1c3 | 1796 | |
klauss | 126:1f90756250fb | 1797 | strcat ( debug_buf, "\r" ); |
klauss | 124:c1b6c893e1c3 | 1798 | |
klauss | 126:1f90756250fb | 1799 | split = strtok ( debug_buf + 3, " " ); |
klauss | 126:1f90756250fb | 1800 | ext = atoi ( split ); |
klauss | 124:c1b6c893e1c3 | 1801 | |
klauss | 124:c1b6c893e1c3 | 1802 | port = ext; |
klauss | 132:05cd37f7e007 | 1803 | |
klauss | 132:05cd37f7e007 | 1804 | split += strlen ( split ) + 1; |
klauss | 124:c1b6c893e1c3 | 1805 | cmd = split; |
klauss | 124:c1b6c893e1c3 | 1806 | |
klauss | 124:c1b6c893e1c3 | 1807 | promptcb_last_ext = ext; |
klauss | 124:c1b6c893e1c3 | 1808 | promptcb_last_port = port; |
klauss | 124:c1b6c893e1c3 | 1809 | |
klauss | 132:05cd37f7e007 | 1810 | strcpy ( promptcb_last_cmd, cmd ); |
klauss | 124:c1b6c893e1c3 | 1811 | |
klauss | 132:05cd37f7e007 | 1812 | for ( register int i = strlen ( cmd ); i < DEBUGBUFSIZE; i++ ) cmd [ i ] = 0; |
klauss | 124:c1b6c893e1c3 | 1813 | |
klauss | 132:05cd37f7e007 | 1814 | send2callboxes( build_cb_package( ext, port, PROMPT, cmd, id_msg++, CB_BUFFER_SIZE - VZ_HEADER_OFFSET, prompt_write_buffer ) ); |
klauss | 132:05cd37f7e007 | 1815 | |
klauss | 132:05cd37f7e007 | 1816 | vz_printf ( "ext=%d port=%d cmd=%s\r\nComando enviado", ext, port, cmd ); |
klauss | 124:c1b6c893e1c3 | 1817 | |
klauss | 124:c1b6c893e1c3 | 1818 | debug_buf = ref; |
klauss | 132:05cd37f7e007 | 1819 | |
klauss | 124:c1b6c893e1c3 | 1820 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 1821 | |
klauss | 132:05cd37f7e007 | 1822 | for ( register int i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 124:c1b6c893e1c3 | 1823 | } |
klauss | 132:05cd37f7e007 | 1824 | |
klauss | 132:05cd37f7e007 | 1825 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "bc ", 3 ) ) |
klauss | 124:c1b6c893e1c3 | 1826 | { |
klauss | 124:c1b6c893e1c3 | 1827 | miss_match = false; |
klauss | 124:c1b6c893e1c3 | 1828 | |
klauss | 132:05cd37f7e007 | 1829 | strcat ( debug_buf, "\r" ); |
klauss | 132:05cd37f7e007 | 1830 | |
klauss | 124:c1b6c893e1c3 | 1831 | char * cmd = debug_buf + 3; |
klauss | 124:c1b6c893e1c3 | 1832 | |
klauss | 124:c1b6c893e1c3 | 1833 | for ( register int i = strlen( cmd ); i < DEBUGBUFSIZE; i++ ) cmd [ i ] = 0; |
klauss | 124:c1b6c893e1c3 | 1834 | |
klauss | 132:05cd37f7e007 | 1835 | send2callboxes ( build_cb_package ( BROADCAST_EXT, BROADCAST_EXT, PROMPT, cmd, id_msg++, CB_BUFFER_SIZE - VZ_HEADER_OFFSET, prompt_write_buffer ) ); |
klauss | 124:c1b6c893e1c3 | 1836 | |
klauss | 132:05cd37f7e007 | 1837 | vz_printf ( "ext=%x port=%x cmd=%s\r\nComando enviado", BROADCAST_EXT, BROADCAST_EXT, cmd ); |
klauss | 124:c1b6c893e1c3 | 1838 | |
klauss | 124:c1b6c893e1c3 | 1839 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 1840 | |
klauss | 132:05cd37f7e007 | 1841 | for ( register int i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 124:c1b6c893e1c3 | 1842 | } |
klauss | 132:05cd37f7e007 | 1843 | |
klauss | 132:05cd37f7e007 | 1844 | |
klauss | 132:05cd37f7e007 | 1845 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "pcb ", 4 ) ) |
klauss | 132:05cd37f7e007 | 1846 | { |
klauss | 78:1353744f01e1 | 1847 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1848 | |
klauss | 78:1353744f01e1 | 1849 | int ext,port; |
klauss | 78:1353744f01e1 | 1850 | char *split, *ref, *cmd; |
klauss | 119:ee6a53069455 | 1851 | |
klauss | 78:1353744f01e1 | 1852 | ref = debug_buf; |
klauss | 119:ee6a53069455 | 1853 | |
klauss | 132:05cd37f7e007 | 1854 | strcat ( debug_buf, "\r" ); |
klauss | 119:ee6a53069455 | 1855 | |
klauss | 132:05cd37f7e007 | 1856 | split = strtok ( debug_buf + 4, " " ); |
klauss | 132:05cd37f7e007 | 1857 | ext = atoi ( split ); |
klauss | 119:ee6a53069455 | 1858 | |
klauss | 132:05cd37f7e007 | 1859 | port = convert_ext_to_port ( ext ); |
klauss | 132:05cd37f7e007 | 1860 | split += strlen ( split ) + 1; |
klauss | 78:1353744f01e1 | 1861 | cmd = split; |
klauss | 119:ee6a53069455 | 1862 | |
klauss | 78:1353744f01e1 | 1863 | promptcb_last_ext = ext; |
klauss | 78:1353744f01e1 | 1864 | promptcb_last_port = port; |
klauss | 119:ee6a53069455 | 1865 | |
klauss | 132:05cd37f7e007 | 1866 | strcpy ( promptcb_last_cmd, cmd ); |
klauss | 119:ee6a53069455 | 1867 | |
klauss | 132:05cd37f7e007 | 1868 | for ( register int i = strlen ( cmd ); i < DEBUGBUFSIZE; i++ ) cmd [ i ] = 0; |
klauss | 119:ee6a53069455 | 1869 | |
klauss | 132:05cd37f7e007 | 1870 | send2callboxes( build_cb_package( ext, port, PROMPT, cmd, id_msg++, CB_BUFFER_SIZE - VZ_HEADER_OFFSET, prompt_write_buffer ) ); |
klauss | 132:05cd37f7e007 | 1871 | |
klauss | 132:05cd37f7e007 | 1872 | vz_printf ( "ext=%d port=%d cmd=%s\r\nComando enviado", ext, port, cmd ); |
klauss | 132:05cd37f7e007 | 1873 | |
klauss | 132:05cd37f7e007 | 1874 | debug_buf = ref; |
klauss | 132:05cd37f7e007 | 1875 | |
klauss | 132:05cd37f7e007 | 1876 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 1877 | |
klauss | 132:05cd37f7e007 | 1878 | for ( register int i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 132:05cd37f7e007 | 1879 | } |
klauss | 119:ee6a53069455 | 1880 | |
klauss | 132:05cd37f7e007 | 1881 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "pend_all" ) ) |
klauss | 132:05cd37f7e007 | 1882 | { |
klauss | 132:05cd37f7e007 | 1883 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1884 | |
klauss | 132:05cd37f7e007 | 1885 | char cmd_msg [ CB_BUFFER_SIZE ] = "pend\r"; |
klauss | 132:05cd37f7e007 | 1886 | |
klauss | 132:05cd37f7e007 | 1887 | for ( register int i = strlen ( cmd_msg ); i < CB_BUFFER_SIZE; i++ ) cmd_msg [ i ] = 0; |
klauss | 119:ee6a53069455 | 1888 | |
klauss | 132:05cd37f7e007 | 1889 | send2callboxes ( build_cb_package ( BROADCAST_EXT, BROADCAST_EXT, PROMPT, cmd_msg, id_msg++, CB_BUFFER_SIZE - VZ_HEADER_OFFSET, prompt_write_buffer ) ); |
klauss | 132:05cd37f7e007 | 1890 | |
klauss | 132:05cd37f7e007 | 1891 | vz_printf ( "ext=%x port=%x cmd=%s\r\nComando enviado", BROADCAST_EXT, BROADCAST_EXT, cmd_msg ); |
klauss | 132:05cd37f7e007 | 1892 | |
klauss | 78:1353744f01e1 | 1893 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 1894 | |
klauss | 132:05cd37f7e007 | 1895 | for ( register int i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 78:1353744f01e1 | 1896 | } |
klauss | 132:05cd37f7e007 | 1897 | |
klauss | 132:05cd37f7e007 | 1898 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "bye ", 4 ) ) |
klauss | 123:1d395b5a4cad | 1899 | { |
klauss | 123:1d395b5a4cad | 1900 | miss_match = false; |
klauss | 123:1d395b5a4cad | 1901 | |
klauss | 92:92df17f538a8 | 1902 | int ext,port; |
klauss | 124:c1b6c893e1c3 | 1903 | char * ref; |
klauss | 124:c1b6c893e1c3 | 1904 | |
klauss | 92:92df17f538a8 | 1905 | ref = debug_buf; |
klauss | 124:c1b6c893e1c3 | 1906 | |
klauss | 132:05cd37f7e007 | 1907 | strcat ( debug_buf, "\r" ); |
klauss | 124:c1b6c893e1c3 | 1908 | |
klauss | 132:05cd37f7e007 | 1909 | ext = atoi ( strtok ( debug_buf + 4, " " ) ); |
klauss | 124:c1b6c893e1c3 | 1910 | |
klauss | 124:c1b6c893e1c3 | 1911 | port = ext; |
klauss | 124:c1b6c893e1c3 | 1912 | |
klauss | 124:c1b6c893e1c3 | 1913 | promptcb_last_ext = ext; |
klauss | 124:c1b6c893e1c3 | 1914 | promptcb_last_port = port; |
klauss | 132:05cd37f7e007 | 1915 | |
klauss | 127:e7160a463b6c | 1916 | char msg [ CB_BUFFER_SIZE ] = ""; |
klauss | 132:05cd37f7e007 | 1917 | |
klauss | 127:e7160a463b6c | 1918 | for ( register int i = 0; i < CB_BUFFER_SIZE; i ++ ) msg [ i ] = 0; |
klauss | 124:c1b6c893e1c3 | 1919 | |
klauss | 132:05cd37f7e007 | 1920 | strcpy ( msg, "bye" ); |
klauss | 124:c1b6c893e1c3 | 1921 | |
klauss | 132:05cd37f7e007 | 1922 | send2callboxes ( build_cb_package ( ext, port, CB_BYE, msg, ( id_msg++ & ~BIT7 ), CB_BUFFER_SIZE - VZ_HEADER_OFFSET, prompt_write_buffer ) ); |
klauss | 132:05cd37f7e007 | 1923 | |
klauss | 132:05cd37f7e007 | 1924 | vz_printf ( "Send BYE to ext=%d port=%d\r\nComando enviado", ext, port ); |
klauss | 124:c1b6c893e1c3 | 1925 | |
klauss | 124:c1b6c893e1c3 | 1926 | debug_buf = ref; |
klauss | 132:05cd37f7e007 | 1927 | |
klauss | 124:c1b6c893e1c3 | 1928 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 1929 | |
klauss | 132:05cd37f7e007 | 1930 | for ( register int i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 124:c1b6c893e1c3 | 1931 | } |
klauss | 132:05cd37f7e007 | 1932 | |
klauss | 132:05cd37f7e007 | 1933 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "end_call ", 9 ) ) |
klauss | 124:c1b6c893e1c3 | 1934 | { |
klauss | 124:c1b6c893e1c3 | 1935 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1936 | |
klauss | 124:c1b6c893e1c3 | 1937 | char * ref; |
klauss | 124:c1b6c893e1c3 | 1938 | |
klauss | 124:c1b6c893e1c3 | 1939 | ref = debug_buf; |
klauss | 124:c1b6c893e1c3 | 1940 | |
klauss | 132:05cd37f7e007 | 1941 | end_call_ext = atoi ( strtok ( debug_buf + 9, " " ) ); |
klauss | 132:05cd37f7e007 | 1942 | |
klauss | 124:c1b6c893e1c3 | 1943 | end_call = true; |
klauss | 124:c1b6c893e1c3 | 1944 | |
klauss | 92:92df17f538a8 | 1945 | debug_buf = ref; |
klauss | 132:05cd37f7e007 | 1946 | |
klauss | 92:92df17f538a8 | 1947 | bufptr = 0; |
klauss | 126:1f90756250fb | 1948 | |
klauss | 132:05cd37f7e007 | 1949 | for ( register int i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 132:05cd37f7e007 | 1950 | |
klauss | 132:05cd37f7e007 | 1951 | vz_printf( "kill call :: %u\r\n> ", end_call_ext ); |
klauss | 45:c80574f24dc3 | 1952 | } |
klauss | 132:05cd37f7e007 | 1953 | |
klauss | 132:05cd37f7e007 | 1954 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "msg", 3 ) ) |
klauss | 126:1f90756250fb | 1955 | { |
klauss | 126:1f90756250fb | 1956 | miss_match = false; |
klauss | 132:05cd37f7e007 | 1957 | |
klauss | 126:1f90756250fb | 1958 | char * ref = debug_buf; |
klauss | 132:05cd37f7e007 | 1959 | |
klauss | 126:1f90756250fb | 1960 | if ( ( strlen ( debug_buf ) == strlen ( "msg" ) ) or ( strstr ( debug_buf + 4, "help" ) not_eq ( NULL ) ) ) |
klauss | 126:1f90756250fb | 1961 | { |
klauss | 132:05cd37f7e007 | 1962 | vz_printf ("usage msg < ext> <msg_id> <type>" ); |
klauss | 132:05cd37f7e007 | 1963 | } else { |
klauss | 132:05cd37f7e007 | 1964 | |
klauss | 126:1f90756250fb | 1965 | char * split = strtok ( debug_buf + 4, " " ); |
klauss | 126:1f90756250fb | 1966 | int ext = atoi ( split ); |
klauss | 126:1f90756250fb | 1967 | int port = ext; |
klauss | 132:05cd37f7e007 | 1968 | |
klauss | 126:1f90756250fb | 1969 | // <msg_id> |
klauss | 126:1f90756250fb | 1970 | split += strlen ( split ) + 1; |
klauss | 126:1f90756250fb | 1971 | split = strtok( NULL, " " ); |
klauss | 132:05cd37f7e007 | 1972 | |
klauss | 126:1f90756250fb | 1973 | int seq_num = ( strncasecmp ( split, "0x", 2 ) ) ? atoi ( split ) : ( int ) strtol ( split + 2, NULL, 16 ); |
klauss | 132:05cd37f7e007 | 1974 | |
klauss | 126:1f90756250fb | 1975 | // <type> |
klauss | 126:1f90756250fb | 1976 | split += strlen ( split ) + 1; |
klauss | 132:05cd37f7e007 | 1977 | split = strtok ( NULL, " " ); |
klauss | 132:05cd37f7e007 | 1978 | |
klauss | 126:1f90756250fb | 1979 | uint8_t num_type = 0; |
klauss | 132:05cd37f7e007 | 1980 | |
klauss | 132:05cd37f7e007 | 1981 | char type [ 16 ]; |
klauss | 132:05cd37f7e007 | 1982 | |
klauss | 126:1f90756250fb | 1983 | strncpy ( type, split, sizeof ( type ) - 1 ); |
klauss | 132:05cd37f7e007 | 1984 | |
klauss | 126:1f90756250fb | 1985 | if ( not ( strcasecmp ( type, "REGISTRY" ) ) ) num_type = REGISTRY; |
klauss | 132:05cd37f7e007 | 1986 | |
klauss | 126:1f90756250fb | 1987 | else if ( not ( strcasecmp ( type, "INVITE" ) ) ) num_type = INVITE; |
klauss | 132:05cd37f7e007 | 1988 | |
klauss | 126:1f90756250fb | 1989 | else if ( not ( strcasecmp ( type, "BOOT" ) ) ) num_type = BOOT; |
klauss | 132:05cd37f7e007 | 1990 | |
klauss | 126:1f90756250fb | 1991 | else if ( not ( strcasecmp ( type, "TELEMETRY" ) ) ) num_type = TELEMETRY; |
klauss | 132:05cd37f7e007 | 1992 | |
klauss | 126:1f90756250fb | 1993 | else if ( not ( strcasecmp ( type, "bye" ) ) ) num_type = CB_BYE; |
klauss | 132:05cd37f7e007 | 1994 | |
klauss | 126:1f90756250fb | 1995 | else if ( not ( strcasecmp ( type, "PROMPT" ) ) ) num_type = PROMPT; |
klauss | 132:05cd37f7e007 | 1996 | |
klauss | 126:1f90756250fb | 1997 | char cmd [ 32 ] = ""; |
klauss | 132:05cd37f7e007 | 1998 | |
klauss | 132:05cd37f7e007 | 1999 | if ( num_type not_eq PROMPT ) for( register int i = 0; i < 32; i++ ) cmd [ i ] = 0; |
klauss | 132:05cd37f7e007 | 2000 | |
klauss | 126:1f90756250fb | 2001 | else strcpy ( cmd, "ping\r" ); |
klauss | 132:05cd37f7e007 | 2002 | |
klauss | 132:05cd37f7e007 | 2003 | send2callboxes( build_cb_package( ext, port, num_type, cmd, seq_num, CB_BUFFER_SIZE - VZ_HEADER_OFFSET, prompt_write_buffer ) ); |
klauss | 126:1f90756250fb | 2004 | |
klauss | 132:05cd37f7e007 | 2005 | vz_printf ( "ext=%d port=%d msg_id=%#x type=%#x", ext, port, seq_num, num_type ); |
klauss | 126:1f90756250fb | 2006 | } |
klauss | 132:05cd37f7e007 | 2007 | |
klauss | 126:1f90756250fb | 2008 | debug_buf = ref; |
klauss | 132:05cd37f7e007 | 2009 | |
klauss | 126:1f90756250fb | 2010 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 2011 | |
klauss | 132:05cd37f7e007 | 2012 | for ( register int i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 126:1f90756250fb | 2013 | } |
klauss | 132:05cd37f7e007 | 2014 | |
klauss | 132:05cd37f7e007 | 2015 | |
klauss | 132:05cd37f7e007 | 2016 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "pcc ", 4 ) ) |
klauss | 132:05cd37f7e007 | 2017 | { |
klauss | 98:43b45f26b430 | 2018 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2019 | |
klauss | 98:43b45f26b430 | 2020 | int ext,port; |
klauss | 98:43b45f26b430 | 2021 | char *split, *ref, *cmd; |
klauss | 119:ee6a53069455 | 2022 | |
klauss | 98:43b45f26b430 | 2023 | ref = debug_buf; |
klauss | 119:ee6a53069455 | 2024 | |
klauss | 132:05cd37f7e007 | 2025 | strcat ( debug_buf, "\r" ); |
klauss | 119:ee6a53069455 | 2026 | |
klauss | 132:05cd37f7e007 | 2027 | split = strtok ( debug_buf + 4, " " ); |
klauss | 132:05cd37f7e007 | 2028 | ext = atoi ( split ); |
klauss | 119:ee6a53069455 | 2029 | |
klauss | 132:05cd37f7e007 | 2030 | split += strlen ( split ) + 1; |
klauss | 132:05cd37f7e007 | 2031 | split = strtok ( NULL, " " ); |
klauss | 132:05cd37f7e007 | 2032 | port = atoi ( split ); |
klauss | 119:ee6a53069455 | 2033 | |
klauss | 132:05cd37f7e007 | 2034 | split += strlen ( split ) + 1; |
klauss | 98:43b45f26b430 | 2035 | cmd = split; |
klauss | 119:ee6a53069455 | 2036 | |
klauss | 98:43b45f26b430 | 2037 | promptcb_last_ext = ext; |
klauss | 98:43b45f26b430 | 2038 | promptcb_last_port = port; |
klauss | 119:ee6a53069455 | 2039 | |
klauss | 132:05cd37f7e007 | 2040 | strcpy ( promptcb_last_cmd, cmd ); |
klauss | 119:ee6a53069455 | 2041 | |
klauss | 132:05cd37f7e007 | 2042 | for ( register int i = strlen( cmd ); i < DEBUGBUFSIZE; i++ ) cmd [ i ] = 0; |
klauss | 132:05cd37f7e007 | 2043 | |
klauss | 132:05cd37f7e007 | 2044 | send2callboxes ( build_cb_package( ext, port, PROMPT, cmd, id_msg++, CB_BUFFER_SIZE - VZ_HEADER_OFFSET, prompt_write_buffer ) ); |
klauss | 132:05cd37f7e007 | 2045 | |
klauss | 132:05cd37f7e007 | 2046 | vz_printf ( "ext=%d port=%d cmd=%s\r\nComando enviado", ext, port, cmd ); |
klauss | 119:ee6a53069455 | 2047 | |
klauss | 98:43b45f26b430 | 2048 | debug_buf = ref; |
klauss | 132:05cd37f7e007 | 2049 | |
klauss | 98:43b45f26b430 | 2050 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 2051 | |
klauss | 132:05cd37f7e007 | 2052 | for ( register int i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 114:472502b31a12 | 2053 | } |
klauss | 132:05cd37f7e007 | 2054 | |
klauss | 132:05cd37f7e007 | 2055 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "print_cb ", 9 ) ) |
klauss | 132:05cd37f7e007 | 2056 | { |
klauss | 114:472502b31a12 | 2057 | miss_match = false; |
klauss | 114:472502b31a12 | 2058 | char *split; |
klauss | 132:05cd37f7e007 | 2059 | |
klauss | 132:05cd37f7e007 | 2060 | split = strtok ( debug_buf + 9, " " ); |
klauss | 114:472502b31a12 | 2061 | if( 0 == ( strcasecmp( split, "all" ) ) ) |
klauss | 114:472502b31a12 | 2062 | { |
klauss | 114:472502b31a12 | 2063 | print_cb_all = true; |
klauss | 132:05cd37f7e007 | 2064 | } else { |
klauss | 114:472502b31a12 | 2065 | print_cb_var = true; |
klauss | 132:05cd37f7e007 | 2066 | print_this_cb = atoi ( split ); |
klauss | 114:472502b31a12 | 2067 | } |
klauss | 132:05cd37f7e007 | 2068 | |
klauss | 114:472502b31a12 | 2069 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 2070 | for ( register int i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 119:ee6a53069455 | 2071 | } |
klauss | 132:05cd37f7e007 | 2072 | |
klauss | 132:05cd37f7e007 | 2073 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "drop_ack ", 9 ) ) |
klauss | 132:05cd37f7e007 | 2074 | { |
klauss | 119:ee6a53069455 | 2075 | miss_match = false; |
klauss | 119:ee6a53069455 | 2076 | char *split; |
klauss | 132:05cd37f7e007 | 2077 | |
klauss | 119:ee6a53069455 | 2078 | split = strtok( debug_buf + 9, " " ); |
klauss | 132:05cd37f7e007 | 2079 | |
klauss | 119:ee6a53069455 | 2080 | drop_this_amount_of_ack_to_ast = atoi( split ); |
klauss | 132:05cd37f7e007 | 2081 | |
klauss | 132:05cd37f7e007 | 2082 | vz_printf ("Will be droped %d acks", drop_this_amount_of_ack_to_ast ); |
klauss | 132:05cd37f7e007 | 2083 | |
klauss | 114:472502b31a12 | 2084 | bufptr = 0; |
klauss | 119:ee6a53069455 | 2085 | for( register int i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf[ i ] = 0; |
klauss | 114:472502b31a12 | 2086 | } |
klauss | 132:05cd37f7e007 | 2087 | |
klauss | 132:05cd37f7e007 | 2088 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "frtp ", 5 ) ) |
klauss | 132:05cd37f7e007 | 2089 | { |
klauss | 132:05cd37f7e007 | 2090 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2091 | char *split; |
klauss | 132:05cd37f7e007 | 2092 | |
klauss | 132:05cd37f7e007 | 2093 | split = strtok ( debug_buf + 5, " " ); |
klauss | 132:05cd37f7e007 | 2094 | frtp = true; |
klauss | 132:05cd37f7e007 | 2095 | frtp_target = atoi ( split ); |
klauss | 132:05cd37f7e007 | 2096 | |
klauss | 132:05cd37f7e007 | 2097 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 2098 | for ( register int i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 132:05cd37f7e007 | 2099 | } |
klauss | 132:05cd37f7e007 | 2100 | |
klauss | 132:05cd37f7e007 | 2101 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "rrtp ", 5 ) ) |
klauss | 132:05cd37f7e007 | 2102 | { |
klauss | 114:472502b31a12 | 2103 | miss_match = false; |
klauss | 114:472502b31a12 | 2104 | char *split; |
klauss | 132:05cd37f7e007 | 2105 | |
klauss | 132:05cd37f7e007 | 2106 | split = strtok ( debug_buf + 5, " " ); |
klauss | 114:472502b31a12 | 2107 | rescue_rtp = true; |
klauss | 132:05cd37f7e007 | 2108 | rescue_rtp_target = atoi ( split ); |
klauss | 132:05cd37f7e007 | 2109 | |
klauss | 132:05cd37f7e007 | 2110 | split += strlen ( split ) + 1; |
klauss | 114:472502b31a12 | 2111 | split = strtok( NULL, " " ); |
klauss | 132:05cd37f7e007 | 2112 | rescue_rtp_value = atoi ( split ); |
klauss | 132:05cd37f7e007 | 2113 | |
klauss | 114:472502b31a12 | 2114 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 2115 | for ( register uint16_t i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 114:472502b31a12 | 2116 | } |
klauss | 132:05cd37f7e007 | 2117 | |
klauss | 132:05cd37f7e007 | 2118 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "print_hex_cb ", 13 ) ) |
klauss | 132:05cd37f7e007 | 2119 | { |
klauss | 114:472502b31a12 | 2120 | miss_match = false; |
klauss | 114:472502b31a12 | 2121 | char *split; |
klauss | 132:05cd37f7e007 | 2122 | |
klauss | 132:05cd37f7e007 | 2123 | split = strtok ( debug_buf + 13, " " ); |
klauss | 132:05cd37f7e007 | 2124 | if( 0 == ( strcasecmp ( split, "all" ) ) ) |
klauss | 114:472502b31a12 | 2125 | { |
klauss | 114:472502b31a12 | 2126 | print_hex_cb_all = true; |
klauss | 132:05cd37f7e007 | 2127 | } else { |
klauss | 114:472502b31a12 | 2128 | print_hex_cb_var = true; |
klauss | 132:05cd37f7e007 | 2129 | print_hex_this_cb = atoi ( split ); |
klauss | 114:472502b31a12 | 2130 | } |
klauss | 132:05cd37f7e007 | 2131 | |
klauss | 114:472502b31a12 | 2132 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 2133 | for ( register uint16_t i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 114:472502b31a12 | 2134 | } |
klauss | 132:05cd37f7e007 | 2135 | |
klauss | 132:05cd37f7e007 | 2136 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * )"print_sip ", 10 ) ) |
klauss | 132:05cd37f7e007 | 2137 | { |
klauss | 114:472502b31a12 | 2138 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2139 | |
klauss | 114:472502b31a12 | 2140 | char *split; |
klauss | 132:05cd37f7e007 | 2141 | |
klauss | 132:05cd37f7e007 | 2142 | split = strtok ( debug_buf + 10, " " ); |
klauss | 132:05cd37f7e007 | 2143 | if ( 0 == ( strcasecmp ( split, "all" ) ) ) |
klauss | 114:472502b31a12 | 2144 | { |
klauss | 114:472502b31a12 | 2145 | print_sip_all = true; |
klauss | 132:05cd37f7e007 | 2146 | } else { |
klauss | 114:472502b31a12 | 2147 | print_sip_var = true; |
klauss | 132:05cd37f7e007 | 2148 | print_this_sip = atoi ( split ); |
klauss | 114:472502b31a12 | 2149 | } |
klauss | 132:05cd37f7e007 | 2150 | |
klauss | 114:472502b31a12 | 2151 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 2152 | for ( register uint16_t i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 98:43b45f26b430 | 2153 | } |
klauss | 132:05cd37f7e007 | 2154 | |
klauss | 132:05cd37f7e007 | 2155 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * )"print_hex_sip ", 14 ) ) |
klauss | 114:472502b31a12 | 2156 | { |
klauss | 114:472502b31a12 | 2157 | miss_match = false; |
klauss | 114:472502b31a12 | 2158 | char *split; |
klauss | 132:05cd37f7e007 | 2159 | |
klauss | 132:05cd37f7e007 | 2160 | split = strtok ( debug_buf + 14, " " ); |
klauss | 132:05cd37f7e007 | 2161 | if ( 0 == ( strcasecmp ( split, "all" ) ) ) |
klauss | 114:472502b31a12 | 2162 | { |
klauss | 132:05cd37f7e007 | 2163 | print_hex_sip_all = true; |
klauss | 132:05cd37f7e007 | 2164 | } else { |
klauss | 132:05cd37f7e007 | 2165 | print_hex_sip_var = true; |
klauss | 132:05cd37f7e007 | 2166 | print_hex_this_sip = atoi ( split ); |
klauss | 114:472502b31a12 | 2167 | } |
klauss | 132:05cd37f7e007 | 2168 | |
klauss | 114:472502b31a12 | 2169 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 2170 | for ( register uint16_t i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 114:472502b31a12 | 2171 | } |
klauss | 132:05cd37f7e007 | 2172 | |
klauss | 132:05cd37f7e007 | 2173 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * )"print_call ", 11 ) ) |
klauss | 114:472502b31a12 | 2174 | { |
klauss | 114:472502b31a12 | 2175 | miss_match = false; |
klauss | 114:472502b31a12 | 2176 | char *split; |
klauss | 132:05cd37f7e007 | 2177 | |
klauss | 132:05cd37f7e007 | 2178 | split = strtok ( debug_buf + 11, " " ); |
klauss | 132:05cd37f7e007 | 2179 | if ( 0 == ( strcasecmp ( split, "all" ) ) ) |
klauss | 114:472502b31a12 | 2180 | { |
klauss | 132:05cd37f7e007 | 2181 | print_call_all = true; |
klauss | 132:05cd37f7e007 | 2182 | } else { |
klauss | 132:05cd37f7e007 | 2183 | print_call_var = true; |
klauss | 132:05cd37f7e007 | 2184 | print_this_call = atoi ( split ); |
klauss | 114:472502b31a12 | 2185 | } |
klauss | 132:05cd37f7e007 | 2186 | |
klauss | 114:472502b31a12 | 2187 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 2188 | for ( register uint16_t i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 114:472502b31a12 | 2189 | } |
klauss | 132:05cd37f7e007 | 2190 | |
klauss | 132:05cd37f7e007 | 2191 | else if ( xmemmatch ( ( uint8_t *)debug_buf, ( uint8_t * ) "print_hex_call ", 15 ) ) |
klauss | 132:05cd37f7e007 | 2192 | { |
klauss | 132:05cd37f7e007 | 2193 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2194 | |
klauss | 132:05cd37f7e007 | 2195 | char *split; |
klauss | 132:05cd37f7e007 | 2196 | |
klauss | 132:05cd37f7e007 | 2197 | split = strtok( debug_buf + 15, " " ); |
klauss | 132:05cd37f7e007 | 2198 | if ( 0 == ( strcasecmp ( split, "all" ) ) ) |
klauss | 132:05cd37f7e007 | 2199 | { |
klauss | 132:05cd37f7e007 | 2200 | print_hex_call_all = true; |
klauss | 132:05cd37f7e007 | 2201 | } else { |
klauss | 132:05cd37f7e007 | 2202 | print_hex_call_var = true; |
klauss | 132:05cd37f7e007 | 2203 | print_hex_this_call = atoi ( split ); |
klauss | 132:05cd37f7e007 | 2204 | } |
klauss | 132:05cd37f7e007 | 2205 | |
klauss | 132:05cd37f7e007 | 2206 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 2207 | for ( register uint16_t i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 132:05cd37f7e007 | 2208 | } |
klauss | 132:05cd37f7e007 | 2209 | |
klauss | 132:05cd37f7e007 | 2210 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "print_rtp ", 10 ) ) |
klauss | 114:472502b31a12 | 2211 | { |
klauss | 114:472502b31a12 | 2212 | miss_match = false; |
klauss | 114:472502b31a12 | 2213 | char *split; |
klauss | 132:05cd37f7e007 | 2214 | |
klauss | 132:05cd37f7e007 | 2215 | split = strtok ( debug_buf + 10, " " ); |
klauss | 132:05cd37f7e007 | 2216 | if ( 0 == ( strcasecmp ( split, "all" ) ) ) |
klauss | 132:05cd37f7e007 | 2217 | { |
klauss | 132:05cd37f7e007 | 2218 | print_rtp_all = true; |
klauss | 132:05cd37f7e007 | 2219 | } else { |
klauss | 132:05cd37f7e007 | 2220 | print_rtp_var = true; |
klauss | 132:05cd37f7e007 | 2221 | print_this_rtp = atoi ( split ); |
klauss | 132:05cd37f7e007 | 2222 | } |
klauss | 132:05cd37f7e007 | 2223 | |
klauss | 132:05cd37f7e007 | 2224 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 2225 | for ( register uint16_t i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 132:05cd37f7e007 | 2226 | } |
klauss | 132:05cd37f7e007 | 2227 | |
klauss | 132:05cd37f7e007 | 2228 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "print_hex_rtp ", 14 ) ) |
klauss | 132:05cd37f7e007 | 2229 | { |
klauss | 132:05cd37f7e007 | 2230 | miss_match = false; |
klauss | 114:472502b31a12 | 2231 | |
klauss | 132:05cd37f7e007 | 2232 | char *split; |
klauss | 132:05cd37f7e007 | 2233 | |
klauss | 132:05cd37f7e007 | 2234 | split = strtok ( debug_buf + 14, " " ); |
klauss | 132:05cd37f7e007 | 2235 | if ( 0 == ( strcasecmp ( split, "all" ) ) ) |
klauss | 114:472502b31a12 | 2236 | { |
klauss | 114:472502b31a12 | 2237 | print_hex_rtp_all = true; |
klauss | 132:05cd37f7e007 | 2238 | } else { |
klauss | 114:472502b31a12 | 2239 | print_hex_rtp_var = true; |
klauss | 132:05cd37f7e007 | 2240 | print_hex_this_rtp = atoi ( split ); |
klauss | 114:472502b31a12 | 2241 | } |
klauss | 132:05cd37f7e007 | 2242 | |
klauss | 114:472502b31a12 | 2243 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 2244 | for ( register uint16_t i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 114:472502b31a12 | 2245 | } |
klauss | 132:05cd37f7e007 | 2246 | |
klauss | 132:05cd37f7e007 | 2247 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "log ", 4 ) ) |
klauss | 132:05cd37f7e007 | 2248 | { |
klauss | 114:472502b31a12 | 2249 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2250 | |
klauss | 132:05cd37f7e007 | 2251 | char * split = strtok ( debug_buf + 4, " " ); |
klauss | 132:05cd37f7e007 | 2252 | |
klauss | 114:472502b31a12 | 2253 | { |
klauss | 114:472502b31a12 | 2254 | print_cb_var = true; |
klauss | 132:05cd37f7e007 | 2255 | print_this_cb = atoi ( split ); |
klauss | 114:472502b31a12 | 2256 | print_sip_var = true; |
klauss | 114:472502b31a12 | 2257 | print_this_sip = print_this_cb; |
klauss | 114:472502b31a12 | 2258 | print_call_var = true; |
klauss | 114:472502b31a12 | 2259 | print_this_call = print_this_cb; |
klauss | 114:472502b31a12 | 2260 | print_rtp_var = true; |
klauss | 114:472502b31a12 | 2261 | print_this_rtp = print_this_cb; |
klauss | 114:472502b31a12 | 2262 | } |
klauss | 132:05cd37f7e007 | 2263 | |
klauss | 114:472502b31a12 | 2264 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 2265 | for ( register uint16_t i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 114:472502b31a12 | 2266 | } |
klauss | 132:05cd37f7e007 | 2267 | |
klauss | 132:05cd37f7e007 | 2268 | |
klauss | 132:05cd37f7e007 | 2269 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "rush ", 5 ) ) |
klauss | 132:05cd37f7e007 | 2270 | { |
klauss | 99:e80850c51106 | 2271 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2272 | |
klauss | 99:e80850c51106 | 2273 | int ext,port; |
klauss | 132:05cd37f7e007 | 2274 | char *split, *ref, cmd [ 32 ]; |
klauss | 119:ee6a53069455 | 2275 | |
klauss | 99:e80850c51106 | 2276 | ref = debug_buf; |
klauss | 119:ee6a53069455 | 2277 | |
klauss | 132:05cd37f7e007 | 2278 | strcat ( debug_buf, "\r" ); |
klauss | 119:ee6a53069455 | 2279 | |
klauss | 132:05cd37f7e007 | 2280 | split = strtok ( debug_buf + 5, " " ); |
klauss | 132:05cd37f7e007 | 2281 | ext = atoi ( split ); |
klauss | 119:ee6a53069455 | 2282 | |
klauss | 132:05cd37f7e007 | 2283 | split += strlen ( split ) + 1; |
klauss | 132:05cd37f7e007 | 2284 | split = strtok ( NULL, " " ); |
klauss | 132:05cd37f7e007 | 2285 | port = atoi ( split ); |
klauss | 119:ee6a53069455 | 2286 | |
klauss | 132:05cd37f7e007 | 2287 | strcpy ( cmd, "ping\r\n" ); |
klauss | 119:ee6a53069455 | 2288 | |
klauss | 99:e80850c51106 | 2289 | promptcb_last_ext = ext; |
klauss | 99:e80850c51106 | 2290 | promptcb_last_port = port; |
klauss | 119:ee6a53069455 | 2291 | |
klauss | 132:05cd37f7e007 | 2292 | strcpy ( promptcb_last_cmd, cmd ); |
klauss | 132:05cd37f7e007 | 2293 | strcat ( cmd, "\r\r\r\n" ); |
klauss | 119:ee6a53069455 | 2294 | |
klauss | 132:05cd37f7e007 | 2295 | for ( register uint8_t i = 0; i < 3; i++ ) |
klauss | 132:05cd37f7e007 | 2296 | { |
klauss | 132:05cd37f7e007 | 2297 | |
klauss | 132:05cd37f7e007 | 2298 | send2callboxes ( build_cb_package ( ext, port, PROMPT, cmd, id_msg++, CB_BUFFER_SIZE - VZ_HEADER_OFFSET, prompt_write_buffer ) ); |
klauss | 132:05cd37f7e007 | 2299 | |
klauss | 132:05cd37f7e007 | 2300 | vz_printf ( "ext=%d port=%d cmd=%s\r\nComando enviado", ext, port, cmd ); |
klauss | 99:e80850c51106 | 2301 | } |
klauss | 119:ee6a53069455 | 2302 | |
klauss | 99:e80850c51106 | 2303 | debug_buf = ref; |
klauss | 99:e80850c51106 | 2304 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 2305 | for ( register int i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 45:c80574f24dc3 | 2306 | } |
klauss | 62:07e5bdc9f8f7 | 2307 | |
klauss | 132:05cd37f7e007 | 2308 | |
klauss | 132:05cd37f7e007 | 2309 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "_", 4 ) ) |
klauss | 132:05cd37f7e007 | 2310 | { |
klauss | 132:05cd37f7e007 | 2311 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2312 | debug_buf [ bufptr++ ] = 0x0D; |
klauss | 132:05cd37f7e007 | 2313 | debug_buf [ bufptr++ ] = 0x00; |
klauss | 132:05cd37f7e007 | 2314 | |
klauss | 132:05cd37f7e007 | 2315 | send2callboxes ( build_cb_package( promptcb_last_ext, promptcb_last_port, PROMPT, debug_buf + 4, id_msg++, CB_BUFFER_SIZE - VZ_HEADER_OFFSET, prompt_write_buffer ) ); |
klauss | 132:05cd37f7e007 | 2316 | |
klauss | 132:05cd37f7e007 | 2317 | vz_printf ( "ext=%d port=%d\r\ncmd=%s\r\nComando enviado",promptcb_last_ext, promptcb_last_port, debug_buf + 4 ); |
klauss | 132:05cd37f7e007 | 2318 | } |
klauss | 132:05cd37f7e007 | 2319 | |
klauss | 132:05cd37f7e007 | 2320 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "cks",3 ) ) |
klauss | 132:05cd37f7e007 | 2321 | { |
klauss | 45:c80574f24dc3 | 2322 | miss_match = false; |
klauss | 81:3656f00ab3db | 2323 | pcks_s = true; |
klauss | 45:c80574f24dc3 | 2324 | } |
klauss | 45:c80574f24dc3 | 2325 | |
klauss | 132:05cd37f7e007 | 2326 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "showcb",6 ) ) |
klauss | 132:05cd37f7e007 | 2327 | { |
klauss | 45:c80574f24dc3 | 2328 | miss_match = false; |
klauss | 81:3656f00ab3db | 2329 | pshowcb = true; |
klauss | 45:c80574f24dc3 | 2330 | } |
klauss | 132:05cd37f7e007 | 2331 | |
klauss | 132:05cd37f7e007 | 2332 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "debug_main ", 11 ) ) |
klauss | 132:05cd37f7e007 | 2333 | { |
klauss | 132:05cd37f7e007 | 2334 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 11 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 2335 | { |
klauss | 45:c80574f24dc3 | 2336 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2337 | |
klauss | 132:05cd37f7e007 | 2338 | vz_printf ( "Debug Main On" ); |
klauss | 132:05cd37f7e007 | 2339 | |
klauss | 81:3656f00ab3db | 2340 | debug_main = true; |
klauss | 45:c80574f24dc3 | 2341 | } |
klauss | 132:05cd37f7e007 | 2342 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 11 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 2343 | { |
klauss | 45:c80574f24dc3 | 2344 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2345 | |
klauss | 132:05cd37f7e007 | 2346 | vz_printf ( "Debug Main Off" ); |
klauss | 132:05cd37f7e007 | 2347 | |
klauss | 45:c80574f24dc3 | 2348 | debug_main = 0; |
klauss | 45:c80574f24dc3 | 2349 | } |
klauss | 45:c80574f24dc3 | 2350 | } |
klauss | 132:05cd37f7e007 | 2351 | |
klauss | 132:05cd37f7e007 | 2352 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dout ", 5 ) ) |
klauss | 132:05cd37f7e007 | 2353 | { |
klauss | 132:05cd37f7e007 | 2354 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 5 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 2355 | { |
klauss | 81:3656f00ab3db | 2356 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2357 | |
klauss | 132:05cd37f7e007 | 2358 | vz_printf ( "Out Debug On" ); |
klauss | 132:05cd37f7e007 | 2359 | |
klauss | 81:3656f00ab3db | 2360 | debug_out_of_range = true; |
klauss | 81:3656f00ab3db | 2361 | } |
klauss | 132:05cd37f7e007 | 2362 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 5 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 2363 | { |
klauss | 81:3656f00ab3db | 2364 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2365 | |
klauss | 132:05cd37f7e007 | 2366 | vz_printf ( "Out Debug Off" ); |
klauss | 132:05cd37f7e007 | 2367 | |
klauss | 81:3656f00ab3db | 2368 | debug_out_of_range = false; |
klauss | 81:3656f00ab3db | 2369 | } |
klauss | 81:3656f00ab3db | 2370 | } |
klauss | 132:05cd37f7e007 | 2371 | |
klauss | 132:05cd37f7e007 | 2372 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dboot ", 6 ) ) |
klauss | 132:05cd37f7e007 | 2373 | { |
klauss | 132:05cd37f7e007 | 2374 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 6 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 2375 | { |
klauss | 99:e80850c51106 | 2376 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2377 | |
klauss | 132:05cd37f7e007 | 2378 | vz_printf ( "Boot Debug On" ); |
klauss | 132:05cd37f7e007 | 2379 | |
klauss | 99:e80850c51106 | 2380 | debug_boot = true; |
klauss | 99:e80850c51106 | 2381 | } |
klauss | 132:05cd37f7e007 | 2382 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 6 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 2383 | { |
klauss | 99:e80850c51106 | 2384 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2385 | |
klauss | 132:05cd37f7e007 | 2386 | vz_printf ( "Boot Debug Off" ); |
klauss | 132:05cd37f7e007 | 2387 | |
klauss | 99:e80850c51106 | 2388 | debug_boot = false; |
klauss | 99:e80850c51106 | 2389 | } |
klauss | 99:e80850c51106 | 2390 | } |
klauss | 132:05cd37f7e007 | 2391 | |
klauss | 132:05cd37f7e007 | 2392 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dbloader ", 9 ) ) |
klauss | 132:05cd37f7e007 | 2393 | { |
klauss | 132:05cd37f7e007 | 2394 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 9 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 2395 | { |
klauss | 121:ee02790d00b7 | 2396 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2397 | |
klauss | 132:05cd37f7e007 | 2398 | vz_printf ( "Bootloader Debug On" ); |
klauss | 132:05cd37f7e007 | 2399 | |
klauss | 121:ee02790d00b7 | 2400 | debug_bootloader = true; |
klauss | 121:ee02790d00b7 | 2401 | } |
klauss | 132:05cd37f7e007 | 2402 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 9 ), ( uint8_t * ) "off", 3 ) ) { |
klauss | 121:ee02790d00b7 | 2403 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2404 | |
klauss | 132:05cd37f7e007 | 2405 | vz_printf ( "Bootloader Debug Off" ); |
klauss | 132:05cd37f7e007 | 2406 | |
klauss | 121:ee02790d00b7 | 2407 | debug_bootloader = false; |
klauss | 121:ee02790d00b7 | 2408 | } |
klauss | 121:ee02790d00b7 | 2409 | } |
klauss | 132:05cd37f7e007 | 2410 | |
klauss | 132:05cd37f7e007 | 2411 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dpower" ) ) |
klauss | 128:3ae1c74773a8 | 2412 | { |
klauss | 128:3ae1c74773a8 | 2413 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2414 | |
klauss | 132:05cd37f7e007 | 2415 | if ( !power_source_status ) |
klauss | 132:05cd37f7e007 | 2416 | { |
klauss | 132:05cd37f7e007 | 2417 | vz_printf ( "Main power is UP" ); |
klauss | 128:3ae1c74773a8 | 2418 | } else { |
klauss | 132:05cd37f7e007 | 2419 | vz_printf ( "Main power is DOWN" ); |
klauss | 128:3ae1c74773a8 | 2420 | } |
klauss | 128:3ae1c74773a8 | 2421 | } |
klauss | 132:05cd37f7e007 | 2422 | |
klauss | 132:05cd37f7e007 | 2423 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dfw ", 4 ) ) |
klauss | 132:05cd37f7e007 | 2424 | { |
klauss | 132:05cd37f7e007 | 2425 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 4 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 2426 | { |
klauss | 99:e80850c51106 | 2427 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2428 | |
klauss | 132:05cd37f7e007 | 2429 | vz_printf ( "FW Debug On" ); |
klauss | 132:05cd37f7e007 | 2430 | |
klauss | 99:e80850c51106 | 2431 | debug_fw = true; |
klauss | 99:e80850c51106 | 2432 | } |
klauss | 132:05cd37f7e007 | 2433 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 4 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 2434 | { |
klauss | 99:e80850c51106 | 2435 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2436 | |
klauss | 132:05cd37f7e007 | 2437 | vz_printf ( "FW Debug Off" ); |
klauss | 132:05cd37f7e007 | 2438 | |
klauss | 99:e80850c51106 | 2439 | debug_fw = false; |
klauss | 99:e80850c51106 | 2440 | } |
klauss | 99:e80850c51106 | 2441 | } |
klauss | 132:05cd37f7e007 | 2442 | |
klauss | 132:05cd37f7e007 | 2443 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dfwp ", 5 ) ) |
klauss | 132:05cd37f7e007 | 2444 | { |
klauss | 132:05cd37f7e007 | 2445 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 5 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 2446 | { |
klauss | 99:e80850c51106 | 2447 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2448 | |
klauss | 132:05cd37f7e007 | 2449 | vz_printf ("FWPrint Debug On" ); |
klauss | 132:05cd37f7e007 | 2450 | |
klauss | 99:e80850c51106 | 2451 | debug_fw_print = true; |
klauss | 99:e80850c51106 | 2452 | } |
klauss | 132:05cd37f7e007 | 2453 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 5 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 2454 | { |
klauss | 99:e80850c51106 | 2455 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2456 | |
klauss | 132:05cd37f7e007 | 2457 | vz_printf ("FWPrint Debug Off" ); |
klauss | 132:05cd37f7e007 | 2458 | |
klauss | 99:e80850c51106 | 2459 | debug_fw_print = false; |
klauss | 99:e80850c51106 | 2460 | } |
klauss | 99:e80850c51106 | 2461 | } |
klauss | 132:05cd37f7e007 | 2462 | |
klauss | 132:05cd37f7e007 | 2463 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "drx ", 4 ) ) |
klauss | 132:05cd37f7e007 | 2464 | { |
klauss | 132:05cd37f7e007 | 2465 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 4 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 2466 | { |
klauss | 45:c80574f24dc3 | 2467 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2468 | |
klauss | 132:05cd37f7e007 | 2469 | vz_printf ( "Debug Cbx Rx On" ); |
klauss | 132:05cd37f7e007 | 2470 | |
klauss | 81:3656f00ab3db | 2471 | debug_cb_rx = true; |
klauss | 45:c80574f24dc3 | 2472 | } |
klauss | 132:05cd37f7e007 | 2473 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 4 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 2474 | { |
klauss | 45:c80574f24dc3 | 2475 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2476 | |
klauss | 132:05cd37f7e007 | 2477 | vz_printf ( "Debug Cbx Rx Off" ); |
klauss | 132:05cd37f7e007 | 2478 | |
klauss | 99:e80850c51106 | 2479 | debug_cb_rx = false; |
klauss | 99:e80850c51106 | 2480 | } |
klauss | 99:e80850c51106 | 2481 | } |
klauss | 132:05cd37f7e007 | 2482 | |
klauss | 132:05cd37f7e007 | 2483 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "dtx ", 4 ) ) |
klauss | 132:05cd37f7e007 | 2484 | { |
klauss | 132:05cd37f7e007 | 2485 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 4 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 2486 | { |
klauss | 99:e80850c51106 | 2487 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2488 | |
klauss | 132:05cd37f7e007 | 2489 | vz_printf ( "Debug Cbx Tx On" ); |
klauss | 132:05cd37f7e007 | 2490 | |
klauss | 99:e80850c51106 | 2491 | debug_cb_tx = true; |
klauss | 99:e80850c51106 | 2492 | } |
klauss | 132:05cd37f7e007 | 2493 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 4 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 2494 | { |
klauss | 132:05cd37f7e007 | 2495 | |
klauss | 99:e80850c51106 | 2496 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2497 | |
klauss | 132:05cd37f7e007 | 2498 | vz_printf ( "Debug Cbx Tx Off" ); |
klauss | 132:05cd37f7e007 | 2499 | |
klauss | 99:e80850c51106 | 2500 | debug_cb_tx = false; |
klauss | 45:c80574f24dc3 | 2501 | } |
klauss | 45:c80574f24dc3 | 2502 | } |
klauss | 132:05cd37f7e007 | 2503 | |
klauss | 132:05cd37f7e007 | 2504 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "debug_file ", 11 ) ) |
klauss | 132:05cd37f7e007 | 2505 | { |
klauss | 132:05cd37f7e007 | 2506 | if ( xmemmatch ( ( uint8_t * )( debug_buf + 11 ), ( uint8_t * ) "on", 2 ) ) |
klauss | 132:05cd37f7e007 | 2507 | { |
klauss | 45:c80574f24dc3 | 2508 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2509 | |
klauss | 132:05cd37f7e007 | 2510 | vz_printf ( "Debug File On" ); |
klauss | 132:05cd37f7e007 | 2511 | |
klauss | 119:ee6a53069455 | 2512 | debug_file = true; |
klauss | 45:c80574f24dc3 | 2513 | } |
klauss | 132:05cd37f7e007 | 2514 | else if ( xmemmatch ( ( uint8_t * )( debug_buf + 11 ), ( uint8_t * ) "off", 3 ) ) |
klauss | 132:05cd37f7e007 | 2515 | { |
klauss | 45:c80574f24dc3 | 2516 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2517 | |
klauss | 132:05cd37f7e007 | 2518 | vz_printf ( "Debug File Off" ); |
klauss | 132:05cd37f7e007 | 2519 | |
klauss | 119:ee6a53069455 | 2520 | debug_file = false; |
klauss | 45:c80574f24dc3 | 2521 | } |
klauss | 45:c80574f24dc3 | 2522 | } |
klauss | 119:ee6a53069455 | 2523 | |
klauss | 132:05cd37f7e007 | 2524 | else if ( xstrmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "help" )) { |
klauss | 132:05cd37f7e007 | 2525 | miss_match = false; |
klauss | 132:05cd37f7e007 | 2526 | |
klauss | 132:05cd37f7e007 | 2527 | vz_printf ( "**************************** PROMPT HELP ****************************" ); |
klauss | 132:05cd37f7e007 | 2528 | vz_printf ( "ifconfig - mostra o arquivo de configuracao do sistema" ); |
klauss | 132:05cd37f7e007 | 2529 | vz_printf ( "dconfig - volta as configuracoes do sistema para o padrao de fabrica" ); |
klauss | 132:05cd37f7e007 | 2530 | vz_printf ( "callme [ramal porta] - envia o pedido de ligacao para o callbox com o ramal e porta indicada" ); |
klauss | 132:05cd37f7e007 | 2531 | vz_printf ( "pcb ramal comando - envia o <comando> para o cbx <ramal> e <porta = ramal sem a centane> executar" ); |
klauss | 132:05cd37f7e007 | 2532 | vz_printf ( "pcc ramal porta comando - envia o <comando> para o cbx <ramal> e <porta> executar" ); |
klauss | 132:05cd37f7e007 | 2533 | vz_printf ( "cc ramal comando - envia o <comando> para o cbx <ramal> e <porta = ramal> executar" ); |
klauss | 132:05cd37f7e007 | 2534 | |
klauss | 132:05cd37f7e007 | 2535 | serial_pc.printf("format - formata o sistema de arquivos" ); |
klauss | 132:05cd37f7e007 | 2536 | |
klauss | 132:05cd37f7e007 | 2537 | vz_printf ( "reset - resta o sistema" ); |
klauss | 132:05cd37f7e007 | 2538 | vz_printf ( "ipset [ip] - Configura o IP da cabeceira" ); |
klauss | 132:05cd37f7e007 | 2539 | vz_printf ( "extset [ext] - Configura a ext da cabeceira" ); |
klauss | 132:05cd37f7e007 | 2540 | vz_printf ( "msipport [port] - Configura a porta SIP da cabeceira" ); |
klauss | 132:05cd37f7e007 | 2541 | vz_printf ( "serverip [ip] - Configura o ip do servidor asterisk" ); |
klauss | 132:05cd37f7e007 | 2542 | vz_printf ( "serextset [ext] - Configura a server ext da cabeceira" ); |
klauss | 132:05cd37f7e007 | 2543 | vz_printf ( "ssport [port] - Configura a porta SIP do servidor asterisk" ); |
klauss | 132:05cd37f7e007 | 2544 | vz_printf ( "maskset [mask] - Configura a mascara da cabeceira" ); |
klauss | 132:05cd37f7e007 | 2545 | vz_printf ( "gatewayset [gateway] - Configura o gateway da cabeceira" ); |
klauss | 132:05cd37f7e007 | 2546 | vz_printf ( "fw_ip - Configura o IP do servidor de fw" ); |
klauss | 132:05cd37f7e007 | 2547 | vz_printf ( "fw_port - Configura a porta do servidor de fw" ); |
klauss | 132:05cd37f7e007 | 2548 | vz_printf ( "maxext - Configura o maior ramal possivel de ser registrado nesse ramo" ); |
klauss | 132:05cd37f7e007 | 2549 | vz_printf ( "minext - Configura o menor ramal possivel de ser registrado nesse ramo" ); |
klauss | 132:05cd37f7e007 | 2550 | vz_printf ( "showcb - lista os Cbx registrados na header" ); |
klauss | 132:05cd37f7e007 | 2551 | vz_printf ( "cks - exibe estatisticas de check sum" ); |
klauss | 132:05cd37f7e007 | 2552 | vz_printf ( "reset_cks - reseta estatisticas de check sum" ); |
klauss | 132:05cd37f7e007 | 2553 | vz_printf ( ". - executa o comando anterior novamente" ); |
klauss | 132:05cd37f7e007 | 2554 | vz_printf ( "debug [on|off|show] - seleciona debugs gerais | lista de debugs" ); |
klauss | 132:05cd37f7e007 | 2555 | vz_printf ( "{ flood [ on | off ] | [+|-] } - simula envio de pacotes de audio" ); |
klauss | 132:05cd37f7e007 | 2556 | vz_printf ( "silence <start_ext end_ext> - envia comando de flood off para os ramais no intervalo end_ext - start_ext" ); |
klauss | 132:05cd37f7e007 | 2557 | vz_printf ( "-- ext - Header flood off, ext flood off" ); |
klauss | 132:05cd37f7e007 | 2558 | vz_printf ( "++ ext - Header flood on, ext flood on" ); |
klauss | 132:05cd37f7e007 | 2559 | vz_printf ( "rx - Exibe ultimo pacote recebido dos CBx" ); |
klauss | 132:05cd37f7e007 | 2560 | vz_printf ( "tx - Exibe ultimo pacote enviado para os CBx" ); |
klauss | 132:05cd37f7e007 | 2561 | vz_printf ( "ls | status - Exibe uma lista ordenada por ext do CBx registrados na Header" ); |
klauss | 132:05cd37f7e007 | 2562 | vz_printf ( "types - Lista os types usados no protocolo de comunicacao Header -- CBx" ); |
klauss | 132:05cd37f7e007 | 2563 | vz_printf ( "protocol - Exibe formato do pacote seguindo o protocolo de comunicacao Header -- CBx" ); |
klauss | 132:05cd37f7e007 | 2564 | vz_printf ( "PROMPT VERSION: V%d -- %s - %s", PVERSION, __DATE__, __TIME__); |
klauss | 132:05cd37f7e007 | 2565 | |
klauss | 132:05cd37f7e007 | 2566 | strcpy ( last_cmd, tmp_cmd ); |
klauss | 132:05cd37f7e007 | 2567 | |
klauss | 132:05cd37f7e007 | 2568 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 2569 | |
klauss | 132:05cd37f7e007 | 2570 | for ( register int i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 132:05cd37f7e007 | 2571 | } |
klauss | 119:ee6a53069455 | 2572 | |
klauss | 132:05cd37f7e007 | 2573 | else if ( xmemmatch ( ( uint8_t * )debug_buf, ( uint8_t * ) "callme ", 7 ) ) |
klauss | 132:05cd37f7e007 | 2574 | { |
klauss | 105:a930035b6556 | 2575 | miss_match = false; |
klauss | 105:a930035b6556 | 2576 | int ext,port; |
klauss | 105:a930035b6556 | 2577 | char cmd[ 16 ]; |
klauss | 119:ee6a53069455 | 2578 | |
klauss | 105:a930035b6556 | 2579 | ext = atoi( debug_buf + 7 ); |
klauss | 105:a930035b6556 | 2580 | port = convert_ext_to_port( ext ); |
klauss | 119:ee6a53069455 | 2581 | |
klauss | 105:a930035b6556 | 2582 | strcpy( cmd, ( ext % 2 ) ? "call init B" : "call init A" ); |
klauss | 119:ee6a53069455 | 2583 | |
klauss | 105:a930035b6556 | 2584 | if( ext % 2 ) ext--; |
klauss | 119:ee6a53069455 | 2585 | |
klauss | 105:a930035b6556 | 2586 | promptcb_last_ext = ext; |
klauss | 105:a930035b6556 | 2587 | promptcb_last_port = port; |
klauss | 119:ee6a53069455 | 2588 | |
klauss | 105:a930035b6556 | 2589 | int tmp = strlen( cmd ); |
klauss | 105:a930035b6556 | 2590 | cmd[ tmp ] = 0x0D; |
klauss | 105:a930035b6556 | 2591 | cmd[ tmp + 1 ] = 0x00; |
klauss | 105:a930035b6556 | 2592 | strcpy( promptcb_last_cmd, cmd ); |
klauss | 119:ee6a53069455 | 2593 | |
klauss | 132:05cd37f7e007 | 2594 | send2callboxes( build_cb_package( ext, port, PROMPT, cmd, id_msg++, CB_BUFFER_SIZE - VZ_HEADER_OFFSET, prompt_write_buffer ) ); |
klauss | 132:05cd37f7e007 | 2595 | |
klauss | 132:05cd37f7e007 | 2596 | vz_printf ( "ext=%d port=%d\r\ncmd=%s\r\n\n\rComando enviado\n\r", ext, port, cmd ); |
klauss | 119:ee6a53069455 | 2597 | |
klauss | 119:ee6a53069455 | 2598 | bufptr = 0; |
klauss | 132:05cd37f7e007 | 2599 | for ( register int i = 0; i < DEBUGBUFSIZE; i++ ) debug_buf [ i ] = 0; |
klauss | 119:ee6a53069455 | 2600 | } |
klauss | 119:ee6a53069455 | 2601 | |
klauss | 132:05cd37f7e007 | 2602 | if ( miss_match ) |
klauss | 132:05cd37f7e007 | 2603 | { |
klauss | 132:05cd37f7e007 | 2604 | vz_printf ( "> %s: command not found", debug_buf ); |
klauss | 132:05cd37f7e007 | 2605 | |
klauss | 119:ee6a53069455 | 2606 | } else { |
klauss | 132:05cd37f7e007 | 2607 | if ( from_eth && strlen ( debug_buf ) > 2 ) strcpy ( last_cmd, tmp_cmd ); |
klauss | 119:ee6a53069455 | 2608 | |
klauss | 132:05cd37f7e007 | 2609 | else if ( strlen ( debug_buf ) > 2 ) strcpy ( last_cmd, tmp_cmd ); |
klauss | 119:ee6a53069455 | 2610 | } |
klauss | 119:ee6a53069455 | 2611 | } |
klauss | 119:ee6a53069455 | 2612 | |
klauss | 119:ee6a53069455 | 2613 | return( NULL ); |
klauss | 132:05cd37f7e007 | 2614 | } |