[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r5557 - gnuradio/branches/developers/gnychis/inband/us
From: |
gnychis |
Subject: |
[Commit-gnuradio] r5557 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband |
Date: |
Mon, 28 May 2007 13:58:33 -0600 (MDT) |
Author: gnychis
Date: 2007-05-28 13:58:33 -0600 (Mon, 28 May 2007)
New Revision: 5557
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.cc
Log:
Should not have "2" hardcoded for the number of TX and RX active channels,
d_ntx_chan and d_nrx_chan should be used
Fixed the wrong signal in usrp_server when the s_response_usrp_close signal was
received. Was accidently sending an open response back to the application
instead of a close response.
Moved starting and stopping of d_utx and d_urx. I am not sure this is correct
yet, that the interface should be started and stopped with every write()
signal, but I do believe that d_urx should not start upon the open. It should
start and stop given the cmd-start-recv-raw-samples and
cmd-stop-recv-raw-samples signals.
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
2007-05-28 17:07:00 UTC (rev 5556)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
2007-05-28 19:58:33 UTC (rev 5557)
@@ -305,7 +305,7 @@
else if (pmt_eq(event, s_response_usrp_close)) {
invocation_handle = pmt_nth(0, data);
pmt_t status = pmt_nth(1, data);
- d_cs->send(s_response_open, pmt_list2(invocation_handle, status));
+ d_cs->send(s_response_close, pmt_list2(invocation_handle, status));
return;
}
else if (pmt_eq(event, s_response_usrp_write)) {
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.cc
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.cc
2007-05-28 17:07:00 UTC (rev 5556)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.cc
2007-05-28 19:58:33 UTC (rev 5557)
@@ -121,12 +121,12 @@
d_utx = usrp_standard_tx::make (which_usrp,
16, // interp = 32.0MB/s
- 2,
+ d_ntx_chan,
-1, // mux
4096, // USB block size
16); // number of blocks for async transfers
- if(!d_utx) {
+ if(d_utx==0) {
std::cout << "[USRP_USB_INTERFACE] Failed to open TX\n";
reply_data = pmt_list2(invocation_handle, PMT_F);
d_cs->send(s_response_usrp_open, reply_data);
@@ -140,13 +140,11 @@
return;
}
- std::cout << "[USRP_USB_INTERFACE] Setup TX channel running...";
- d_utx->start(); // not sure if this is the appropriate place to start yet
- std::cout << "done!\n";
+ std::cout << "[USRP_USB_INTERFACE] Setup TX channel\n";
d_urx = usrp_standard_rx::make (which_usrp,
16, // interp = 32.0MB/s
- 2,
+ d_nrx_chan,
-1, // mux
4096, // USB block size
16); // number of blocks for async transfers
@@ -164,11 +162,9 @@
d_cs->send(s_response_usrp_open, reply_data);
return;
}
+
+ std::cout << "[USRP_USB_INTERFACE] Setup RX channel\n";
- std::cout << "[USRP_USB_INTERFACE] Setup RX, running...";
- d_urx->start(); // not sure if this is the appropriate place to start yet
- std::cout << "done!\n";
-
d_cs->send(s_response_usrp_open, pmt_list2(invocation_handle, PMT_T));
}
@@ -185,6 +181,8 @@
transport_pkt *pkts = (transport_pkt *)
pmt_u8vector_writeable_elements(v_packets, psize);
+ d_utx->start();
+
int ret = d_utx->write (pkts, n_bytes, &underrun);
if (ret == n_bytes) {
@@ -192,15 +190,17 @@
// need to respond with the channel so the USRP server knows who to
forward the result of
// the write to by looking up the owner of the channel
d_cs->send(s_response_usrp_write, pmt_list3(invocation_handle,
pmt_from_long(channel), PMT_T));
- return;
}
else {
std::cout << "[usrp_server] Error writing " << n_bytes << " bytes to USB
bus\n";
// need to respond with the channel so the USRP server knows who to
forward the result of
// the write to by looking up the owner of the channel
d_cs->send(s_response_usrp_write, pmt_list3(invocation_handle,
pmt_from_long(channel), PMT_F));
- return;
}
+
+ d_utx->stop();
+
+ return;
}
void
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r5557 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband,
gnychis <=