bosko lekovic
/
ETHtoCOM_10
nova verzija tcp+udp->serial com
Diff: Ethernet/EthernetSetup.cpp
- Revision:
- 21:2232f5a34eb4
- Parent:
- 18:5ee53205451a
--- a/Ethernet/EthernetSetup.cpp Sat May 23 23:37:10 2020 +0200 +++ b/Ethernet/EthernetSetup.cpp Mon May 25 22:19:36 2020 +0200 @@ -51,24 +51,6 @@ printf( " Ethernet disconnect-ovan\n\r"); } -int ethRiseUp( void ) -{ - printf("Rise Up\n\r"); - gp_eth = ethernet_setup( ); /*paljenje etherneta*/ - if(gp_eth == NULL) { printf("ethernet greska\n\r"); return 0;} - else { printf("eth OK\n\r"); return 1;} -} - -void ethRestart( void ) -{ - do - { -// thread_sleep_for(5000); - printf("Ethernet start\n\r"); fflush(stdout); - ethCancel( ); - } - while( !ethRiseUp( ) ); -} @@ -80,7 +62,7 @@ } -EthernetInterface * ethernet_setup( void ) +bool ethernet_setup( void ) { // if( (err = eth.disconnect()) != NSAPI_ERROR_OK ) { printf(" greska diskonekcije %d \n\r", err); return 1; } // ((NetworkInterface *)ð)->set_network("192.168.1.11","255.255.255.0","192.168.1.1"); @@ -109,11 +91,11 @@ printf( "net mask: %s\n\r", gp_eth->get_netmask() ); printf( "GW adresa: %s\n\r", gp_eth->get_gateway() ); - return gp_eth; + return true; } // delete gp_eth; // return gp_eth = NULL; - return NULL; + return false; }