MavlinkLogHandler: remove MavlinkStream inheritance

This commit is contained in:
Beat Küng 2017-05-12 14:28:45 +02:00 committed by Lorenz Meier
parent e6c3b29aa6
commit 99b29777ba
2 changed files with 12 additions and 34 deletions

View File

@ -79,17 +79,10 @@ stat_file(const char *file, time_t *date = nullptr, uint32_t *size = nullptr)
return false;
}
//-------------------------------------------------------------------
MavlinkLogHandler *
MavlinkLogHandler::new_instance(Mavlink *mavlink)
{
return new MavlinkLogHandler(mavlink);
}
//-------------------------------------------------------------------
MavlinkLogHandler::MavlinkLogHandler(Mavlink *mavlink)
: MavlinkStream(mavlink)
, _pLogHandlerHelper(nullptr)
: _pLogHandlerHelper(nullptr),
_mavlink(mavlink)
{
}
@ -117,20 +110,6 @@ MavlinkLogHandler::handle_message(const mavlink_message_t *msg)
}
}
//-------------------------------------------------------------------
const char *
MavlinkLogHandler::get_name() const
{
return "MAVLINK_LOG_HANDLER";
}
//-------------------------------------------------------------------
uint16_t
MavlinkLogHandler::get_id()
{
return MAVLINK_MSG_ID_LOG_ENTRY;
}
//-------------------------------------------------------------------
unsigned
MavlinkLogHandler::get_size()

View File

@ -42,7 +42,7 @@
#include <stdio.h>
#include <cstdbool>
#include <v2.0/mavlink_types.h>
#include "mavlink_stream.h"
#include <drivers/drv_hrt.h>
class Mavlink;
@ -88,21 +88,21 @@ private:
};
// MAVLink LOG_* Message Handler
class MavlinkLogHandler : public MavlinkStream
class MavlinkLogHandler
{
public:
MavlinkLogHandler(Mavlink *mavlink);
static MavlinkLogHandler *new_instance(Mavlink *mavlink);
// Handle possible LOG message
void handle_message(const mavlink_message_t *msg);
// Overrides from MavlinkStream
const char *get_name(void) const;
uint16_t get_id(void);
unsigned get_size(void);
void send(const hrt_abstime t);
/**
* Handle sending of messages. Call this regularly at a fixed frequency.
* @param t current time
*/
void send(const hrt_abstime t);
unsigned get_size();
private:
void _log_message(const mavlink_message_t *msg);
@ -114,7 +114,6 @@ private:
size_t _log_send_listing();
size_t _log_send_data();
private:
LogListHelper *_pLogHandlerHelper;
Mavlink *_mavlink;
};