Public Types | Public Member Functions | Public Attributes | List of all members
msp::msg::BatteryState Struct Reference

#include <msp_msg.hpp>

Inheritance diagram for msp::msg::BatteryState:
Inheritance graph
[legend]

Public Types

enum  state_t : uint8_t {
  state_t::OK, state_t::WARNING, state_t::CRITICAL, state_t::NOT_PRESENT,
  state_t::INIT
}
 

Public Member Functions

 BatteryState (FirmwareVariant v)
 
virtual bool decode (const ByteVector &data) override
 Decode message contents from a ByteVector. More...
 
virtual ID id () const override
 get the ID of the message More...
 
virtual std::ostream & print (std::ostream &s) const override
 
- Public Member Functions inherited from msp::Message
virtual ByteVectorUptr encode () const
 Encode all data into a ByteVector. More...
 
FirmwareVariant getFirmwareVariant () const
 Queries the firmware variant the message works with. More...
 
 Message (FirmwareVariant v)
 Message constructor accepting a FirmwareVariant. More...
 
void setFirmwareVariant (FirmwareVariant v)
 Set the firmware the message should work with. More...
 
virtual ~Message ()
 Message destructor. More...
 

Public Attributes

Value< uint16_t > amperage
 
Value< uint16_t > capacity_mAh
 
Value< uint8_t > cell_count
 
Value< uint16_t > mAh_drawn
 
Value< state_tstate
 
Value< float > voltage
 

Additional Inherited Members

- Protected Attributes inherited from msp::Message
FirmwareVariant fw_variant
 

Detailed Description

Definition at line 3837 of file msp_msg.hpp.

Member Enumeration Documentation

enum msp::msg::BatteryState::state_t : uint8_t
strong
Enumerator
OK 
WARNING 
CRITICAL 
NOT_PRESENT 
INIT 

Definition at line 3838 of file msp_msg.hpp.

Constructor & Destructor Documentation

msp::msg::BatteryState::BatteryState ( FirmwareVariant  v)
inline

Definition at line 3840 of file msp_msg.hpp.

Member Function Documentation

virtual bool msp::msg::BatteryState::decode ( const ByteVector )
inlineoverridevirtual

Decode message contents from a ByteVector.

Parameters
dataSource of data
Returns
False. Override methods should return true on success

Reimplemented from msp::Message.

Definition at line 3851 of file msp_msg.hpp.

virtual ID msp::msg::BatteryState::id ( ) const
inlineoverridevirtual

get the ID of the message

Returns
ID

Implements msp::Message.

Definition at line 3842 of file msp_msg.hpp.

virtual std::ostream& msp::msg::BatteryState::print ( std::ostream &  s) const
inlineoverridevirtual

Reimplemented from msp::Message.

Definition at line 3864 of file msp_msg.hpp.

Member Data Documentation

Value<uint16_t> msp::msg::BatteryState::amperage

Definition at line 3848 of file msp_msg.hpp.

Value<uint16_t> msp::msg::BatteryState::capacity_mAh

Definition at line 3845 of file msp_msg.hpp.

Value<uint8_t> msp::msg::BatteryState::cell_count

Definition at line 3844 of file msp_msg.hpp.

Value<uint16_t> msp::msg::BatteryState::mAh_drawn

Definition at line 3847 of file msp_msg.hpp.

Value<state_t> msp::msg::BatteryState::state

Definition at line 3849 of file msp_msg.hpp.

Value<float> msp::msg::BatteryState::voltage

Definition at line 3846 of file msp_msg.hpp.


The documentation for this struct was generated from the following file:


msp
Author(s): Christian Rauch
autogenerated on Tue Oct 6 2020 03:39:02