Monday, September 12, 2016

[Discuss-gnuradio] Fwd: GRC block crash after some seconds

/* -*- c++ -*- */
/*
* Copyright 2016 <+YOU OR YOUR COMPANY+>.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/

#ifndef INCLUDED_TUTORIALMURILLO_MY_DEINTERLEAVER_IMPL_H
#define INCLUDED_TUTORIALMURILLO_MY_DEINTERLEAVER_IMPL_H

#include <tutorialmurillo/my_deinterleaver.h>

const int buff_entr= 2880; //Tamaño del buffer de entrada
using namespace std;

#include <tutorialmurillo/my_interleaver.h>
#include <iostream> /* cin,cout */
#include <vector> /* vector */
#include <stdlib.h> /* srand, rand */
#include <time.h> /* time */
#include <cstdlib> /* clean */
#include <cstdio> /* printf */

namespace gr {
namespace tutorialmurillo {

class my_deinterleaver_impl : public my_deinterleaver
{
private:
// Nothing to declare in this block.
void IDbuff(unsigned char in);
vector<vector<int> > inici_mat(vector<vector<int> > interleaver, int fil, int col);
void imprimir_vec(unsigned char ini_vec[buff_entr],const int tam);
void imprim_mat(vector<vector<int> > interleaver, int fil, int col);
void dellenar_long(vector<vector<int> > long_interleaver, unsigned char ini_vec[buff_entr]);
void dellenar_short(vector<vector<int> > short_interleaver,unsigned char ini_vec[buff_entr]);
vector<vector<int> > rellenar_short(vector<vector<int> > short_interleaver,unsigned char ini_vec[buff_entr]);
vector<vector<int> > rellenar_long(vector<vector<int> > long_interleaver,unsigned char ini_vec[buff_entr]);

public:
my_deinterleaver_impl();
~my_deinterleaver_impl();

// Where all the action really happens
int work(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
};

} // namespace tutorialmurillo
} // namespace gr

#endif /* INCLUDED_TUTORIALMURILLO_MY_DEINTERLEAVER_IMPL_H */

/* -*- c++ -*- */
/*
* Copyright 2016 <+YOU OR YOUR COMPANY+>.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/

#ifndef INCLUDED_TUTORIALMURILLO_MY_INTERLEAVER_IMPL_H
#define INCLUDED_TUTORIALMURILLO_MY_INTERLEAVER_IMPL_H

const int buff_entr= 2880; //Tamaño del buffer de entrada

#include <tutorialmurillo/my_interleaver.h>
#include <iostream> /* cin,cout */
#include <vector> /* vector */
#include <stdlib.h> /* srand, rand */
#include <time.h> /* time */
#include <cstdlib> /* clean */
#include <cstdio> /* printf */
using namespace std;

namespace gr {
namespace tutorialmurillo {

class my_interleaver_impl : public my_interleaver
{
private:
// Poner funciones extras aqui.
void IDbuff(unsigned char in);
vector<vector<int> > inici_mat(vector<vector<int> > interleaver, int fil, int col);
vector<vector<int> > llenar_short(vector<vector<int> > long_interleaver, unsigned char ini_vec[buff_entr]);
vector<vector<int> > llenar_long(vector<vector<int> > long_interleaver, unsigned char ini_vec[buff_entr]);
void imprimir_vec(unsigned char ini_vec[buff_entr],const int tam);
void imprim_mat(vector<vector<int> > interleaver, int fil, int col);
void vaciar_long(vector<vector<int> > long_interleaver, unsigned char ini_vec[buff_entr]);
void vaciar_short(vector<vector<int> > short_interleaver, unsigned char ini_vec[buff_entr]);

public:
my_interleaver_impl();
~my_interleaver_impl();

// Where all the action really happens
int work(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);


};

} // namespace tutorialmurillo
} // namespace gr

#endif /* INCLUDED_TUTORIALMURILLO_MY_INTERLEAVER_IMPL_H */


---------- Forwarded message ----------
From: Giancarlo Murillo <giancarlo.murillo@ucsp.edu.pe>
Date: 2016-09-08 17:13 GMT-05:00
Subject: GRC block crash after some seconds
To: discuss-gnuradio-request@gnu.org


Hello experts, i managed to build my first block for GNURadio, which is a interleaver and deinterleaver, which functions like this

1) Receive 2880 byte buffer
2) Fill interleaver matrix
3) Flush Interleaver matrix in a new buffer

And the process repeats, but for some reason, the program works for a random period of time, then crashes, i dont know what is the problem, im attaching my code.


--
Saludos y Buena suerte
Atte.
Giancarlo Freddy Murillo Arenas
Estudiante de IngenierĂ­a Electronica y de telecomunicaciones
Universidad Catolica San Pablo




--
Saludos y Buena suerte
Atte.
Giancarlo Freddy Murillo Arenas
Estudiante de IngenierĂ­a Electronica y de telecomunicaciones
Universidad Catolica San Pablo

No comments:

Post a Comment