APM:Libraries
|
#include <DataFlash_Backend.h>
Public Member Functions | |
FUNCTOR_TYPEDEF (vehicle_startup_message_Log_Writer, void) | |
DataFlash_Backend (DataFlash_Class &front, class DFMessageWriter_DFLogStart *writer) | |
vehicle_startup_message_Log_Writer | vehicle_message_writer () |
void | internal_error () |
virtual bool | CardInserted (void) const =0 |
virtual void | EraseAll ()=0 |
virtual bool | NeedPrep ()=0 |
virtual void | Prep ()=0 |
bool | WriteBlock (const void *pBuffer, uint16_t size) |
bool | WriteCriticalBlock (const void *pBuffer, uint16_t size) |
bool | WritePrioritisedBlock (const void *pBuffer, uint16_t size, bool is_critical) |
virtual uint16_t | find_last_log ()=0 |
virtual void | get_log_boundaries (uint16_t log_num, uint16_t &start_page, uint16_t &end_page)=0 |
virtual void | get_log_info (uint16_t log_num, uint32_t &size, uint32_t &time_utc)=0 |
virtual int16_t | get_log_data (uint16_t log_num, uint16_t page, uint32_t offset, uint16_t len, uint8_t *data)=0 |
virtual uint16_t | get_num_logs ()=0 |
virtual bool | logging_started (void) const =0 |
virtual void | Init () |
void | set_mission (const AP_Mission *mission) |
virtual uint32_t | bufferspace_available ()=0 |
virtual void | PrepForArming () |
virtual uint16_t | start_new_log (void)=0 |
virtual void | stop_logging (void)=0 |
void | Log_Fill_Format (const struct LogStructure *structure, struct log_Format &pkt) |
void | Log_Fill_Format_Units (const struct LogStructure *s, struct log_Format_Units &pkt) |
virtual void | flush (void) |
virtual void | remote_log_block_status_msg (mavlink_channel_t chan, mavlink_message_t *msg) |
virtual void | periodic_tasks () |
uint8_t | num_types () const |
const struct LogStructure * | structure (uint8_t structure) const |
uint8_t | num_units () const |
const struct UnitStructure * | unit (uint8_t unit) const |
uint8_t | num_multipliers () const |
const struct MultiplierStructure * | multiplier (uint8_t multiplier) const |
void | Log_Write_EntireMission (const AP_Mission &mission) |
bool | Log_Write_Format (const struct LogStructure *structure) |
bool | Log_Write_MavCmd (uint16_t cmd_total, const mavlink_mission_item_t &mav_cmd) |
bool | Log_Write_Message (const char *message) |
bool | Log_Write_Mission_Cmd (const AP_Mission &mission, const AP_Mission::Mission_Command &cmd) |
bool | Log_Write_Mode (uint8_t mode, uint8_t reason=0) |
bool | Log_Write_Parameter (const char *name, float value) |
bool | Log_Write_Parameter (const AP_Param *ap, const AP_Param::ParamToken &token, enum ap_var_type type) |
uint32_t | num_dropped (void) const |
bool | Log_Write_Emit_FMT (uint8_t msg_type) |
bool | Log_Write (uint8_t msg_type, va_list arg_list, bool is_critical=false) |
virtual bool | logging_enabled () const =0 |
virtual bool | logging_failed () const =0 |
virtual void | vehicle_was_disarmed () |
bool | Log_Write_Unit (const struct UnitStructure *s) |
bool | Log_Write_Multiplier (const struct MultiplierStructure *s) |
bool | Log_Write_Format_Units (const struct LogStructure *structure) |
Protected Member Functions | |
virtual void | periodic_10Hz (const uint32_t now) |
virtual void | periodic_1Hz (const uint32_t now) |
virtual void | periodic_fullrate (const uint32_t now) |
bool | ShouldLog (bool is_critical) |
virtual bool | WritesOK () const =0 |
virtual bool | StartNewLogOK () const |
virtual bool | ReadBlock (void *pkt, uint16_t size)=0 |
virtual bool | WriteBlockCheckStartupMessages () |
virtual void | WriteMoreStartupMessages () |
virtual void | push_log_blocks () |
virtual void | start_new_log_reset_variables () |
virtual bool | _WritePrioritisedBlock (const void *pBuffer, uint16_t size, bool is_critical)=0 |
Protected Attributes | |
DataFlash_Class & | _front |
DFMessageWriter_DFLogStart * | _startup_messagewriter |
bool | _writing_startup_messages |
uint8_t | _internal_errors |
uint32_t | _dropped |
bool | _initialised |
Private Attributes | |
uint32_t | _last_periodic_1Hz |
uint32_t | _last_periodic_10Hz |
bool | have_logged_armed |
Definition at line 7 of file DataFlash_Backend.h.
DataFlash_Backend::DataFlash_Backend | ( | DataFlash_Class & | front, |
class DFMessageWriter_DFLogStart * | writer | ||
) |
|
protectedpure virtual |
Implemented in DataFlash_Revo, and DataFlash_MAVLink.
Referenced by WritePrioritisedBlock().
|
pure virtual |
Implemented in DataFlash_Revo, and DataFlash_MAVLink.
Referenced by Init(), Log_Write(), and DFMessageWriter_DFLogStart::process().
|
pure virtual |
Implemented in DataFlash_Revo, and DataFlash_MAVLink.
|
pure virtual |
Implemented in DataFlash_Revo, and DataFlash_MAVLink.
|
pure virtual |
Implemented in DataFlash_Revo, and DataFlash_MAVLink.
Referenced by DataFlash_Class::find_last_log(), and WriteCriticalBlock().
|
inlinevirtual |
Definition at line 71 of file DataFlash_Backend.h.
DataFlash_Backend::FUNCTOR_TYPEDEF | ( | vehicle_startup_message_Log_Writer | , |
void | |||
) |
|
pure virtual |
Implemented in DataFlash_Revo, and DataFlash_MAVLink.
Referenced by DataFlash_Class::get_log_boundaries(), and WriteCriticalBlock().
|
pure virtual |
Implemented in DataFlash_Revo, and DataFlash_MAVLink.
Referenced by DataFlash_Class::get_log_data(), and WriteCriticalBlock().
|
pure virtual |
Implemented in DataFlash_Revo, and DataFlash_MAVLink.
Referenced by DataFlash_Class::get_log_info(), and WriteCriticalBlock().
|
pure virtual |
Implemented in DataFlash_Revo, and DataFlash_MAVLink.
Referenced by DataFlash_Class::get_num_logs(), and WriteCriticalBlock().
|
inlinevirtual |
Reimplemented in DataFlash_Revo, and DataFlash_MAVLink.
Definition at line 48 of file DataFlash_Backend.h.
Referenced by DataFlash_MAVLink::Init(), and DataFlash_Class::Init().
void DataFlash_Backend::internal_error | ( | ) |
Definition at line 79 of file DataFlash_Backend.cpp.
Referenced by DataFlash_MAVLink::_WritePrioritisedBlock(), Log_Write(), Log_Write_Emit_FMT(), DataFlash_MAVLink::send_log_blocks_from_queue(), and DataFlash_MAVLink::stats_collect().
void DataFlash_Backend::Log_Fill_Format | ( | const struct LogStructure * | structure, |
struct log_Format & | pkt | ||
) |
Definition at line 29 of file LogFile.cpp.
Referenced by Log_Write_Format(), and PrepForArming().
void DataFlash_Backend::Log_Fill_Format_Units | ( | const struct LogStructure * | s, |
struct log_Format_Units & | pkt | ||
) |
Definition at line 45 of file LogFile.cpp.
Referenced by Log_Write_Format_Units(), and PrepForArming().
bool DataFlash_Backend::Log_Write | ( | uint8_t | msg_type, |
va_list | arg_list, | ||
bool | is_critical = false |
||
) |
Definition at line 182 of file DataFlash_Backend.cpp.
Referenced by DataFlash_Class::Log_Write_POS(), DataFlash_Class::Log_WriteV(), and num_dropped().
bool DataFlash_Backend::Log_Write_Emit_FMT | ( | uint8_t | msg_type | ) |
Definition at line 146 of file DataFlash_Backend.cpp.
Referenced by num_dropped().
void DataFlash_Backend::Log_Write_EntireMission | ( | const AP_Mission & | mission | ) |
Definition at line 417 of file LogFile.cpp.
Referenced by remote_log_block_status_msg().
bool DataFlash_Backend::Log_Write_Format | ( | const struct LogStructure * | structure | ) |
Definition at line 60 of file LogFile.cpp.
Referenced by Log_Write_Emit_FMT(), DFMessageWriter_DFLogStart::process(), and remote_log_block_status_msg().
bool DataFlash_Backend::Log_Write_Format_Units | ( | const struct LogStructure * | structure | ) |
Definition at line 101 of file LogFile.cpp.
Referenced by Log_Write_Emit_FMT(), DFMessageWriter_DFLogStart::process(), and vehicle_was_disarmed().
bool DataFlash_Backend::Log_Write_MavCmd | ( | uint16_t | cmd_total, |
const mavlink_mission_item_t & | mav_cmd | ||
) |
Definition at line 1276 of file LogFile.cpp.
Referenced by Log_Write_Mission_Cmd(), and remote_log_block_status_msg().
bool DataFlash_Backend::Log_Write_Message | ( | const char * | message | ) |
Definition at line 426 of file LogFile.cpp.
Referenced by DFMessageWriter_WriteSysInfo::process(), DFMessageWriter_WriteEntireMission::process(), and remote_log_block_status_msg().
bool DataFlash_Backend::Log_Write_Mission_Cmd | ( | const AP_Mission & | mission, |
const AP_Mission::Mission_Command & | cmd | ||
) |
Definition at line 409 of file LogFile.cpp.
Referenced by DFMessageWriter_WriteEntireMission::process(), and remote_log_block_status_msg().
bool DataFlash_Backend::Log_Write_Mode | ( | uint8_t | mode, |
uint8_t | reason = 0 |
||
) |
Definition at line 1496 of file LogFile.cpp.
Referenced by remote_log_block_status_msg().
bool DataFlash_Backend::Log_Write_Multiplier | ( | const struct MultiplierStructure * | s | ) |
Definition at line 86 of file LogFile.cpp.
Referenced by DFMessageWriter_DFLogStart::process(), and vehicle_was_disarmed().
bool DataFlash_Backend::Log_Write_Parameter | ( | const char * | name, |
float | value | ||
) |
Definition at line 111 of file LogFile.cpp.
Referenced by Log_Write_Parameter(), DFMessageWriter_DFLogStart::process(), and remote_log_block_status_msg().
bool DataFlash_Backend::Log_Write_Parameter | ( | const AP_Param * | ap, |
const AP_Param::ParamToken & | token, | ||
enum ap_var_type | type | ||
) |
bool DataFlash_Backend::Log_Write_Unit | ( | const struct UnitStructure * | s | ) |
Definition at line 70 of file LogFile.cpp.
Referenced by DFMessageWriter_DFLogStart::process(), and vehicle_was_disarmed().
|
pure virtual |
Implemented in DataFlash_Revo, and DataFlash_MAVLink.
Referenced by num_dropped().
|
pure virtual |
Implemented in DataFlash_Revo, and DataFlash_MAVLink.
Referenced by num_dropped().
|
pure virtual |
Implemented in DataFlash_Revo, and DataFlash_MAVLink.
Referenced by StartNewLogOK(), and WriteCriticalBlock().
const struct MultiplierStructure * DataFlash_Backend::multiplier | ( | uint8_t | multiplier | ) | const |
Definition at line 40 of file DataFlash_Backend.cpp.
Referenced by Log_Write_Multiplier(), DFMessageWriter_DFLogStart::process(), and remote_log_block_status_msg().
|
pure virtual |
Implemented in DataFlash_Revo, and DataFlash_MAVLink.
|
inline |
Definition at line 102 of file DataFlash_Backend.h.
Referenced by DataFlash_Class::num_dropped().
uint8_t DataFlash_Backend::num_multipliers | ( | ) | const |
Definition at line 35 of file DataFlash_Backend.cpp.
Referenced by remote_log_block_status_msg().
uint8_t DataFlash_Backend::num_types | ( | ) | const |
Definition at line 15 of file DataFlash_Backend.cpp.
Referenced by DataFlash_Class::instance(), and remote_log_block_status_msg().
uint8_t DataFlash_Backend::num_units | ( | ) | const |
Definition at line 25 of file DataFlash_Backend.cpp.
Referenced by remote_log_block_status_msg().
|
protectedvirtual |
Reimplemented in DataFlash_MAVLink.
Definition at line 49 of file DataFlash_Backend.cpp.
Referenced by periodic_tasks().
|
protectedvirtual |
Reimplemented in DataFlash_MAVLink.
Definition at line 52 of file DataFlash_Backend.cpp.
Referenced by periodic_tasks().
|
protectedvirtual |
Reimplemented in DataFlash_MAVLink.
Definition at line 55 of file DataFlash_Backend.cpp.
Referenced by periodic_tasks().
|
virtual |
Definition at line 59 of file DataFlash_Backend.cpp.
Referenced by remote_log_block_status_msg().
|
pure virtual |
Implemented in DataFlash_Revo, and DataFlash_MAVLink.
|
inlinevirtual |
|
protectedvirtual |
Reimplemented in DataFlash_MAVLink.
Definition at line 92 of file DataFlash_Backend.cpp.
Referenced by WriteBlockCheckStartupMessages().
|
protectedpure virtual |
Implemented in DataFlash_MAVLink, and DataFlash_Revo.
|
inlinevirtual |
Reimplemented in DataFlash_MAVLink.
Definition at line 75 of file DataFlash_Backend.h.
void DataFlash_Backend::set_mission | ( | const AP_Mission * | mission | ) |
Definition at line 86 of file DataFlash_Backend.cpp.
Referenced by Init().
|
protected |
Definition at line 330 of file DataFlash_Backend.cpp.
Referenced by WritePrioritisedBlock().
|
pure virtual |
Implemented in DataFlash_Revo, and DataFlash_MAVLink.
Referenced by PrepForArming(), and WritePrioritisedBlock().
|
protectedvirtual |
Definition at line 73 of file DataFlash_Backend.cpp.
Referenced by DataFlash_MAVLink::handle_ack().
|
protectedvirtual |
Definition at line 299 of file DataFlash_Backend.cpp.
Referenced by WritePrioritisedBlock().
|
pure virtual |
Implemented in DataFlash_Revo, and DataFlash_MAVLink.
Referenced by PrepForArming().
const struct LogStructure * DataFlash_Backend::structure | ( | uint8_t | structure | ) | const |
Definition at line 20 of file DataFlash_Backend.cpp.
Referenced by PrepForArming(), DFMessageWriter_DFLogStart::process(), and remote_log_block_status_msg().
const struct UnitStructure * DataFlash_Backend::unit | ( | uint8_t | unit | ) | const |
Definition at line 30 of file DataFlash_Backend.cpp.
Referenced by Log_Write_Unit(), DFMessageWriter_DFLogStart::process(), and remote_log_block_status_msg().
DataFlash_Backend::vehicle_startup_message_Log_Writer DataFlash_Backend::vehicle_message_writer | ( | ) |
Definition at line 45 of file DataFlash_Backend.cpp.
Referenced by DFMessageWriter_DFLogStart::process().
|
inlinevirtual |
|
inline |
Definition at line 29 of file DataFlash_Backend.h.
Referenced by DataFlash_Class::Log_Write_AHRS2(), DataFlash_Class::Log_Write_Airspeed(), DataFlash_Class::Log_Write_AOA_SSA(), DataFlash_Class::Log_Write_Attitude(), DataFlash_Class::Log_Write_AttitudeView(), DataFlash_Class::Log_Write_Baro_instance(), DataFlash_Class::Log_Write_Beacon(), DataFlash_Class::Log_Write_Compass_instance(), DataFlash_Class::Log_Write_Current_instance(), DataFlash_MAVLink::Log_Write_DF_MAV(), DataFlash_Class::Log_Write_ESC(), DataFlash_Class::Log_Write_GPS(), DataFlash_Class::Log_Write_IMU_instance(), DataFlash_Class::Log_Write_IMUDT_instance(), DataFlash_Class::Log_Write_ISBD(), DataFlash_Class::Log_Write_ISBH(), Log_Write_MavCmd(), DataFlash_Class::Log_Write_Origin(), DataFlash_Class::Log_Write_PID(), DataFlash_Class::Log_Write_POS(), DataFlash_Class::Log_Write_Power(), DataFlash_Class::Log_Write_Proximity(), DataFlash_Class::Log_Write_Radio(), DataFlash_Class::Log_Write_Rally(), DataFlash_Class::Log_Write_Rate(), DataFlash_Class::Log_Write_RCIN(), DataFlash_Class::Log_Write_RCOUT(), DataFlash_Class::Log_Write_RFND(), DataFlash_Class::Log_Write_RPM(), DataFlash_Class::Log_Write_RSSI(), DataFlash_Class::Log_Write_SRTL(), DataFlash_Class::Log_Write_Vibration(), and DataFlash_Class::Log_Write_VisualOdom().
|
protectedvirtual |
Definition at line 98 of file DataFlash_Backend.cpp.
Referenced by DataFlash_MAVLink::_WritePrioritisedBlock().
|
inline |
Definition at line 33 of file DataFlash_Backend.h.
Referenced by DataFlash_Class::Log_Write_CameraInfo(), Log_Write_Format(), Log_Write_Format_Units(), Log_Write_Message(), Log_Write_Mode(), Log_Write_Multiplier(), Log_Write_Parameter(), and Log_Write_Unit().
|
protectedvirtual |
Definition at line 129 of file DataFlash_Backend.cpp.
Referenced by DataFlash_MAVLink::push_log_blocks(), and push_log_blocks().
bool DataFlash_Backend::WritePrioritisedBlock | ( | const void * | pBuffer, |
uint16_t | size, | ||
bool | is_critical | ||
) |
Definition at line 316 of file DataFlash_Backend.cpp.
Referenced by Log_Write(), WriteBlock(), and WriteCriticalBlock().
|
protectedpure virtual |
Implemented in DataFlash_Revo, and DataFlash_MAVLink.
Referenced by WritePrioritisedBlock().
|
protected |
Definition at line 153 of file DataFlash_Backend.h.
Referenced by DataFlash_MAVLink::_WritePrioritisedBlock(), DataFlash_MAVLink::Log_Write_DF_MAV(), num_dropped(), and DataFlash_MAVLink::stats_init().
|
protected |
Definition at line 130 of file DataFlash_Backend.h.
Referenced by DataFlash_MAVLink::DataFlash_MAVLink(), Log_Write(), Log_Write_Emit_FMT(), multiplier(), num_multipliers(), num_types(), num_units(), ShouldLog(), start_new_log_reset_variables(), StartNewLogOK(), structure(), unit(), and vehicle_message_writer().
|
protected |
Definition at line 160 of file DataFlash_Backend.h.
Referenced by DataFlash_MAVLink::do_resends(), DataFlash_MAVLink::handle_ack(), DataFlash_MAVLink::handle_retry(), DataFlash_MAVLink::Init(), DataFlash_MAVLink::logging_started(), DataFlash_MAVLink::push_log_blocks(), DataFlash_MAVLink::send_log_block(), ShouldLog(), DataFlash_MAVLink::stats_collect(), and DataFlash_MAVLink::stats_log().
|
protected |
Definition at line 152 of file DataFlash_Backend.h.
Referenced by internal_error(), DataFlash_MAVLink::Log_Write_DF_MAV(), and DataFlash_MAVLink::stats_init().
|
private |
Definition at line 165 of file DataFlash_Backend.h.
Referenced by periodic_tasks().
|
private |
Definition at line 164 of file DataFlash_Backend.h.
Referenced by periodic_tasks().
|
protected |
Definition at line 149 of file DataFlash_Backend.h.
Referenced by DataFlash_MAVLink::_WritePrioritisedBlock(), set_mission(), ShouldLog(), start_new_log_reset_variables(), WriteBlockCheckStartupMessages(), and WriteMoreStartupMessages().
|
protected |
Definition at line 150 of file DataFlash_Backend.h.
Referenced by WriteBlockCheckStartupMessages(), and WriteMoreStartupMessages().
|
private |
Definition at line 166 of file DataFlash_Backend.h.
Referenced by ShouldLog().