diff options
Diffstat (limited to 'gr-pager')
-rw-r--r-- | gr-pager/CMakeLists.txt | 102 | ||||
-rw-r--r-- | gr-pager/apps/CMakeLists.txt | 22 | ||||
-rw-r--r-- | gr-pager/grc/CMakeLists.txt | 26 | ||||
-rw-r--r-- | gr-pager/lib/CMakeLists.txt | 76 | ||||
-rw-r--r-- | gr-pager/lib/Makefile.am | 1 | ||||
-rw-r--r-- | gr-pager/lib/pager_api.h | 33 | ||||
-rw-r--r-- | gr-pager/lib/pager_flex_deinterleave.h | 7 | ||||
-rw-r--r-- | gr-pager/lib/pager_flex_frame.h | 7 | ||||
-rw-r--r-- | gr-pager/lib/pager_flex_parse.h | 7 | ||||
-rw-r--r-- | gr-pager/lib/pager_flex_sync.h | 7 | ||||
-rw-r--r-- | gr-pager/lib/pager_slicer_fb.h | 7 | ||||
-rw-r--r-- | gr-pager/python/CMakeLists.txt | 49 | ||||
-rw-r--r-- | gr-pager/swig/CMakeLists.txt | 51 |
13 files changed, 380 insertions, 15 deletions
diff --git a/gr-pager/CMakeLists.txt b/gr-pager/CMakeLists.txt new file mode 100644 index 000000000..9d23e617d --- /dev/null +++ b/gr-pager/CMakeLists.txt @@ -0,0 +1,102 @@ +# Copyright 2011 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 3, 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Setup dependencies +######################################################################## +include(GrBoost) + +######################################################################## +# Register component +######################################################################## +include(GrComponent) +GR_REGISTER_COMPONENT("gr-pager" ENABLE_GR_PAGER + Boost_FOUND + ENABLE_GR_CORE_ +) + +GR_SET_GLOBAL(GR_PAGER_INCLUDE_DIRS + ${CMAKE_CURRENT_SOURCE_DIR}/lib +) + +######################################################################## +# Begin conditional configuration +######################################################################## +if(ENABLE_GR_PAGER) + +######################################################################## +# Setup CPack components +######################################################################## +include(GrPackage) +CPACK_SET(CPACK_COMPONENT_GROUP_PAGER_DESCRIPTION "GNU Radio Pager Blocks") + +CPACK_COMPONENT("pager_runtime" + GROUP "Pager" + DISPLAY_NAME "Runtime" + DESCRIPTION "Runtime" + DEPENDS "core_runtime" +) + +CPACK_COMPONENT("pager_devel" + GROUP "Pager" + DISPLAY_NAME "Development" + DESCRIPTION "C++ headers, package config, import libraries" + DEPENDS "core_devel" +) + +CPACK_COMPONENT("pager_python" + GROUP "Pager" + DISPLAY_NAME "Python" + DESCRIPTION "Python modules for runtime; GRC xml files" + DEPENDS "core_python;pager_runtime" +) + +CPACK_COMPONENT("pager_swig" + GROUP "Pager" + DISPLAY_NAME "SWIG" + DESCRIPTION "SWIG development .i files" + DEPENDS "core_swig;pager_python;pager_devel" +) + +######################################################################## +# Add subdirectories +######################################################################## +add_subdirectory(lib) +if(ENABLE_PYTHON) + add_subdirectory(python) + add_subdirectory(swig) + add_subdirectory(grc) + add_subdirectory(apps) +endif(ENABLE_PYTHON) + +######################################################################## +# Create Pkg Config File +######################################################################## +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-pager.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-pager.pc +@ONLY) + +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-pager.pc + DESTINATION ${GR_LIBRARY_DIR}/pkgconfig + COMPONENT "pager_devel" +) + +endif(ENABLE_GR_PAGER) diff --git a/gr-pager/apps/CMakeLists.txt b/gr-pager/apps/CMakeLists.txt new file mode 100644 index 000000000..4b7cd54fa --- /dev/null +++ b/gr-pager/apps/CMakeLists.txt @@ -0,0 +1,22 @@ +# Copyright 2011 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 3, 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +#FIXME +#not bothering to install because the apps require gr-usrp +#which we are choosing not to support in the cmake build system diff --git a/gr-pager/grc/CMakeLists.txt b/gr-pager/grc/CMakeLists.txt new file mode 100644 index 000000000..2b01a1e0b --- /dev/null +++ b/gr-pager/grc/CMakeLists.txt @@ -0,0 +1,26 @@ +# Copyright 2011 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 3, 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +install(FILES + pager_slicer_fb.xml + pager_flex_sync.xml + pager_flex_deinterleave.xml + DESTINATION ${GRC_BLOCKS_DIR} + COMPONENT "pager_python" +) diff --git a/gr-pager/lib/CMakeLists.txt b/gr-pager/lib/CMakeLists.txt new file mode 100644 index 000000000..c6899ab20 --- /dev/null +++ b/gr-pager/lib/CMakeLists.txt @@ -0,0 +1,76 @@ +# Copyright 2011 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 3, 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Setup the include and linker paths +######################################################################## +include_directories( + ${GNURADIO_CORE_INCLUDE_DIRS} + ${GR_PAGER_INCLUDE_DIRS} +) + +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) + +######################################################################## +# Setup library +######################################################################## +list(APPEND gr_pager_sources + pager_flex_frame.cc + pager_slicer_fb.cc + pager_flex_sync.cc + pager_flex_deinterleave.cc + pager_flex_parse.cc + pageri_bch3221.cc + pageri_flex_modes.cc + pageri_util.cc +) + +list(APPEND pager_libs + gnuradio-core + ${Boost_LIBRARIES} +) + +add_library(gnuradio-pager SHARED ${gr_pager_sources}) +target_link_libraries(gnuradio-pager ${pager_libs}) +set_target_properties(gnuradio-pager PROPERTIES DEFINE_SYMBOL "gnuradio_pager_EXPORTS") +set_target_properties(gnuradio-pager PROPERTIES SOVERSION ${LIBVER}) + +install(TARGETS gnuradio-pager + LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "pager_runtime" # .so/.dylib file + ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "pager_devel" # .lib file + RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "pager_runtime" # .dll file +) + +######################################################################## +# Install header files +######################################################################## +install(FILES + pager_api.h + pager_slicer_fb.h + pager_flex_sync.h + pager_flex_deinterleave.h + pager_flex_parse.h + pager_flex_frame.h + pageri_bch3221.h + pageri_flex_modes.h + pageri_util.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio + COMPONENT "pager_devel" +) diff --git a/gr-pager/lib/Makefile.am b/gr-pager/lib/Makefile.am index 29c82ebe8..b6131171d 100644 --- a/gr-pager/lib/Makefile.am +++ b/gr-pager/lib/Makefile.am @@ -25,6 +25,7 @@ AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES) # These headers get installed in ${prefix}/include/gnuradio grinclude_HEADERS = \ + pager_api.h \ pager_slicer_fb.h \ pager_flex_sync.h \ pager_flex_deinterleave.h \ diff --git a/gr-pager/lib/pager_api.h b/gr-pager/lib/pager_api.h new file mode 100644 index 000000000..4312c5ae3 --- /dev/null +++ b/gr-pager/lib/pager_api.h @@ -0,0 +1,33 @@ +/* + * Copyright 2011 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 3, 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 GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_PAGER_API_H +#define INCLUDED_PAGER_API_H + +#include <gruel/attributes.h> + +#ifdef gnuradio_pager_EXPORTS +# define PAGER_API __GR_ATTR_EXPORT +#else +# define PAGER_API __GR_ATTR_IMPORT +#endif + +#endif /* INCLUDED_PAGER_API_H */ diff --git a/gr-pager/lib/pager_flex_deinterleave.h b/gr-pager/lib/pager_flex_deinterleave.h index 7211a71ad..87094490d 100644 --- a/gr-pager/lib/pager_flex_deinterleave.h +++ b/gr-pager/lib/pager_flex_deinterleave.h @@ -22,23 +22,24 @@ #ifndef INCLUDED_PAGER_FLEX_DEINTERLEAVE_H #define INCLUDED_PAGER_FLEX_DEINTERLEAVE_H +#include <pager_api.h> #include <gr_sync_decimator.h> class pager_flex_deinterleave; typedef boost::shared_ptr<pager_flex_deinterleave> pager_flex_deinterleave_sptr; -pager_flex_deinterleave_sptr pager_make_flex_deinterleave(); +PAGER_API pager_flex_deinterleave_sptr pager_make_flex_deinterleave(); /*! * \brief flex deinterleave description * \ingroup pager_blk */ -class pager_flex_deinterleave : public gr_sync_decimator +class PAGER_API pager_flex_deinterleave : public gr_sync_decimator { private: // Constructors - friend pager_flex_deinterleave_sptr pager_make_flex_deinterleave(); + friend PAGER_API pager_flex_deinterleave_sptr pager_make_flex_deinterleave(); pager_flex_deinterleave(); // One FLEX block of deinterleaved data diff --git a/gr-pager/lib/pager_flex_frame.h b/gr-pager/lib/pager_flex_frame.h index 1f4999e2b..857b49d29 100644 --- a/gr-pager/lib/pager_flex_frame.h +++ b/gr-pager/lib/pager_flex_frame.h @@ -21,6 +21,7 @@ #ifndef INCLUDED_PAGER_FLEX_FRAME_H #define INCLUDED_PAGER_FLEX_FRAME_H +#include <pager_api.h> #include <boost/shared_ptr.hpp> class pager_flex_frame; @@ -29,15 +30,15 @@ typedef boost::shared_ptr<pager_flex_frame> pager_flex_frame_sptr; /*! * \brief public constructor for pager_flex_frame */ -pager_flex_frame_sptr pager_make_flex_frame(); +PAGER_API pager_flex_frame_sptr pager_make_flex_frame(); /*! * \brief flex_frame. */ -class pager_flex_frame { +class PAGER_API pager_flex_frame { // Constructor is private to force use of shared_ptr pager_flex_frame(); - friend pager_flex_frame_sptr pager_make_flex_frame(); + friend PAGER_API pager_flex_frame_sptr pager_make_flex_frame(); public: ~pager_flex_frame(); diff --git a/gr-pager/lib/pager_flex_parse.h b/gr-pager/lib/pager_flex_parse.h index 0f7cfb370..dcbd19eae 100644 --- a/gr-pager/lib/pager_flex_parse.h +++ b/gr-pager/lib/pager_flex_parse.h @@ -22,6 +22,7 @@ #ifndef INCLUDED_PAGER_FLEX_PARSE_H #define INCLUDED_PAGER_FLEX_PARSE_H +#include <pager_api.h> #include <gr_sync_block.h> #include <gr_msg_queue.h> #include <pageri_flex_modes.h> @@ -30,7 +31,7 @@ class pager_flex_parse; typedef boost::shared_ptr<pager_flex_parse> pager_flex_parse_sptr; -pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue, float freq); +PAGER_API pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue, float freq); #define FIELD_DELIM ((unsigned char)128) @@ -38,11 +39,11 @@ pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue, float freq) * \brief flex parse description * \ingroup pager_blk */ -class pager_flex_parse : public gr_sync_block +class PAGER_API pager_flex_parse : public gr_sync_block { private: // Constructors - friend pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue, float freq); + friend PAGER_API pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue, float freq); pager_flex_parse(gr_msg_queue_sptr queue, float freq); std::ostringstream d_payload; diff --git a/gr-pager/lib/pager_flex_sync.h b/gr-pager/lib/pager_flex_sync.h index b401bf532..53b6f950a 100644 --- a/gr-pager/lib/pager_flex_sync.h +++ b/gr-pager/lib/pager_flex_sync.h @@ -22,24 +22,25 @@ #ifndef INCLUDED_PAGER_FLEX_SYNC_H #define INCLUDED_PAGER_FLEX_SYNC_H +#include <pager_api.h> #include <gr_block.h> class pager_flex_sync; typedef boost::shared_ptr<pager_flex_sync> pager_flex_sync_sptr; typedef std::vector<gr_int64> gr_int64_vector; -pager_flex_sync_sptr pager_make_flex_sync(); +PAGER_API pager_flex_sync_sptr pager_make_flex_sync(); /*! * \brief flex sync description * \ingroup pager_blk */ -class pager_flex_sync : public gr_block +class PAGER_API pager_flex_sync : public gr_block { private: // Constructors - friend pager_flex_sync_sptr pager_make_flex_sync(); + friend PAGER_API pager_flex_sync_sptr pager_make_flex_sync(); pager_flex_sync(); // State machine transitions diff --git a/gr-pager/lib/pager_slicer_fb.h b/gr-pager/lib/pager_slicer_fb.h index 75eea3cd3..b3d92780f 100644 --- a/gr-pager/lib/pager_slicer_fb.h +++ b/gr-pager/lib/pager_slicer_fb.h @@ -22,21 +22,22 @@ #ifndef INCLUDED_PAGER_SLICER_FB_H #define INCLUDED_PAGER_SLICER_FB_H +#include <pager_api.h> #include <gr_sync_block.h> class pager_slicer_fb; typedef boost::shared_ptr<pager_slicer_fb> pager_slicer_fb_sptr; -pager_slicer_fb_sptr pager_make_slicer_fb(float alpha); +PAGER_API pager_slicer_fb_sptr pager_make_slicer_fb(float alpha); /*! * \brief slicer description * \ingroup pager_blk */ -class pager_slicer_fb : public gr_sync_block +class PAGER_API pager_slicer_fb : public gr_sync_block { private: - friend pager_slicer_fb_sptr pager_make_slicer_fb(float alpha); + friend PAGER_API pager_slicer_fb_sptr pager_make_slicer_fb(float alpha); pager_slicer_fb(float alpha); unsigned char slice(float sample); diff --git a/gr-pager/python/CMakeLists.txt b/gr-pager/python/CMakeLists.txt new file mode 100644 index 000000000..bbbf35a71 --- /dev/null +++ b/gr-pager/python/CMakeLists.txt @@ -0,0 +1,49 @@ +# Copyright 2011 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 3, 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +include(GrPython) + +GR_PYTHON_INSTALL( + FILES + __init__.py + pager_utils.py + flex_demod.py + DESTINATION ${GR_PYTHON_DIR}/gnuradio/pager + COMPONENT "pager_python" +) + +######################################################################## +# Handle the unit tests +######################################################################## +if(ENABLE_TESTING) +include(GrTest) +file(GLOB py_qa_test_files "qa_*.py") +foreach(py_qa_test_file ${py_qa_test_files}) + get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) + set(GR_TEST_PYTHON_DIRS + ${CMAKE_BINARY_DIR}/gnuradio-core/src/python + ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig + ${CMAKE_BINARY_DIR}/gr-pager/python + ${CMAKE_BINARY_DIR}/gr-pager/swig + ) + set(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-pager) + GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${py_qa_test_file}) +endforeach(py_qa_test_file) +endif(ENABLE_TESTING) diff --git a/gr-pager/swig/CMakeLists.txt b/gr-pager/swig/CMakeLists.txt new file mode 100644 index 000000000..bfb34c929 --- /dev/null +++ b/gr-pager/swig/CMakeLists.txt @@ -0,0 +1,51 @@ +# Copyright 2011 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 3, 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Setup swig generation +######################################################################## +include(GrPython) +include(GrSwig) + +set(GR_SWIG_INCLUDE_DIRS + ${GR_PAGER_INCLUDE_DIRS} + ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} +) + +set(GR_SWIG_LIBRARIES gnuradio-pager) + +GR_SWIG_MAKE(pager_swig pager_swig.i) + +GR_SWIG_INSTALL( + TARGETS pager_swig + DESTINATION ${GR_PYTHON_DIR}/gnuradio/pager + COMPONENT "pager_python" +) + +install( + FILES + pager_swig.i + pager_flex_deinterleave.i + pager_flex_frame.i + pager_flex_parse.i + pager_flex_sync.i + pager_slicer_fb.i + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig + COMPONENT "pager_swig" +) |