diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-10-23 15:16:30 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-10-23 17:10:03 -0700 |
commit | 1ba66314ffc8d3eced5c30a2d484660ab16559f0 (patch) | |
tree | 6b133f365a65b9c76be3c9230db35da2d87bd792 | |
parent | 22e3c3e85925937653371ea970292caffc899ef9 (diff) | |
download | uhd-1ba66314ffc8d3eced5c30a2d484660ab16559f0.tar.gz uhd-1ba66314ffc8d3eced5c30a2d484660ab16559f0.tar.bz2 uhd-1ba66314ffc8d3eced5c30a2d484660ab16559f0.zip |
n230: Properly initialize request before discovery
The request struct passed to send() was not fully initialized, causing
code checkers to choke. This fix doesn't affect functionality (the
values were not used for anything), but removes warnings.
-rw-r--r-- | host/lib/usrp/n230/n230_fw_ctrl_iface.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/host/lib/usrp/n230/n230_fw_ctrl_iface.cpp b/host/lib/usrp/n230/n230_fw_ctrl_iface.cpp index 18c2c4cf8..61a7d2d65 100644 --- a/host/lib/usrp/n230/n230_fw_ctrl_iface.cpp +++ b/host/lib/usrp/n230/n230_fw_ctrl_iface.cpp @@ -23,6 +23,7 @@ #include <boost/format.hpp> #include <boost/asio.hpp> //used for htonl and ntohl #include "n230_fw_comm_protocol.h" +#include <cstring> namespace uhd { namespace usrp { namespace n230 { @@ -189,6 +190,7 @@ std::vector<std::string> n230_fw_ctrl_iface::discover_devices( //Send dummy request fw_comm_pkt_t request; + std::memset(&request, 0, sizeof(request)); request.id = uhd::htonx<uint32_t>(FW_COMM_GENERATE_ID(product_id)); request.flags = uhd::htonx<uint32_t>(FW_COMM_FLAGS_ACK|FW_COMM_CMD_ECHO); request.sequence = uhd::htonx<uint32_t>(std::rand()); |