All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.divpundir.mavlink.definitions.common.MavBatteryFunction.kt Maven / Gradle / Ivy

The newest version!
package com.divpundir.mavlink.definitions.common

import com.divpundir.mavlink.api.GeneratedMavEnum
import com.divpundir.mavlink.api.GeneratedMavEnumEntry
import com.divpundir.mavlink.api.MavEnum
import kotlin.UInt

/**
 * Enumeration of battery functions
 */
@GeneratedMavEnum
public enum class MavBatteryFunction(
  override val `value`: UInt,
) : MavEnum {
  /**
   * Battery function is unknown
   */
  @GeneratedMavEnumEntry
  UNKNOWN(0u),
  /**
   * Battery supports all flight systems
   */
  @GeneratedMavEnumEntry
  ALL(1u),
  /**
   * Battery for the propulsion system
   */
  @GeneratedMavEnumEntry
  PROPULSION(2u),
  /**
   * Avionics battery
   */
  @GeneratedMavEnumEntry
  AVIONICS(3u),
  /**
   * Payload battery
   */
  @GeneratedMavEnumEntry
  PAYLOAD(4u),
  ;

  public companion object : MavEnum.MavCompanion {
    override fun getEntryFromValueOrNull(v: UInt): MavBatteryFunction? = when (v) {
      0u -> UNKNOWN
      1u -> ALL
      2u -> PROPULSION
      3u -> AVIONICS
      4u -> PAYLOAD
      else -> null
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy