/* Encodes and sends messages that contain only message id in the variable header.  */
static int mqtt_message_id_only_enc(uint8_t message_type, uint16_t message_id, struct buf_ctx *buf)
/* Encodes and sends messages that contain only message id in the variable header.  */
static int mqtt_message_id_only_enc(uint8_t message_type, uint16_t message_id, struct buf_ctx *buf)
{
	int err_code;
	uint8_t *start;
	if (message_id == 0U) {
		return -EINVAL;
	}
	buf->cur += MQTT_FIXED_HEADER_MAX_SIZE;
	start = buf->cur;
	err_code = pack_uint16(message_id, buf);
	if (err_code != 0) {
		return err_code;
	}
	return mqtt_encode_fixed_header(message_type, start, buf);
}