![](/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: fw_handler.cpp
- Revision:
- 126:1f90756250fb
- Parent:
- 125:8ff4dc96ad58
- Child:
- 132:05cd37f7e007
--- a/fw_handler.cpp Wed May 13 21:18:12 2015 +0000 +++ b/fw_handler.cpp Wed May 20 19:50:31 2015 +0000 @@ -27,6 +27,7 @@ strncpy( buff_ip, __FW_SERVER_IP__, 20 ); } } + if( fip != NULL ) fclose( fip ); FILE * fport = fopen( "/qspi/fw_port.txt", "r"); @@ -44,6 +45,7 @@ fw_port = __FW_SERVER_PORT__; } } + if( fport != NULL ) fclose( fport ); int addr = fw_server.set_address( buff_ip , fw_port ); @@ -62,11 +64,13 @@ init_fw_handler(); } -void fw_cbx_pkg( int ext, int port, char * data ){ +void fw_cbx_pkg ( const int ext, char * data ) +{ static uint8_t fw_cbx_pkg_id = 0x00; - data[ CB_BUFFER_SIZE - 1 ] = fw_cbx_pkg_id++; + + data [ CB_BUFFER_SIZE - 1 ] = fw_cbx_pkg_id++; - int send = fw_sock.sendTo( fw_server, data, CB_BUFFER_SIZE ); + int send = fw_sock.sendTo ( fw_server, data, CB_BUFFER_SIZE ); if( send != CB_BUFFER_SIZE ) {