discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] Clear output buffer of a block in GnuRadio


From: Cristian Rodríguez
Subject: [Discuss-gnuradio] Clear output buffer of a block in GnuRadio
Date: Sun, 2 Jul 2017 02:53:20 -0500

Hi all.

I'm implementing the next block:

Imágenes integradas 1
Depending of a parameter that's put in the message port, it links the input to just one of the outputs. The code is:

int n= std::min(ninput_items[0], noutput_items);
int i=0;
        if(d_st==0){
            while(i < n){
                out_wifi[i] = in[i]; //Output 1
                i++;
            }
        }else{
            while(i < n){
                out_zigbee[i] = in[i]; //Output 2
                i++;
            }
        }
        consume_each (i);
        return i;

When I implement it, I get a bad output if I link one second one output, and the rest of the time the other.

Input to output2 (1 second)
Imágenes integradas 3

Later, I switch input to output1 (rest of the simulation)
Imágenes integradas 2

It should continue as the before screenshot, but after a while, suddenly, i have signal in the two outputs.
Imágenes integradas 4

How can it happen? After that moment, the behavior is cyclic, the output 2 a while has signal and other while it doesn't (The signal must be just in the output 1). So I think, the circular buffer of the  output 2, was wrote and it is not being erased.

How can I clear the buffer after switch the output? or, what do you think is my problem?

Thanks in advance.

Best regards,

Cristian

Pdta: It is the flowgraph
Imágenes integradas 5

reply via email to

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