Struct mavlink::common::BATTERY_STATUS_DATA

source ·
pub struct BATTERY_STATUS_DATA {
Show 14 fields pub current_consumed: i32, pub energy_consumed: i32, pub temperature: i16, pub voltages: [u16; 10], pub current_battery: i16, pub id: u8, pub battery_function: MavBatteryFunction, pub mavtype: MavBatteryType, pub battery_remaining: i8, pub time_remaining: i32, pub charge_state: MavBatteryChargeState, pub voltages_ext: [u16; 4], pub mode: MavBatteryMode, pub fault_bitmask: MavBatteryFault,
}
Available on crate feature common only.
Expand description

id: 147 Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send SMART_BATTERY_INFO..

Fields§

§current_consumed: i32

Consumed charge, -1: autopilot does not provide consumption estimate.

§energy_consumed: i32

Consumed energy, -1: autopilot does not provide energy consumption estimate.

§temperature: i16

Temperature of the battery. INT16_MAX for unknown temperature..

§voltages: [u16; 10]

Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)..

§current_battery: i16

Battery current, -1: autopilot does not measure the current.

§id: u8

Battery ID.

§battery_function: MavBatteryFunction

Function of the battery.

§mavtype: MavBatteryType

Type (chemistry) of the battery.

§battery_remaining: i8

Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery..

§time_remaining: i32

Remaining battery time, 0: autopilot does not provide remaining battery time estimate.

§charge_state: MavBatteryChargeState

State for extent of discharge, provided by autopilot for warning or external reactions.

§voltages_ext: [u16; 4]

Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead..

§mode: MavBatteryMode

Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode..

§fault_bitmask: MavBatteryFault

Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)..

Implementations§

source§

impl BATTERY_STATUS_DATA

source

pub const ENCODED_LEN: usize = 54usize

source

pub const DEFAULT: Self = _

Trait Implementations§

source§

impl Clone for BATTERY_STATUS_DATA

source§

fn clone(&self) -> BATTERY_STATUS_DATA

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BATTERY_STATUS_DATA

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for BATTERY_STATUS_DATA

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for BATTERY_STATUS_DATA

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl MessageData for BATTERY_STATUS_DATA

source§

const ID: u32 = 147u32

source§

const NAME: &'static str = "BATTERY_STATUS"

source§

const EXTRA_CRC: u8 = 154u8

source§

const ENCODED_LEN: usize = 54usize

source§

type Message = MavMessage

source§

fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError>

source§

fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize

source§

impl PartialEq for BATTERY_STATUS_DATA

source§

fn eq(&self, other: &BATTERY_STATUS_DATA) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for BATTERY_STATUS_DATA

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for BATTERY_STATUS_DATA

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,