diff --git a/protocols/sacn/data.h b/protocols/sacn/data.h index 8f0058d..dd22d52 100644 --- a/protocols/sacn/data.h +++ b/protocols/sacn/data.h @@ -143,7 +143,7 @@ struct data_header /// > for every packet sent on that universe. There is no implied relationship /// > between the sequence number of an E1.31 Synchronization Packet and the /// > sequence number of an E1.31 Data Packet on that same universe. - uint8_t sequence_number; + mutable uint8_t sequence_number; /// @brief \cite sACN 6.2.6 E1.31 Data Packet: Options /// diff --git a/protocols/sacn/source.h b/protocols/sacn/source.h index 9ab9b1f..9533053 100644 --- a/protocols/sacn/source.h +++ b/protocols/sacn/source.h @@ -66,16 +66,15 @@ protected: private: std::unordered_map universes_; - std::mutex universes_mutext_; + mutable std::mutex universes_mutext_; - /// > \cite sACN 6.2.5 E1.31 Data Packet: Sequence Number + /// > \cite 6.3.2 E1.31 Synchronization Packet: Sequence Number /// > /// > Sources shall maintain a sequence for each universe they transmit. /// > The sequence number for a universe shall be incremented by one for /// > every packet sent on that universe. There is no implied relationship /// > between the sequence number of an E1.31 Synchronization Packet and /// > the sequence number of an E1.31 Data Packet on that same universe. - std::unordered_map data_sequences_; std::unordered_map sync_sequences_; std::promise discovery_exitSignal_; diff --git a/protocols/sacn/universe.cpp b/protocols/sacn/universe.cpp index 674d402..3b3e9fc 100644 --- a/protocols/sacn/universe.cpp +++ b/protocols/sacn/universe.cpp @@ -201,6 +201,12 @@ void Universe::synchronize(uint8_t sequence_number) */ void Universe::sACNsend() const { + /// > \cite sACN 6.2.5 E1.31 Data Packet: Sequence Number + /// > + /// > ... The sequence number for a universe shall be incremented by one for + /// > every packet sent on that universe... + provenance_->sequence_number++; + // header auto addrtyp = std::make_shared(); addrtyp->byte = 0;