Komut
gatewayIP()
Açıklama
Aygıtın ağ geçidi IP adresini döndürür.
Sözdizimi
Ethernet.gatewayIP ()
Parametreler
Yok
İadeler
aygıtın ağ geçidi IP adresi ( IPAdresi ).
Misal
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(10, 0, 0, 177);
void setup() {
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Ethernet.begin(mac, ip);
Serial.print("The gateway IP address is: ");
Serial.println(Ethernet.gatewayIP());
}
void loop () {}
#include <Ethernet.h>
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(10, 0, 0, 177);
void setup() {
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Ethernet.begin(mac, ip);
Serial.print("The gateway IP address is: ");
Serial.println(Ethernet.gatewayIP());
}
void loop () {}
Ayrıca bakınız
- Ethernet.MACAddress()
- Ethernet.localIP()
- Ethernet.dnsServerIP()
- Ethernet.subnetMask()
- Ethernet.begin()