func Publish(id int, msg *Message) *PublishPacket {
	return &PublishPacket{
		header: &FixedHeader{
			PacketType: PUBLISH,
			QoS:        msg.QoS,
			Retain:     msg.Retain,
		},
		ID:    id,
		Topic: msg.Topic,
		Data:  msg.Data,
	}
}
// Publish creates a new MQTT PUBLISH control packet.
Publish creates a new MQTT PUBLISH control packet.
// Publish creates a new MQTT PUBLISH control packet .
func Publish(id int, msg *Message) *PublishPacket {
	return &PublishPacket{
		header: &FixedHeader{
			PacketType: PUBLISH,
			QoS:        msg.QoS,
			Retain:     msg.Retain,
		},
		ID:    id,
		Topic: msg.Topic,
		Data:  msg.Data,
	}
}
func Publish ( id int , msg * Message ) * PublishPacket { return & PublishPacket { header : & FixedHeader { PacketType : PUBLISH , QoS : msg . QoS , Retain : msg . Retain , } , ID : id , Topic : msg . Topic , Data : msg . Data , } }
Publish creates a new MQTT PUBLISH control packet.
Publish creates a new MQTT PUBLISH control packet .