mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 12:33:35 +08:00
WIP: mavlink send hacks
This commit is contained in:
committed by
Lorenz Meier
parent
050d5de93b
commit
dc2254aa34
@@ -318,21 +318,17 @@ public:
|
||||
/**
|
||||
* This is the beginning of a MAVLINK_START_UART_SEND/MAVLINK_END_UART_SEND transaction
|
||||
*/
|
||||
void begin_send() { pthread_mutex_lock(&_send_mutex); }
|
||||
void send_start(int length);
|
||||
|
||||
/**
|
||||
* Send bytes out on the link.
|
||||
*
|
||||
* On a network port these might actually get buffered to form a packet.
|
||||
* Buffer bytes to send out on the link.
|
||||
*/
|
||||
void send_bytes(const uint8_t *buf, unsigned packet_len);
|
||||
|
||||
/**
|
||||
* Flush the transmit buffer and send one MAVLink packet
|
||||
*
|
||||
* @return the number of bytes sent or -1 in case of error
|
||||
*/
|
||||
int send_packet();
|
||||
void send_finish();
|
||||
|
||||
/**
|
||||
* Resend message as is, don't change sequence number and CRC.
|
||||
@@ -619,13 +615,16 @@ private:
|
||||
bool _broadcast_address_found{false};
|
||||
bool _broadcast_address_not_found_warned{false};
|
||||
bool _broadcast_failed_warned{false};
|
||||
uint8_t _network_buf[MAVLINK_MAX_PACKET_LEN] {};
|
||||
unsigned _network_buf_len{0};
|
||||
|
||||
unsigned short _network_port{14556};
|
||||
unsigned short _remote_port{DEFAULT_REMOTE_PORT_UDP};
|
||||
#endif // MAVLINK_UDP
|
||||
|
||||
uint8_t _buf[MAVLINK_MAX_PACKET_LEN] {};
|
||||
unsigned _buf_fill{0};
|
||||
|
||||
bool _tx_buffer_low{false};
|
||||
|
||||
const char *_interface_name{nullptr};
|
||||
|
||||
int _socket_fd{-1};
|
||||
@@ -668,6 +667,8 @@ private:
|
||||
|
||||
perf_counter_t _loop_perf{perf_alloc(PC_ELAPSED, "mavlink_el")}; /**< loop performance counter */
|
||||
perf_counter_t _loop_interval_perf{perf_alloc(PC_INTERVAL, "mavlink_int")}; /**< loop interval performance counter */
|
||||
perf_counter_t _send_byte_error_perf{perf_alloc(PC_COUNT, "mavlink_send_bytes_error")}; /**< send bytes error count */
|
||||
perf_counter_t _send_start_tx_buf_low{perf_alloc(PC_COUNT, "mavlink_tx_buf_low")}; /**< available tx buffer smaller than message */
|
||||
|
||||
void mavlink_update_parameters();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user