github.com/bluenviron/gomavlib/v2@v2.2.1-0.20240308101627-2c07e3da629c/pkg/message/message.go (about) 1 // Package message contains the message definition and its parser. 2 package message 3 4 // Message is the interface that must be implemented by all Mavlink messages. 5 // Furthermore, any message struct must be labeled "MessageNameOfMessage". 6 type Message interface { 7 GetID() uint32 8 } 9 10 // MessageRaw is a special struct that contains an unencoded message. 11 // It is used: 12 // 13 // * as intermediate step in the encoding/decoding process 14 // 15 // * when the parser receives an unknown message 16 type MessageRaw struct { //nolint:revive 17 ID uint32 18 Payload []byte 19 } 20 21 // GetID implements the Message interface. 22 func (m *MessageRaw) GetID() uint32 { 23 return m.ID 24 }