1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-04 15:24:12 +01:00
Arduino/libraries/Ethernet/Ethernet.h

38 lines
973 B
C
Raw Normal View History

#ifndef ethernet_h
#define ethernet_h
2008-07-30 16:47:36 +02:00
#include <inttypes.h>
//#include "w5100.h"
#include "IPAddress.h"
#include "Client.h"
#include "Server.h"
#define MAX_SOCK_NUM 4
2008-07-30 16:47:36 +02:00
class EthernetClass {
private:
IPAddress _dnsServerAddress;
2008-07-30 16:47:36 +02:00
public:
static uint8_t _state[MAX_SOCK_NUM];
static uint16_t _server_port[MAX_SOCK_NUM];
// Initialise the Ethernet shield to use the provided MAC address and gain the rest of the
// configuration through DHCP.
// Returns 0 if the DHCP configuration failed, and 1 if it succeeded
int begin(uint8_t *mac_address);
void begin(uint8_t *mac_address, IPAddress local_ip);
void begin(uint8_t *mac_address, IPAddress local_ip, IPAddress gateway);
void begin(uint8_t *mac_address, IPAddress local_ip, IPAddress gateway, IPAddress subnet);
IPAddress localIP();
IPAddress subnetMask();
IPAddress gatewayIP();
IPAddress dnsServerIP();
2008-07-30 16:47:36 +02:00
friend class Client;
friend class Server;
};
extern EthernetClass Ethernet;
#endif