Skip to content

Commit

Permalink
DataFlash: expose the number of lost log messages
Browse files Browse the repository at this point in the history
will be logged in PM message
  • Loading branch information
tridge committed Apr 21, 2016
1 parent 8683616 commit c765979
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libraries/DataFlash/DataFlash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ void DataFlash_Class::Log_Write_Mission_Cmd(const AP_Mission &mission,
FOR_EACH_BACKEND(Log_Write_Mission_Cmd(mission, cmd));
}

uint32_t DataFlash_Class::num_dropped() const
{
if (_next_backend == 0) {
return 0;
}
return backends[0]->num_dropped();
}


// end functions pass straight through to backend

Expand Down
3 changes: 3 additions & 0 deletions libraries/DataFlash/DataFlash.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ class DataFlash_Class

void periodic_tasks(); // may want to split this into GCS/non-GCS duties

// number of blocks that have been dropped
uint32_t num_dropped(void) const;

vehicle_startup_message_Log_Writer _vehicle_messages;

// parameter support
Expand Down
4 changes: 4 additions & 0 deletions libraries/DataFlash/DataFlash_Backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ class DataFlash_Backend
const AP_Param::ParamToken &token,
enum ap_var_type type);

uint32_t num_dropped(void) const {
return _dropped;
}

protected:
uint32_t dropped;
uint8_t internal_errors; // uint8_t - wishful thinking?
Expand Down

0 comments on commit c765979

Please sign in to comment.