Ok, I've added E1.31 translation code to my project. The only thing that you might add is layers' length validation.
The project is here: GECERemote
This is how you would use it (just an example, won't necessarily compile):
Code:
#include "E131.h"
E131 packet;
void loop() {
if (Udp.available()) {
int len = Udp.readPacket(buf, BUF_SIZE);
if (packet.validate(buf)) {
for (int i = 0; i < packet.getLength(); i += 3) {
uint8_t red = static_cast<uint8_t>(buf[E131::DATA_OFFSET + i]);
uint8_t green = static_cast<uint8_t>(buf[E131::DATA_OFFSET + i + 1]);
uint8_t blue = static_cast<uint8_t>(buf[E131::DATA_OFFSET + i + 2]);
}
}
}
}
Bookmarks