discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] strange operation when char at input


From: Nemanja Savic
Subject: [Discuss-gnuradio] strange operation when char at input
Date: Thu, 30 May 2013 00:54:51 +0200

Hi all guys,

I wouldn't bother again but I have spent a lot of time trying to figure out what's going on.

Nameli I want to design block with char type at input and char type at the output.
After finished with the design I realized strange block operation. Input samples were always zero. Then I tried with this:

int
test_proba_sync_bb::work(int noutput_items,
          gr_vector_const_void_star &input_items,
          gr_vector_void_star &output_items)
{
    const char *in1 = (const char *) input_items[0];
    char *out = (char *) output_items[0];
    const char *in2 = (const char *) input_items[1];

    // Do <+signal processing+>
    for(int i=0;i<noutput_items;i++)
        out[i] = in1[i]+in2[i];
    // Tell runtime system how many output items we produced.
    return noutput_items;
}

After quite some time I designed similar block with float ports and it worked. Then I changed upper block to have short type at input and output and it worked just fine.
And yes, in test everything works just fine, but in grc not, It always spits 0 at the output.
Is there any possible complications with endianess or I don't know.

Best,

--
Nemanja Savić

reply via email to

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