def hook_cb(args):
    print "TEST HOOK CB Called with %s :: %s"%(type(args), str(args));
    print args.bufs;
    print args.msg;
    print args.blocks.keys();
    r = es.es_hook_rval();
    return r;
Exemplo n.º 2
0
def pre_hook(val):
    key_pmt = es.event_field( val.msg, key_sym );   
    key = pmt.pmt_symbol_to_string( key_pmt );
    print key;
    if(key == "*"):
        key = "10";
    elif(key == "#"):
        key = "12";
    elif(key=="0"):
        ival = 11;
    ival = int(key);
    
    row = (ival - 1)/3;
    col = (ival - 1)%3;
    rowfreqs = [697.0, 770.0, 852.0, 941.0];
    colfreqs = [1209.0, 1336.0, 1477.0, 1633.0];
    assert(row < len(rowfreqs));
    assert(col < len(colfreqs));

    blocks = val.handler.pb2();
    blocks["src_L"].set_frequency(rowfreqs[row]);
    blocks["src_R"].set_frequency(colfreqs[col]);
    print "set freq %s"%( str((rowfreqs[row], colfreqs[col])) );
    r = es.es_hook_rval();
    return r;
Exemplo n.º 3
0
def pre_hook(val):
    key_pmt = es.event_field( val.msg, key_sym );   
    key = pmt.symbol_to_string( key_pmt );
    print key;
    if(key == "*"):
        key = "10";
    elif(key == "#"):
        key = "12";
    elif(key=="0"):
        ival = 11;
    ival = int(key);
    
    row = (ival - 1)/3;
    col = (ival - 1)%3;
    rowfreqs = [697.0, 770.0, 852.0, 941.0];
    colfreqs = [1209.0, 1336.0, 1477.0, 1633.0];
    assert(row < len(rowfreqs));
    assert(col < len(colfreqs));

    blocks = val.handler.pb2();
    blocks["src_L"].set_frequency(rowfreqs[row]);
    blocks["src_R"].set_frequency(colfreqs[col]);
    print "set freq %s"%( str((rowfreqs[row], colfreqs[col])) );
    r = es.es_hook_rval();
    return r;
def hook_cb(args):
    print "TEST HOOK CB Called with %s :: %s" % (type(args), str(args))
    print args.bufs
    print args.msg
    print args.blocks.keys()
    r = es.es_hook_rval()
    return r
def test_hook_cb(val):
    print "TEST HOOK CB Called with %s :: %s"%(type(val), str(val));
    print val.bufs;
    print val.msg;
    print val.handler.pb2();
    r = es.es_hook_rval();
    return r;
def test_hook_cb(val):
    print "TEST HOOK CB Called with %s :: %s" % (type(val), str(val))
    print val.bufs
    print val.msg
    print val.handler.pb2()
    r = es.es_hook_rval()
    return r
Exemplo n.º 7
0
def pre_hook(val):
    payload = es.event_field(val.msg, key_sym)
    payload = pmt.symbol_to_string(payload)
    v = numpy.fromstring(payload, dtype=numpy.byte)
    blocks = val.handler.pb2()
    blocks["src"].set_data(es.StrVector([payload]), len(v))
    r = es.es_hook_rval()
    return r
Exemplo n.º 8
0
def pre_hook(val):
    payload = es.event_field( val.msg, key_sym );   
    payload = pmt.symbol_to_string( payload );
    v = numpy.fromstring( payload, dtype=numpy.byte );
    blocks = val.handler.pb2();
    blocks["src"].set_data( es.StrVector([payload]), len(v) );
    r = es.es_hook_rval();
    return r;
Exemplo n.º 9
0
def post_hook(val):
    blocks = val.handler.pb2();
    blocks["head_L"].reset();
    blocks["head_R"].reset();
    r = es.es_hook_rval();
    return r;
Exemplo n.º 10
0
def post_hook(val):
    #    val.handler.sink.clear();
    r = es.es_hook_rval()
    return r
Exemplo n.º 11
0
def post_hook(val):
    blocks = val.handler.pb2();
    blocks["head_L"].reset();
    blocks["head_R"].reset();
    r = es.es_hook_rval();
    return r;
Exemplo n.º 12
0
def post_hook(val):
#    val.handler.sink.clear();
    r = es.es_hook_rval();
    return r;