![](/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: vz_protocol.cpp
- Revision:
- 125:8ff4dc96ad58
- Parent:
- 124:c1b6c893e1c3
- Child:
- 126:1f90756250fb
--- a/vz_protocol.cpp Wed May 13 14:25:57 2015 +0000 +++ b/vz_protocol.cpp Wed May 13 21:18:12 2015 +0000 @@ -52,7 +52,7 @@ //tratamento dos pacotes do tipo flood logo na chegada { - if( cb_buffer[ 6 ] == FLOOD ){ + if( cb_buffer[ TYPE_PLACE ] == FLOOD ){ flood_counter++; static uint8_t flood_cnt = 0; static uint8_t first_run_flag = 0; @@ -149,7 +149,7 @@ if( debug_port_match ) if( *ext == *port ) debug_msg("%u:%u", *ext, *port ); - *type = cb_buffer[ 6 ]; + *type = cb_buffer[ TYPE_PLACE ]; if( ( ( *port < BASE_PORT ) || ( *port >= ( BASE_PORT + MAX_CB_IN_A_BRANCH ) ) && ( *type == TELEMETRY ) ) ) return NULL; @@ -170,7 +170,7 @@ pkg[ 2 ] = ( uint8_t )( ( port & 0xFF00 ) >> 8 ); pkg[ 3 ] = ( uint8_t )( port & 0x00FF ); - pkg[ 6 ] = type; + pkg[ TYPE_PLACE ] = type; //preenche os dados de acordo com o tipo do pacote transmitido size_t fill = VZ_HEADER_OFFSET;