1
0
Fork 0

cast range types before writing

This commit is contained in:
Kevin Matz 2021-09-01 12:21:22 -04:00
parent 7c40861383
commit b356d052b3
1 changed files with 6 additions and 3 deletions

View File

@ -56,11 +56,14 @@ void range::write_(PDU::Stream stream, const uint32_t& val) const
{
switch (type_.address_length) {
case ONE:
stream->writeType<uint8_t>(val);
*stream << static_cast<uint8_t>(val);
break;
case TWO:
stream->writeType<uint16_t>(val);
*stream << static_cast<uint16_t>(val);
break;
case FOUR:
stream->writeType<uint32_t>(val);
*stream << val;
break;
default:
break;
}