1
0
Fork 0

also enforce priority value constraint on sending

This commit is contained in:
Kevin Matz 2021-08-28 09:08:40 -04:00
parent bd05b0439a
commit 0614524d0b
1 changed files with 11 additions and 7 deletions

View File

@ -35,17 +35,17 @@ namespace DATA {
void data_header::iStream(ACN::PDU::Stream stream)
{
stream->readString(source_name, 64);
/// \cite sACN 6.2.3 E1.31 Data Packet: Priority
///
/// No priority outside the range of 0 to 200 shall be transmitted
/// on the network.
*stream >> priority;
if (priority> 200)
stream->setstate(std::ios_base::failbit);
*stream >> sync_address;
*stream >> sequence_number;
*stream >> options;
*stream >> universe;
/// \cite sACN 6.2.3 E1.31 Data Packet: Priority
/// No priority outside the range of 0 to 200 shall be transmitted on
/// the network.
if (priority> 200)
stream->setstate(std::ios_base::failbit);
}
@ -56,7 +56,11 @@ void data_header::iStream(ACN::PDU::Stream stream)
void data_header::oStream(ACN::PDU::Stream stream) const
{
stream->writeString(source_name, 64);
*stream << priority;
/// \cite sACN 6.2.3 E1.31 Data Packet: Priority
///
/// No priority outside the range of 0 to 200 shall be transmitted on
/// the network.
*stream << (priority <= 200 ? priority : 200);
*stream << sync_address;
*stream << sequence_number;
*stream << options;