ESPixelStick Firmware
Firmware for the ESPixelStick
Loading...
Searching...
No Matches
InputE131.hpp
Go to the documentation of this file.
1#pragma once
2/*
3* E131Input.h - Code to wrap ESPAsyncE131 for input
4*
5* Project: ESPixelStick - An ESP8266 / ESP32 and E1.31 based pixel driver
6* Copyright (c) 2021, 2025 Shelby Merrick
7* http://www.forkineye.com
8*
9* This program is provided free for you to use in any way that you wish,
10* subject to the laws and regulations where you are using it. Due diligence
11* is strongly suggested before using this code. Please give credit where due.
12*
13* The Author makes no warranty of any kind, express or implied, with regard
14* to this program or the documentation contained in this document. The
15* Author shall not be liable in any event for incidental or consequential
16* damages in connection with, or arising out of, the furnishing, performance
17* or use of these programs.
18*
19*/
20
21#include "InputCommon.hpp"
22#include <ESPAsyncE131.h>
23
25{
26 private:
27 static const uint16_t UNIVERSE_MAX = 512;
28 static const char ConfigFileName[];
29 static const uint8_t MAX_NUM_UNIVERSES = (OM_MAX_NUM_CHANNELS / UNIVERSE_MAX) + 1;
30
31 ESPAsyncE131 * e131 = nullptr;
32 // e131_packet_t packet; ///< Packet buffer for parsing
33
35 uint16_t startUniverse = 1;
36 uint16_t LastUniverse = 1;
37 uint16_t ChannelsPerUniverse = 512;
39 ESPAsyncE131PortId PortId = E131_DEFAULT_PORT;
41
43 uint16_t channel_count = 0;
44
46 {
48 uint32_t BytesToCopy;
52 };
54
56 void NetworkStateChanged (bool IsConnected, bool RebootAllowed); // used by poorly designed rx functions
58
59 public:
60
62 c_InputMgr::e_InputType NewChannelType,
63 uint32_t BufferSize);
64 virtual ~c_InputE131();
65
66 // functions to be provided by the derived class
67 void Begin ();
68 bool SetConfig (JsonObject & jsonConfig);
69 void GetConfig (JsonObject & jsonConfig);
70 void GetStatus (JsonObject & jsonStatus);
71 void Process ();
72 void GetDriverName (String & sDriverName) { sDriverName = "E1.31"; }
73 void SetBufferInfo (uint32_t BufferSize);
74 void NetworkStateChanged (bool IsConnected); // used by poorly designed rx functions
76 void ProcessIncomingE131Data (e131_packet_t *);
77};
#define OM_MAX_NUM_CHANNELS
Definition OutputMgr.hpp:197
Definition InputCommon.hpp:27
bool HasBeenInitialized
Definition InputCommon.hpp:51
Definition InputE131.hpp:25
uint16_t LastUniverse
Last Universe to listen for.
Definition InputE131.hpp:36
static const uint16_t UNIVERSE_MAX
Definition InputE131.hpp:27
void validateConfiguration()
Definition InputE131.cpp:288
void ProcessIncomingE131Data(e131_packet_t *)
Definition InputE131.cpp:131
static const char ConfigFileName[]
Definition InputE131.hpp:28
uint16_t startUniverse
JSON configuration parameters.
Definition InputE131.hpp:35
void Process()
Call from loop(), renders Input data.
Definition InputE131.cpp:122
ESPAsyncE131PortId PortId
Definition InputE131.hpp:39
virtual ~c_InputE131()
Definition InputE131.cpp:40
c_InputE131(c_InputMgr::e_InputChannelIds NewInputChannelId, c_InputMgr::e_InputType NewChannelType, uint32_t BufferSize)
Definition InputE131.cpp:24
void NetworkStateChanged(bool IsConnected, bool RebootAllowed)
Definition InputE131.cpp:353
uint16_t ChannelsPerUniverse
Universe boundary limit.
Definition InputE131.hpp:37
uint16_t channel_count
from sketch globals
Definition InputE131.hpp:43
void GetStatus(JsonObject &jsonStatus)
Definition InputE131.cpp:91
void SetBufferTranslation()
Definition InputE131.cpp:214
bool ESPAsyncE131Initialized
Definition InputE131.hpp:40
uint16_t FirstUniverseChannelOffset
Channel to start listening at - 1 based.
Definition InputE131.hpp:38
void GetConfig(JsonObject &jsonConfig)
Get the current config used by the driver.
Definition InputE131.cpp:77
void GetDriverName(String &sDriverName)
get the name for the instantiated driver
Definition InputE131.hpp:72
void Begin()
set up the operating environment based on the current config (or defaults)
Definition InputE131.cpp:49
static const uint8_t MAX_NUM_UNIVERSES
Definition InputE131.hpp:29
void SetBufferInfo(uint32_t BufferSize)
Definition InputE131.cpp:194
bool isShutDownRebootNeeded()
Definition InputE131.hpp:75
ESPAsyncE131 * e131
ESPAsyncE131.
Definition InputE131.hpp:31
bool SetConfig(JsonObject &jsonConfig)
Set a new config in the driver.
Definition InputE131.cpp:260
Universe_t UniverseArray[MAX_NUM_UNIVERSES]
Definition InputE131.hpp:53
e_InputType
Definition InputMgr.hpp:71
e_InputChannelIds
Definition InputMgr.hpp:40
Definition InputE131.hpp:46
uint32_t SequenceErrorCounter
Definition InputE131.hpp:51
uint32_t DestinationOffset
Definition InputE131.hpp:47
uint8_t SequenceNumber
Definition InputE131.hpp:50
uint32_t SourceDataOffset
Definition InputE131.hpp:49
uint32_t BytesToCopy
Definition InputE131.hpp:48