Forum: GNU Radio [use of gr.vector_source_b]

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Rita A. (Guest)
on 2009-06-02 22:18
(Received via mailing list)
Hello!
What I want to do is coding a string with trellis. This is the code I
wrote.
(..)
f = trellis.fsm("rita.fsm")
class my_top_block (gr.top_block):
  def __init__ (self):
    gr.top_block.__init__(self)
    cadena= 'asdf'
    src = gr.vector_source_b(cadena,False)
    tre = trellis.encoder_bb(f,0)
    sink_cod_vector = gr.vector_sink_b ()
    self.connect(src,tre,sink_cod_vector)
/*/*/*/*/*
And this is what I get:
 don't know why I got this message, because I think the use of the
gr.vector_source is ok.
Traceback (most recent call last):
  File "./prueba2.py", line 21, in <module>
    my_top_block().run()
  File "./prueba2.py", line 13, in __init__
    src = gr.vector_source_b(cadena,False)
  File
"/usr/local/lib/python2.5/site-packages/gnuradio/gr/gnuradio_swig_py_gengen.py",
line 9306, in vector_source_b
    return _gnuradio_swig_py_gengen.vector_source_b(*args)
NotImplementedError: Wrong number of arguments for overloaded function
'vector_source_b'.
  Possible C/C++ prototypes are:
    gr_make_vector_source_b(std::vector<unsigned
char,std::allocator<unsigned char > > const &,bool,int)
    gr_make_vector_source_b(std::vector<unsigned
char,std::allocator<unsigned char > > const &,bool)
    gr_make_vector_source_b(std::vector<unsigned
char,std::allocator<unsigned char > > const &)


I don't what I'm doing wrong. Can someone help me?

Thanks
--
View this message in context:
http://www.nabble.com/-use-of-gr.vector_source_b--...
Sent from the GnuRadio mailing list archive at Nabble.com.
Eric B. (Guest)
on 2009-06-03 02:01
(Received via mailing list)
On Tue, Jun 02, 2009 at 11:15:35AM -0700, Rita's pfc wrote:
>
> Hello!
> What I want to do is coding a string with trellis. This is the code I wrote.
> (..)
> f = trellis.fsm("rita.fsm")
> class my_top_block (gr.top_block):
>   def __init__ (self):
>     gr.top_block.__init__(self)
>     cadena= 'asdf'

Use this instead:

    cadena = map(ord, 'asdf')
Rita A. (Guest)
on 2009-06-05 04:42
(Received via mailing list)
Thanks Eric.
But now, I want to print, or just simply get into a vector or file the
result of coding. I use the subfunction, vector_sink_x.data() . The code
I
have is:


                s='asdf'
    cadena = map(ord, s)
    src = gr.vector_source_b(cadena,False)
    tre = trellis.encoder_bb(f,0)
    sink_cod_vector = gr.vector_sink_b()
    sin = gr.file_sink(gr.sizeof_char,"fichero.log")
    self.connect(src, tre)
    self.connect(tre, sink_cod_vector)
    self.connect(tre, sin)
    print "...               ", sink_cod_vector.data()
    print "datas cod len     ", len(sink_cod_vector.data())


and the output was:

...                ()
datas cod len      0

but it creates the file fichero.log whose size is 4 bytes, what is
normal (4
chars to code)

My question is:
is there another way to get the encoded data ?




--
View this message in context:
http://www.nabble.com/-use-of-gr.vector_source_b--...
Sent from the GnuRadio mailing list archive at Nabble.com.
Eric B. (Guest)
on 2009-06-07 08:47
(Received via mailing list)
On Thu, Jun 04, 2009 at 05:50:03AM -0700, Rita's pfc wrote:
>     tre = trellis.encoder_bb(f,0)
>
> ...                ()
> datas cod len      0
>
> but it creates the file fichero.log whose size is 4 bytes, what is normal (4
> chars to code)

The vector_sink is empty because you have not yet run the graph.
Take a look at pretty much any of the qa_*.py files for examples.

Eric
Rita A. (Guest)
on 2009-06-15 16:10
(Received via mailing list)
Thanks a lot Eric

In the end I could do a small part of what I wanted, at least I have
made
some progress.
It's very probable that I will have some new troubles....

Thanks again


Eric B. wrote:
>>                 s='asdf'
>>
> The vector_sink is empty because you have not yet run the graph.
>
--
View this message in context:
http://www.nabble.com/-use-of-gr.vector_source_b--...
Sent from the GnuRadio mailing list archive at Nabble.com.
This topic is locked and can not be replied to.