PX4 Firmware
PX4 Autopilot Software http://px4.io
|
Writes logging data to uORB, and then sent via mavlink. More...
#include <log_writer_mavlink.h>
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} |
Writes logging data to uORB, and then sent via mavlink.
Definition at line 50 of file log_writer_mavlink.h.
px4::logger::LogWriterMavlink::LogWriterMavlink | ( | ) |
Definition at line 48 of file log_writer_mavlink.cpp.
References _ulog_stream_data, and ulog_stream_s::length.
px4::logger::LogWriterMavlink::~LogWriterMavlink | ( | ) |
Definition at line 58 of file log_writer_mavlink.cpp.
References _ulog_stream_ack_sub, and orb_unsubscribe().
bool px4::logger::LogWriterMavlink::init | ( | ) |
Definition at line 53 of file log_writer_mavlink.cpp.
Referenced by px4::logger::LogWriter::init().
|
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().
|
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().
|
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().
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().
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().
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().
int px4::logger::LogWriterMavlink::write_message | ( | void * | ptr, |
size_t | size | ||
) |
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().
|
private |
Definition at line 83 of file log_writer_mavlink.h.
Referenced by is_started(), start_log(), and stop_log().
|
private |
Definition at line 82 of file log_writer_mavlink.h.
Referenced by need_reliable_transfer(), publish_message(), and set_need_reliable_transfer().
|
private |
Definition at line 81 of file log_writer_mavlink.h.
Referenced by publish_message(), start_log(), and ~LogWriterMavlink().
|
private |
Definition at line 79 of file log_writer_mavlink.h.
Referenced by LogWriterMavlink(), publish_message(), set_need_reliable_transfer(), start_log(), stop_log(), and write_message().
|
private |
Definition at line 80 of file log_writer_mavlink.h.
Referenced by publish_message().