func (m *Ping) Decode(buf []byte) {
	data := bytes.NewBuffer(buf)
	binary.Read(data, binary.LittleEndian, &m.TIME_USEC)
	binary.Read(data, binary.LittleEndian, &m.SEQ)
	binary.Read(data, binary.LittleEndian, &m.TARGET_SYSTEM)
	binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT)
}
Decode accepts a packed byte array and populates the fields of the Ping
package mavlink
import (
	"bytes"
	"encoding/binary"
	"fmt"
)
var messages = map[uint8]MAVLinkMessage{
	0:   &Heartbeat{},
	1:   &SysStatus{},
	2:   &SystemTime{},
	4:   &Ping{},
	5:   &ChangeOperatorControl{},
	6:   &ChangeOperatorControlAck{},
	7:   &AuthKey{},
	11:  &SetMode{},
	20:  &ParamRequestRead{},
	21:  &ParamRequestList{},
	22:  &ParamValue{},
	23:  &ParamSet{},
	24:  &GpsRawInt{},
	25:  &GpsStatus{},
	26:  &ScaledImu{},
	27:  &RawImu{},
	28:  &RawPressure{},
	29:  &ScaledPressure{},
	30:  &Attitude{},
	31:  &AttitudeQuaternion{},
	32:  &LocalPositionNed{},
	33:  &GlobalPositionInt{},
	34:  &RcChannelsScaled{},
	35:  &RcChannelsRaw{},
	36:  &ServoOutputRaw{},
	37:  &MissionRequestPartialList{},
	38:  &MissionWritePartialList{},
	39:  &MissionItem{},
	40:  &MissionRequest{},
	41:  &MissionSetCurrent{},
	42:  &MissionCurrent{},
	43:  &MissionRequestList{},
	44:  &MissionCount{},
	45:  &MissionClearAll{},
	46:  &MissionItemReached{},
	47:  &MissionAck{},
	48:  &SetGpsGlobalOrigin{},
	49:  &GpsGlobalOrigin{},
	50:  &SetLocalPositionSetpoint{},
	51:  &LocalPositionSetpoint{},
	52:  &GlobalPositionSetpointInt{},
	53:  &SetGlobalPositionSetpointInt{},
	54:  &SafetySetAllowedArea{},
	55:  &SafetyAllowedArea{},
	56:  &SetRollPitchYawThrust{},
	57:  &SetRollPitchYawSpeedThrust{},
	58:  &RollPitchYawThrustSetpoint{},
	59:  &RollPitchYawSpeedThrustSetpoint{},
	60:  &SetQuadMotorsSetpoint{},
	61:  &SetQuadSwarmRollPitchYawThrust{},
	62:  &NavControllerOutput{},
	63:  &SetQuadSwarmLedRollPitchYawThrust{},
	64:  &StateCorrection{},
	65:  &RcChannels{},
	66:  &RequestDataStream{},
	67:  &DataStream{},
	69:  &ManualControl{},
	70:  &RcChannelsOverride{},
	74:  &VfrHud{},
	76:  &CommandLong{},
	77:  &CommandAck{},
	80:  &RollPitchYawRatesThrustSetpoint{},
	81:  &ManualSetpoint{},
	82:  &AttitudeSetpointExternal{},
	83:  &LocalNedPositionSetpointExternal{},
	84:  &GlobalPositionSetpointExternalInt{},
	89:  &LocalPositionNedSystemGlobalOffset{},
	90:  &HilState{},
	91:  &HilControls{},
	92:  &HilRcInputsRaw{},
	100: &OpticalFlow{},
	101: &GlobalVisionPositionEstimate{},
	102: &VisionPositionEstimate{},
	103: &VisionSpeedEstimate{},
	104: &ViconPositionEstimate{},
	105: &HighresImu{},
	106: &OmnidirectionalFlow{},
	107: &HilSensor{},
	108: &SimState{},
	109: &RadioStatus{},
	110: &FileTransferStart{},
	111: &FileTransferDirList{},
	112: &FileTransferRes{},
	113: &HilGps{},
	114: &HilOpticalFlow{},
	115: &HilStateQuaternion{},
	116: &ScaledImu2{},
	117: &LogRequestList{},
	118: &LogEntry{},
	119: &LogRequestData{},
	120: &LogData{},
	121: &LogErase{},
	122: &LogRequestEnd{},
	123: &GpsInjectData{},
	124: &Gps2Raw{},
	125: &PowerStatus{},
	126: &SerialControl{},
	127: &GpsRtk{},
	128: &Gps2Rtk{},
	130: &DataTransmissionHandshake{},
	131: &EncapsulatedData{},
	132: &DistanceSensor{},
	133: &TerrainRequest{},
	134: &TerrainData{},
	135: &TerrainCheck{},
	136: &TerrainReport{},
	147: &BatteryStatus{},
	148: &Setpoint8Dof{},
	149: &Setpoint6Dof{},
	249: &MemoryVect{},
	250: &DebugVect{},
	251: &NamedValueFloat{},
	252: &NamedValueInt{},
	253: &Statustext{},
	254: &Debug{},
}
func NewMAVLinkMessage(msgid uint8, data []byte) (MAVLinkMessage, error) {
	message := messages[msgid]
	if message != nil {
		message.Decode(data)
		return message, nil
	}
	return nil, fmt.Errorf("Unknown Message ID: %v", msgid)
}
const (
	MAV_AUTOPILOT_GENERIC                                      = 0   
	MAV_AUTOPILOT_PIXHAWK                                      = 1   
	MAV_AUTOPILOT_SLUGS                                        = 2   
	MAV_AUTOPILOT_ARDUPILOTMEGA                                = 3   
	MAV_AUTOPILOT_OPENPILOT                                    = 4   
	MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY                       = 5   
	MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6   
	MAV_AUTOPILOT_GENERIC_MISSION_FULL                         = 7   
	MAV_AUTOPILOT_INVALID                                      = 8   
	MAV_AUTOPILOT_PPZ                                          = 9   
	MAV_AUTOPILOT_UDB                                          = 10  
	MAV_AUTOPILOT_FP                                           = 11  
	MAV_AUTOPILOT_PX4                                          = 12  
	MAV_AUTOPILOT_SMACCMPILOT                                  = 13  
	MAV_AUTOPILOT_AUTOQUAD                                     = 14  
	MAV_AUTOPILOT_ARMAZILA                                     = 15  
	MAV_AUTOPILOT_AEROB                                        = 16  
	MAV_AUTOPILOT_ENUM_END                                     = 17  
)
const (
	MAV_TYPE_GENERIC            = 0   
	MAV_TYPE_FIXED_WING         = 1   
	MAV_TYPE_QUADROTOR          = 2   
	MAV_TYPE_COAXIAL            = 3   
	MAV_TYPE_HELICOPTER         = 4   
	MAV_TYPE_ANTENNA_TRACKER    = 5   
	MAV_TYPE_GCS                = 6   
	MAV_TYPE_AIRSHIP            = 7   
	MAV_TYPE_FREE_BALLOON       = 8   
	MAV_TYPE_ROCKET             = 9   
	MAV_TYPE_GROUND_ROVER       = 10  
	MAV_TYPE_SURFACE_BOAT       = 11  
	MAV_TYPE_SUBMARINE          = 12  
	MAV_TYPE_HEXAROTOR          = 13  
	MAV_TYPE_OCTOROTOR          = 14  
	MAV_TYPE_TRICOPTER          = 15  
	MAV_TYPE_FLAPPING_WING      = 16  
	MAV_TYPE_KITE               = 17  
	MAV_TYPE_ONBOARD_CONTROLLER = 18  
	MAV_TYPE_ENUM_END           = 19  
)
const (
	MAV_MODE_FLAG_CUSTOM_MODE_ENABLED  = 1    
	MAV_MODE_FLAG_TEST_ENABLED         = 2    
	MAV_MODE_FLAG_AUTO_ENABLED         = 4    
	MAV_MODE_FLAG_GUIDED_ENABLED       = 8    
	MAV_MODE_FLAG_STABILIZE_ENABLED    = 16   
	MAV_MODE_FLAG_HIL_ENABLED          = 32   
	MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64   
	MAV_MODE_FLAG_SAFETY_ARMED         = 128  
	MAV_MODE_FLAG_ENUM_END             = 129  
)
const (
	MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1    
	MAV_MODE_FLAG_DECODE_POSITION_TEST        = 2    
	MAV_MODE_FLAG_DECODE_POSITION_AUTO        = 4    
	MAV_MODE_FLAG_DECODE_POSITION_GUIDED      = 8    
	MAV_MODE_FLAG_DECODE_POSITION_STABILIZE   = 16   
	MAV_MODE_FLAG_DECODE_POSITION_HIL         = 32   
	MAV_MODE_FLAG_DECODE_POSITION_MANUAL      = 64   
	MAV_MODE_FLAG_DECODE_POSITION_SAFETY      = 128  
	MAV_MODE_FLAG_DECODE_POSITION_ENUM_END    = 129  
)
const (
	MAV_GOTO_DO_HOLD                    = 0  
	MAV_GOTO_DO_CONTINUE                = 1  
	MAV_GOTO_HOLD_AT_CURRENT_POSITION   = 2  
	MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3  
	MAV_GOTO_ENUM_END                   = 4  
)
const (
	MAV_MODE_PREFLIGHT          = 0    
	MAV_MODE_MANUAL_DISARMED    = 64   
	MAV_MODE_TEST_DISARMED      = 66   
	MAV_MODE_STABILIZE_DISARMED = 80   
	MAV_MODE_GUIDED_DISARMED    = 88   
	MAV_MODE_AUTO_DISARMED      = 92   
	MAV_MODE_MANUAL_ARMED       = 192  
	MAV_MODE_TEST_ARMED         = 194  
	MAV_MODE_STABILIZE_ARMED    = 208  
	MAV_MODE_GUIDED_ARMED       = 216  
	MAV_MODE_AUTO_ARMED         = 220  
	MAV_MODE_ENUM_END           = 221  
)
const (
	MAV_STATE_UNINIT      = 0  
	MAV_STATE_BOOT        = 1  
	MAV_STATE_CALIBRATING = 2  
	MAV_STATE_STANDBY     = 3  
	MAV_STATE_ACTIVE      = 4  
	MAV_STATE_CRITICAL    = 5  
	MAV_STATE_EMERGENCY   = 6  
	MAV_STATE_POWEROFF    = 7  
	MAV_STATE_ENUM_END    = 8  
)
const (
	MAV_COMP_ID_ALL            = 0    
	MAV_COMP_ID_CAMERA         = 100  
	MAV_COMP_ID_SERVO1         = 140  
	MAV_COMP_ID_SERVO2         = 141  
	MAV_COMP_ID_SERVO3         = 142  
	MAV_COMP_ID_SERVO4         = 143  
	MAV_COMP_ID_SERVO5         = 144  
	MAV_COMP_ID_SERVO6         = 145  
	MAV_COMP_ID_SERVO7         = 146  
	MAV_COMP_ID_SERVO8         = 147  
	MAV_COMP_ID_SERVO9         = 148  
	MAV_COMP_ID_SERVO10        = 149  
	MAV_COMP_ID_SERVO11        = 150  
	MAV_COMP_ID_SERVO12        = 151  
	MAV_COMP_ID_SERVO13        = 152  
	MAV_COMP_ID_SERVO14        = 153  
	MAV_COMP_ID_MAPPER         = 180  
	MAV_COMP_ID_MISSIONPLANNER = 190  
	MAV_COMP_ID_PATHPLANNER    = 195  
	MAV_COMP_ID_IMU            = 200  
	MAV_COMP_ID_IMU_2          = 201  
	MAV_COMP_ID_IMU_3          = 202  
	MAV_COMP_ID_GPS            = 220  
	MAV_COMP_ID_UDP_BRIDGE     = 240  
	MAV_COMP_ID_UART_BRIDGE    = 241  
	MAV_COMP_ID_SYSTEM_CONTROL = 250  
	MAV_COMPONENT_ENUM_END     = 251  
)
const (
	MAV_SYS_STATUS_SENSOR_3D_GYRO                = 1        
	MAV_SYS_STATUS_SENSOR_3D_ACCEL               = 2        
	MAV_SYS_STATUS_SENSOR_3D_MAG                 = 4        
	MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE      = 8        
	MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE  = 16       
	MAV_SYS_STATUS_SENSOR_GPS                    = 32       
	MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW           = 64       
	MAV_SYS_STATUS_SENSOR_VISION_POSITION        = 128      
	MAV_SYS_STATUS_SENSOR_LASER_POSITION         = 256      
	MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH  = 512      
	MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL   = 1024     
	MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048     
	MAV_SYS_STATUS_SENSOR_YAW_POSITION           = 4096     
	MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL     = 8192     
	MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL    = 16384    
	MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS          = 32768    
	MAV_SYS_STATUS_SENSOR_RC_RECEIVER            = 65536    
	MAV_SYS_STATUS_SENSOR_3D_GYRO2               = 131072   
	MAV_SYS_STATUS_SENSOR_3D_ACCEL2              = 262144   
	MAV_SYS_STATUS_SENSOR_3D_MAG2                = 524288   
	MAV_SYS_STATUS_GEOFENCE                      = 1048576  
	MAV_SYS_STATUS_AHRS                          = 2097152  
	MAV_SYS_STATUS_TERRAIN                       = 4194304  
	MAV_SYS_STATUS_SENSOR_ENUM_END               = 4194305  
)
const (
	MAV_FRAME_GLOBAL                  = 0   
	MAV_FRAME_LOCAL_NED               = 1   
	MAV_FRAME_MISSION                 = 2   
	MAV_FRAME_GLOBAL_RELATIVE_ALT     = 3   
	MAV_FRAME_LOCAL_ENU               = 4   
	MAV_FRAME_GLOBAL_INT              = 5   
	MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6   
	MAV_FRAME_LOCAL_OFFSET_NED        = 7   
	MAV_FRAME_BODY_NED                = 8   
	MAV_FRAME_BODY_OFFSET_NED         = 9   
	MAV_FRAME_GLOBAL_TERRAIN_ALT      = 10  
	MAV_FRAME_ENUM_END                = 11  
)
const (
	MAVLINK_DATA_STREAM_IMG_JPEG      = 1  
	MAVLINK_DATA_STREAM_IMG_BMP       = 2  
	MAVLINK_DATA_STREAM_IMG_RAW8U     = 3  
	MAVLINK_DATA_STREAM_IMG_RAW32U    = 4  
	MAVLINK_DATA_STREAM_IMG_PGM       = 5  
	MAVLINK_DATA_STREAM_IMG_PNG       = 6  
	MAVLINK_DATA_STREAM_TYPE_ENUM_END = 7  
)
const (
	FENCE_ACTION_NONE            = 0  
	FENCE_ACTION_GUIDED          = 1  
	FENCE_ACTION_REPORT          = 2  
	FENCE_ACTION_GUIDED_THR_PASS = 3  
	FENCE_ACTION_ENUM_END        = 4  
)
const (
	FENCE_BREACH_NONE     = 0  
	FENCE_BREACH_MINALT   = 1  
	FENCE_BREACH_MAXALT   = 2  
	FENCE_BREACH_BOUNDARY = 3  
	FENCE_BREACH_ENUM_END = 4  
)
const (
	MAV_MOUNT_MODE_RETRACT           = 0  
	MAV_MOUNT_MODE_NEUTRAL           = 1  
	MAV_MOUNT_MODE_MAVLINK_TARGETING = 2  
	MAV_MOUNT_MODE_RC_TARGETING      = 3  
	MAV_MOUNT_MODE_GPS_POINT         = 4  
	MAV_MOUNT_MODE_ENUM_END          = 5  
)
const (
	MAV_CMD_NAV_WAYPOINT                 = 16   
	MAV_CMD_NAV_LOITER_UNLIM             = 17   
	MAV_CMD_NAV_LOITER_TURNS             = 18   
	MAV_CMD_NAV_LOITER_TIME              = 19   
	MAV_CMD_NAV_RETURN_TO_LAUNCH         = 20   
	MAV_CMD_NAV_LAND                     = 21   
	MAV_CMD_NAV_TAKEOFF                  = 22   
	MAV_CMD_NAV_ROI                      = 80   
	MAV_CMD_NAV_PATHPLANNING             = 81   
	MAV_CMD_NAV_SPLINE_WAYPOINT          = 82   
	MAV_CMD_NAV_GUIDED_ENABLE            = 92   
	MAV_CMD_NAV_LAST                     = 95   
	MAV_CMD_CONDITION_DELAY              = 112  
	MAV_CMD_CONDITION_CHANGE_ALT         = 113  
	MAV_CMD_CONDITION_DISTANCE           = 114  
	MAV_CMD_CONDITION_YAW                = 115  
	MAV_CMD_CONDITION_LAST               = 159  
	MAV_CMD_DO_SET_MODE                  = 176  
	MAV_CMD_DO_JUMP                      = 177  
	MAV_CMD_DO_CHANGE_SPEED              = 178  
	MAV_CMD_DO_SET_HOME                  = 179  
	MAV_CMD_DO_SET_PARAMETER             = 180  
	MAV_CMD_DO_SET_RELAY                 = 181  
	MAV_CMD_DO_REPEAT_RELAY              = 182  
	MAV_CMD_DO_SET_SERVO                 = 183  
	MAV_CMD_DO_REPEAT_SERVO              = 184  
	MAV_CMD_DO_FLIGHTTERMINATION         = 185  
	MAV_CMD_DO_RALLY_LAND                = 190  
	MAV_CMD_DO_GO_AROUND                 = 191  
	MAV_CMD_DO_CONTROL_VIDEO             = 200  
	MAV_CMD_DO_SET_ROI                   = 201  
	MAV_CMD_DO_DIGICAM_CONFIGURE         = 202  
	MAV_CMD_DO_DIGICAM_CONTROL           = 203  
	MAV_CMD_DO_MOUNT_CONFIGURE           = 204  
	MAV_CMD_DO_MOUNT_CONTROL             = 205  
	MAV_CMD_DO_SET_CAM_TRIGG_DIST        = 206  
	MAV_CMD_DO_FENCE_ENABLE              = 207  
	MAV_CMD_DO_PARACHUTE                 = 208  
	MAV_CMD_DO_INVERTED_FLIGHT           = 210  
	MAV_CMD_DO_MOUNT_CONTROL_QUAT        = 220  
	MAV_CMD_DO_GUIDED_MASTER             = 221  
	MAV_CMD_DO_GUIDED_LIMITS             = 222  
	MAV_CMD_DO_LAST                      = 240  
	MAV_CMD_PREFLIGHT_CALIBRATION        = 241  
	MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242  
	MAV_CMD_PREFLIGHT_STORAGE            = 245  
	MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN    = 246  
	MAV_CMD_OVERRIDE_GOTO                = 252  
	MAV_CMD_MISSION_START                = 300  
	MAV_CMD_COMPONENT_ARM_DISARM         = 400  
	MAV_CMD_START_RX_PAIR                = 500  
	MAV_CMD_ENUM_END                     = 501  
)
const (
	MAV_DATA_STREAM_ALL             = 0   
	MAV_DATA_STREAM_RAW_SENSORS     = 1   
	MAV_DATA_STREAM_EXTENDED_STATUS = 2   
	MAV_DATA_STREAM_RC_CHANNELS     = 3   
	MAV_DATA_STREAM_RAW_CONTROLLER  = 4   
	MAV_DATA_STREAM_POSITION        = 6   
	MAV_DATA_STREAM_EXTRA1          = 10  
	MAV_DATA_STREAM_EXTRA2          = 11  
	MAV_DATA_STREAM_EXTRA3          = 12  
	MAV_DATA_STREAM_ENUM_END        = 13  
)
const (
	MAV_ROI_NONE     = 0  
	MAV_ROI_WPNEXT   = 1  
	MAV_ROI_WPINDEX  = 2  
	MAV_ROI_LOCATION = 3  
	MAV_ROI_TARGET   = 4  
	MAV_ROI_ENUM_END = 5  
)
const (
	MAV_CMD_ACK_OK                                 = 1   
	MAV_CMD_ACK_ERR_FAIL                           = 2   
	MAV_CMD_ACK_ERR_ACCESS_DENIED                  = 3   
	MAV_CMD_ACK_ERR_NOT_SUPPORTED                  = 4   
	MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED = 5   
	MAV_CMD_ACK_ERR_COORDINATES_OUT_OF_RANGE       = 6   
	MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE             = 7   
	MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE             = 8   
	MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE             = 9   
	MAV_CMD_ACK_ENUM_END                           = 10  
)
const (
	MAV_PARAM_TYPE_UINT8    = 1   
	MAV_PARAM_TYPE_INT8     = 2   
	MAV_PARAM_TYPE_UINT16   = 3   
	MAV_PARAM_TYPE_INT16    = 4   
	MAV_PARAM_TYPE_UINT32   = 5   
	MAV_PARAM_TYPE_INT32    = 6   
	MAV_PARAM_TYPE_UINT64   = 7   
	MAV_PARAM_TYPE_INT64    = 8   
	MAV_PARAM_TYPE_REAL32   = 9   
	MAV_PARAM_TYPE_REAL64   = 10  
	MAV_PARAM_TYPE_ENUM_END = 11  
)
const (
	MAV_RESULT_ACCEPTED             = 0  
	MAV_RESULT_TEMPORARILY_REJECTED = 1  
	MAV_RESULT_DENIED               = 2  
	MAV_RESULT_UNSUPPORTED          = 3  
	MAV_RESULT_FAILED               = 4  
	MAV_RESULT_ENUM_END             = 5  
)
const (
	MAV_MISSION_ACCEPTED          = 0   
	MAV_MISSION_ERROR             = 1   
	MAV_MISSION_UNSUPPORTED_FRAME = 2   
	MAV_MISSION_UNSUPPORTED       = 3   
	MAV_MISSION_NO_SPACE          = 4   
	MAV_MISSION_INVALID           = 5   
	MAV_MISSION_INVALID_PARAM1    = 6   
	MAV_MISSION_INVALID_PARAM2    = 7   
	MAV_MISSION_INVALID_PARAM3    = 8   
	MAV_MISSION_INVALID_PARAM4    = 9   
	MAV_MISSION_INVALID_PARAM5_X  = 10  
	MAV_MISSION_INVALID_PARAM6_Y  = 11  
	MAV_MISSION_INVALID_PARAM7    = 12  
	MAV_MISSION_INVALID_SEQUENCE  = 13  
	MAV_MISSION_DENIED            = 14  
	MAV_MISSION_RESULT_ENUM_END   = 15  
)
const (
	MAV_SEVERITY_EMERGENCY = 0  
	MAV_SEVERITY_ALERT     = 1  
	MAV_SEVERITY_CRITICAL  = 2  
	MAV_SEVERITY_ERROR     = 3  
	MAV_SEVERITY_WARNING   = 4  
	MAV_SEVERITY_NOTICE    = 5  
	MAV_SEVERITY_INFO      = 6  
	MAV_SEVERITY_DEBUG     = 7  
	MAV_SEVERITY_ENUM_END  = 8  
)
const (
	MAV_POWER_STATUS_BRICK_VALID                = 1   
	MAV_POWER_STATUS_SERVO_VALID                = 2   
	MAV_POWER_STATUS_USB_CONNECTED              = 4   
	MAV_POWER_STATUS_PERIPH_OVERCURRENT         = 8   
	MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16  
	MAV_POWER_STATUS_CHANGED                    = 32  
	MAV_POWER_STATUS_ENUM_END                   = 33  
)
const (
	SERIAL_CONTROL_DEV_TELEM1   = 0  
	SERIAL_CONTROL_DEV_TELEM2   = 1  
	SERIAL_CONTROL_DEV_GPS1     = 2  
	SERIAL_CONTROL_DEV_GPS2     = 3  
	SERIAL_CONTROL_DEV_ENUM_END = 4  
)
const (
	SERIAL_CONTROL_FLAG_REPLY     = 1   
	SERIAL_CONTROL_FLAG_RESPOND   = 2   
	SERIAL_CONTROL_FLAG_EXCLUSIVE = 4   
	SERIAL_CONTROL_FLAG_BLOCKING  = 8   
	SERIAL_CONTROL_FLAG_MULTI     = 16  
	SERIAL_CONTROL_FLAG_ENUM_END  = 17  
)
const (
	MAV_DISTANCE_SENSOR_LASER      = 0  
	MAV_DISTANCE_SENSOR_ULTRASOUND = 1  
	MAV_DISTANCE_SENSOR_ENUM_END   = 2  
)
type Heartbeat struct {
	CUSTOM_MODE     uint32  
	TYPE            uint8   
	AUTOPILOT       uint8   
	BASE_MODE       uint8   
	SYSTEM_STATUS   uint8   
	MAVLINK_VERSION uint8   
}
func NewHeartbeat(CUSTOM_MODE uint32, TYPE uint8, AUTOPILOT uint8, BASE_MODE uint8, SYSTEM_STATUS uint8, MAVLINK_VERSION uint8) *Heartbeat {
	m := Heartbeat{}
	m.CUSTOM_MODE = CUSTOM_MODE
	m.TYPE = TYPE
	m.AUTOPILOT = AUTOPILOT
	m.BASE_MODE = BASE_MODE
	m.SYSTEM_STATUS = SYSTEM_STATUS
	m.MAVLINK_VERSION = MAVLINK_VERSION
	return &m
}
func (*Heartbeat) Id() uint8 {
	return 0
}
func (*Heartbeat) Len() uint8 {
	return 9
}
func (*Heartbeat) Crc() uint8 {
	return 50
}
func (m *Heartbeat) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.CUSTOM_MODE)
	binary.Write(data, binary.LittleEndian, m.TYPE)
	binary.Write(data, binary.LittleEndian, m.AUTOPILOT)
	binary.Write(data, binary.LittleEndian, m.BASE_MODE)
	binary.Write(data, binary.LittleEndian, m.SYSTEM_STATUS)
	binary.Write(data, binary.LittleEndian, m.MAVLINK_VERSION)
	return data.Bytes()
}
func (m *Heartbeat) Decode(buf []byte) {
	data := bytes.NewBuffer(buf)
	binary.Read(data, binary.LittleEndian, &m.CUSTOM_MODE)
	binary.Read(data, binary.LittleEndian, &m.TYPE)
	binary.Read(data, binary.LittleEndian, &m.AUTOPILOT)
	binary.Read(data, binary.LittleEndian, &m.BASE_MODE)
	binary.Read(data, binary.LittleEndian, &m.SYSTEM_STATUS)
	binary.Read(data, binary.LittleEndian, &m.MAVLINK_VERSION)
}
const ()
type SysStatus struct {
	ONBOARD_CONTROL_SENSORS_PRESENT uint32  
	ONBOARD_CONTROL_SENSORS_ENABLED uint32  
	ONBOARD_CONTROL_SENSORS_HEALTH  uint32  
	LOAD                            uint16  
	VOLTAGE_BATTERY                 uint16  
	CURRENT_BATTERY                 int16   
	DROP_RATE_COMM                  uint16  
	ERRORS_COMM                     uint16  
	ERRORS_COUNT1                   uint16  
	ERRORS_COUNT2                   uint16  
	ERRORS_COUNT3                   uint16  
	ERRORS_COUNT4                   uint16  
	BATTERY_REMAINING               int8    
}
func NewSysStatus(ONBOARD_CONTROL_SENSORS_PRESENT uint32, ONBOARD_CONTROL_SENSORS_ENABLED uint32, ONBOARD_CONTROL_SENSORS_HEALTH uint32, LOAD uint16, VOLTAGE_BATTERY uint16, CURRENT_BATTERY int16, DROP_RATE_COMM uint16, ERRORS_COMM uint16, ERRORS_COUNT1 uint16, ERRORS_COUNT2 uint16, ERRORS_COUNT3 uint16, ERRORS_COUNT4 uint16, BATTERY_REMAINING int8) *SysStatus {
	m := SysStatus{}
	m.ONBOARD_CONTROL_SENSORS_PRESENT = ONBOARD_CONTROL_SENSORS_PRESENT
	m.ONBOARD_CONTROL_SENSORS_ENABLED = ONBOARD_CONTROL_SENSORS_ENABLED
	m.ONBOARD_CONTROL_SENSORS_HEALTH = ONBOARD_CONTROL_SENSORS_HEALTH
	m.LOAD = LOAD
	m.VOLTAGE_BATTERY = VOLTAGE_BATTERY
	m.CURRENT_BATTERY = CURRENT_BATTERY
	m.DROP_RATE_COMM = DROP_RATE_COMM
	m.ERRORS_COMM = ERRORS_COMM
	m.ERRORS_COUNT1 = ERRORS_COUNT1
	m.ERRORS_COUNT2 = ERRORS_COUNT2
	m.ERRORS_COUNT3 = ERRORS_COUNT3
	m.ERRORS_COUNT4 = ERRORS_COUNT4
	m.BATTERY_REMAINING = BATTERY_REMAINING
	return &m
}
func (*SysStatus) Id() uint8 {
	return 1
}
func (*SysStatus) Len() uint8 {
	return 31
}
func (*SysStatus) Crc() uint8 {
	return 124
}
func (m *SysStatus) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.ONBOARD_CONTROL_SENSORS_PRESENT)
	binary.Write(data, binary.LittleEndian, m.ONBOARD_CONTROL_SENSORS_ENABLED)
	binary.Write(data, binary.LittleEndian, m.ONBOARD_CONTROL_SENSORS_HEALTH)
	binary.Write(data, binary.LittleEndian, m.LOAD)
	binary.Write(data, binary.LittleEndian, m.VOLTAGE_BATTERY)
	binary.Write(data, binary.LittleEndian, m.CURRENT_BATTERY)
	binary.Write(data, binary.LittleEndian, m.DROP_RATE_COMM)
	binary.Write(data, binary.LittleEndian, m.ERRORS_COMM)
	binary.Write(data, binary.LittleEndian, m.ERRORS_COUNT1)
	binary.Write(data, binary.LittleEndian, m.ERRORS_COUNT2)
	binary.Write(data, binary.LittleEndian, m.ERRORS_COUNT3)
	binary.Write(data, binary.LittleEndian, m.ERRORS_COUNT4)
	binary.Write(data, binary.LittleEndian, m.BATTERY_REMAINING)
	return data.Bytes()
}
func (m *SysStatus) Decode(buf []byte) {
	data := bytes.NewBuffer(buf)
	binary.Read(data, binary.LittleEndian, &m.ONBOARD_CONTROL_SENSORS_PRESENT)
	binary.Read(data, binary.LittleEndian, &m.ONBOARD_CONTROL_SENSORS_ENABLED)
	binary.Read(data, binary.LittleEndian, &m.ONBOARD_CONTROL_SENSORS_HEALTH)
	binary.Read(data, binary.LittleEndian, &m.LOAD)
	binary.Read(data, binary.LittleEndian, &m.VOLTAGE_BATTERY)
	binary.Read(data, binary.LittleEndian, &m.CURRENT_BATTERY)
	binary.Read(data, binary.LittleEndian, &m.DROP_RATE_COMM)
	binary.Read(data, binary.LittleEndian, &m.ERRORS_COMM)
	binary.Read(data, binary.LittleEndian, &m.ERRORS_COUNT1)
	binary.Read(data, binary.LittleEndian, &m.ERRORS_COUNT2)
	binary.Read(data, binary.LittleEndian, &m.ERRORS_COUNT3)
	binary.Read(data, binary.LittleEndian, &m.ERRORS_COUNT4)
	binary.Read(data, binary.LittleEndian, &m.BATTERY_REMAINING)
}
const ()
type SystemTime struct {
	TIME_UNIX_USEC uint64  
	TIME_BOOT_MS   uint32  
}
func NewSystemTime(TIME_UNIX_USEC uint64, TIME_BOOT_MS uint32) *SystemTime {
	m := SystemTime{}
	m.TIME_UNIX_USEC = TIME_UNIX_USEC
	m.TIME_BOOT_MS = TIME_BOOT_MS
	return &m
}
func (*SystemTime) Id() uint8 {
	return 2
}
func (*SystemTime) Len() uint8 {
	return 12
}
func (*SystemTime) Crc() uint8 {
	return 137
}
func (m *SystemTime) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_UNIX_USEC)
	binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS)
	return data.Bytes()
}
func (m *SystemTime) Decode(buf []byte) {
	data := bytes.NewBuffer(buf)
	binary.Read(data, binary.LittleEndian, &m.TIME_UNIX_USEC)
	binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS)
}
const ()
type Ping struct {
	TIME_USEC        uint64  
	SEQ              uint32  
	TARGET_SYSTEM    uint8   
	TARGET_COMPONENT uint8   
}
func NewPing(TIME_USEC uint64, SEQ uint32, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *Ping {
	m := Ping{}
	m.TIME_USEC = TIME_USEC
	m.SEQ = SEQ
	m.TARGET_SYSTEM = TARGET_SYSTEM
	m.TARGET_COMPONENT = TARGET_COMPONENT
	return &m
}
func (*Ping) Id() uint8 {
	return 4
}
func (*Ping) Len() uint8 {
	return 14
}
func (*Ping) Crc() uint8 {
	return 237
}
func (m *Ping) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_USEC)
	binary.Write(data, binary.LittleEndian, m.SEQ)
	binary.Write(data, binary.LittleEndian, m.TARGET_SYSTEM)
	binary.Write(data, binary.LittleEndian, m.TARGET_COMPONENT)
	return data.Bytes()
}