1 #include <marnav/seatalk/message_27.hpp>
3 namespace marnav::seatalk
6 message_27::message_27()
11 std::unique_ptr
<message
> message_27::parse(const raw
& data
)
13 check_size(data
, SIZE
);
15 std::unique_ptr
<message
> result
= std::make_unique
<message_27
>();
16 auto & msg
= static_cast<message_27
&>(*result
);
23 msg
.temperature_
= value
;
24 msg
.temperature_
-= 100;
29 raw
message_27::get_data() const
31 uint16_t value
= (temperature_
+ 100) & 0xffff;
33 return raw
{static_cast<uint8_t>(ID
), 0x01, static_cast<uint8_t>((value
>> 8) & 0xff),
34 static_cast<uint8_t>((value
>> 0) & 0xff)};