Modularizando o src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

Revision:
43:455522f98de5
Parent:
38:af5ecd6997ab
Child:
46:a670f187a704
--- a/sip.cpp	Fri Oct 03 20:14:59 2014 +0000
+++ b/sip.cpp	Mon Oct 06 14:31:54 2014 +0000
@@ -48,7 +48,9 @@
         if( debug_sip ) debug_msg("Failed to open /qspi/serverip.txt" );
         strncpy( this->server_ip, __SERVER_IP__, 20 );    
     }else{
-        if( fread( this->server_ip, 1, 20, fp ) > 0 ){
+        char tmp[ 20 ];
+        if( fread( tmp, 1, 20, fp ) > 0 ){
+            strcpy( this->server_ip, tmp );
             if( debug_sip ) debug_msg("Objeto SIP fixado no server ip %s", this->server_ip );
         }else{
             if( debug_sip ) debug_msg("Failed to read /qspi/serverip.txt" );
@@ -78,7 +80,9 @@
         if( debug_sip ) debug_msg("Failed to open /qspi/myip.txt" );
         strncpy( this->my_ip, __MY_IP__, 20 );    
     }else{
-        if( fread( this->my_ip, 1, 20, fp ) > 0 ){
+        char tmp[ 20 ];
+        if( fread( tmp, 1, 20, fp ) > 0 ){
+            strcpy( this->my_ip, tmp );
             if( debug_sip ) debug_msg("Objeto SIP fixado no ip %s", this->my_ip );
         }else{
             if( debug_sip ) debug_msg("Failed to read /qspi/myip.txt" );
@@ -86,7 +90,7 @@
         }
     }
     fclose( fp );
-    this->my_ip[19] = 0;
+    this->my_ip[ 19 ] = 0;
     
     this->my_port = my_port;
     this->my_rtp_port = fill_random_rtp_port();