Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
Diff: utils.cpp
- Revision:
- 69:65665afbad5d
- Parent:
- 68:b54993674190
- Child:
- 70:714c33487aae
diff -r b54993674190 -r 65665afbad5d utils.cpp --- a/utils.cpp Fri Nov 07 17:57:55 2014 +0000 +++ b/utils.cpp Wed Nov 12 13:25:54 2014 +0000 @@ -3,8 +3,8 @@ EthernetInterface eth; uint8_t cb_tx_buffer[ __CB_BUFFER_SIZE__ ]; - -UDPSocket t_sock; + +UDPSocket t_sock; Endpoint t_server; void reverse( char str[], int length ){ @@ -69,7 +69,6 @@ } if( debug_file ) debug_msg("Eth ip %s", buff_ip ); }else{ - //if( debug_file ) if( debug_file ) debug_msg("Failed to read /qspi/myip.txt" ); if( debug_file ) debug_msg("Failed to read /qspi/myip.txt" ); strncpy( buff_ip, __MY_IP__, 20 ); } @@ -176,9 +175,9 @@ } } -int sip_manager( Vector * v_cb, Vector * v_call, uint8_t * write_buffer ){ +int sip_manager( Vector * v_cb, Vector * v_call ){ static int index = 0; - if( v_cb && write_buffer ){ + if( v_cb ){ if( v_cb->size() > 0 ){ if( index >= v_cb->size() ) index = 0; }else return 0; @@ -252,7 +251,7 @@ for( register uint16_t i = __TELEMETRY_SIZE__ + offset; i < __CB_BUFFER_SIZE__; i++ ) aux[ i ] = 0; - int sent = t_sock.sendTo( t_server, aux, __CB_BUFFER_SIZE__ ); + int sent = t_sock.sendTo( t_server, aux, __CB_BUFFER_SIZE__ ); if( debug_telemetry ) send_msg(" Valor de retorno sent-- %d ", sent ); if( sent == -1 ){ @@ -297,8 +296,6 @@ send2callboxes(); } void init_telemetry_handler( void ){ - //FIXME isso deveria ler do arquivo e nao do define. - char buff_ip[ 16 ] = ""; char buff_port[ 8 ] = ""; int telemetry_port = 0;