[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r6249 - gnuradio/branches/developers/gnychis/inband/us
From: |
gnychis |
Subject: |
[Commit-gnuradio] r6249 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband |
Date: |
Fri, 31 Aug 2007 23:22:12 -0600 (MDT) |
Author: gnychis
Date: 2007-08-31 23:22:12 -0600 (Fri, 31 Aug 2007)
New Revision: 6249
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_server_cs.h
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
Log:
Adding in additional error codes dealing with the state of the USRP and
reflecting these error codes in the QA code for much cleaner error response
checking.
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
2007-09-01 04:35:18 UTC (rev 6248)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
2007-09-01 05:22:12 UTC (rev 6249)
@@ -105,11 +105,13 @@
{
// Allocations should fail before open
d_tx->send(s_cmd_allocate_channel,
- pmt_list2(pmt_list2(s_response_allocate_channel, PMT_F),
+ pmt_list2(pmt_list2(s_response_allocate_channel,
+ s_err_usrp_not_opened),
pmt_from_long(1)));
d_rx->send(s_cmd_allocate_channel,
- pmt_list2(pmt_list2(s_response_allocate_channel,PMT_F),
+ pmt_list2(pmt_list2(s_response_allocate_channel,
+ s_err_usrp_not_opened),
pmt_from_long(1)));
// Retrieve information about the USRP, then run tests
@@ -608,7 +610,8 @@
// std::cout << "[qa_open_close_top] Starting tests\n";
// A close before an open should fail
- d_cs->send(s_cmd_close, pmt_list1(pmt_list2(s_response_close,PMT_F)));
+ d_cs->send(s_cmd_close, pmt_list1(pmt_list2(s_response_close,
+ s_err_usrp_already_closed)));
// Perform an open, and a second open which should fail
d_cs->send(s_cmd_open,
@@ -616,14 +619,16 @@
pmt_from_long(0)));
d_cs->send(s_cmd_open,
- pmt_list2(pmt_list2(s_response_open,PMT_F),
+ pmt_list2(pmt_list2(s_response_open,
+ s_err_usrp_already_opened),
pmt_from_long(0)));
// A close should now be successful since the interface is open
d_cs->send(s_cmd_close, pmt_list1(pmt_list2(s_response_close,PMT_T)));
// But, a second close should fail
- d_cs->send(s_cmd_close, pmt_list1(pmt_list2(s_response_close,PMT_F)));
+ d_cs->send(s_cmd_close, pmt_list1(pmt_list2(s_response_close,
+ s_err_usrp_already_closed)));
// Just to be thorough, try an open and close again
d_cs->send(s_cmd_open,
@@ -749,7 +754,8 @@
// A transmit before an open should fail
d_tx->send(s_cmd_xmit_raw_frame,
- pmt_list4(pmt_list2(s_response_xmit_raw_frame, PMT_F),
+ pmt_list4(pmt_list2(s_response_xmit_raw_frame,
+ s_err_usrp_not_opened),
pmt_from_long(0),
pmt_make_u32vector(transport_pkt::max_payload()/4, 0),
pmt_from_long(0)));
@@ -784,7 +790,8 @@
// After closing, a new transmit raw frame should fail again
d_tx->send(s_cmd_xmit_raw_frame,
- pmt_list4(pmt_list2(s_response_xmit_raw_frame, PMT_F),
+ pmt_list4(pmt_list2(s_response_xmit_raw_frame,
+ s_err_usrp_not_opened),
pmt_from_long(0),
pmt_make_u32vector(transport_pkt::max_payload()/4, 0),
pmt_from_long(0)));
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_server_cs.h
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_server_cs.h
2007-09-01 04:35:18 UTC (rev 6248)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_server_cs.h
2007-09-01 05:22:12 UTC (rev 6249)
@@ -39,4 +39,9 @@
static pmt_t s_response_nrx_chan = pmt_intern("response-nrx-chan");
static pmt_t s_response_current_capacity_allocation =
pmt_intern("response-current-capacity-allocation");
+// Errors
+static pmt_t s_err_usrp_not_opened = pmt_intern("err-usrp-not-opened");
+static pmt_t s_err_usrp_already_opened = pmt_intern("err-usrp-already-opened");
+static pmt_t s_err_usrp_already_closed = pmt_intern("err-usrp-already-closed");
+
#endif /* INCLUDED_SYMBOLS_USRP_SERVER_CS_H */
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-09-01 04:35:18 UTC (rev 6248)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
2007-09-01 05:22:12 UTC (rev 6249)
@@ -247,7 +247,7 @@
// Reject if already open
if(d_opened) {
- d_cs->send(s_response_open, pmt_list2(invocation_handle, PMT_F));
+ d_cs->send(s_response_open, pmt_list2(invocation_handle,
s_err_usrp_already_opened));
return;
}
@@ -262,7 +262,7 @@
else if (pmt_eq(event, s_cmd_close)){
if(!d_opened) {
- d_cs->send(s_response_close, pmt_list2(invocation_handle, PMT_F));
+ d_cs->send(s_response_close, pmt_list2(invocation_handle,
s_err_usrp_already_closed));
return;
}
@@ -276,7 +276,7 @@
if(!d_opened) {
d_cs->send(s_response_max_capacity,
- pmt_list3(invocation_handle, PMT_F, pmt_from_long(0)));
+ pmt_list3(invocation_handle, s_err_usrp_not_opened,
pmt_from_long(0)));
return;
}
@@ -291,7 +291,7 @@
if(!d_opened) {
d_cs->send(s_response_ntx_chan,
- pmt_list3(invocation_handle, PMT_F, pmt_from_long(0)));
+ pmt_list3(invocation_handle, s_err_usrp_not_opened,
pmt_from_long(0)));
return;
}
@@ -306,7 +306,7 @@
if(!d_opened) {
d_cs->send(s_response_nrx_chan,
- pmt_list3(invocation_handle, PMT_F, pmt_from_long(0)));
+ pmt_list3(invocation_handle, s_err_usrp_not_opened,
pmt_from_long(0)));
return;
}
@@ -322,7 +322,7 @@
if(!d_opened) {
d_cs->send(s_response_current_capacity_allocation,
pmt_list3(invocation_handle,
- PMT_F,
+ s_err_usrp_not_opened,
pmt_from_long(0)));
return;
}
@@ -345,7 +345,7 @@
if(!d_opened) {
d_tx[port]->send(s_response_allocate_channel,
pmt_list3(invocation_handle,
- PMT_F,
+ s_err_usrp_not_opened,
pmt_from_long(0)));
return;
}
@@ -360,7 +360,7 @@
if(!d_opened) {
d_tx[port]->send(s_response_deallocate_channel,
pmt_list3(invocation_handle,
- PMT_F,
+ s_err_usrp_not_opened,
pmt_from_long(0)));
return;
}
@@ -374,7 +374,7 @@
if(!d_opened) {
d_tx[port]->send(s_response_xmit_raw_frame,
- pmt_list2(invocation_handle, PMT_F));
+ pmt_list2(invocation_handle, s_err_usrp_not_opened));
return;
}
@@ -387,7 +387,7 @@
if(!d_opened) {
d_tx[port]->send(s_response_xmit_raw_frame,
- pmt_list2(invocation_handle, PMT_F));
+ pmt_list2(invocation_handle, s_err_usrp_not_opened));
return;
}
@@ -408,7 +408,7 @@
if(!d_opened) {
d_rx[port]->send(s_response_allocate_channel,
pmt_list3(invocation_handle,
- PMT_F,
+ s_err_usrp_not_opened,
pmt_from_long(0)));
return;
}
@@ -423,7 +423,7 @@
if(!d_opened) {
d_rx[port]->send(s_response_deallocate_channel,
pmt_list3(invocation_handle,
- PMT_F,
+ s_err_usrp_not_opened,
pmt_from_long(0)));
return;
}
@@ -437,7 +437,7 @@
if(!d_opened) {
d_rx[port]->send(s_response_recv_raw_samples,
- pmt_list2(invocation_handle, PMT_F));
+ pmt_list2(invocation_handle, s_err_usrp_not_opened));
return;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r6249 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband,
gnychis <=