Do not receive anything in OSD mode

This commit is contained in:
Lorenz Meier
2016-03-28 12:37:03 +02:00
parent b600e3ee93
commit e26c5bb590
+7 -3
View File
@@ -143,7 +143,7 @@ Mavlink::Mavlink() :
_radio_id(0), _radio_id(0),
_logbuffer(5, sizeof(mavlink_log_s)), _logbuffer(5, sizeof(mavlink_log_s)),
_total_counter(0), _total_counter(0),
_receive_thread {}, _receive_thread{},
_verbose(false), _verbose(false),
_forwarding_on(false), _forwarding_on(false),
_ftp_on(false), _ftp_on(false),
@@ -1629,7 +1629,9 @@ Mavlink::task_main(int argc, char *argv[])
mavlink_update_system(); mavlink_update_system();
/* start the MAVLink receiver */ /* start the MAVLink receiver */
MavlinkReceiver::receive_start(&_receive_thread, this); if (_mode != MAVLINK_MODE_OSD) {
MavlinkReceiver::receive_start(&_receive_thread, this);
}
MavlinkOrbSubscription *param_sub = add_orb_subscription(ORB_ID(parameter_update)); MavlinkOrbSubscription *param_sub = add_orb_subscription(ORB_ID(parameter_update));
uint64_t param_time = 0; uint64_t param_time = 0;
@@ -1989,7 +1991,9 @@ Mavlink::task_main(int argc, char *argv[])
} }
/* first wait for threads to complete before tearing down anything */ /* first wait for threads to complete before tearing down anything */
pthread_join(_receive_thread, NULL); if (_mode != MAVLINK_MODE_OSD) {
pthread_join(_receive_thread, NULL);
}
delete _subscribe_to_stream; delete _subscribe_to_stream;
_subscribe_to_stream = nullptr; _subscribe_to_stream = nullptr;