diff --git a/libraries/AP_Logger/AP_Logger.cpp b/libraries/AP_Logger/AP_Logger.cpp index ce0a994fa8..bf31bb794c 100644 --- a/libraries/AP_Logger/AP_Logger.cpp +++ b/libraries/AP_Logger/AP_Logger.cpp @@ -1114,7 +1114,7 @@ AP_Logger::log_write_fmt *AP_Logger::msg_fmt_for_name(const char *name, const ch return f; } -const struct LogStructure *AP_Logger::structure_for_msg_type(const uint8_t msg_type) +const struct LogStructure *AP_Logger::structure_for_msg_type(const uint8_t msg_type) const { for (uint16_t i=0; i<_num_types;i++) { const struct LogStructure *s = structure(i); diff --git a/libraries/AP_Logger/AP_Logger.h b/libraries/AP_Logger/AP_Logger.h index 5ba0a8e5ad..7f06a9b147 100644 --- a/libraries/AP_Logger/AP_Logger.h +++ b/libraries/AP_Logger/AP_Logger.h @@ -497,7 +497,7 @@ private: // return (possibly allocating) a log_write_fmt for a name const struct log_write_fmt *log_write_fmt_for_msg_type(uint8_t msg_type) const; - const struct LogStructure *structure_for_msg_type(uint8_t msg_type); + const struct LogStructure *structure_for_msg_type(uint8_t msg_type) const; // return a msg_type which is not currently in use (or -1 if none available) int16_t find_free_msg_type() const; @@ -588,7 +588,7 @@ private: // can be used by other subsystems to detect if they should log data uint8_t _log_start_count; - bool should_handle_log_message(); + bool should_handle_log_message() const; void handle_log_message(class GCS_MAVLINK &, const mavlink_message_t &msg); void handle_log_request_list(class GCS_MAVLINK &, const mavlink_message_t &msg); diff --git a/libraries/AP_Logger/AP_Logger_Backend.cpp b/libraries/AP_Logger/AP_Logger_Backend.cpp index 190274f59c..261d019ea0 100644 --- a/libraries/AP_Logger/AP_Logger_Backend.cpp +++ b/libraries/AP_Logger/AP_Logger_Backend.cpp @@ -44,7 +44,7 @@ const struct MultiplierStructure *AP_Logger_Backend::multiplier(uint8_t num) con return _front.multiplier(num); } -AP_Logger_Backend::vehicle_startup_message_Writer AP_Logger_Backend::vehicle_message_writer() { +AP_Logger_Backend::vehicle_startup_message_Writer AP_Logger_Backend::vehicle_message_writer() const { return _front._vehicle_messages; } diff --git a/libraries/AP_Logger/AP_Logger_Backend.h b/libraries/AP_Logger/AP_Logger_Backend.h index dcbcde6eef..6d583a0047 100644 --- a/libraries/AP_Logger/AP_Logger_Backend.h +++ b/libraries/AP_Logger/AP_Logger_Backend.h @@ -15,7 +15,7 @@ public: AP_Logger_Backend(AP_Logger &front, class LoggerMessageWriter_DFLogStart *writer); - vehicle_startup_message_Writer vehicle_message_writer(); + vehicle_startup_message_Writer vehicle_message_writer() const; virtual bool CardInserted(void) const = 0; diff --git a/libraries/AP_Logger/AP_Logger_Block.cpp b/libraries/AP_Logger/AP_Logger_Block.cpp index ca60652d6e..8457d532b8 100644 --- a/libraries/AP_Logger/AP_Logger_Block.cpp +++ b/libraries/AP_Logger/AP_Logger_Block.cpp @@ -261,7 +261,7 @@ void AP_Logger_Block::StartLogFile(uint16_t FileNumber) df_Write_FilePage = 1; } -uint16_t AP_Logger_Block::GetFileNumber() +uint16_t AP_Logger_Block::GetFileNumber() const { return df_FileNumber; } diff --git a/libraries/AP_Logger/AP_Logger_Block.h b/libraries/AP_Logger/AP_Logger_Block.h index d91cebb3e8..0eb723629c 100644 --- a/libraries/AP_Logger/AP_Logger_Block.h +++ b/libraries/AP_Logger/AP_Logger_Block.h @@ -41,12 +41,12 @@ protected: bool WritesOK() const override; // get the current sector from the current page - uint32_t get_sector(uint32_t current_page) { + uint32_t get_sector(uint32_t current_page) const { return ((current_page - 1) / df_PagePerSector); } // get the current block from the current page - uint32_t get_block(uint32_t current_page) { + uint32_t get_block(uint32_t current_page) const { return ((current_page - 1) / df_PagePerBlock); } @@ -154,7 +154,7 @@ private: void StartLogFile(uint16_t FileNumber); // file numbers - uint16_t GetFileNumber(); + uint16_t GetFileNumber() const; void _print_log_formats(AP_HAL::BetterStream *port); diff --git a/libraries/AP_Logger/AP_Logger_MAVLink.cpp b/libraries/AP_Logger/AP_Logger_MAVLink.cpp index 58fc3c2420..952352b379 100644 --- a/libraries/AP_Logger/AP_Logger_MAVLink.cpp +++ b/libraries/AP_Logger/AP_Logger_MAVLink.cpp @@ -54,7 +54,7 @@ uint32_t AP_Logger_MAVLink::bufferspace_available() { return (_blockcount_free * 200 + remaining_space_in_current_block()); } -uint8_t AP_Logger_MAVLink::remaining_space_in_current_block() { +uint8_t AP_Logger_MAVLink::remaining_space_in_current_block() const { // note that _current_block *could* be NULL ATM. return (MAVLINK_MSG_REMOTE_LOG_DATA_BLOCK_FIELD_DATA_LEN - _latest_block_len); } diff --git a/libraries/AP_Logger/AP_Logger_MAVLink.h b/libraries/AP_Logger/AP_Logger_MAVLink.h index 3df7afd92d..d1a74430d5 100644 --- a/libraries/AP_Logger/AP_Logger_MAVLink.h +++ b/libraries/AP_Logger/AP_Logger_MAVLink.h @@ -145,7 +145,7 @@ private: void Write_logger_MAV(AP_Logger_MAVLink &logger); uint32_t bufferspace_available() override; // in bytes - uint8_t remaining_space_in_current_block(); + uint8_t remaining_space_in_current_block() const; // write buffer uint8_t _blockcount_free; uint8_t _blockcount; diff --git a/libraries/AP_Logger/AP_Logger_MAVLinkLogTransfer.cpp b/libraries/AP_Logger/AP_Logger_MAVLinkLogTransfer.cpp index 6c119091d9..5a099b2d67 100644 --- a/libraries/AP_Logger/AP_Logger_MAVLinkLogTransfer.cpp +++ b/libraries/AP_Logger/AP_Logger_MAVLinkLogTransfer.cpp @@ -25,7 +25,7 @@ extern const AP_HAL::HAL& hal; // We avoid doing log messages when timing is critical: -bool AP_Logger::should_handle_log_message() +bool AP_Logger::should_handle_log_message() const { if (!WritesEnabled()) { // this is currently used as a proxy for "in_mavlink_delay" diff --git a/libraries/AP_Logger/LoggerMessageWriter.h b/libraries/AP_Logger/LoggerMessageWriter.h index 6bf967d4fa..0744d1f96e 100644 --- a/libraries/AP_Logger/LoggerMessageWriter.h +++ b/libraries/AP_Logger/LoggerMessageWriter.h @@ -92,8 +92,8 @@ public: void reset() override; void process() override; - bool fmt_done() { return _fmt_done; } - bool params_done() { return _params_done; } + bool fmt_done() const { return _fmt_done; } + bool params_done() const { return _params_done; } // reset some writers so we push stuff out to logs again. Will // only work if we are in state DONE!