commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r4747 - in gnuradio/branches/developers/n4hy/ofdm: . c


From: n4hy
Subject: [Commit-gnuradio] r4747 - in gnuradio/branches/developers/n4hy/ofdm: . config gnuradio-core/src/lib/general gnuradio-core/src/python/gnuradio/gruimpl gr-qtgui/src/lib usrp/doc
Date: Wed, 14 Mar 2007 06:47:51 -0600 (MDT)

Author: n4hy
Date: 2007-03-14 06:47:51 -0600 (Wed, 14 Mar 2007)
New Revision: 4747

Added:
   gnuradio/branches/developers/n4hy/ofdm/config/gr_qwt.m4
   gnuradio/branches/developers/n4hy/ofdm/usrp/doc/inband-signaling-usb-host
Modified:
   gnuradio/branches/developers/n4hy/ofdm/config/grc_gr_qtgui.m4
   gnuradio/branches/developers/n4hy/ofdm/configure.ac
   
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_framer_sink_1.cc
   
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/python/gnuradio/gruimpl/crc.py
   gnuradio/branches/developers/n4hy/ofdm/gr-qtgui/src/lib/Makefile.am
   gnuradio/branches/developers/n4hy/ofdm/gr-qtgui/src/lib/fftdisplay.cc
   gnuradio/branches/developers/n4hy/ofdm/gr-qtgui/src/lib/fftdisplay.h
Log:
merge -r 4732:4746 from trunk

Copied: gnuradio/branches/developers/n4hy/ofdm/config/gr_qwt.m4 (from rev 4746, 
gnuradio/trunk/config/gr_qwt.m4)
===================================================================
--- gnuradio/branches/developers/n4hy/ofdm/config/gr_qwt.m4                     
        (rev 0)
+++ gnuradio/branches/developers/n4hy/ofdm/config/gr_qwt.m4     2007-03-14 
12:47:51 UTC (rev 4747)
@@ -0,0 +1,99 @@
+dnl
+dnl Copyright 2007 Free Software Foundation, Inc.
+dnl 
+dnl This file is part of GNU Radio
+dnl 
+dnl GNU Radio is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2, or (at your option)
+dnl any later version.
+dnl 
+dnl GNU Radio is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License
+dnl along with GNU Radio; see the file COPYING.  If not, write to
+dnl the Free Software Foundation, Inc., 51 Franklin Street,
+dnl Boston, MA 02110-1301, USA.
+dnl
+
+dnl Configure paths for library qwt.
+dnl
+dnl GR_QWT([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl
+dnl Test for library qwt, set QWT_CFLAGS and QWT_LIBS if found. Assumes 
+dnl QT_CFLAGS and QT_LIBS have already been correctly set.
+dnl
+
+AC_DEFUN([GR_QWT],
+[
+    dnl Save the environment
+    AC_LANG_PUSH(C++)
+    qwt_save_CPPFLAGS="$CPPFLAGS"
+    qwt_save_LIBS="$LIBS"
+    libqwt_ok=yes
+
+    dnl Allow user to specify where QWT files are
+    AC_ARG_WITH([qwt-libdir],
+               [  --with-qwt-libdir=path  Prefix where QWT library is 
installed (optional)],
+               [qwt_libdir="$withval"], [qwt_libdir=""])
+
+    AC_ARG_WITH([qwt-incdir],
+               [  --with-qwt-incdir=path  Prefix where QWT include files are 
(optional)],
+               [qwt_incdir="$withval"], [qwt_incdir=""])
+
+    dnl Create QWT_CFLAGS based on user input
+    AC_MSG_CHECKING(QWT_CFLAGS)
+    if test "$qwt_incdir" != "" ; then
+       QWT_CFLAGS="$QWT_CFLAGS -I$qwt_incdir"
+    fi
+    AC_MSG_RESULT($QWT_CFLAGS)
+    
+    dnl Set CPPFLAGS so C++ tests can operate
+    CPPFLAGS="$CPPFLAGS $QT_CFLAGS $QWT_CFLAGS"
+
+    dnl Check for presence of header files
+    AC_CHECK_HEADERS([qwt/qwt.h], 
+                    [],
+                    [libqwt_ok=no;AC_MSG_RESULT([cannot find usable qwt 
headers])]
+    )
+
+    dnl Set QWT_LIBS based on user input
+    AC_MSG_CHECKING(QWT_LIBS)
+    QWT_LIBS="-lqwt"
+    if test "$qwt_libdir" != "" ; then
+       QWT_LIBS="$QWT_LIBS -L$qwt_libdir"
+    fi
+    AC_MSG_RESULT($QWT_LIBS)
+
+    dnl Set LIBS so C++ link test can operate
+    LIBS="$QWT_LIBS $QT_LIBS $LIBS"
+
+    dnl Check that library files can be linked in
+    dnl This references an arbitrary static class method 
+    AC_TRY_LINK([#include <qwt/qwt_text.h>],
+               [Qt::TextFormat tf = QwtText::defaultFormat()],
+               [],
+                [libqwt_ok=no;AC_MSG_RESULT([unable to link QWT library])]
+    )
+
+    dnl Restore saved variables
+    LIBS="$qwt_save_LIBS"
+    CPPFLAGS="$qwt_save_CPPFLAGS"
+    AC_LANG_POP
+
+    dnl Execute user actions
+    if test "x$libqwt_ok" = "xyes" ; then
+       ifelse([$1], , :, [$1])
+    else
+       QWT_CFLAGS=""
+       QWT_LIBDIRS=""
+       ifelse([$2], , :, [$2])
+    fi
+
+    dnl Export our variables
+    AC_SUBST(QWT_CFLAGS)
+    AC_SUBST(QWT_LIBS)
+])

Modified: gnuradio/branches/developers/n4hy/ofdm/config/grc_gr_qtgui.m4
===================================================================
--- gnuradio/branches/developers/n4hy/ofdm/config/grc_gr_qtgui.m4       
2007-03-14 00:18:18 UTC (rev 4746)
+++ gnuradio/branches/developers/n4hy/ofdm/config/grc_gr_qtgui.m4       
2007-03-14 12:47:51 UTC (rev 4747)
@@ -26,22 +26,19 @@
          gr-qtgui/src/lib/Makefile \
     ])
 
+    # Check for package qt or qt-mt, set QT_CFLAGS and QT_LIBS
     passed=yes
     PKG_CHECK_MODULES(QT, qt >= 3.3,[],
-    [passed=no;AC_MSG_RESULT([gr-qtgui requires qt, not found. Checking for 
qt-mt])])
+    [passed=no;AC_MSG_RESULT([gr-qtgui requires libqt or libqt-mt, libqt not 
found. Checking for libqt-mt])])
 
     if test x$passed == xno; then
        passed=yes
        PKG_CHECK_MODULES(QT, qt-mt >= 3.3,[],
-       [passed=no;AC_MSG_RESULT([gr-qtgui requires qt, not found. Checking for 
qt-mt])])
+       [passed=no;AC_MSG_RESULT([gr-qtgui requires libqt or libqt-mt, neither 
found.])])
     fi
 
