roDeviceInfo to confirm a network interface is up, and a deeper check that probes the active server to confirm internet or LAN reachability.
Functions
GTV_IsOnline
roDeviceInfo.GetConnectionType().
Return value — true if GetConnectionType() returns a non-empty string (e.g. "WiFiConnection" or "WiredConnection"); false when the string is empty, indicating no network interface is up.
GTV_IsOnline only checks that a physical connection exists. It does not verify that the connection has internet access or that the backend server is reachable.GTV_GetConnectionType
roDeviceInfo.GetConnectionType().
Return value — A string such as "WiFiConnection", "WiredConnection", or "" when offline.
Example
GTV_HasInternet
GTV_IsOnline), then pinging the backend server (GTV_PingServer).
The base URL of the server to ping. When empty (
""), falls back to GTV_ServerPrimaryConnectivityUrl(), which returns the first LAN profile URL (or the first profile URL if no LAN profiles exist). Returns false if no URL can be determined.true only if both the network interface check and the server ping succeed.
Example
Integration with ConnectivityTask
TheConnectivityTask calls GTV_HasInternet on a fixed 10-second loop (hardcoded interval = 10000 inside RunConnectivityTask) and updates both m.global.hasInternet and m.global.isOnline.
NET_RETRY_MS = 30 000 is a separate AppConstants value used by error dialogs and retry logic elsewhere in the app — it is not the ConnectivityTask polling interval.ConnectivityTaskcallsGTV_PingServer(m.global.activeServer)(viaDoCheck()).- If
false, it setsm.global.hasInternet = falseandm.global.isOnline = GTV_IsOnline(). - When
trueagain, it setsm.global.hasInternet = true.
LAN vs internet connectivity
GTV_HasInternet does not distinguish between LAN and internet — it pings whichever server URL it receives. The distinction is made at the server profile level:
| Profile type | Ping target | What a passing ping means |
|---|---|---|
lan | http://172.17.11.2:3333 | The local backend server is reachable |
wan | https://admin.globaltv.lat | The public internet backend is reachable |
GTV_HasInternet is called with an empty activeServer, it uses GTV_ServerPrimaryConnectivityUrl(), which always prefers the first LAN profile. This means connectivity checks default to the local server when one is configured.
Health check dependency
BothGTV_HasInternet and GTV_FindActiveServer (in ServerManager) rely on GTV_PingServer from HealthCheck.brs. That function issues an HTTP GET to <baseUrl>/health with a TIMEOUT_HEALTH = 2500 ms timeout and treats any response with an HTTP status code below 500 as a passing ping.