MCPcopy Create free account
hub / github.com/BruceDevices/firmware / internetConnection

Function internetConnection

src/core/net_utils.cpp:6–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include <sstream>
5
6bool internetConnection() {
7 WiFiClient client;
8 const char *host = "8.8.8.8"; // Google DNS
9 const uint16_t port = 53; // DNS Port
10
11 if (client.connect(host, port)) {
12 client.stop();
13 return true; // Connected
14 } else return false;
15}
16
17String getManufacturer(const String &mac) {
18 if (!internetConnection()) { return "NO_INTERNET_ACCESS"; }

Callers 2

fillInfoFunction · 0.85
getManufacturerFunction · 0.85

Calls 2

connectMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected