File tree Expand file tree Collapse file tree 4 files changed +18
-19
lines changed Expand file tree Collapse file tree 4 files changed +18
-19
lines changed Original file line number Diff line number Diff line change @@ -3193,7 +3193,7 @@ const uint8_t * getMacAddress()
31933193 return wifiMACAddress;
31943194#endif
31953195#ifdef COMPILE_ETHERNET
3196- else if (online.ethernetStatus >= ETH_BEGUN_NO_LINK )
3196+ else if (( online.ethernetStatus >= ETH_STARTED_CHECK_CABLE) && (online. ethernetStatus <= ETH_CONNECTED) )
31973197 return ethernetMACAddress;
31983198#endif
31993199#endif
Original file line number Diff line number Diff line change @@ -367,12 +367,7 @@ void ntripClientUpdate()
367367#ifdef COMPILE_ETHERNET
368368 if (HAS_ETHERNET)
369369 {
370- if (online.ethernetStatus < ETH_BEGUN_NO_LINK)
371- {
372- systemPrintln (" Error: Please connect Ethernet before starting NTRIP Client" );
373- ntripClientStop (true ); // Do not allocate new wifiClient
374- }
375- else
370+ if ((online.ethernetStatus >= ETH_STARTED_CHECK_CABLE) && (online.ethernetStatus <= ETH_CONNECTED))
376371 {
377372 // Pause until connection timeout has passed
378373 if (millis () - ntripClientLastConnectionAttempt > ntripClientConnectionAttemptTimeout)
@@ -382,6 +377,11 @@ void ntripClientUpdate()
382377 ntripClientSetState (NTRIP_CLIENT_WIFI_ETHERNET_STARTED);
383378 }
384379 }
380+ else
381+ {
382+ systemPrintln (" Error: Please connect Ethernet before starting NTRIP Client" );
383+ ntripClientStop (true ); // Do not allocate new wifiClient
384+ }
385385 }
386386 else
387387#endif
@@ -412,7 +412,7 @@ void ntripClientUpdate()
412412 {
413413 if (online.ethernetStatus == ETH_CONNECTED)
414414 ntripClientSetState (NTRIP_CLIENT_WIFI_ETHERNET_CONNECTED);
415- else if (online. ethernetStatus >= ETH_BEGUN_NO_LINK)
415+ else
416416 ntripClientSetState (NTRIP_CLIENT_OFF);
417417 }
418418 else
Original file line number Diff line number Diff line change @@ -369,12 +369,7 @@ void ntripServerUpdate()
369369#ifdef COMPILE_ETHERNET
370370 if (HAS_ETHERNET)
371371 {
372- if (online.ethernetStatus < ETH_BEGUN_NO_LINK)
373- {
374- systemPrintln (" Error: Please connect Ethernet before starting NTRIP Server" );
375- ntripServerStop (true ); // Do not allocate new wifiClient
376- }
377- else
372+ if ((online.ethernetStatus >= ETH_STARTED_CHECK_CABLE) && (online.ethernetStatus <= ETH_CONNECTED))
378373 {
379374 // Pause until connection timeout has passed
380375 if (millis () - ntripServerLastConnectionAttempt > ntripServerConnectionAttemptTimeout)
@@ -384,6 +379,11 @@ void ntripServerUpdate()
384379 ntripServerSetState (NTRIP_SERVER_WIFI_ETHERNET_STARTED);
385380 }
386381 }
382+ else
383+ {
384+ systemPrintln (" Error: Please connect Ethernet before starting NTRIP Server" );
385+ ntripServerStop (true ); // Do not allocate new wifiClient
386+ }
387387 }
388388 else
389389#endif
@@ -414,7 +414,7 @@ void ntripServerUpdate()
414414 {
415415 if (online.ethernetStatus == ETH_CONNECTED)
416416 ntripServerSetState (NTRIP_SERVER_WIFI_ETHERNET_CONNECTED);
417- else if (online. ethernetStatus >= ETH_BEGUN_NO_LINK)
417+ else
418418 ntripServerSetState (NTRIP_SERVER_OFF);
419419 }
420420 else
Original file line number Diff line number Diff line change @@ -17,10 +17,6 @@ void beginEthernet()
1717
1818 switch (online.ethernetStatus )
1919 {
20- default :
21- log_d (" Unknown status" );
22- break ;
23-
2420 case (ETH_NOT_STARTED):
2521 Ethernet.init (pin_Ethernet_CS);
2622
@@ -90,6 +86,9 @@ void beginEthernet()
9086 case (ETH_CAN_NOT_BEGIN):
9187 break ;
9288
89+ default :
90+ log_d (" Unknown status" );
91+ break ;
9392 }
9493#endif // /COMPILE_ETHERNET
9594}
You can’t perform that action at this time.
0 commit comments