Skip to content

Commit

Permalink
fix out-of-sync detection on E1.31 packets
Browse files Browse the repository at this point in the history
  • Loading branch information
pille committed Feb 22, 2020
1 parent 447594b commit c66af86
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions wled00/wled07_notify.ino
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,12 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP){
//E1.31 protocol support

// skip out-of-sequence packets
if (p->sequence_number < e131LastSequenceNumber && p->sequence_number - e131LastSequenceNumber > -20){
if (p->sequence_number < e131LastSequenceNumber && p->sequence_number > 20 && e131LastSequenceNumber < 250){
DEBUG_PRINT("skipping E1.31 frame (last seq=");
DEBUG_PRINT(e131LastSequenceNumber);
DEBUG_PRINT(", current seq=");
DEBUG_PRINT(p->sequence_number);
DEBUG_PRINTLN(")");
e131LastSequenceNumber = p->sequence_number;
return;
}
e131LastSequenceNumber = p->sequence_number;
Expand Down

0 comments on commit c66af86

Please sign in to comment.