38 #include <mathlib/mathlib.h> 39 #include <px4_platform_common/log.h> 40 #include <px4_platform_common/posix.h> 95 uint8_t *ptr_data = (uint8_t *)ptr;
105 ptr_data += send_len;
144 px4_pollfd_struct_t fds[1];
146 fds[0].events = POLLIN;
147 bool got_ack =
false;
148 const int timeout_ms = ulog_stream_ack_s::ACK_TIMEOUT * ulog_stream_ack_s::ACK_MAX_TRIES;
153 int ret =
px4_poll(fds,
sizeof(fds) /
sizeof(fds[0]), timeout_ms);
159 if (fds[0].revents & POLLIN) {
173 PX4_ERR(
"Ack timeout. Stopping mavlink log");
int orb_copy(const struct orb_metadata *meta, int handle, void *buffer)
ulog_stream_s _ulog_stream_data
bool publish(const T &data)
Publish the struct.
High-resolution timer with callouts and timekeeping.
int orb_subscribe(const struct orb_metadata *meta)
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
uORB::PublicationQueued< ulog_stream_s > _ulog_stream_pub
int publish_message()
publish message, wait for ack if needed & reset message
int orb_unsubscribe(int handle)
static hrt_abstime hrt_elapsed_time(const hrt_abstime *then)
Compute the delta between a timestamp taken in the past and now.
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
constexpr _Tp min(_Tp a, _Tp b)
bool _need_reliable_transfer
void set_need_reliable_transfer(bool need_reliable)
uint8_t first_message_offset
int write_message(void *ptr, size_t size)
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).