-    PKG_CHECK_MODULES(qwt, qwt >= 5.0,[],
-    [passed=no;AC_MSG_RESULT([gr-qtgui requires qwt, not found. Checking for 
qt-mt])])
+    # Fetch QWT variables
+    GR_QWT([], [passed=no])
 
-    
-    GRC_BUILD_CONDITIONAL([gr-qtgui], [
-    AC_SUBST(QT_LIBS)
-    AC_SUBST(QWT_CFLAGS)
-    AC_SUBST(QWT_LIBS)])
+    GRC_BUILD_CONDITIONAL([gr-qtgui],[])
 ])

Modified: gnuradio/branches/developers/n4hy/ofdm/configure.ac
===================================================================
--- gnuradio/branches/developers/n4hy/ofdm/configure.ac 2007-03-14 00:18:18 UTC 
(rev 4746)
+++ gnuradio/branches/developers/n4hy/ofdm/configure.ac 2007-03-14 12:47:51 UTC 
(rev 4747)
@@ -195,6 +195,9 @@
     [  --enable-all-components Build all components or stop on failed 
dependencies]
 )
 
+dnl check to see if QWT libraries are availble to build QTGUI
+GR_QWT
+
 build_dirs="config"
 GRC_OMNITHREAD                 dnl must come before gnuradio-core and mblock
 GRC_GNURADIO_CORE
@@ -213,7 +216,7 @@
 GRC_GR_RADIO_ASTRONOMY
 GRC_GR_TRELLIS
 GRC_GR_VIDEO_SDL
-#GRC_GR_QTGUI                  dnl disabled until grc_gr_qtgui.m4 is final
+GRC_GR_QTGUI                   dnl disabled until grc_gr_qtgui.m4 is final
 GRC_GR_WXGUI
 GRC_PMT
 GRC_MBLOCK                     dnl this must come after GRC_PMT

