add function to create new MQTTMessage

This commit is contained in:
Joel Wetzell
2026-02-09 23:17:53 -06:00
parent 060c12512c
commit 1d8baa8c17

View File

@@ -22,6 +22,15 @@ type MQTTMessageCreate struct {
Payload []byte Payload []byte
} }
func NewMQTTMessage(topic string, qos byte, retained bool, payload []byte) MQTTMessage {
return MQTTMessage{
topic: topic,
qos: qos,
retained: retained,
payload: payload,
}
}
func (mm MQTTMessage) Duplicate() bool { func (mm MQTTMessage) Duplicate() bool {
// TODO(jwetzell): implement? // TODO(jwetzell): implement?
return false return false