[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r5834 - gnuradio/branches/developers/gnychis/inband/us
From: |
gnychis |
Subject: |
[Commit-gnuradio] r5834 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband |
Date: |
Mon, 25 Jun 2007 16:17:03 -0600 (MDT) |
Author: gnychis
Date: 2007-06-25 16:17:03 -0600 (Mon, 25 Jun 2007)
New Revision: 5834
Added:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_channel.h
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_interface_cs.h
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_low_level_cs.h
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_rx.h
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_rx_cs.h
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_tx.h
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_tx_cs.h
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.h
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_interface.mbh
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx.cc
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx_stub.cc
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx.cc
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.cc
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.cc
Log:
Adding in new symbol headers to clean up repeating symbol definitions throughout
multiple source files which is a nuisance.
The current control/status commands are only coded to be 1 per USB packet
currently, and will later be multiple per packet. Want to speed up testing on
the FPGA with basic commands.
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.h
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.h
2007-06-25 22:15:03 UTC (rev 5833)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.h
2007-06-25 22:17:03 UTC (rev 5834)
@@ -32,7 +32,7 @@
CPPUNIT_TEST(test_chan_allocation);
CPPUNIT_TEST(test_chan_deallocation);
CPPUNIT_TEST(test_tx);
- CPPUNIT_TEST(test_rx);
+// CPPUNIT_TEST(test_rx);
CPPUNIT_TEST_SUITE_END();
private:
Added:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_channel.h
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_channel.h
(rev 0)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_channel.h
2007-06-25 22:17:03 UTC (rev 5834)
@@ -0,0 +1,34 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_SYMBOLS_USRP_CHANNEL_H
+#define INCLUDED_SYMBOLS_USRP_CHANNEL_H
+
+#include <pmt.h>
+
+// Outgoing
+static pmt_t s_cmd_allocate_channel = pmt_intern("cmd-allocate-channel");
+static pmt_t s_cmd_deallocate_channel = pmt_intern("cmd-deallocate-channel");
+
+// Incoming
+static pmt_t s_response_allocate_channel =
pmt_intern("response-allocate-channel");
+static pmt_t s_response_deallocate_channel =
pmt_intern("response-deallocate-channel");
+
+#endif /* INCLUDED_SYMBOLS_USRP_CHANNEL_H */
Added:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_interface_cs.h
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_interface_cs.h
(rev 0)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_interface_cs.h
2007-06-25 22:17:03 UTC (rev 5834)
@@ -0,0 +1,43 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_SYMBOLS_USRP_INTERFACE_CS_H
+#define INCLUDED_SYMBOLS_USRP_INTERFACE_CS_H
+
+#include <pmt.h>
+
+// Outgoing
+static pmt_t s_cmd_usrp_open = pmt_intern("cmd-usrp-open");
+static pmt_t s_cmd_usrp_close = pmt_intern("cmd-usrp-close");
+static pmt_t s_cmd_usrp_ntx_chan = pmt_intern("cmd-usrp-ntx-chan");
+static pmt_t s_cmd_usrp_nrx_chan = pmt_intern("cmd-usrp-nrx-chan");
+static pmt_t s_cmd_usrp_write = pmt_intern("cmd-usrp-write");
+static pmt_t s_cmd_usrp_start_reading = pmt_intern("cmd-usrp-start-reading");
+static pmt_t s_cmd_usrp_stop_reading = pmt_intern("cmd-usrp-stop-reading");
+
+// Incoming
+static pmt_t s_response_usrp_open = pmt_intern("response-usrp-open");
+static pmt_t s_response_usrp_close = pmt_intern("response-usrp-close");
+static pmt_t s_response_usrp_ntx_chan = pmt_intern("response-usrp-ntx-chan");
+static pmt_t s_response_usrp_nrx_chan = pmt_intern("response-usrp-nrx-chan");
+static pmt_t s_response_usrp_write = pmt_intern("response-usrp-write");
+static pmt_t s_response_usrp_read = pmt_intern("response-usrp-read");
+
+#endif /* INCLUDED_SYMBOLS_USRP_INTERFACE_CS_H */
Added:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_low_level_cs.h
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_low_level_cs.h
(rev 0)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_low_level_cs.h
2007-06-25 22:17:03 UTC (rev 5834)
@@ -0,0 +1,47 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_SYMBOLS_USRP_LOW_LEVEL_CS_H
+#define INCLUDED_SYMBOLS_USRP_LOW_LEVEL_CS_H
+
+#include <pmt.h>
+
+// Outgoing
+static pmt_t s_cmd_to_control_channel = pmt_intern("cmd-to-control-channel");
+
+// Incoming
+static pmt_t s_response_from_control_channel =
pmt_intern("response-from-control-channel");
+
+// Subpackets
+static pmt_t s_op_ping_fixed = pmt_intern("op-ping-fixed");
+static pmt_t s_op_ping_fixed_reply = pmt_intern("op-ping-fixed-reply");
+static pmt_t s_op_write_reg = pmt_intern("op-write-reg");
+static pmt_t s_op_write_reg_masked = pmt_intern("op-write-reg-masked");
+static pmt_t s_op_read_reg = pmt_intern("op-read-reg");
+static pmt_t s_op_read_reg_reply = pmt_intern("op-read-reg-reply");
+static pmt_t s_op_i2c_write = pmt_intern("op-i2c-write");
+static pmt_t s_op_i2c_read = pmt_intern("op-i2c-read");
+static pmt_t s_op_i2c_read_reply = pmt_intern("op-i2c-read-reply");
+static pmt_t s_op_spi_write = pmt_intern("op-spi-write");
+static pmt_t s_op_spi_read = pmt_intern("op-spi-read");
+static pmt_t s_op_spi_read_reply = pmt_intern("op-spi-read-reply");
+static pmt_t s_op_delay = pmt_intern("op-delay");
+
+#endif /* INCLUDED_SYMBOLS_USRP_LOW_LEVEL_CS_H */
Added:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_rx.h
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_rx.h
(rev 0)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_rx.h
2007-06-25 22:17:03 UTC (rev 5834)
@@ -0,0 +1,33 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_SYMBOLS_USRP_RX_H
+#define INCLUDED_SYMBOLS_USRP_RX_H
+
+#include <pmt.h>
+
+// Outgoing
+static pmt_t s_cmd_start_recv_raw_samples =
pmt_intern("cmd-start-recv-raw-samples");
+static pmt_t s_cmd_stop_recv_raw_samples =
pmt_intern("cmd-stop-recv-raw-samples");
+
+// Incoming
+static pmt_t s_response_recv_raw_samples =
pmt_intern("response-recv-raw-samples");
+
+#endif /* INCLUDED_SYMBOLS_USRP_RX_H */
Added:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_rx_cs.h
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_rx_cs.h
(rev 0)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_rx_cs.h
2007-06-25 22:17:03 UTC (rev 5834)
@@ -0,0 +1,32 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_SYMBOLS_USRP_RX_CS_H
+#define INCLUDED_SYMBOLS_USRP_RX_CS_H
+
+#include <pmt.h>
+
+// Outgoing
+static pmt_t s_cmd_usrp_rx_start_reading =
pmt_intern("cmd-usrp-rx-start-reading");
+
+// Incoming
+static pmt_t s_response_usrp_rx_read = pmt_intern("response-usrp-rx-read");
+
+#endif /* INCLUDED_SYMBOLS_USRP_RX_CS_H */
Added:
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
(rev 0)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_server_cs.h
2007-06-25 22:17:03 UTC (rev 5834)
@@ -0,0 +1,42 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_SYMBOLS_USRP_SERVER_CS_H
+#define INCLUDED_SYMBOLS_USRP_SERVER_CS_H
+
+#include <pmt.h>
+
+// Outgoing
+static pmt_t s_cmd_open = pmt_intern("cmd-open");
+static pmt_t s_cmd_close = pmt_intern("cmd-close");
+static pmt_t s_cmd_max_capacity = pmt_intern("cmd-max-capacity");
+static pmt_t s_cmd_ntx_chan = pmt_intern("cmd-ntx-chan");
+static pmt_t s_cmd_nrx_chan = pmt_intern("cmd-nrx-chan");
+static pmt_t s_cmd_current_capacity_allocation =
pmt_intern("cmd-current-capacity-allocation");
+
+// Incoming
+static pmt_t s_response_open = pmt_intern("response-open");
+static pmt_t s_response_close = pmt_intern("response-close");
+static pmt_t s_response_max_capacity = pmt_intern("response-max-capacity");
+static pmt_t s_response_ntx_chan = pmt_intern("response-ntx-chan");
+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");
+
+#endif /* INCLUDED_SYMBOLS_USRP_SERVER_CS_H */
Added:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_tx.h
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_tx.h
(rev 0)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_tx.h
2007-06-25 22:17:03 UTC (rev 5834)
@@ -0,0 +1,32 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_SYMBOLS_USRP_TX_H
+#define INCLUDED_SYMBOLS_USRP_TX_H
+
+#include <pmt.h>
+
+// Outgoing
+static pmt_t s_cmd_xmit_raw_frame = pmt_intern("cmd-xmit-raw-frame");
+
+// Incoming
+static pmt_t s_response_xmit_raw_frame = pmt_intern("response-xmit-raw-frame");
+
+#endif /* INCLUDED_SYMBOLS_USRP_TX_H */
Added:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_tx_cs.h
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_tx_cs.h
(rev 0)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_tx_cs.h
2007-06-25 22:17:03 UTC (rev 5834)
@@ -0,0 +1,32 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_SYMBOLS_USRP_TX_CS_H
+#define INCLUDED_SYMBOLS_USRP_TX_CS_H
+
+#include <pmt.h>
+
+// Outgoing
+static pmt_t s_cmd_usrp_tx_write = pmt_intern("cmd-usrp-tx-write");
+
+// Incoming
+static pmt_t s_response_usrp_tx_write = pmt_intern("response-usrp-tx-write");
+
+#endif /* INCLUDED_SYMBOLS_USRP_TX_CS_H */
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_interface.mbh
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_interface.mbh
2007-06-25 22:15:03 UTC (rev 5833)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_interface.mbh
2007-06-25 22:17:03 UTC (rev 5834)
@@ -55,7 +55,7 @@
;; ----------------------------------------------------------------
;; usrp-tx-cs
;;
-;; Handles interaction between the USB interface and RX interface
+;; Handles interaction between the USB interface and TX interface
(define-protocol-class usrp-tx-cs
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx.cc
===================================================================
--- gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx.cc
2007-06-25 22:15:03 UTC (rev 5833)
+++ gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx.cc
2007-06-25 22:17:03 UTC (rev 5834)
@@ -34,13 +34,12 @@
#include <fpga_regs_common.h>
#include <stdio.h>
+#include <symbols_usrp_rx_cs.h>
+
typedef usrp_inband_usb_packet transport_pkt;
static const bool verbose = false;
-static pmt_t s_cmd_usrp_rx_start_reading =
pmt_intern("cmd-usrp-rx-start-reading");
-static pmt_t s_response_usrp_rx_read = pmt_intern("response-usrp-rx-read");
-
usrp_rx::usrp_rx(mb_runtime *rt, const std::string &instance_name, pmt_t
user_arg)
: mb_mblock(rt, instance_name, user_arg),
d_disk_write(false)
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx_stub.cc
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx_stub.cc
2007-06-25 22:15:03 UTC (rev 5833)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx_stub.cc
2007-06-25 22:17:03 UTC (rev 5834)
@@ -36,15 +36,14 @@
#include "ui_nco.h"
#include <fstream>
+#include <symbols_usrp_rx_cs.h>
+
typedef usrp_inband_usb_packet transport_pkt;
static const bool verbose = false;
bool usrp_rx_stop;
-static pmt_t s_cmd_usrp_rx_start_reading =
pmt_intern("cmd-usrp-rx-start-reading");
-static pmt_t s_response_usrp_rx_read = pmt_intern("response-usrp-rx-read");
-
usrp_rx_stub::usrp_rx_stub(mb_runtime *rt, const std::string &instance_name,
pmt_t user_arg)
: mb_mblock(rt, instance_name, user_arg),
d_samples_per_frame((long)(126)),
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-06-25 22:15:03 UTC (rev 5833)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
2007-06-25 22:17:03 UTC (rev 5834)
@@ -29,55 +29,15 @@
#include <vector>
#include <usrp_usb_interface.h>
+#include <symbols_usrp_server_cs.h>
+#include <symbols_usrp_channel.h>
+#include <symbols_usrp_tx.h>
+#include <symbols_usrp_rx.h>
+#include <symbols_usrp_low_level_cs.h>
+#include <symbols_usrp_interface_cs.h>
+
typedef usrp_inband_usb_packet transport_pkt; // makes conversion to gigabit
easy
-// FIXME We should machine generate these by a simple preprocessor run over
this file
-//
-// These are all the messages that we expect to receive.
-//
-// We "intern" these here (make them into symbols) so that our
-// comparisions below are effectively pointer comparisons.
-
-static pmt_t s_cmd_allocate_channel = pmt_intern("cmd-allocate-channel");
-static pmt_t s_cmd_close = pmt_intern("cmd-close");
-static pmt_t s_cmd_deallocate_channel = pmt_intern("cmd-deallocate-channel");
-static pmt_t s_cmd_open = pmt_intern("cmd-open");
-static pmt_t s_cmd_start_recv_raw_samples =
pmt_intern("cmd-start-recv-raw-samples");
-static pmt_t s_cmd_stop_recv_raw_samples =
pmt_intern("cmd-stop-recv-raw-samples");
-static pmt_t s_cmd_to_control_channel = pmt_intern("cmd-to-control-channel");
-static pmt_t s_cmd_xmit_raw_frame = pmt_intern("cmd-xmit-raw-frame");
-static pmt_t s_cmd_max_capacity = pmt_intern("cmd-max-capacity");
-static pmt_t s_cmd_ntx_chan = pmt_intern("cmd-ntx-chan");
-static pmt_t s_cmd_nrx_chan = pmt_intern("cmd-nrx-chan");
-static pmt_t s_cmd_current_capacity_allocation =
pmt_intern("cmd-current-capacity-allocation");
-static pmt_t s_response_allocate_channel =
pmt_intern("response-allocate-channel");
-static pmt_t s_response_close = pmt_intern("response-close");
-static pmt_t s_response_deallocate_channel =
pmt_intern("response-deallocate-channel");
-static pmt_t s_response_from_control_channel =
pmt_intern("response-from-control-channel");
-static pmt_t s_response_open = pmt_intern("response-open");
-static pmt_t s_response_recv_raw_samples =
pmt_intern("response-recv-raw-samples");
-static pmt_t s_response_xmit_raw_frame = pmt_intern("response-xmit-raw-frame");
-static pmt_t s_response_max_capacity = pmt_intern("response-max-capacity");
-static pmt_t s_response_ntx_chan = pmt_intern("response-ntx-chan");
-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");
-
-// USRP signal set
-static pmt_t s_cmd_usrp_open = pmt_intern("cmd-usrp-open");
-static pmt_t s_cmd_usrp_close = pmt_intern("cmd-usrp-close");
-static pmt_t s_cmd_usrp_write = pmt_intern("cmd-usrp-write");
-static pmt_t s_cmd_usrp_ntx_chan = pmt_intern("cmd-usrp-ntx-chan");
-static pmt_t s_cmd_usrp_nrx_chan = pmt_intern("cmd-usrp-nrx-chan");
-static pmt_t s_cmd_usrp_start_reading = pmt_intern("cmd-usrp-start-reading");
-static pmt_t s_cmd_usrp_stop_reading = pmt_intern("cmd-usrp-stop-reading");
-static pmt_t s_response_usrp_ntx_chan = pmt_intern("response-usrp-ntx-chan");
-static pmt_t s_response_usrp_nrx_chan = pmt_intern("response-usrp-nrx-chan");
-static pmt_t s_response_usrp_open = pmt_intern("response-usrp-open");
-static pmt_t s_response_usrp_close = pmt_intern("response-usrp-close");
-static pmt_t s_response_usrp_write = pmt_intern("response-usrp-write");
-static pmt_t s_response_usrp_read = pmt_intern("response-usrp-read");
-
-
const static bool verbose = false;
static std::string
@@ -238,6 +198,11 @@
long channel = pmt_to_long(pmt_nth(2, data));
long port;
+ // Do not report back responses if they were generated from a
+ // command packet
+ if(channel == 0x1f)
+ return;
+
// Find the port through the owner of the channel
if((port = tx_port_index(d_chaninfo_tx[channel].owner)) !=-1 )
d_tx[port]->send(s_response_xmit_raw_frame,
@@ -688,10 +653,15 @@
long n_subpackets = pmt_length(subpackets);
size_t psize;
- long payload = 0;
+ long payload_len = 0;
+ long channel = 0x1f;
- pmt_t v_packets;
+ pmt_t v_packet;
transport_pkt *pkt;
+
+ // Ensure the channel is valid and the caller owns the port
+ if(!check_valid(port, channel, chan_info,
+ pmt_list2(s_response_xmit_raw_frame, invocation_handle)))
// The design of the following code is optimized for simplicity, not
// performance. To performance optimize this code, the total size in bytes
@@ -705,14 +675,26 @@
// another packet is created.
for(int i=0; i < n_subpackets; i++) {
+
+ v_packet = pmt_make_u8vector(sizeof(transport_pkt), 0);
+ pkt = (transport_pkt *) pmt_u8vector_writeable_elements(v_packet, psize);
- // We create a new packet when the payload is set to 0
- if(payload == 0) {
- v_packets = pmt_make_u8vector(sizeof(transport_pkt), 0);
+ pmt_t subp = pmt_nth(i, subpackets);
+ pmt_t subp_cmd = pmt_nth(0, subp);
- pkt = (transport_pkt *) pmt_u8vector_writeable_elements(v_packets,
psize);
+ //--------- PING FIXED --------------//
+ if(pmt_eq(subp_cmd, s_op_ping_fixed)) {
+ payload_len = 4;
}
+
+ pkt->set_header(0, channel, 0, payload_len);
+ pkt->set_timestamp(0xffffffff);
+ d_cs_usrp->send(s_cmd_usrp_write,
+ pmt_list3(invocation_handle,
+ pmt_from_long(channel),
+ v_packet));
+
}
return;
@@ -897,7 +879,7 @@
pmt_t invocation_handle = pmt_nth(1, signal_info);
// not a valid channel number?
- if(channel >= chan_info.size()) {
+ if(channel >= (long)chan_info.size()) {
port->send(response_signal,
pmt_list2(invocation_handle,
pmt_from_long(CHANNEL_INVALID)));
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx.cc
===================================================================
--- gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx.cc
2007-06-25 22:15:03 UTC (rev 5833)
+++ gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx.cc
2007-06-25 22:17:03 UTC (rev 5834)
@@ -32,13 +32,12 @@
#include <usrp_standard.h>
#include <stdio.h>
+#include <symbols_usrp_tx_cs.h>
+
typedef usrp_inband_usb_packet transport_pkt;
static const bool verbose = false;
-static pmt_t s_cmd_usrp_tx_write = pmt_intern("cmd-usrp-tx-write");
-static pmt_t s_response_usrp_tx_write = pmt_intern("response-usrp-tx-write");
-
usrp_tx::usrp_tx(mb_runtime *rt, const std::string &instance_name, pmt_t
user_arg)
: mb_mblock(rt, instance_name, user_arg)
{
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.cc
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.cc
2007-06-25 22:15:03 UTC (rev 5833)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.cc
2007-06-25 22:17:03 UTC (rev 5834)
@@ -34,13 +34,12 @@
#include <stdio.h>
#include <fstream>
+#include <symbols_usrp_tx_cs.h>
+
typedef usrp_inband_usb_packet transport_pkt;
static const bool verbose = false;
-static pmt_t s_cmd_usrp_tx_write = pmt_intern("cmd-usrp-tx-write");
-static pmt_t s_response_usrp_tx_write = pmt_intern("response-usrp-tx-write");
-
usrp_tx_stub::usrp_tx_stub(mb_runtime *rt, const std::string &instance_name,
pmt_t user_arg)
: mb_mblock(rt, instance_name, user_arg),
d_disk_write(false)
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-06-25 22:15:03 UTC (rev 5833)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.cc
2007-06-25 22:17:03 UTC (rev 5834)
@@ -39,26 +39,10 @@
typedef usrp_inband_usb_packet transport_pkt;
-static pmt_t s_cmd_usrp_open = pmt_intern("cmd-usrp-open");
-static pmt_t s_cmd_usrp_close = pmt_intern("cmd-usrp-close");
-static pmt_t s_cmd_usrp_write = pmt_intern("cmd-usrp-write");
-static pmt_t s_cmd_usrp_ntx_chan = pmt_intern("cmd-usrp-ntx-chan");
-static pmt_t s_cmd_usrp_nrx_chan = pmt_intern("cmd-usrp-nrx-chan");
-static pmt_t s_cmd_usrp_start_reading = pmt_intern("cmd-usrp-start-reading");
-static pmt_t s_cmd_usrp_stop_reading = pmt_intern("cmd-usrp-stop-reading");
-static pmt_t s_response_usrp_ntx_chan = pmt_intern("response-usrp-ntx-chan");
-static pmt_t s_response_usrp_nrx_chan = pmt_intern("response-usrp-nrx-chan");
-static pmt_t s_response_usrp_open = pmt_intern("response-usrp-open");
-static pmt_t s_response_usrp_close = pmt_intern("response-usrp-close");
-static pmt_t s_response_usrp_write = pmt_intern("response-usrp-write");
-static pmt_t s_response_usrp_read = pmt_intern("response-usrp-read");
+#include <symbols_usrp_interface_cs.h>
+#include <symbols_usrp_tx_cs.h>
+#include <symbols_usrp_rx_cs.h>
-// TX and RX signals
-static pmt_t s_cmd_usrp_rx_start_reading =
pmt_intern("cmd-usrp-rx-start-reading");
-static pmt_t s_response_usrp_rx_read = pmt_intern("response-usrp-rx-read");
-static pmt_t s_cmd_usrp_tx_write = pmt_intern("cmd-usrp-tx-write");
-static pmt_t s_response_usrp_tx_write = pmt_intern("response-usrp-tx-write");
-
static const bool verbose = false;
// need to take number of TX and RX channels as parameter
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r5834 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband,
gnychis <=