Modified: 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_framer_sink_1.cc
===================================================================
--- 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_framer_sink_1.cc
    2007-03-14 00:18:18 UTC (rev 4746)
+++ 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_framer_sink_1.cc
    2007-03-14 12:47:51 UTC (rev 4747)
@@ -127,13 +127,25 @@
          // we have a full header, check to see if it has been received 
properly
          if (header_ok()){
            int payload_len;
-           int payload_offset;
-           header_payload(&payload_len, &payload_offset);
-           enter_have_header(payload_len, payload_offset);
+           int whitener_offset;
+           header_payload(&payload_len, &whitener_offset);
+           enter_have_header(payload_len, whitener_offset);
+
+           if (d_packetlen == 0){          // check for zero-length payload
+             // build a zero-length message
+             // NOTE: passing header field as arg1 is not scalable
+             gr_message_sptr msg =
+               gr_make_message(0, d_packet_whitener_offset, 0, 0);
+             
+             d_target_queue->insert_tail(msg);         // send it
+             msg.reset();                              // free it up
+
+             enter_search();                           
+           }
          }
          else
-           enter_search();                             // no.
-         break;                        // we're in a new state
+           enter_search();                             // bad header
+         break;                                        // we're in a new state
        }
       }
       break;
@@ -152,7 +164,8 @@
 
            // build a message
            // NOTE: passing header field as arg1 is not scalable
-           gr_message_sptr msg = gr_make_message(0, d_packet_whitener_offset, 
0, d_packetlen_cnt);         
+           gr_message_sptr msg =
+             gr_make_message(0, d_packet_whitener_offset, 0, d_packetlen_cnt);
            memcpy(msg->msg(), d_packet, d_packetlen_cnt);
 
            d_target_queue->insert_tail(msg);           // send it

Modified: 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/python/gnuradio/gruimpl/crc.py
===================================================================
--- 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/python/gnuradio/gruimpl/crc.py
     2007-03-14 00:18:18 UTC (rev 4746)
+++ 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/python/gnuradio/gruimpl/crc.py
     2007-03-14 12:47:51 UTC (rev 4747)
@@ -28,6 +28,8 @@
     return s + struct.pack(">I", hexint(crc))
 
 def check_crc32(s):
+    if len(s) < 4:
+        return (False, '')
     msg = s[:-4]
     #print "msg = '%s'" % (msg,)
     actual = gr.crc32(msg)

Modified: gnuradio/branches/developers/n4hy/ofdm/gr-qtgui/src/lib/Makefile.am
===================================================================
--- gnuradio/branches/developers/n4hy/ofdm/gr-qtgui/src/lib/Makefile.am 
2007-03-14 00:18:18 UTC (rev 4746)
+++ gnuradio/branches/developers/n4hy/ofdm/gr-qtgui/src/lib/Makefile.am 
2007-03-14 12:47:51 UTC (rev 4747)
@@ -1,5 +1,5 @@
 #
-# Copyright 2004,2005 Free Software Foundation, Inc.
+# Copyright 2004,2005,2007 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -48,7 +48,7 @@
 
 nodist_qt_examples_SOURCES =           \
        $(BUILT_SOURCES)
-       
+
 qt_examples_SOURCES =                  \
        fftdisplay.cc                   \
        qt_examples.cc
@@ -57,9 +57,5 @@
                    $(QT_LIBS)          \
                    $(GNURADIO_CORE_LA)
 
-
-qt_examples_LDFLAGS = $(QT_CFLAGS)     \
-                     $(QWT_CFLAGS)
-
 MOSTLYCLEANFILES =                     \
        *~ $(BUILT_SOURCES)

Modified: gnuradio/branches/developers/n4hy/ofdm/gr-qtgui/src/lib/fftdisplay.cc
===================================================================
--- gnuradio/branches/developers/n4hy/ofdm/gr-qtgui/src/lib/fftdisplay.cc       
2007-03-14 00:18:18 UTC (rev 4746)
+++ gnuradio/branches/developers/n4hy/ofdm/gr-qtgui/src/lib/fftdisplay.cc       
2007-03-14 12:47:51 UTC (rev 4747)
@@ -1,10 +1,10 @@
 #ifndef FFT_DISPLAY_CC
 #define FFT_DISPLAY_CC
 
