mirror of
https://github.com/HendrikRauh/dmx-interface.git
synced 2025-05-19 10:32:56 +00:00
only send DMX packets if there is no packet error
This commit is contained in:
parent
85b692e931
commit
f2f17a6f4c
1 changed files with 4 additions and 12 deletions
16
src/main.cpp
16
src/main.cpp
|
@ -472,17 +472,13 @@ void loop()
|
||||||
// check if there's a new DMX packet
|
// check if there's a new DMX packet
|
||||||
if (direction1 == Input && dmx_receive(dmx1, &dmx1_packet, 0))
|
if (direction1 == Input && dmx_receive(dmx1, &dmx1_packet, 0))
|
||||||
{
|
{
|
||||||
dmx_read_offset(dmx1, 1, dmx1_data, 512);
|
|
||||||
artnet.sendArtDmx(broadcastIp, universe1, dmx1_data, 512);
|
|
||||||
|
|
||||||
/* We should check to make sure that there weren't any DMX errors. */
|
/* We should check to make sure that there weren't any DMX errors. */
|
||||||
if (!dmx1_packet.err)
|
if (!dmx1_packet.err)
|
||||||
{
|
{
|
||||||
/* Don't forget we need to actually read the DMX data into our buffer so
|
/* Don't forget we need to actually read the DMX data into our buffer so
|
||||||
that we can print it out. */
|
that we can print it out. */
|
||||||
|
dmx_read_offset(dmx1, 1, dmx1_data, dmx1_packet.size);
|
||||||
/*dmx_read_offset(dmx1, 1, dmx1_data, dmx1_packet.size);
|
artnet.sendArtDmx(broadcastIp, universe1, dmx1_data, dmx1_packet.size);
|
||||||
artnet.sendArtDmx(broadcastIp, universe1, dmx1_data, 512);*/
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -496,17 +492,13 @@ void loop()
|
||||||
|
|
||||||
if (direction2 == Input && dmx_receive(dmx2, &dmx2_packet, 0))
|
if (direction2 == Input && dmx_receive(dmx2, &dmx2_packet, 0))
|
||||||
{
|
{
|
||||||
dmx_read_offset(dmx2, 1, dmx2_data, 512);
|
|
||||||
artnet.sendArtDmx(broadcastIp, universe2, dmx2_data, 512);
|
|
||||||
|
|
||||||
/* We should check to make sure that there weren't any DMX errors. */
|
/* We should check to make sure that there weren't any DMX errors. */
|
||||||
if (!dmx2_packet.err)
|
if (!dmx2_packet.err)
|
||||||
{
|
{
|
||||||
/* Don't forget we need to actually read the DMX data into our buffer so
|
/* Don't forget we need to actually read the DMX data into our buffer so
|
||||||
that we can print it out. */
|
that we can print it out. */
|
||||||
|
dmx_read_offset(dmx2, 1, dmx2_data, dmx2_packet.size);
|
||||||
/*dmx_read_offset(dmx2, 1, dmx2_data, dmx2_packet.size);
|
artnet.sendArtDmx(broadcastIp, universe2, dmx2_data, dmx2_packet.size);
|
||||||
artnet.sendArtDmx(broadcastIp, universe2, dmx2_data, 512);*/
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue