![](/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: eth.h
- Revision:
- 35:96885a7931f0
- Parent:
- 34:f19d9735428e
- Child:
- 36:728498a78e1e
--- a/eth.h Tue Sep 30 14:28:01 2014 +0000 +++ b/eth.h Tue Sep 30 18:15:08 2014 +0000 @@ -33,7 +33,6 @@ int is_time_to_stop( uint8_t * data ){ static int count = 0; - if( !data ) return( 0 ); if( is_stop_pkg( data ) == 1 ) count++; @@ -47,7 +46,7 @@ char * listen_eth_udp( char * buffer, int *length ){ static UDPSocket server; - server.set_blocking( false, 1 ); + server.set_blocking( false, 2 ); server.bind( UDP_PORT_LISTENER ); Endpoint client; bool valid_reboot = false; @@ -58,13 +57,21 @@ static Timer t; static uint8_t status = udp_idle; static uint8_t seq_num = 0; + // OBS sizeof( buffer ) == 4 ???? - *length = server.receiveFrom( client, buffer, sizeof( buffer ) ); - + //*length = server.receiveFrom( client, buffer, sizeof( buffer ) ); + *length = server.receiveFrom( client, buffer, __UDP_ETH_BUFFER_SIZE__ ); + if( *length > 0){ buffer[ *length ] = '\0'; + buffer[ strlen( buffer ) - 1 ] = '\0'; t.start(); + debug_msg("%s", buffer ); + prompt_process( buffer ); + + return( NULL ); + data = __parse_vz_pkg__( &ext, &port, &type, (uint8_t *)buffer ); if( !data ){