-#include <qwt_painter.h>
-#include <qwt_plot_canvas.h>
-#include <qwt_plot_curve.h>
-#include <qwt_scale_engine.h>
+#include <qwt/qwt_painter.h>
+#include <qwt/qwt_plot_canvas.h>
+#include <qwt/qwt_plot_curve.h>
+#include <qwt/qwt_scale_engine.h>
 #include <qapplication.h>
 #include <fftdisplay.h>
 

Modified: gnuradio/branches/developers/n4hy/ofdm/gr-qtgui/src/lib/fftdisplay.h
===================================================================
--- gnuradio/branches/developers/n4hy/ofdm/gr-qtgui/src/lib/fftdisplay.h        
2007-03-14 00:18:18 UTC (rev 4746)
+++ gnuradio/branches/developers/n4hy/ofdm/gr-qtgui/src/lib/fftdisplay.h        
2007-03-14 12:47:51 UTC (rev 4747)
@@ -6,7 +6,7 @@
 #include <vector>
 
 #include <qwidget.h>
-#include <qwt_plot.h>
+#include <qwt/qwt_plot.h>
 #include <qevent.h>
 
 class fft_display_event:public QCustomEvent{

Copied: 
gnuradio/branches/developers/n4hy/ofdm/usrp/doc/inband-signaling-usb-host (from 
rev 4746, gnuradio/trunk/usrp/doc/inband-signaling-usb-host)
===================================================================
--- gnuradio/branches/developers/n4hy/ofdm/usrp/doc/inband-signaling-usb-host   
                        (rev 0)
+++ gnuradio/branches/developers/n4hy/ofdm/usrp/doc/inband-signaling-usb-host   
2007-03-14 12:47:51 UTC (rev 4747)
@@ -0,0 +1,258 @@
+#
+# 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.
+#
+
+This is preliminary design document on the organization of the host
+component of the USRP inband signaling implementation over USB.
+
+Assumptions: we'll have a single usrp_usb_daemon, implemented as an
+mblock, that will provide the high-level message based interface to
+the USRP.  The daemon will handle all resource allocation, muxing and
+demuxing for the control and status messages from multiple clients.
+
+The underlying cross-process IPC mechanism is not yet specified.
+All communication will be via messages.
+
+The external interface to the usrp_usb_daemon will consist of two sets
+of replicated ports, one set for the transmit, and one set for
+receive.
+
+
+// ------------------------------------------------------------------------
+
+// Protocol class usrp_usb_common
+// Defined from client's point-of-view
+//
+// This protocol class is shared by the usrp_usb_tx and usrp_usb_rx
+// protocol classes
+
+// outgoing:
+
+cmd_allocate_channel(invocation_handle, channel, capacity_reservation)
+
+invocation_handle
+Type   Handle
+Use    The identifier provided by the client to tag the method invocation.
+       The identifier will be returned with the response, to provide
+       the client with a mechanism to match asynchronous responses with
+       commands that generated them.
+
+channel
+Type   integer
+Use    Specifies the Tx channel to allocate
+
+capacity_reservation
+Type   float, units are bytes/s
+Use    Specifies the number of bytes/s of USB capacity to reserve for
+       this channel.
+
+
+// incoming:
+
+response_allocate_channel(invocation_handle, status)
+
+Type   Handle
+Use    The identifier provided by the client in the prompting invocation.
+       The identifier is returned with the response, so that the
+       client has a mechanism to match asynchronous responses with
+       commands that generated them.  The value of the invocation_handle
+       is opaque to the server, and is not required by the server to be unique.
+
+Type   Status
+Use    Contains the status code for the operation, per FIXME, and
+       an optional message.
+
+Preconditions:
+  a) None
+  
+Postconditions:
+  a) If successful, the requested channel and USB capacity are
+     allocated for the client's exclusive use.
+
+
+// outgoing:
+
+cmd_deallocate_channel(invocation_handle, channel)
+
+invocation_handle
+Type   Handle
+Use    The identifier provided by the client to tag the method invocation.
+       The identifier will be returned with the response, to provide
+       the client with a mechanism to match asynchronous responses with
+       commands that generated them.
+
+channel
+Type   integer
+Use    Specifies the Tx channel to deallocate
+
+
+// incoming:
+
+response_deallocate_channel(invocation_handle, status)
+
+Type   Handle
+Use    The identifier provided by the client in the prompting invocation.
+       The identifier is returned with the response, so that the
+       client has a mechanism to match asynchronous responses with
+       commands that generated them.  The value of the invocation_handle
+       is opaque to the server, and is not required by the server to be unique.
+
+Type   Status
+Use    Contains the status code for the operation, per FIXME, and
+       an optional message.
+
+Preconditions:
+  a) None
+  
+Postconditions: 
+  a) If successful, the requested channel and associated USB capacity
+     are deallocated, and return to the pool of available resources.
+
+
+// ------------------------------------------------------------------------
+
+// Protocol class usrp_usb_tx inherits from usrp_usb_common 
+// Defined from client's point-of-view
+
+// outgoing:
+
+cmd_xmit_raw_frame(invocation_handle, channel, samples, timestamp)
+
+invocation_handle
+Type   Handle
+Use    The identifier provided by the client to tag the method invocation.
+       The identifier will be returned with the response, to provide
+       the client with a mechanism to match asynchronous responses with
+       commands that generated them.
+
+channel
+Type   integer
+Use    Specifies the channel that the frame of samples shall be transmitted on.
+
+samples
+Type   homogenous vector of unsigned char
+Use    These samples must already be in the appropriate format for parsing
+       by the USRP FPGA.  The required format depends on the
+       configuration associated with this channel.  No conversion of
+       the samples takes place in this method.  Samples will be split
+       into multiple USB data packets as required for transport
+       across the USB.
+
+timestamp
+Type   32-bit integer
+Use    Specifies the time at which the first sample in samples
+       shall be sent to the D/A converter.  The format and
+       interpretation of time is as specified in
+       inband-signaling-usb.
+
+
+// incoming:
+
+response_xmit_raw_frame(invocation_handle, status)
+
+Type   Handle
+Use    The identifier provided by the client in the prompting invocation.
+       The identifier is returned with the response, so that the
+       client has a mechanism to match asynchronous responses with
+       commands that generated them.  The value of the invocation_handle
+       is opaque to the server, and is not required by the server to be unique.
+
+Type   Status
+Use    Contains the status code for the operation, per FIXME, and
+       an optional message.
+
+Preconditions:
+  a) The specified channel is allocated to this client
+  
+Postconditions: 
+  a) If successful, the samples of the frame have been queued for
+     transmission to the USRP.
+
+
+// ------------------------------------------------------------------------
+
+// Protocol class usrp_usb_rx inherits from usrp_usb_common 
+// Defined from client's point-of-view
+
+
+// outgoing:
+
+cmd_recv_raw_samples(invocation_handle, channel)
+
+invocation_handle
+Type   Handle
+Use    The identifier provided by the client to tag the method invocation.
+       The identifier will be returned with the response, to provide
+       the client with a mechanism to match asynchronous responses with
+       commands that generated them.
+
+channel
+Type   integer
+Use    Specifies the channel that the samples shall be received from.
+
+The client may issue multiple cmd_recv_raw_samples commands to ensure
+an uninterrupted flow of samples.  The appropriate number of
+outstanding cmds to issue is TBD, but is at least 2.
+
+[Discussion: I'm not sure if this is really the interface we want.  
+We may want to provide an enable/disable method, and then just begin
+streaming samples.  Or, we may wan to implement packet boundary
+detection in the FPGA, and then return a frame's worth of samples
+(potentially in multiple pieces).
+
+It may be that we need to different modes, one for packet based
+reception and one for continuous streaming.]
+
+
+// incoming:
+
+response_recv_raw_samples(invocation_handle, samples, timestamp, properties)
+
+Type   Handle
+Use    The identifier provided by the client in the prompting invocation.
+       The identifier is returned with the response, so that the
+       client has a mechanism to match asynchronous responses with
+       commands that generated them.  The value of the invocation_handle
+       is opaque to the server, and is not required by the server to be unique.
+
+samples
+Type   homogenous vector of unsigned char
+Use    Samples as returned by the USRP FPGA.  The format of the
+       returned samples depends on the configuration associated with
+       this channel.  No conversion or unpacking of samples takes place in
+       this method.
+
+timestamp
+Type   32-bit integer
+Use    Specifies the time at which the first sample in samples
+       was received from the A/D converter.  The format and
+       interpretation of time is as specified in
+       inband-signaling-usb.
+
+properties
+Type   Map
+Use    Returns additional (key, value) pairs associated with the
+       reception of these samples.  In particular, the map may contain
+       the Received Strength Signal Indication (RSSI) reported by the
+       front end at the time the first sample was received from the A/D.
+
+// ------------------------------------------------------------------------
+
+To do: control and configuration messages...
+





reply via email to

[Prev in Thread] Current Thread [Next in Thread]