From b356d052b3c92d1d7ae5522237469c684d01a70d Mon Sep 17 00:00:00 2001 From: Kevin Matz Date: Wed, 1 Sep 2021 12:21:22 -0400 Subject: [PATCH] cast range types before writing --- protocols/dmp/dmp.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/protocols/dmp/dmp.cpp b/protocols/dmp/dmp.cpp index 6927c59..635a61d 100644 --- a/protocols/dmp/dmp.cpp +++ b/protocols/dmp/dmp.cpp @@ -56,11 +56,14 @@ void range::write_(PDU::Stream stream, const uint32_t& val) const { switch (type_.address_length) { case ONE: - stream->writeType(val); + *stream << static_cast(val); + break; case TWO: - stream->writeType(val); + *stream << static_cast(val); + break; case FOUR: - stream->writeType(val); + *stream << val; + break; default: break; }