diff options
author | Thomas Tsou <tom@tsou.cc> | 2013-11-15 23:00:28 -0500 |
---|---|---|
committer | Thomas Tsou <tom@tsou.cc> | 2013-11-16 01:44:07 -0500 |
commit | 2c7911096991648ca2be73b9abfafb5c937177a0 (patch) | |
tree | fa38ac3e0d7c256a0acd062ef848a5bf3e2fc79b /Transceiver52M/UHDDevice.cpp | |
parent | 85b179d125bb0b969188599f57a2f5dbb9b0151d (diff) |
Transceiver52M: UHD: Check running status before stopping stream
On startup errors we get a segfault if we stop and shutdown. This
is because we try to send a stop stream command to the device before
it has been created. Setup a check for running status before
attempting to stop the physical device.
Signed-off-by: Thomas Tsou <tom@tsou.cc>
Diffstat (limited to 'Transceiver52M/UHDDevice.cpp')
-rw-r--r-- | Transceiver52M/UHDDevice.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index 6275cb2..7781838 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -756,7 +756,10 @@ bool uhd_device::start() bool uhd_device::stop() { - uhd::stream_cmd_t stream_cmd = + if (!started) + return false; + + uhd::stream_cmd_t stream_cmd = uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS; usrp_dev->issue_stream_cmd(stream_cmd); |