Skip to content
andredumas edited this page Dec 6, 2012 · 4 revisions

GBEthernet

Description

This method emulates the Arduino Ethernet.begin() for WiFi.

Syntax

Ethernet.begin(mac);
Ethernet.begin(mac, ip);
Ethernet.begin(mac, ip, dns);
Ethernet.begin(mac, ip, dns, gateway);
Ethernet.begin(mac, ip, dns, gateway, subnet);

Parameters

mac A 6 byte byte array representing the MAC address. The GBIMAC can be used for this purpose.
ip The IP Address to connect to.
dns The DNS server to use
gateway The gateway to configure to use
subnet The subnet mask of the network

Return

1 on successful connection, 0 on failure.

Example

#include <SPI.h>
// Need to include GorillaBuilderz WizFi Ethernet libraries
#include <Transport.h>
#include <WizFi210.h>
#include <GBEthernet.h>

byte mac[] = { 0xCD, 0xDD, 0xCC, 0xAA, 0xFF, 0xDC };

void setup() {
  // Set the network name
  Ethernet.ssid("BatPhone");
  // Initialise secure network passphrase
  Ethernet.passphrase("password");
  // Returns 1 if successfully associated to network and IP Address obtained. 
  // Use a previously read mac address from GBIMAC
  Ethernet.begin(mac)
}
Clone this wiki locally