![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
Diff: prompt.cpp
- Revision:
- 128:3ae1c74773a8
- Parent:
- 127:e7160a463b6c
- Child:
- 129:d73538fbc017
--- a/prompt.cpp Sun May 24 16:07:14 2015 +0000 +++ b/prompt.cpp Mon May 25 13:11:00 2015 +0000 @@ -2766,6 +2766,34 @@ } } + else if (xstrmatch( (uint8_t*)debug_buf, (uint8_t*) "dpower" ) ) + { + miss_match = false; + if ( !pwr_src_status ) { + if ( debug_uart3 && !( from_eth ) ) pc.printf("\n\rMain power is UP\n\r"); + if ( from_eth ) { + snprintf( debug_buf, PROMPT_ETH_BUFFER_SIZE, "Main power is UP\n\r" ); + debug_buf[ strlen( debug_buf ) - 1 ] = '\0'; + if( tcp_session && !udp_query ) { + tcp_client.send_all( debug_buf, strlen( debug_buf ) ); + } else if( udp_query ) { + udp_query_send_msg( debug_buf ); + } + } + } else { + if ( debug_uart3 && !( from_eth ) ) pc.printf("\n\rMain power is DOWN\n\r"); + if ( from_eth ) { + snprintf( debug_buf, PROMPT_ETH_BUFFER_SIZE, "Main power is DOWN\n\r" ); + debug_buf[ strlen( debug_buf ) - 1 ] = '\0'; + if( tcp_session && !udp_query ) { + tcp_client.send_all( debug_buf, strlen( debug_buf ) ); + } else if( udp_query ) { + udp_query_send_msg( debug_buf ); + } + } + } + } + else if (xmemmatch( (uint8_t*)debug_buf, (uint8_t*) "dfw ", 4 ) ) { if (xmemmatch( (uint8_t*)( debug_buf + 4 ), (uint8_t*) "on", 2 ) ) { miss_match = false;