check internet antes de fixar posição da base

This commit is contained in:
Diego Freitas 2026-07-07 15:57:28 -03:00
parent bebb1f42c8
commit 894144380b
2 changed files with 3 additions and 2 deletions

View File

@ -47,6 +47,7 @@ namespace AgroBase.Services
} }
} }
public static bool HasInternet { get; set; } public static bool HasInternet { get; set; }
public static bool HasInternetNow() => _hasInternet;
public static void IniciarRotinas() public static void IniciarRotinas()
{ {
@ -58,7 +59,7 @@ namespace AgroBase.Services
private static async Task tmrMonitoramento_Tick() private static async Task tmrMonitoramento_Tick()
{ {
HasInternet = _hasInternet; HasInternet = HasInternetNow();
} }
// Método para GET // Método para GET

View File

@ -2294,7 +2294,7 @@ namespace OperationControl.Services
Func<Task> stopNtrip = null, Func<Task> stopNtrip = null,
CancellationToken ct = default) CancellationToken ct = default)
{ {
if (!APIService.HasInternet) if (!APIService.HasInternetNow())
return false; return false;
await ConfigurarComoRoverParadoAsync(portaUsb, portaEntrada, ct) await ConfigurarComoRoverParadoAsync(portaUsb, portaEntrada, ct)