diff --git a/Artnet.h b/Artnet.h deleted file mode 100644 index 0e9e970..0000000 --- a/Artnet.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once -#ifndef ARDUINO_ARTNET_H -#define ARDUINO_ARTNET_H - -// Spec (Art-Net 4) : http://artisticlicence.com/WebSiteMaster/User%20Guides/art-net.pdf -// Packet Summary : https://art-net.org.uk/structure/packet-summary-2/ -// Packet Definition : https://art-net.org.uk/structure/streaming-packets/artdmx-packet-definition/ - -#include "ArtnetWiFi.h" -#include "ArtnetEther.h" - -#if !defined(ARTNET_ENABLE_WIFI) && !defined(ARTNET_ENABLE_ETHER) -#error THIS PLATFORM HAS NO WIFI OR ETHERNET OR NOT SUPPORTED ARCHITECTURE. PLEASE LET ME KNOW! -#endif - -#if defined(ARTNET_ENABLE_WIFI) && defined(ARTNET_ENABLE_ETHER) -#error BOTH WIFI AND ETHERNET ARE ENABLED. PLEASE INCLUDE ONLY ArtnetWiFi.h OR ArtnetEther.h -#endif - -#endif // ARDUINO_ARTNET_H diff --git a/ArtnetETH.h b/ArtnetETH.h index af55213..a511234 100644 --- a/ArtnetETH.h +++ b/ArtnetETH.h @@ -12,8 +12,8 @@ #include "Artnet/Manager.h" // ETH.h is a library for Ethernet PHY, but we should use WiFi library's apis for sever/client -using Artnet = art_net::Manager; -using ArtnetSender = art_net::Sender; -using ArtnetReceiver = art_net::Receiver; +using ArtnetETH = art_net::Manager; +using ArtnetETHSender = art_net::Sender; +using ArtnetETHReceiver = art_net::Receiver; #endif // ARTNET_ETH_H diff --git a/ArtnetEther.h b/ArtnetEther.h index 1c2fc98..0be1b7c 100644 --- a/ArtnetEther.h +++ b/ArtnetEther.h @@ -12,8 +12,8 @@ #include "Artnet/util/TeensyDirtySTLErrorSolution/TeensyDirtySTLErrorSolution.h" #include "Artnet/Manager.h" -using Artnet = art_net::Manager; -using ArtnetSender = art_net::Sender; -using ArtnetReceiver = art_net::Receiver; +using ArtnetEther = art_net::Manager; +using ArtnetEtherSender = art_net::Sender; +using ArtnetEtherReceiver = art_net::Receiver; #endif // ARTNET_ETHER_H diff --git a/ArtnetEtherENC.h b/ArtnetEtherENC.h index 8de9e82..1bf7ced 100644 --- a/ArtnetEtherENC.h +++ b/ArtnetEtherENC.h @@ -12,8 +12,8 @@ #include "Artnet/util/TeensyDirtySTLErrorSolution/TeensyDirtySTLErrorSolution.h" #include "Artnet/Manager.h" -using Artnet = art_net::Manager; -using ArtnetSender = art_net::Sender; -using ArtnetReceiver = art_net::Receiver; +using ArtnetEtherENC = art_net::Manager; +using ArtnetEtherENCSender = art_net::Sender; +using ArtnetEtherENCReceiver = art_net::Receiver; #endif // ARTNET_ETHER_H diff --git a/ArtnetNativeEther.h b/ArtnetNativeEther.h index 532a4ed..c579610 100644 --- a/ArtnetNativeEther.h +++ b/ArtnetNativeEther.h @@ -12,8 +12,8 @@ #include "Artnet/util/TeensyDirtySTLErrorSolution/TeensyDirtySTLErrorSolution.h" #include "Artnet/Manager.h" -using Artnet = art_net::Manager; -using ArtnetSender = art_net::Sender; -using ArtnetReceiver = art_net::Receiver; +using ArtnetNativeEther = art_net::Manager; +using ArtnetNativeEtherSender = art_net::Sender; +using ArtnetNativeEtherReceiver = art_net::Receiver; #endif // ARTNET_NATIVE_ETHER_H diff --git a/README.md b/README.md index 7f45c5f..3d4f7ca 100644 --- a/README.md +++ b/README.md @@ -3,16 +3,13 @@ [Art-Net](https://en.wikipedia.org/wiki/Art-Net) Sender/Receiver for Arduino (Ethernet, WiFi) > [!WARNING] -> Breaking API changes from v0.4.0 and above - -> [!WARNING] -> Dependent libraries removed from v0.3.0 - -If you have already installed this library before v0.3.0, please follow: - -- Cloned from GitHub (manually): Please install dependent libraries manually -- Installed from library manager: re-install this library from library manager - - Dependent libraries will be installed automatically +> Breaking API changes from v0.9.0 and above. `Artnet.h` is no longer included. Please include the header file and use interface-specific classes depending on the interface you want to use. +> +> - WiFi: `ArtnetWiFi.h` (`ArtnetWiFi`, `ArtnetWiFiSender`, `ArtnetWiFiReceiver`) +> - Ethernet: `ArtnetEther.h` (`ArtnetEther`, `ArtnetEtherSender`, `ArtnetEtherReceiver`) +> - EthernetENC (ENC28J60): `ArtnetEtherENC.h` (`ArtnetEtherENC`, `ArtnetEtherENCSender`, `ArtnetEtherENCReceiver`) +> - ETH (ESP32): `ArtnetETH.h` (`ArtnetETH`, `ArtnetETHSender`, `ArtnetETHReceiver`) +> - NativeEthernet (Teensy 4.1): `ArtnetNativeEther.h` (`ArtnetNativeEther`, `ArtnetNativeEtherSender`, `ArtnetNativeEtherReceiver`) ## Feature @@ -29,6 +26,7 @@ If you have already installed this library before v0.3.0, please follow: - Ethernet - EthernetENC - ETH (ESP32) + - NativeEthernet (Teensy 4.1) - Supports a lot of boards which can use Ethernet or WiFi - Multiple receiver callbacks depending on universe - Mutilple destination streaming with sender @@ -54,6 +52,7 @@ If you have already installed this library before v0.3.0, please follow: - ESP32 (Ethernet and ETH) - ESP8266 +- Teensy 4.1 (NativeEthernet) - Almost all platforms without WiFi - Any platform supported by ENC28J60 (please read following section) @@ -63,38 +62,35 @@ If you have already installed this library before v0.3.0, please follow: When using the ENC28J60 controller - make sure to **clone** the [EthernetENC](https://github.com/JAndrassy/EthernetENC) library (version =< 2.0.4 doesn't support MAC address) -- simply replace `#include ` with `#include ` +- simply replace `#include ` with `#include ` + ## Usage -This library has following Art-Net controller options. -Please use them depending on the situation. +This library has following Art-Net controller options. Please use them depending on the situation. -- ArtnetReveiver -- ArtnetSender -- Artnet (Integrated Sender/Receiver) +- `Artnet{interface}Receiver` +- `Artnet{interface}Sender` +- `Artnet{interface}` -### Include Artnet +Where `{interface}` is one of the following depending on the interface you want to use. -Please include `#include "Artnet.h` first. +| Interface | Header File | Class Name Prefix | +|---------------|-----------------------|-------------------| +| WiFi | ArtnetWiFi.h | ArtnetWiFi | +| Ethernet | ArtnetEther.h | ArtnetEther | +| EthernetENC | ArtnetEtherENC.h | ArtnetEtherENC | +| ETH (ESP32) | ArtnetETH.h | ArtnetETH | +| NativeEthernet| ArtnetNativeEther.h | ArtnetNativeEther | -If you use the board which has both `WiFi` and `Ethernet`, you can't use `#include `. Please replace it with `#include ` or `#include ` depending on the interface you want to use. - -```C++ -// For the boards which can use ether WiFi or Ethernet -#include -// OR use WiFi on the board which can use both WiFi and Ethernet -#include -// OR use Ethenet on the board which can use both WiFi and Ethernet -#include -``` +Also, you can use multiple interfaces in the same sketch. ### ArtnetReceiver ```C++ -#include -ArtnetReceiver artnet; +#include +ArtnetWiFiReceiver artnet; void callback(const uint8_t *data, uint16_t size, const ArtDmxMetadata &metadata, const ArtNetRemoteInfo &remote) { // you can also use pre-defined callbacks @@ -121,8 +117,8 @@ void loop() { ### ArtnetSender ```C++ -#include -ArtnetSender artnet; +#include +ArtnetWiFiSender artnet; void setup() { // setup Ethernet/WiFi... @@ -149,11 +145,11 @@ void loop() { ### Artnet (Integrated Sender/Receiver) -`ArtNet` class has `ArtNetReceiver` and `ArtNetSender` features. +`ArtNet` class has both `ArtNetReceiver` and `ArtNetSender` features. ```C++ -#include -Artnet artnet; +#include +ArtnetWiFi artnet; void setup() { @@ -184,8 +180,8 @@ void loop() { ### Artnet Receiver + FastLED ```C++ -#include -ArtnetReceiver artnet; +#include +ArtnetWiFiReceiver artnet; // FastLED #define NUM_LEDS 1 @@ -238,7 +234,7 @@ void loop() { - `ArtPoll` is automatically parsed and sends `ArtPollReply` - You can configure the following information of by `setArtPollReplyConfig()` - Other settings are set automatically based on registerd callbacks -- Please refer [here](https://art-net.org.uk/downloads/art-net.pdf) for more information +- Please refer the [spec](https://art-net.org.uk/downloads/art-net.pdf) for more information ```C++ struct ArtPollReplyMetadata @@ -284,7 +280,7 @@ void setArtPollReplyConfigSwIn(uint8_t sw_in_0, uint8_t sw_in_1, uint8_t sw_in_2 ## ArtTrigger -You can send/subscribe `ArtTrigger` using the follwing APIs. Please refer [here](https://art-net.org.uk/how-it-works/time-keeping-triggering/arttrigger/) for more information. +You can send/subscribe `ArtTrigger` using the following APIs. Please refer the [spec](https://art-net.org.uk/how-it-works/time-keeping-triggering/arttrigger/) for more information. ```C++ void sendArtTrigger(const String& ip, uint16_t oem = 0, uint8_t key = 0, uint8_t subkey = 0, const uint8_t *payload = nullptr, uint16_t size = 512); @@ -294,7 +290,7 @@ using ArtTriggerCallback = std::function; ## APIs -### ArtnetSender +### ArtnetSender APIs ```C++ // streaming artdmx packet @@ -332,7 +328,7 @@ void sendArtTrigger(const String& ip, uint16_t oem = 0, uint8_t key = 0, uint8_t void sendArtSync(const String& ip); ``` -### ArtnetReceiver +### ArtnetReceiver APIs ```C++ using ArtDmxCallback = std::function; diff --git a/examples/ETH/receive_fastled/receive_fastled.ino b/examples/ETH/receive_fastled/receive_fastled.ino index 87afd72..53afdea 100644 --- a/examples/ETH/receive_fastled/receive_fastled.ino +++ b/examples/ETH/receive_fastled/receive_fastled.ino @@ -6,7 +6,7 @@ const IPAddress ip(192, 168, 0, 201); const IPAddress gateway(192, 168, 0, 1); const IPAddress subnet(255, 255, 255, 0); -ArtnetReceiver artnet; +ArtnetETHReceiver artnet; uint8_t universe = 1; // 0 - 15 // FastLED diff --git a/examples/ETH/receiver/receiver.ino b/examples/ETH/receiver/receiver.ino index ea58583..33b68b8 100644 --- a/examples/ETH/receiver/receiver.ino +++ b/examples/ETH/receiver/receiver.ino @@ -5,7 +5,7 @@ const IPAddress ip(192, 168, 0, 201); const IPAddress gateway(192, 168, 0, 1); const IPAddress subnet_mask(255, 255, 255, 0); -ArtnetReceiver artnet; +ArtnetETHReceiver artnet; uint16_t universe1 = 1; // 0 - 32767 uint8_t net = 0; // 0 - 127 uint8_t subnet = 0; // 0 - 15 diff --git a/examples/ETH/send_receive/send_receive.ino b/examples/ETH/send_receive/send_receive.ino index a4be2c0..678d1e1 100644 --- a/examples/ETH/send_receive/send_receive.ino +++ b/examples/ETH/send_receive/send_receive.ino @@ -5,7 +5,7 @@ const IPAddress ip(192, 168, 0, 201); const IPAddress gateway(192, 168, 0, 1); const IPAddress subnet(255, 255, 255, 0); -Artnet artnet; +ArtnetETH artnet; const String target_ip = "192.168.0.200"; uint8_t universe = 1; // 0 - 15 diff --git a/examples/ETH/sender/sender.ino b/examples/ETH/sender/sender.ino index e94d62e..8454af3 100644 --- a/examples/ETH/sender/sender.ino +++ b/examples/ETH/sender/sender.ino @@ -5,7 +5,7 @@ const IPAddress ip(192, 168, 0, 201); const IPAddress gateway(192, 168, 0, 1); const IPAddress subnet(255, 255, 255, 0); -ArtnetSender artnet; +ArtnetETHSender artnet; const String target_ip = "192.168.0.200"; uint16_t universe = 1; diff --git a/examples/Ethernet/receive_fastled/receive_fastled.ino b/examples/Ethernet/receive_fastled/receive_fastled.ino index 76ee0bf..de9c65a 100644 --- a/examples/Ethernet/receive_fastled/receive_fastled.ino +++ b/examples/Ethernet/receive_fastled/receive_fastled.ino @@ -1,17 +1,13 @@ #include // include FastLED *before* Artnet -// Please include ArtnetEther.h to use Artnet on the platform -// which can use both WiFi and Ethernet #include // #include // only for Teensy 4.1 -// this is also valid for other platforms which can use only Ethernet -// #include // Ethernet stuff const IPAddress ip(192, 168, 0, 201); uint8_t mac[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB}; -ArtnetReceiver artnet; +ArtnetEtherReceiver artnet; uint8_t universe = 1; // 0 - 15 // FastLED diff --git a/examples/Ethernet/receiver/receiver.ino b/examples/Ethernet/receiver/receiver.ino index 79d673f..a26d413 100644 --- a/examples/Ethernet/receiver/receiver.ino +++ b/examples/Ethernet/receiver/receiver.ino @@ -1,15 +1,11 @@ -// Please include ArtnetEther.h to use Artnet on the platform -// which can use both WiFi and Ethernet #include // #include // only for Teensy 4.1 -// this is also valid for other platforms which can use only Ethernet -// #include // Ethernet stuff const IPAddress ip(192, 168, 0, 201); uint8_t mac[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB}; -ArtnetReceiver artnet; +ArtnetEtherReceiver artnet; uint16_t universe1 = 1; // 0 - 32767 uint8_t universe2 = 2; // 0 - 15 diff --git a/examples/Ethernet/send_receive/send_receive.ino b/examples/Ethernet/send_receive/send_receive.ino index 61127ea..5eb7d13 100644 --- a/examples/Ethernet/send_receive/send_receive.ino +++ b/examples/Ethernet/send_receive/send_receive.ino @@ -2,18 +2,14 @@ #warning THIS EXAMPLE MAY USE TOO MUCH MEMORY FOR AVR. WE RECOMMEND TO USE SENDER OR RECEIVER ONLY. #endif -// Please include ArtnetEther.h to use Artnet on the platform -// which can use both WiFi and Ethernet #include // #include // only for Teensy 4.1 -// this is also valid for other platforms which can use only Ethernet -// #include // Ethernet stuff const IPAddress ip(192, 168, 0, 201); uint8_t mac[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB}; -Artnet artnet; +ArtnetEther artnet; const String target_ip = "192.168.0.200"; uint8_t universe = 1; // 0 - 15 diff --git a/examples/Ethernet/sender/sender.ino b/examples/Ethernet/sender/sender.ino index d5ce9d6..86fd050 100644 --- a/examples/Ethernet/sender/sender.ino +++ b/examples/Ethernet/sender/sender.ino @@ -1,15 +1,11 @@ -// Please include ArtnetEther.h to use Artnet on the platform -// which can use both WiFi and Ethernet #include // #include // only for Teensy 4.1 -// this is also valid for other platforms which can use only Ethernet -// #include // Ethernet stuff const IPAddress ip(192, 168, 0, 201); uint8_t mac[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB}; -ArtnetSender artnet; +ArtnetEtherSender artnet; const String target_ip = "192.168.0.200"; uint16_t universe = 1; diff --git a/examples/EthernetENC/receive_fastled/receive_fastled.ino b/examples/EthernetENC/receive_fastled/receive_fastled.ino index 707e408..fd2b456 100644 --- a/examples/EthernetENC/receive_fastled/receive_fastled.ino +++ b/examples/EthernetENC/receive_fastled/receive_fastled.ino @@ -6,7 +6,7 @@ const IPAddress ip(192, 168, 0, 201); uint8_t mac[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB}; -ArtnetReceiver artnet; +ArtnetEtherENCReceiver artnet; uint8_t universe = 1; // 0 - 15 // FastLED diff --git a/examples/EthernetENC/receiver/receiver.ino b/examples/EthernetENC/receiver/receiver.ino index 279c5e8..00fbdcc 100644 --- a/examples/EthernetENC/receiver/receiver.ino +++ b/examples/EthernetENC/receiver/receiver.ino @@ -5,7 +5,7 @@ const IPAddress ip(192, 168, 0, 201); uint8_t mac[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB}; -ArtnetReceiver artnet; +ArtnetEtherENCReceiver artnet; uint16_t universe1 = 1; // 0 - 32767 uint8_t net = 0; // 0 - 127 uint8_t subnet = 0; // 0 - 15 diff --git a/examples/EthernetENC/send_receive/send_receive.ino b/examples/EthernetENC/send_receive/send_receive.ino index 9b97598..c76ff86 100644 --- a/examples/EthernetENC/send_receive/send_receive.ino +++ b/examples/EthernetENC/send_receive/send_receive.ino @@ -9,7 +9,7 @@ const IPAddress ip(192, 168, 0, 201); uint8_t mac[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB}; -Artnet artnet; +ArtnetEtherENC artnet; const String target_ip = "192.168.0.200"; uint8_t universe = 1; // 0 - 15 diff --git a/examples/EthernetENC/sender/sender.ino b/examples/EthernetENC/sender/sender.ino index 37445c9..532cf0f 100644 --- a/examples/EthernetENC/sender/sender.ino +++ b/examples/EthernetENC/sender/sender.ino @@ -5,7 +5,7 @@ const IPAddress ip(192, 168, 0, 201); uint8_t mac[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB}; -ArtnetSender artnet; +ArtnetEtherENCSender artnet; const String target_ip = "192.168.0.200"; uint16_t universe = 1; diff --git a/examples/WiFi/receive_fastled/receive_fastled.ino b/examples/WiFi/receive_fastled/receive_fastled.ino index 482bb74..fa348de 100644 --- a/examples/WiFi/receive_fastled/receive_fastled.ino +++ b/examples/WiFi/receive_fastled/receive_fastled.ino @@ -1,10 +1,5 @@ #include // include FastLED *before* Artnet - -// Please include ArtnetWiFi.h to use Artnet on the platform -// which can use both WiFi and Ethernet #include -// this is also valid for other platforms which can use only WiFi -// #include // WiFi stuff const char* ssid = "your-ssid"; diff --git a/examples/WiFi/receiver/receiver.ino b/examples/WiFi/receiver/receiver.ino index 65e821d..413e080 100644 --- a/examples/WiFi/receiver/receiver.ino +++ b/examples/WiFi/receiver/receiver.ino @@ -1,8 +1,4 @@ -// Please include ArtnetWiFi.h to use Artnet on the platform -// which can use both WiFi and Ethernet #include -// this is also valid for other platforms which can use only WiFi -// #include // WiFi stuff const char* ssid = "your-ssid"; diff --git a/examples/WiFi/send_receive/send_receive.ino b/examples/WiFi/send_receive/send_receive.ino index 7ad05fb..5d5fe11 100644 --- a/examples/WiFi/send_receive/send_receive.ino +++ b/examples/WiFi/send_receive/send_receive.ino @@ -1,8 +1,4 @@ -// Please include ArtnetWiFi.h to use Artnet on the platform -// which can use both WiFi and Ethernet #include -// this is also valid for other platforms which can use only WiFi -// #include // WiFi stuff const char* ssid = "your-ssid"; diff --git a/examples/WiFi/sender/sender.ino b/examples/WiFi/sender/sender.ino index 0850d54..5372833 100644 --- a/examples/WiFi/sender/sender.ino +++ b/examples/WiFi/sender/sender.ino @@ -1,8 +1,4 @@ -// Please include ArtnetWiFi.h to use Artnet on the platform -// which can use both WiFi and Ethernet #include -// this is also valid for other platforms which can use only WiFi -// #include // WiFi stuff const char* ssid = "your-ssid";