AlteriomPainlessMesh v2.1.1
Easy ESP32/ESP8266 mesh networking with Alteriom IoT extensions
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
painlessmesh::gateway::InternetStatus Struct Reference

Structure to hold Internet connectivity check results. More...

#include <gateway.hpp>

Public Member Functions

uint8_t getUptimePercent () const
 Get the uptime percentage of Internet connectivity.
 
uint32_t getTimeSinceLastSuccess () const
 Get time since last successful Internet check.
 
bool isStale (uint32_t maxAgeMs=60000) const
 Check if Internet status is stale (no recent check)
 

Public Attributes

bool available = false
 Whether Internet is currently available.
 
uint32_t lastCheckTime = 0
 Timestamp of last check (millis)
 
uint32_t lastSuccessTime = 0
 Timestamp of last successful check (millis)
 
uint32_t checkCount = 0
 Total number of checks performed.
 
uint32_t successCount = 0
 Number of successful checks.
 
uint32_t failureCount = 0
 Number of failed checks.
 
uint32_t lastLatencyMs = 0
 Latency of last successful check in ms.
 
TSTRING lastError = ""
 Error message from last failed check.
 
TSTRING checkHost = ""
 Host used for connectivity check.
 
uint16_t checkPort = 0
 Port used for connectivity check.
 

Detailed Description

Structure to hold Internet connectivity check results.

Contains detailed information about the last Internet connectivity check, including whether it succeeded, timing information, and error details.

Member Function Documentation

◆ getTimeSinceLastSuccess()

uint32_t painlessmesh::gateway::InternetStatus::getTimeSinceLastSuccess ( ) const
inline

Get time since last successful Internet check.

Returns
Milliseconds since last success, or UINT32_MAX if never succeeded

◆ getUptimePercent()

uint8_t painlessmesh::gateway::InternetStatus::getUptimePercent ( ) const
inline

Get the uptime percentage of Internet connectivity.

Returns
Percentage of successful checks (0-100), or 0 if no checks performed

◆ isStale()

bool painlessmesh::gateway::InternetStatus::isStale ( uint32_t  maxAgeMs = 60000) const
inline

Check if Internet status is stale (no recent check)

Parameters
maxAgeMsMaximum age in milliseconds (default: 60000)
Returns
true if last check was too long ago

Member Data Documentation

◆ available

bool painlessmesh::gateway::InternetStatus::available = false

Whether Internet is currently available.

◆ checkCount

uint32_t painlessmesh::gateway::InternetStatus::checkCount = 0

Total number of checks performed.

◆ checkHost

TSTRING painlessmesh::gateway::InternetStatus::checkHost = ""

Host used for connectivity check.

◆ checkPort

uint16_t painlessmesh::gateway::InternetStatus::checkPort = 0

Port used for connectivity check.

◆ failureCount

uint32_t painlessmesh::gateway::InternetStatus::failureCount = 0

Number of failed checks.

◆ lastCheckTime

uint32_t painlessmesh::gateway::InternetStatus::lastCheckTime = 0

Timestamp of last check (millis)

◆ lastError

TSTRING painlessmesh::gateway::InternetStatus::lastError = ""

Error message from last failed check.

◆ lastLatencyMs

uint32_t painlessmesh::gateway::InternetStatus::lastLatencyMs = 0

Latency of last successful check in ms.

◆ lastSuccessTime

uint32_t painlessmesh::gateway::InternetStatus::lastSuccessTime = 0

Timestamp of last successful check (millis)

◆ successCount

uint32_t painlessmesh::gateway::InternetStatus::successCount = 0

Number of successful checks.


The documentation for this struct was generated from the following file: