Can you really share your whole Out-Of-Tree module including an example .grc or python flow graph?
Best regards, Marcus On 04.01.2017 10:53, David Kersh wrote: > Hi Marcus, > > The 'stop' comparison definitely triggers as the appropriate text is > printed to the GRC console. > > I think you're right about my UDP broadcaster. I want it to be one of > those types of blocks similar to the two default blocks in a > flowgraph: /Options /and /Variable/. I think the way I've created it > is wrong as I essentially just removed the input and output terminals > in the .xml file and added arguments for IP address, port and message > packet. So actually I plan /not/ to use the inputs and outputs later > on, I just don't really know what I'm doing / don't know how to remove > the input / output related code from the python file. > > Apart, from the two blocks I mentioned earlier and the Options and > Variable blocks, the serverSource blocks outputs to the pre-defined > Vector Sink block. > > Thank you > David > > > > On Wed, Jan 4, 2017 at 12:34 AM, Marcus Müller > <marcus.muel...@ettus.com <mailto:marcus.muel...@ettus.com>> wrote: > > Hi David, > > are you sure the 'stop' comparison ever triggers? > > I'm not quite sure your UDP broadcaster /should/ be a GNU Radio > block – > it doesn't have any in- or outputs (but I presume you plan to add > these > later on). > > What's the whole Flow graph you're using? > > > Best regards, > > Marcus > > On 03.01.2017 09:53, davidk wrote: > > Dear Marcus, Happy new year! > > > > Here is my UDP Server Block Python Code: > > > > /import numpy > > import socket > > from gnuradio import gr > > from gnuradio import blocks > > > > UDP_IP = "192.168.10.2" > > UDP_PORT = 58 > > > > sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) > > > > class serverSource(gr.sync_block): > > def __init__(self): > > > > > > gr.sync_block.__init__(self,name="serverSource",in_sig=None,out_sig=[numpy.float32]) > > print "Setting up server" > > sock.bind((UDP_IP, UDP_PORT)) > > > > def work(self, input_items, output_items): > > out = output_items[0] > > data, addr = sock.recvfrom(1024) > > packetString = repr(data) > > > > packetString = packetString.replace('\\x00','') > > packetString = packetString.replace('\'','') > > > > print "message received: ", packetString > > print "address: ", addr > > > > if packetString == 'stop': > > return -1 > > > > return len(output_items[0])/ > > > > and here is my UDP Broadcast block: > > > > /import numpy > > import socket > > from gnuradio import gr > > > > class udpBroadcast(gr.basic_block): > > def __init__(self, ip, port, message): > > > > > > gr.basic_block.__init__(self,name="udpBroadcast",in_sig=[numpy.float32],out_sig=[numpy.float32]) > > print "Setting up UDP Message" > > > > UDP_IP = ip > > UDP_PORT = port > > MESSAGE = message > > > > sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) > > sock.sendto(MESSAGE, (UDP_IP, UDP_PORT))/ > > > > Hopefully you can make out what I'm aiming for here. > > > > Many thanks > > David > > > > > > > > -- > > View this message in context: > > http://gnuradio.4.n7.nabble.com/How-to-kill-flowgraph-with-a-custom-block-tp62332p62402.html > > <http://gnuradio.4.n7.nabble.com/How-to-kill-flowgraph-with-a-custom-block-tp62332p62402.html> > > Sent from the GnuRadio mailing list archive at Nabble.com. > > > > _______________________________________________ > > Discuss-gnuradio mailing list > > Discuss-gnuradio@gnu.org <mailto:Discuss-gnuradio@gnu.org> > > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio > <https://lists.gnu.org/mailman/listinfo/discuss-gnuradio> > >
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio