//autogenerated:yes
//nolint:revive,misspell,govet,lll,dupl,gocritic
package common

import (
	"fmt"
	"strconv"
)

type MAV_TUNNEL_PAYLOAD_TYPE uint64

const (
	// Encoding of payload unknown.
	MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN MAV_TUNNEL_PAYLOAD_TYPE = 0
	// Registered for STorM32 gimbal controller.
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 MAV_TUNNEL_PAYLOAD_TYPE = 200
	// Registered for STorM32 gimbal controller.
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 MAV_TUNNEL_PAYLOAD_TYPE = 201
	// Registered for STorM32 gimbal controller.
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 MAV_TUNNEL_PAYLOAD_TYPE = 202
	// Registered for STorM32 gimbal controller.
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 MAV_TUNNEL_PAYLOAD_TYPE = 203
	// Registered for STorM32 gimbal controller.
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 MAV_TUNNEL_PAYLOAD_TYPE = 204
	// Registered for STorM32 gimbal controller.
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 MAV_TUNNEL_PAYLOAD_TYPE = 205
	// Registered for STorM32 gimbal controller.
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 MAV_TUNNEL_PAYLOAD_TYPE = 206
	// Registered for STorM32 gimbal controller.
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 MAV_TUNNEL_PAYLOAD_TYPE = 207
	// Registered for STorM32 gimbal controller.
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 MAV_TUNNEL_PAYLOAD_TYPE = 208
	// Registered for STorM32 gimbal controller.
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 MAV_TUNNEL_PAYLOAD_TYPE = 209
	// Registered for ModalAI remote OSD protocol.
	MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD MAV_TUNNEL_PAYLOAD_TYPE = 210
	// Registered for ModalAI ESC UART passthru protocol.
	MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU MAV_TUNNEL_PAYLOAD_TYPE = 211
	// Registered for ModalAI vendor use.
	MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU MAV_TUNNEL_PAYLOAD_TYPE = 212
)

var value_to_label_MAV_TUNNEL_PAYLOAD_TYPE = map[MAV_TUNNEL_PAYLOAD_TYPE]string{
	MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN:                   "MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN",
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0:         "MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0",
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1:         "MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1",
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2:         "MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2",
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3:         "MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3",
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4:         "MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4",
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5:         "MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5",
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6:         "MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6",
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7:         "MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7",
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8:         "MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8",
	MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9:         "MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9",
	MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD:        "MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD",
	MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU: "MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU",
	MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU:  "MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU",
}

var label_to_value_MAV_TUNNEL_PAYLOAD_TYPE = map[string]MAV_TUNNEL_PAYLOAD_TYPE{
	"MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN":                   MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN,
	"MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0":         MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0,
	"MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1":         MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1,
	"MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2":         MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2,
	"MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3":         MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3,
	"MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4":         MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4,
	"MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5":         MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5,
	"MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6":         MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6,
	"MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7":         MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7,
	"MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8":         MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8,
	"MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9":         MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9,
	"MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD":        MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD,
	"MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU": MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU,
	"MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU":  MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU,
}

// MarshalText implements the encoding.TextMarshaler interface.
func (e MAV_TUNNEL_PAYLOAD_TYPE) MarshalText() ([]byte, error) {
	if name, ok := value_to_label_MAV_TUNNEL_PAYLOAD_TYPE[e]; ok {
		return []byte(name), nil
	}
	return []byte(strconv.Itoa(int(e))), nil
}

// UnmarshalText implements the encoding.TextUnmarshaler interface.
func (e *MAV_TUNNEL_PAYLOAD_TYPE) UnmarshalText(text []byte) error {
	if value, ok := label_to_value_MAV_TUNNEL_PAYLOAD_TYPE[string(text)]; ok {
		*e = value
	} else if value, err := strconv.Atoi(string(text)); err == nil {
		*e = MAV_TUNNEL_PAYLOAD_TYPE(value)
	} else {
		return fmt.Errorf("invalid label '%s'", text)
	}
	return nil
}

// String implements the fmt.Stringer interface.
func (e MAV_TUNNEL_PAYLOAD_TYPE) String() string {
	val, _ := e.MarshalText()
	return string(val)
}
