diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-04-20 02:04:05 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-04-20 02:04:05 +0200 |
commit | 2ea32b315fb06f13813950a8ef385dd521694278 (patch) | |
tree | 2ea9711c8a3f18244685a6a356bfc43b3836730b /src/modules/mavlink/mavlink_main.h | |
parent | eb9daf097e10f434e729581b3ffce6c1b322b927 (diff) | |
parent | 0b85c41cd19486e829d48cf9e604fbc25b9e52a6 (diff) | |
download | px4-firmware-2ea32b315fb06f13813950a8ef385dd521694278.tar.gz px4-firmware-2ea32b315fb06f13813950a8ef385dd521694278.tar.bz2 px4-firmware-2ea32b315fb06f13813950a8ef385dd521694278.zip |
Merged master
Diffstat (limited to 'src/modules/mavlink/mavlink_main.h')
-rw-r--r-- | src/modules/mavlink/mavlink_main.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/modules/mavlink/mavlink_main.h b/src/modules/mavlink/mavlink_main.h index 9941a5f99..66d82b471 100644 --- a/src/modules/mavlink/mavlink_main.h +++ b/src/modules/mavlink/mavlink_main.h @@ -202,6 +202,14 @@ public: int get_mavlink_fd() { return _mavlink_fd; } + + /* Functions for waiting to start transmission until message received. */ + void set_has_received_messages(bool received_messages) { _received_messages = received_messages; } + bool get_has_received_messages() { return _received_messages; } + void set_wait_to_transmit(bool wait) { _wait_to_transmit = wait; } + bool get_wait_to_transmit() { return _wait_to_transmit; } + bool should_transmit() { return (!_wait_to_transmit || (_wait_to_transmit && _received_messages)); } + protected: Mavlink *next; @@ -216,6 +224,8 @@ private: /* states */ bool _hil_enabled; /**< Hardware In the Loop mode */ bool _is_usb_uart; /**< Port is USB */ + bool _wait_to_transmit; /**< Wait to transmit until received messages. */ + bool _received_messages; /**< Whether we've received valid mavlink messages. */ unsigned _main_loop_delay; /**< mainloop delay, depends on data rate */ @@ -270,6 +280,8 @@ private: pthread_mutex_t _message_buffer_mutex; + + /** * Send one parameter. * |