discuss-gnuradio
[Top][All Lists]
Advanced

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

Re[Discuss-gnuradio] cursive call


From: Chris_Spain
Subject: Re[Discuss-gnuradio] cursive call
Date: Mon, 21 Dec 2009 03:41:16 -0800 (PST)

Hello All,

I'm trying manage a vector of 10528 bytes, I made a C++ routine and works
but, when I work with my routine in GNU Radio, It do really extrange things
and I don't know why. I try to explain:

My Routine in GNU is:

ex_scramb_ss::general_work (int noutput_items,
                               gr_vector_int &ninput_items,
                               gr_vector_const_void_star &input_items,
                               gr_vector_void_star &output_items)
{
       
        const unsigned char *mpeg2package = (const unsigned char *)
input_items[0];
        unsigned char *mpeg2packageout = (unsigned char *) output_items[0];     
     
        unsigned char result
;
        
        printf ("hello");
        for (short i=0;i<10528;i++){
                result=mpeg2package[i];
                .........  
                .........
                .........
        }
}

And my test in python is:

from gnuradio import gr, gr_unittest
import ex

class qa_ex (gr_unittest.TestCase):

    def setUp (self):
        self.tb = gr.top_block ()

    def tearDown (self):
        self.tb = None

    def test_001_escramb_ss (self):

    src_data=(0x47, 0xA7, 0x15, 0x38......(10528))
    src = gr.vector_source_b (src_data)         
    dst = gr.vector_sink_b ()   
    sqr = ex.suma_ss ()         
    self.tb.connect (src, (sqr,0))      
    self.tb.connect (sqr, dst)  
    self.tb.run ()
    result_data = dst.data ()           
if __name__ == '__main__':
    gr_unittest.main ()


Ok, I put printf("hello") and hello is printed 4 times and I don't know why,
only I connect one time my block, besides, when I print mpeg2package[i], my
entry, is printed 4 times and with diferents value (71 0 0 184), this isn't
sense because I don't modify, and I can't, my entry

-- 
View this message in context: 
http://old.nabble.com/Recursive-call-tp26872871p26872871.html
Sent from the GnuRadio mailing list archive at Nabble.com.





reply via email to

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