From 7a6d8fc1da77e11decd341e81ab6d65e46ae2eed Mon Sep 17 00:00:00 2001 From: tvoid Date: Mon, 7 Apr 2008 17:50:59 -0600 Subject: working callback --- gsm-tvoid/src/lib/gsm_burst.cc | 78 ++++-------------------------------------- 1 file changed, 7 insertions(+), 71 deletions(-) (limited to 'gsm-tvoid/src/lib/gsm_burst.cc') diff --git a/gsm-tvoid/src/lib/gsm_burst.cc b/gsm-tvoid/src/lib/gsm_burst.cc index ff5fac1..6bec32c 100755 --- a/gsm-tvoid/src/lib/gsm_burst.cc +++ b/gsm-tvoid/src/lib/gsm_burst.cc @@ -12,75 +12,14 @@ #include "system.h" #include "gsmstack.h" -/* -void do_tuner_callback(gsm_tuner_callback *t, double f) -{ - if (t) t->do_tune(f); -} - -//this should be overridden by a python class -void gsm_tuner_callback::tune(double x) { - printf("t1: %f\n",x); -} - -void gsm_tuner_callback::do_tune(double x) { - printf("do_"); - tune(x); -} - - -void gsm_burst::set_tuner_callback(gsm_tuner_callback *f) { - printf("set_tuner_callback: %8.8x\n",(unsigned int)f); - p_tuner = f; -} -*/ - -/* -void gsm_burst::set_tuner_callback(gr_feval_dd *t) { - p_tuner = t; -} -*/ - -/* -void gsm_burst::set_status_callback(PSTAT_FUNC func, void *clientdata) { - p_stat_func = func; - stat_func_data = clientdata; -} - -void gsm_burst::py_set_status_callback(PyObject *pyfunc) { - //set_status_callback(PythonCallBack, (void *) pyfunc); - stat_func_data = (void *) pyfunc; - Py_INCREF(pyfunc); -} -*/ - - -/* -static void PythonCallBack(int a, void *clientdata) -{ - PyObject *func, *arglist, *result; -// long int dres = 0; - - func = (PyObject *) clientdata; // Get Python function - arglist = Py_BuildValue("(i)",a); // Build argument list - result = PyEval_CallObject(func,arglist); // Call Python - Py_DECREF(arglist); // Trash arglist -// if (result) { // If no errors, return double -// dres = PyInt_AsLong(result); -// } - Py_XDECREF(result); -// return dres; -} -*/ - -gsm_burst::gsm_burst (gr_feval_dd *t) : +gsm_burst::gsm_burst (gr_feval_ll *t) : d_clock_options(DEFAULT_CLK_OPTS), d_print_options(0), d_equalizer_type(EQ_FIXED_DFE) { - printf("gsm_burst: enter constructor (t=%8.8x)\n",(unsigned int)t); + fprintf(stderr,"gsm_burst: enter constructor (t=%8.8x)\n",(unsigned int)t); // M_PI = M_PI; //4.0 * atan(1.0); @@ -755,15 +694,12 @@ int gsm_burst::get_burst(void) if (got_burst) { d_total_count++; //do callback - //do_tuner_callback(p_tuner,1.0); - //if (p_callback) - if (p_tuner) + if (p_tuner) { //p_tuner->eval(1.0); - p_tuner->calleval(1.0); - //p_tuner->do_tune(1.0); - //PythonCallBack(STAT_GOT_BURST,stat_func_data); - //(*p_stat_func)(STAT_GOT_BURST,stat_func_data); - //p_callback->(1.0); + long in=1; + long out = -1; + out = p_tuner->calleval(in); + } //print info print_burst(); -- cgit v1.2.3