discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] new block creation


From: Yogesh Dahiya
Subject: [Discuss-gnuradio] new block creation
Date: Fri, 14 Jun 2013 02:32:58 +0530

I have created a new block with 2 input ports and 2 output ports
If i connect to port 0 of block work function gets called but when i connect to port 1 it does'nt (and i m leaving some ports of my block disconnected)

Block:

class another(gras.Block):
def __init__(self,dest_addr,source_addr,max_attempts,time_out):
gras.Block.__init__(self,name="aloha_mac",
in_sig = [numpy.uint8,numpy.uint8],
            out_sig = [numpy.uint8,numpy.uint8])
#self.output_config(0).reserve_items = 4096

def param(self):
print "Destination addr : ",self.dest_addr
print "Source addr : ",self.source_addr
print "TimeOut : ",self.time_out
print "Max Attempts : ",self.max_attempts

def work(self,ins,outs):
print "hello"

Connection

self.connect((self.sniffer,0),(self.another_0,0)) self.connect((self.another_0,0),(self.extras_datagram_to_stream_0,0))

work get called

but if

self.connect((self.sniffer,0),(self.another_1,0)) self.connect((self.another_1,0),(self.extras_datagram_to_stream_0,0))

work is not called


reply via email to

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