Changeset 9118

Show
Ignore:
Timestamp:
08/01/08 00:25:50
Author:
eb
Message:

work-in-progress porting old apps to new framework; tx_*

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • usrp2/branches/developers/eb/merge-wip/host-ng/apps

    • Property svn:ignore changed from Makefile Makefile.in .libs .deps test_eth test_usrp2 test2_usrp2 cerr *.sh to Makefile Makefile.in .libs .deps test_eth test_usrp2 test2_usrp2 gen_const find_usrps cerr *.sh
  • usrp2/branches/developers/eb/merge-wip/host-ng/apps/Makefile.am

    r9115 r9118  
    1818include $(top_srcdir)/Makefile.common 
    1919 
    20 #AM_CXXFLAGS = -Wall -Werror (handle this with: $ ./configure CXXFLAGS="-Wall -Werror -O2 -g") 
    2120AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) $(GRUEL_CFLAGS) 
    2221 
     
    2524        -lgruel 
    2625 
     26bin_PROGRAMS = \ 
     27        find_usrps 
     28 
    2729noinst_PROGRAMS = \ 
     30        gen_const \ 
    2831        test2_usrp2 
    2932 
    30 test2_usrp2_SOURCES = \ 
    31        test2_usrp2.cc 
    32  
     33find_usrps = find_usrps.cc 
     34test2_usrp2_SOURCES = test2_usrp2.cc 
     35gen_const_SOURCES = gen_const.cc 
  • usrp2/branches/developers/eb/merge-wip/host-ng/apps/find_usrps.cc

    r9112 r9118  
    11/* -*- c++ -*- */ 
    22/* 
    3  * Copyright 2007 Free Software Foundation, Inc. 
     3 * Copyright 2007,2008 Free Software Foundation, Inc. 
    44 * 
    55 * This program is free software: you can redistribute it and/or modify 
     
    1818 
    1919#ifdef HAVE_CONFIG_H 
    20 #include "config.h" 
     20#include <config.h> 
    2121#endif 
    22 #include "usrp2_basic.h" 
     22 
     23#include <usrp2/usrp2.h> 
    2324#include <iostream> 
    2425#include <getopt.h> 
     
    5556  } 
    5657   
    57 #if 0 
    58   usrp2_basic *u2 = new usrp2_basic(); 
    59  
    60   if (!u2->open(interface)){ 
    61     std::cerr << "couldn't open " << interface << std::endl; 
    62     return 0; 
    63   } 
    64  
    65   std::vector<op_id_reply_t> r = u2->find_usrps(); 
    66 #endif 
    67  
    68   std::vector<op_id_reply_t> r = usrp2_basic::find_usrps(interface); 
     58  usrp2::props_vector_t r = usrp2::find(interface); 
    6959 
    7060  for (size_t i = 0; i < r.size(); i++){ 
  • usrp2/branches/developers/eb/merge-wip/host-ng/apps/test2_usrp2.cc

    r9115 r9118  
    2222 
    2323#include <usrp2/usrp2.h> 
    24 #include <usrp2/tune_result.h> 
    2524#include <usrp2/strtod_si.h> 
    26 #include <usrp2/rx_sample_handler.h> 
    2725#include <usrp2/copiers.h> 
    2826#include <gruel/realtime.h> 
  • usrp2/branches/developers/eb/merge-wip/host-ng/include/usrp2/usrp2.h

    r9115 r9118  
    2323#include <boost/utility.hpp> 
    2424#include <vector> 
     25#include <complex> 
     26#include <iosfwd> 
    2527#include <usrp2/rx_sample_handler.h> 
     28#include <usrp2/tune_result.h> 
     29#include <usrp2/rx_sample_handler.h> 
     30 
    2631 
    2732namespace usrp2 { 
     
    183188    // bool set_tx_format(...); 
    184189 
    185     // bool tx_samples(...) 
     190    /*! 
     191     * \brief transmit complex<float> samples to USRP2 
     192     * 
     193     * \param channel specifies the channel to send them to 
     194     * \param samples are the samples to transmit 
     195     * \param nsamples is the number of samples to transmit 
     196     * \param metadata provides the timestamp and flags 
     197     */ 
     198    bool tx_complex_float(unsigned int channel, 
     199                          const std::complex<float> *samples, 
     200                          size_t nsamples, 
     201                          const tx_metadata *metadata); 
     202 
     203    /*! 
     204     * \brief transmit complex<int16_t> samples to USRP2 
     205     * 
     206     * \param channel specifies the channel to send them to 
     207     * \param samples are the samples to transmit 
     208     * \param nsamples is the number of samples to transmit 
     209     * \param metadata provides the timestamp and flags 
     210     */ 
     211    bool tx_complex_int16(unsigned int channel, 
     212                          const std::complex<int16_t> *samples, 
     213                          size_t nsamples, 
     214                          const tx_metadata *metadata); 
     215 
     216    /*! 
     217     * \brief transmit raw uint32_t data items to USRP2 
     218     * 
     219     * The caller is responsible for ensuring that the items are 
     220     * formatted appropriately for the USRP2 and its configuration. 
     221     * This method is used primarily by the system itself.  Users 
     222     * should call tx_complex_float or tx_complex_16 instead. 
     223     * 
     224     * \param channel specifies the channel to send them to 
     225     * \param items are the data items to transmit 
     226     * \param nitems is the number of items to transmit 
     227     * \param metadata provides the timestamp and flags 
     228     */ 
     229    bool tx_raw(unsigned int channel, 
     230                const uint32_t *items, 
     231                size_t nitems, 
     232                const tx_metadata *metadata); 
     233 
     234    // ---------------------------------------------------------------- 
     235 
     236    /*! 
     237     * \brief MIMO configuration 
     238     * 
     239     * \param flags from usrp2_mimo_config.h 
     240     * 
     241     * <pre> 
     242     *   one of these: 
     243     * 
     244     *     MC_WE_DONT_LOCK 
     245     *     MC_WE_LOCK_TO_SMA 
     246     *     MC_WE_LOCK_TO_MIMO 
     247     * 
     248     *   and optionally this: 
     249     * 
     250     *     MC_PROVIDE_CLK_TO_MIMO 
     251     * </pre> 
     252     */ 
     253    bool config_mimo(int flags); 
    186254 
    187255 
     
    199267}; 
    200268 
     269std::ostream& operator<<(std::ostream &os, const usrp2::props &x); 
     270 
     271 
    201272#endif /* INCLUDED_USRP2_H */ 
  • usrp2/branches/developers/eb/merge-wip/host-ng/lib/usrp2.cc

    r9115 r9118  
    128128  } 
    129129   
     130  bool 
     131  usrp2::tx_complex_float(unsigned int channel, 
     132                          const std::complex<float> *samples, 
     133                          size_t nsamples, 
     134                          const tx_metadata *metadata) 
     135  { 
     136    return d_impl->tx_complex_float(channel, samples, nsamples, metadata); 
     137  } 
     138 
     139  bool 
     140  usrp2::tx_complex_int16(unsigned int channel, 
     141                          const std::complex<int16_t> *samples, 
     142                          size_t nsamples, 
     143                          const tx_metadata *metadata) 
     144  { 
     145    return d_impl->tx_complex_int16(channel, samples, nsamples, metadata); 
     146  } 
     147 
     148  bool 
     149  usrp2::tx_raw(unsigned int channel, 
     150                const uint32_t *items, 
     151                size_t nitems, 
     152                const tx_metadata *metadata) 
     153  { 
     154    return d_impl->tx_raw(channel, items, nitems, metadata); 
     155  } 
     156 
     157} // namespace usrp2 
    130158 
    131159 
     160std::ostream& operator<<(std::ostream &os, const usrp2::props &x) 
     161{ 
     162  os << x.addr; 
    132163 
    133 } // namespace usrp2 
     164  char buf[128]; 
     165  snprintf(buf, sizeof(buf)," hw_rev = 0x%04x", x.hw_rev); 
     166 
     167  os << buf; 
     168  return os; 
     169
  • usrp2/branches/developers/eb/merge-wip/host-ng/lib/usrp2_impl.cc

    r9116 r9118  
    743743  } 
    744744 
     745 
     746 
     747  bool 
     748  usrp2::impl::tx_complex_float(unsigned int channel, 
     749                                const std::complex<float> *samples, 
     750                                size_t nsamples, 
     751                                const tx_metadata *metadata) 
     752  { 
     753    throw std::runtime_error("not implemented"); 
     754  } 
     755 
     756  bool 
     757  usrp2::impl::tx_complex_int16(unsigned int channel, 
     758                                const std::complex<int16_t> *samples, 
     759                                size_t nsamples, 
     760                                const tx_metadata *metadata) 
     761  { 
     762    throw std::runtime_error("not implemented"); 
     763  } 
     764 
     765  bool 
     766  usrp2::impl::tx_raw(unsigned int channel, 
     767                      const uint32_t *items, 
     768                      size_t nitems, 
     769                      const tx_metadata *metadata) 
     770  { 
     771    throw std::runtime_error("not implemented"); 
     772  } 
     773 
    745774} // namespace usrp2 
  • usrp2/branches/developers/eb/merge-wip/host-ng/lib/usrp2_impl.h

    r9115 r9118  
    110110    bool set_tx_scale_iq(int scale_i, int scale_q); 
    111111 
     112    bool tx_complex_float(unsigned int channel, 
     113                          const std::complex<float> *samples, 
     114                          size_t nsamples, 
     115                          const tx_metadata *metadata); 
     116 
     117    bool tx_complex_int16(unsigned int channel, 
     118                          const std::complex<int16_t> *samples, 
     119                          size_t nsamples, 
     120                          const tx_metadata *metadata); 
     121 
     122    bool tx_raw(unsigned int channel, 
     123                const uint32_t *items, 
     124                size_t nitems, 
     125                const tx_metadata *metadata); 
    112126  }; 
    113127