* The function also checks the validity of the packet.
* All returned pointers within the struct will point to parts of the provided buffer, so the buffer
* must not be discarded after the call.
+ * if the return value is positive, it is the topic string length.
*/
int mqtt_unpack_publish_packet(struct mqtt_publish_pkt* pkt, uint8_t* buf, uint32_t size)
{
if (pkt->message_size != 0) {
pkt->application_message = (buf + idx);
}
- return 0;
+ return topic_len;
}
/***************************************************************************** */