/* Determines the length of the MQTT publish packet that would be produced using the supplied parameters  */
static int publish_length(int qos, mqtt_string_t topicName, int payloadlen)
/* Determines the length of the MQTT publish packet that would be produced using the supplied parameters  */
static int publish_length(int qos, mqtt_string_t topicName, int payloadlen)
{
	int len = 0;
	len += 2 + mqtt_strlen(topicName) + payloadlen;
	if (qos > 0)
		len += 2;
	return len;
}