Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
Diff: prompt.cpp
- Revision:
- 33:735fd60e96d8
- Parent:
- 31:bb5fb28a77df
- Child:
- 35:96885a7931f0
diff -r 43041f5e27c4 -r 735fd60e96d8 prompt.cpp --- a/prompt.cpp Thu Sep 25 19:46:37 2014 +0000 +++ b/prompt.cpp Tue Sep 30 11:37:31 2014 +0000 @@ -124,52 +124,61 @@ } if (type == 'i' ){ // Check if files exist, if not create the files + bool exists = true; fip = fopen("/qspi/myip.txt", "r"); if (fip == NULL){ fip = fopen("/qspi/myip.txt", "w"); //fprintf(fip, "%s\n\r",__MY_IP__); //myip fprintf(fip, "%s",__MY_IP__); //myip + exists = false; } fserext = fopen("/qspi/myext.txt", "r"); if ( fserext == NULL ){ fserext = fopen("/qspi/myext.txt", "w"); fprintf( fserext, "%i" ,__MY_EXT__ ); //asterisk ext + exists = false; } fport = fopen("/qspi/mysipport.txt", "r"); if (fport == NULL){ fport = fopen("/qspi/mysipport.txt", "w"); fprintf(fport, "%i",__MY_PORT__); //mysipport + exists = false; } fsip = fopen("/qspi/serverip.txt", "r"); if (fsip == NULL){ fsip = fopen("/qspi/serverip.txt", "w"); //fprintf(fsip, "%s\n\r",__SERVER_IP__ ); //asterisk ip fprintf(fsip, "%s",__SERVER_IP__ ); //asterisk ip + exists = false; } fext = fopen("/qspi/peerext.txt", "r"); if ( fext == NULL ){ fext = fopen("/qspi/peerext.txt", "w"); fprintf( fext, "%i",__PEER_EXT__ ); //asterisk ip + exists = false; } fsport = fopen("/qspi/serverport.txt", "r"); if (fsport == NULL){ fsport = fopen("/qspi/serverport.txt", "w"); fprintf(fsport, "%i",__SERVER_PORT__ ); //asterisk port + exists = false; } fmask = fopen("/qspi/mymask.txt", "r"); if (fmask == NULL){ fmask = fopen("/qspi/mymask.txt", "w"); fprintf(fmask, "%s",__MY_MSK__); //mymask + exists = false; } fgate = fopen("/qspi/mygateway.txt", "r"); if (fgate == NULL){ fgate = fopen("/qspi/mygate.txt", "w"); fprintf(fgate, "%s",__MY_GTW__); //mygateway + exists = false; } - pc.printf("\n\r Default configurations set! \n\r"); + if( !exists ) pc.printf("\n\r Default configurations set! \n\r"); } if (type == 'r' ){ // Just open for read