Sub CheckConnected As ResumableSub
'Requires Phone Library
Dim p As Phone
'Ping Google DNS
Wait For (p.ShellAsync("ping", Array As String("-c", "1", "8.8.8.8"))) Complete (Success As Boolean, ExitValue As Int, StdOut As String, StdErr As String)
If StdErr = "" And StdOut.Contains("Destination Host Unreachable")=False Then
Return True
Else
Return False
End If
End Sub