aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/usrp2_impl.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-06-14 17:34:51 -0700
committerJosh Blum <josh@joshknows.com>2010-06-17 18:19:39 -0700
commite2bde1a9a38be9ca6c3bf3979d31c6a67904ab9a (patch)
treeddcba8005b04454f6efcac9c8312cdc6b450eef0 /host/lib/usrp/usrp2/usrp2_impl.cpp
parent1db016bc6503cdca76025f131773e550bd895d48 (diff)
downloaduhd-e2bde1a9a38be9ca6c3bf3979d31c6a67904ab9a.tar.gz
uhd-e2bde1a9a38be9ca6c3bf3979d31c6a67904ab9a.tar.bz2
uhd-e2bde1a9a38be9ca6c3bf3979d31c6a67904ab9a.zip
usrp2: enlarged the i2c transaction size, rev-ed the firmware protocol number, added constants for packet sizes
Diffstat (limited to 'host/lib/usrp/usrp2/usrp2_impl.cpp')
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index 0837f4ac4..36c264c3c 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -79,12 +79,12 @@ uhd::device_addrs_t usrp2::find(const device_addr_t &hint){
udp_transport->send(boost::asio::buffer(&ctrl_data_out, sizeof(ctrl_data_out)));
//loop and recieve until the timeout
- boost::uint8_t usrp2_ctrl_data_in_mem[1500]; //allocate MTU bytes for recv
+ boost::uint8_t usrp2_ctrl_data_in_mem[USRP2_UDP_BYTES]; //allocate max bytes for recv
usrp2_ctrl_data_t *ctrl_data_in = reinterpret_cast<usrp2_ctrl_data_t *>(usrp2_ctrl_data_in_mem);
while(true){
size_t len = udp_transport->recv(asio::buffer(usrp2_ctrl_data_in_mem));
//std::cout << len << "\n";
- if (len >= sizeof(usrp2_ctrl_data_t)){
+ if (len > offsetof(usrp2_ctrl_data_t, data)){
//handle the received data
switch(ntohl(ctrl_data_in->id)){
case USRP2_CTRL_ID_WAZZUP_DUDE: