![](/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: main.cpp
- Revision:
- 53:bb492a8f115a
- Parent:
- 52:12930cef17c4
- Child:
- 54:448d57291be6
--- a/main.cpp Mon Oct 20 19:44:16 2014 +0000 +++ b/main.cpp Tue Oct 21 19:35:07 2014 +0000 @@ -176,11 +176,9 @@ //---------------------- if( t.read() > 5 ){ static uint8_t count = 0; - /* - static int test_ext = 870; - static int test_port = 5170; + static int test_ext = 65531; + static int test_port = 65531; static bool main_test = false; - */ //send_msg("from_eth = %s - tcp_session = %s", ( from_eth ) ? "true" : "false", ( tcp_session ) ? "true" : "false" ); if( debug_alive ){ send_msg("Registred %d CBx", v_cb->size() ); @@ -217,21 +215,23 @@ } } } - //if( count == 4 ){ + if( count == 4 ){ //debug_msg("Colocar simulacoes de cbx aqui"); - //main_test = true; - //} - /* - if( main_test ){ - send_msg("Request registry from %d", test_ext ); + main_test = true; + } + + if( telemetry_test ){ + send_msg( "Validando telemetria" ); + for( register uint16_t i = 0; i < __CB_BUFFER_SIZE__; i++ ) buffer[ i ] = 0x42; data = buffer; - ext = test_ext++; - port = test_port++; - type = __REGISTRY__; - //if( test_ext == 881 ) main_test = false; + ext = test_ext; + port = test_port; + type = __TELEMETRY__; main_test = false; + debug_telemetry = true; + telemetry_test = false; } - */ + /* if( count == 5 * 2 ){ //debug_msg("Colocar simulacoes de cbx aqui"); @@ -394,8 +394,8 @@ ( char * )data, data[ 0 ], __CB_BUFFER_SIZE__ - __VZ_HEADER_OFFSET__, write_buffer ) ); }break; case __TELEMETRY__ : { - if( debug_main ) debug_msg("::telemetry from %d - %d::", ext, port ); - //build_telemetry_report( ext, port, ( char *)data ); + if( debug_telemetry ) send_msg("::telemetry from %d - %d::", ext, port ); + build_telemetry_report( ext, port, ( char *)data ); }break; case __PROMPT__ : {