Commit 1ca1bdf6c6f46c92d1e2dcc7af6d58e32c70bca8
1 parent
27b65bef
Use writeString helper in mqttpacket
Showing
1 changed file
with
1 additions
and
2 deletions
mqttpacket.cpp
| @@ -151,8 +151,7 @@ MqttPacket::MqttPacket(const ProtocolVersion protocolVersion, Publish &_publish) | @@ -151,8 +151,7 @@ MqttPacket::MqttPacket(const ProtocolVersion protocolVersion, Publish &_publish) | ||
| 151 | first_byte |= (_publish.qos << 1); | 151 | first_byte |= (_publish.qos << 1); |
| 152 | first_byte |= (static_cast<char>(_publish.retain) & 0b00000001); | 152 | first_byte |= (static_cast<char>(_publish.retain) & 0b00000001); |
| 153 | 153 | ||
| 154 | - writeUint16(publishData.topic.length()); | ||
| 155 | - writeBytes(publishData.topic.c_str(), publishData.topic.length()); | 154 | + writeString(publishData.topic); |
| 156 | 155 | ||
| 157 | if (publishData.qos) | 156 | if (publishData.qos) |
| 158 | { | 157 | { |