aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-10-23 15:16:30 -0700
committermichael-west <michael.west@ettus.com>2017-12-19 17:36:30 -0800
commit0e378472772732ecf73fe21d5bb70042555d4d19 (patch)
treee01047bd4575786329c5a3200068151b4c78c977
parentaf2ea27551d74d631c9645cbaa9d96c8a5ec74d3 (diff)
downloaduhd-0e378472772732ecf73fe21d5bb70042555d4d19.tar.gz
uhd-0e378472772732ecf73fe21d5bb70042555d4d19.tar.bz2
uhd-0e378472772732ecf73fe21d5bb70042555d4d19.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/common/usrp3_fw_ctrl_iface.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp b/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp
index 16ee84140..1010c069b 100644
--- a/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp
+++ b/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp
@@ -24,6 +24,7 @@
#include <boost/asio.hpp> //used for htonl and ntohl
#include <boost/foreach.hpp>
#include "fw_comm_protocol.h"
+#include <cstring>
namespace uhd { namespace usrp { namespace usrp3 {
@@ -190,6 +191,7 @@ std::vector<std::string> usrp3_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());