From 737e217172dd17d4516e484d64193d56ade315ce Mon Sep 17 00:00:00 2001 From: hsaturn Date: Wed, 5 Jan 2022 02:00:59 +0100 Subject: [PATCH] fix type return value --- src/TinyMqtt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TinyMqtt.h b/src/TinyMqtt.h index 30a2320..bc36e7e 100644 --- a/src/TinyMqtt.h +++ b/src/TinyMqtt.h @@ -111,7 +111,7 @@ class MqttMessage Type type() const { - return state == Complete ? static_cast(buffer[0]) : Unknown; + return state == Complete ? static_cast(buffer[0] & 0xF0) : Unknown; } uint8_t flags() const { return static_cast(buffer[0] & 0x0F); }