|
|
|
@ -30,6 +30,10 @@ const PROGMEM byte E131::ACN_ID[12] = { 0x41, 0x53, 0x43, 0x2d, 0x45, 0x31, 0x2e
|
|
|
|
|
const byte E131::ACN_ID[12] = { 0x41, 0x53, 0x43, 0x2d, 0x45, 0x31, 0x2e, 0x31, 0x37, 0x00, 0x00, 0x00 };
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
Wiznet5500lwIP eth(17, SPI, 21); // 17 : cs, 21 : INTn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Constructor */
|
|
|
|
|
E131::E131() {
|
|
|
|
|
#ifdef NO_DOUBLE_BUFFER
|
|
|
|
@ -191,24 +195,34 @@ int E131::beginMulticast(const char *ssid, const char *passphrase,
|
|
|
|
|
#if defined (INT_ETHERNET)
|
|
|
|
|
|
|
|
|
|
/* Unicast Ethernet Initializers */
|
|
|
|
|
int E131::begin(uint8_t *mac) {
|
|
|
|
|
int E131::begin() {
|
|
|
|
|
int retval = 0;
|
|
|
|
|
|
|
|
|
|
if (Serial) {
|
|
|
|
|
Serial.println("");
|
|
|
|
|
Serial.println(F("Requesting Address via DHCP"));
|
|
|
|
|
Serial.print(F("- MAC: "));
|
|
|
|
|
for (int i = 0; i < 6; i++)
|
|
|
|
|
Serial.print(mac[i], HEX);
|
|
|
|
|
Serial.println("");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
retval = Ethernet.begin(mac);
|
|
|
|
|
|
|
|
|
|
SPI.setRX(16);
|
|
|
|
|
SPI.setCS(17);
|
|
|
|
|
SPI.setSCK(18);
|
|
|
|
|
SPI.setTX(19);
|
|
|
|
|
//eth.setSPISpeed(30000000);
|
|
|
|
|
//lwipPollingPeriod(3);
|
|
|
|
|
if (!eth.begin()) {
|
|
|
|
|
Serial.println("No wired Ethernet hardware detected. Check pinouts, wiring.");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
while (!eth.connected()) {
|
|
|
|
|
Serial.print(".");
|
|
|
|
|
delay(500);
|
|
|
|
|
}
|
|
|
|
|
retval = eth.connected();
|
|
|
|
|
if (Serial) {
|
|
|
|
|
if (retval) {
|
|
|
|
|
Serial.print(F("- IP Address: "));
|
|
|
|
|
Serial.println(Ethernet.localIP());
|
|
|
|
|
Serial.print(F("\n- IP Address: "));
|
|
|
|
|
Serial.println(eth.localIP());
|
|
|
|
|
} else {
|
|
|
|
|
Serial.println(F("** DHCP FAILED"));
|
|
|
|
|
}
|
|
|
|
@ -220,31 +234,18 @@ int E131::begin(uint8_t *mac) {
|
|
|
|
|
return retval;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void E131::begin(uint8_t *mac, IPAddress ip, IPAddress netmask,
|
|
|
|
|
IPAddress gateway, IPAddress dns) {
|
|
|
|
|
Ethernet.begin(mac, ip, dns, gateway, netmask);
|
|
|
|
|
if (Serial) {
|
|
|
|
|
Serial.println("");
|
|
|
|
|
Serial.println(F("Static Configuration"));
|
|
|
|
|
Serial.println(F("- MAC: "));
|
|
|
|
|
for (int i = 0; i < 6; i++)
|
|
|
|
|
Serial.print(mac[i], HEX);
|
|
|
|
|
Serial.print(F("- IP Address: "));
|
|
|
|
|
Serial.println(Ethernet.localIP());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
initUnicast();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Multicast Ethernet Initializers */
|
|
|
|
|
int E131::beginMulticast(uint8_t *mac, uint16_t universe, uint8_t n) {
|
|
|
|
|
//TODO: Add ethernet multicast support
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void E131::beginMulticast(uint8_t *mac, uint16_t universe,
|
|
|
|
|
IPAddress ip, IPAddress netmask, IPAddress gateway,
|
|
|
|
|
IPAddress dns, uint8_t n) {
|
|
|
|
|
//TODO: Add ethernet multicast support
|
|
|
|
|
//return -1;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
/****** END - Ethernet ifdef block ******/
|
|
|
|
|