// Pack returns a packed byte array which represents a NamedValueInt payload
519245
func (m *NamedValueInt) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS)
	binary.Write(data, binary.LittleEndian, m.VALUE)
	binary.Write(data, binary.LittleEndian, m.NAME)
	return data.Bytes()
}
858964
func (m *SerialControl) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.BAUDRATE)
	binary.Write(data, binary.LittleEndian, m.TIMEOUT)
	binary.Write(data, binary.LittleEndian, m.DEVICE)
	binary.Write(data, binary.LittleEndian, m.FLAGS)
	binary.Write(data, binary.LittleEndian, m.COUNT)
	binary.Write(data, binary.LittleEndian, m.DATA)
	return data.Bytes()
}
794750
func (m *LocalPositionSetpoint) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.X)
	binary.Write(data, binary.LittleEndian, m.Y)
	binary.Write(data, binary.LittleEndian, m.Z)
	binary.Write(data, binary.LittleEndian, m.YAW)
	binary.Write(data, binary.LittleEndian, m.COORDINATE_FRAME)
	return data.Bytes()
}
554730
func (m *DistanceSensor) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS)
	binary.Write(data, binary.LittleEndian, m.MIN_DISTANCE)
	binary.Write(data, binary.LittleEndian, m.MAX_DISTANCE)
	binary.Write(data, binary.LittleEndian, m.CURRENT_DISTANCE)
	binary.Write(data, binary.LittleEndian, m.TYPE)
	binary.Write(data, binary.LittleEndian, m.ID)
	binary.Write(data, binary.LittleEndian, m.ORIENTATION)
	binary.Write(data, binary.LittleEndian, m.COVARIANCE)
	return data.Bytes()
}
359884
func (m *HighresImu) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_USEC)
	binary.Write(data, binary.LittleEndian, m.XACC)
	binary.Write(data, binary.LittleEndian, m.YACC)
	binary.Write(data, binary.LittleEndian, m.ZACC)
	binary.Write(data, binary.LittleEndian, m.XGYRO)
	binary.Write(data, binary.LittleEndian, m.YGYRO)
	binary.Write(data, binary.LittleEndian, m.ZGYRO)
	binary.Write(data, binary.LittleEndian, m.XMAG)
	binary.Write(data, binary.LittleEndian, m.YMAG)
	binary.Write(data, binary.LittleEndian, m.ZMAG)
	binary.Write(data, binary.LittleEndian, m.ABS_PRESSURE)
	binary.Write(data, binary.LittleEndian, m.DIFF_PRESSURE)
	binary.Write(data, binary.LittleEndian, m.PRESSURE_ALT)
	binary.Write(data, binary.LittleEndian, m.TEMPERATURE)
	binary.Write(data, binary.LittleEndian, m.FIELDS_UPDATED)
	return data.Bytes()
}
1272584
func (m *Setpoint8Dof) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.VAL1)
	binary.Write(data, binary.LittleEndian, m.VAL2)
	binary.Write(data, binary.LittleEndian, m.VAL3)
	binary.Write(data, binary.LittleEndian, m.VAL4)
	binary.Write(data, binary.LittleEndian, m.VAL5)
	binary.Write(data, binary.LittleEndian, m.VAL6)
	binary.Write(data, binary.LittleEndian, m.VAL7)
	binary.Write(data, binary.LittleEndian, m.VAL8)
	binary.Write(data, binary.LittleEndian, m.TARGET_SYSTEM)
	return data.Bytes()
}
329706
func (m *SetGpsGlobalOrigin) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.LATITUDE)
	binary.Write(data, binary.LittleEndian, m.LONGITUDE)
	binary.Write(data, binary.LittleEndian, m.ALTITUDE)
	binary.Write(data, binary.LittleEndian, m.TARGET_SYSTEM)
	return data.Bytes()
}
1197991
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()
}
196540
func (m *DebugVect) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_USEC)
	binary.Write(data, binary.LittleEndian, m.X)
	binary.Write(data, binary.LittleEndian, m.Y)
	binary.Write(data, binary.LittleEndian, m.Z)
	binary.Write(data, binary.LittleEndian, m.NAME)
	return data.Bytes()
}
277167
func PackBytesGzip(box string, name string, bb []byte) error {
	// TODO: this function never did what it was supposed to do!
	PackBytes(box, name, bb)
	return nil
}
738633
func (m *MissionItem) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.PARAM1)
	binary.Write(data, binary.LittleEndian, m.PARAM2)
	binary.Write(data, binary.LittleEndian, m.PARAM3)
	binary.Write(data, binary.LittleEndian, m.PARAM4)
	binary.Write(data, binary.LittleEndian, m.X)
	binary.Write(data, binary.LittleEndian, m.Y)
	binary.Write(data, binary.LittleEndian, m.Z)
	binary.Write(data, binary.LittleEndian, m.SEQ)
	binary.Write(data, binary.LittleEndian, m.COMMAND)
	binary.Write(data, binary.LittleEndian, m.TARGET_SYSTEM)
	binary.Write(data, binary.LittleEndian, m.TARGET_COMPONENT)
	binary.Write(data, binary.LittleEndian, m.FRAME)
	binary.Write(data, binary.LittleEndian, m.CURRENT)
	binary.Write(data, binary.LittleEndian, m.AUTOCONTINUE)
	return data.Bytes()
}
1169805
func (m *HilOpticalFlow) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_USEC)
	binary.Write(data, binary.LittleEndian, m.FLOW_COMP_M_X)
	binary.Write(data, binary.LittleEndian, m.FLOW_COMP_M_Y)
	binary.Write(data, binary.LittleEndian, m.GROUND_DISTANCE)
	binary.Write(data, binary.LittleEndian, m.FLOW_X)
	binary.Write(data, binary.LittleEndian, m.FLOW_Y)
	binary.Write(data, binary.LittleEndian, m.SENSOR_ID)
	binary.Write(data, binary.LittleEndian, m.QUALITY)
	return data.Bytes()
}
262214
func (m *RcChannelsRaw) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS)
	binary.Write(data, binary.LittleEndian, m.CHAN1_RAW)
	binary.Write(data, binary.LittleEndian, m.CHAN2_RAW)
	binary.Write(data, binary.LittleEndian, m.CHAN3_RAW)
	binary.Write(data, binary.LittleEndian, m.CHAN4_RAW)
	binary.Write(data, binary.LittleEndian, m.CHAN5_RAW)
	binary.Write(data, binary.LittleEndian, m.CHAN6_RAW)
	binary.Write(data, binary.LittleEndian, m.CHAN7_RAW)
	binary.Write(data, binary.LittleEndian, m.CHAN8_RAW)
	binary.Write(data, binary.LittleEndian, m.PORT)
	binary.Write(data, binary.LittleEndian, m.RSSI)
	return data.Bytes()
}
145722
func (m *RollPitchYawSpeedThrustSetpoint) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS)
	binary.Write(data, binary.LittleEndian, m.ROLL_SPEED)
	binary.Write(data, binary.LittleEndian, m.PITCH_SPEED)
	binary.Write(data, binary.LittleEndian, m.YAW_SPEED)
	binary.Write(data, binary.LittleEndian, m.THRUST)
	return data.Bytes()
}
518185
func PackBytes(box string, name string, bb []byte) {
	gil.Lock()
	defer gil.Unlock()
	if _, ok := data[box]; !ok {
		data[box] = map[string][]byte{}
	}
	data[box][name] = bb
}
687455
func (m *OmnidirectionalFlow) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_USEC)
	binary.Write(data, binary.LittleEndian, m.FRONT_DISTANCE_M)
	binary.Write(data, binary.LittleEndian, m.LEFT)
	binary.Write(data, binary.LittleEndian, m.RIGHT)
	binary.Write(data, binary.LittleEndian, m.SENSOR_ID)
	binary.Write(data, binary.LittleEndian, m.QUALITY)
	return data.Bytes()
}
730476
func PackBytes(cmd BufferEx, b []byte) (int, error) {
	return packBytes(cmd, b)
}