使用 ESP8266 在 Arduino 中获取网关地址

Fab*_*oft 3 arduino arduino-ide esp8266

我需要 ESP8266 的默认网关 IP 地址。我知道在 LUA 中,您可以使用以下代码检索它:

ip, netmask, gateway = wifi.sta.getip()
print(gateway)
Run Code Online (Sandbox Code Playgroud)

但是如何使用 Arduino/C++?

cag*_*das 6

用于WiFi.gatewayIP().toString()将其作为字符串获取。