Komut
setSubnetMask()
Açıklama
Ağın alt ağ maskesini ayarlayın. DHCP ile kullanım için değildir.
Sözdizimi
Ethernet.setSubnetMask (alt)
Parametreler
alt ağ : ağın alt ağ maskesi ( IPAdresi )
İadeler
Hiçbir şey değil
Misal
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(10, 0, 0, 177);
IPAddress myDns(192, 168, 1, 1);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 0, 0);
void setup() {
Ethernet.begin(mac, ip, myDns, gateway, subnet);
IPAddress newSubnet(255, 255, 255, 0);
Ethernet.setSubnetMask(newSubnet); // change the subnet mask
}
void loop () {}
#include <Ethernet.h>
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(10, 0, 0, 177);
IPAddress myDns(192, 168, 1, 1);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 0, 0);
void setup() {
Ethernet.begin(mac, ip, myDns, gateway, subnet);
IPAddress newSubnet(255, 255, 255, 0);
Ethernet.setSubnetMask(newSubnet); // change the subnet mask
}
void loop () {}
Ayrıca bakınız
- Ethernet.setMACAddress()
- Ethernet.setLocalIP()
- Ethernet.setDnsServerIP()
- Ethernet.setGatewayIP()
- Ethernet.begin()