fail on receiving invalid universe number
This commit is contained in:
parent
c808341eff
commit
39cb36c46e
|
@ -45,7 +45,13 @@ void data_header::iStream(ACN::PDU::Stream stream)
|
|||
*stream >> sync_address;
|
||||
*stream >> sequence_number;
|
||||
*stream >> options;
|
||||
/// \cite sACN 6.2.7 E1.31 Data Packet: Universe
|
||||
///
|
||||
/// Universe values shall be limited to the range 1 to 63999.
|
||||
*stream >> universe;
|
||||
if ((universe == 0) ||
|
||||
(universe >= 64000 && universe != E131_DISCOVERY_UNIVERSE))
|
||||
stream->setstate(std::ios_base::failbit);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ TEST_F(sACNdataTest, stream_in) {
|
|||
e131_data[108] = priority;
|
||||
|
||||
// Universe
|
||||
uint16_t univ = 64000;
|
||||
uint16_t univ = 63999;
|
||||
e131_data[113] = univ >> 8; // high
|
||||
e131_data[114] = univ & 0xff; // low
|
||||
node.subscribe(univ);
|
||||
|
|
Loading…
Reference in New Issue