PX4 Firmware
PX4 Autopilot Software http://px4.io
px4::logger::LogWriterMavlink Class Reference

Writes logging data to uORB, and then sent via mavlink. More...

#include <log_writer_mavlink.h>

Collaboration diagram for px4::logger::LogWriterMavlink:

Public Member Functions

 LogWriterMavlink ()
 
 ~LogWriterMavlink ()
 
bool init ()
 
void start_log ()
 
void stop_log ()
 
bool is_started () const
 
int write_message (void *ptr, size_t size)
 
void set_need_reliable_transfer (bool need_reliable)
 
bool need_reliable_transfer () const
 

Private Member Functions

int publish_message ()
 publish message, wait for ack if needed & reset message More...
 

Private Attributes

ulog_stream_s _ulog_stream_data {}
 
uORB::PublicationQueued< ulog_stream_s_ulog_stream_pub {ORB_ID(ulog_stream)}
 
int _ulog_stream_ack_sub {-1}
 
bool _need_reliable_transfer {false}
 
bool _is_started {false}
 

Detailed Description

Writes logging data to uORB, and then sent via mavlink.

Definition at line 50 of file log_writer_mavlink.h.

Constructor & Destructor Documentation

◆ LogWriterMavlink()

px4::logger::LogWriterMavlink::LogWriterMavlink ( )

Definition at line 48 of file log_writer_mavlink.cpp.

References _ulog_stream_data, and ulog_stream_s::length.

◆ ~LogWriterMavlink()

px4::logger::LogWriterMavlink::~LogWriterMavlink ( )

Definition at line 58 of file log_writer_mavlink.cpp.

References _ulog_stream_ack_sub, and orb_unsubscribe().

Here is the call graph for this function:

Member Function Documentation

◆ init()

bool px4::logger::LogWriterMavlink::init ( )

Definition at line 53 of file log_writer_mavlink.cpp.

Referenced by px4::logger::LogWriter::init().

Here is the caller graph for this function:

◆ is_started()

bool px4::logger::LogWriterMavlink::is_started ( ) const
inline

Definition at line 62 of file log_writer_mavlink.h.

References _is_started, set_need_reliable_transfer(), and write_message().

Referenced by px4::logger::LogWriter::is_started(), and write_message().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ need_reliable_transfer()

bool px4::logger::LogWriterMavlink::need_reliable_transfer ( ) const
inline

Definition at line 69 of file log_writer_mavlink.h.

References _need_reliable_transfer, and publish_message().

Referenced by px4::logger::LogWriter::need_reliable_transfer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ publish_message()

int px4::logger::LogWriterMavlink::publish_message ( )
private

publish message, wait for ack if needed & reset message

Definition at line 130 of file log_writer_mavlink.cpp.

References _need_reliable_transfer, _ulog_stream_ack_sub, _ulog_stream_data, _ulog_stream_pub, ulog_stream_s::first_message_offset, ulog_stream_s::flags, hrt_absolute_time(), hrt_abstime, hrt_elapsed_time(), ulog_stream_s::length, ulog_stream_s::msg_sequence, ulog_stream_ack_s::msg_sequence, orb_copy(), ORB_ID, uORB::PublicationQueued< T >::publish(), px4_poll(), stop_log(), timeout_ms, and ulog_stream_s::timestamp.

Referenced by need_reliable_transfer(), set_need_reliable_transfer(), and write_message().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_need_reliable_transfer()

void px4::logger::LogWriterMavlink::set_need_reliable_transfer ( bool  need_reliable)

Definition at line 118 of file log_writer_mavlink.cpp.

References _need_reliable_transfer, _ulog_stream_data, ulog_stream_s::length, and publish_message().

Referenced by is_started(), and px4::logger::LogWriter::set_need_reliable_transfer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start_log()

void px4::logger::LogWriterMavlink::start_log ( )

Definition at line 65 of file log_writer_mavlink.cpp.

References _is_started, _ulog_stream_ack_sub, _ulog_stream_data, ulog_stream_s::first_message_offset, ulog_stream_s::length, ulog_stream_s::msg_sequence, orb_copy(), ORB_ID, and orb_subscribe().

Referenced by px4::logger::LogWriter::start_log_mavlink().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stop_log()

void px4::logger::LogWriterMavlink::stop_log ( )

Definition at line 82 of file log_writer_mavlink.cpp.

References _is_started, _ulog_stream_data, and ulog_stream_s::length.

Referenced by publish_message(), and px4::logger::LogWriter::stop_log_mavlink().

Here is the caller graph for this function:

◆ write_message()

int px4::logger::LogWriterMavlink::write_message ( void *  ptr,
size_t  size 
)
See also
LogWriter::write_message()

Definition at line 88 of file log_writer_mavlink.cpp.

References _ulog_stream_data, ulog_stream_s::data, ulog_stream_s::first_message_offset, is_started(), ulog_stream_s::length, math::min(), and publish_message().

Referenced by is_started(), and px4::logger::LogWriter::write_message().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _is_started

bool px4::logger::LogWriterMavlink::_is_started {false}
private

Definition at line 83 of file log_writer_mavlink.h.

Referenced by is_started(), start_log(), and stop_log().

◆ _need_reliable_transfer

bool px4::logger::LogWriterMavlink::_need_reliable_transfer {false}
private

◆ _ulog_stream_ack_sub

int px4::logger::LogWriterMavlink::_ulog_stream_ack_sub {-1}
private

Definition at line 81 of file log_writer_mavlink.h.

Referenced by publish_message(), start_log(), and ~LogWriterMavlink().

◆ _ulog_stream_data

ulog_stream_s px4::logger::LogWriterMavlink::_ulog_stream_data {}
private

◆ _ulog_stream_pub

uORB::PublicationQueued<ulog_stream_s> px4::logger::LogWriterMavlink::_ulog_stream_pub {ORB_ID(ulog_stream)}
private

Definition at line 80 of file log_writer_mavlink.h.

Referenced by publish_message().


The documentation for this class was generated from the following files: