discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] Issue with the Message API in Python


From: Sebastian Sahlin
Subject: [Discuss-gnuradio] Issue with the Message API in Python
Date: Thu, 23 May 2019 17:42:39 +0200

Hi,

For learning purposes I'm trying to replicate the functionality of the Message Strobe block in Python, however I'm stumped by what should be a very basic function. I'm simply attempting to publish a message every x seconds:

def __init__(self, period):
        gr.basic_block.__init__(self,
            name="msg_strobe",
            in_sig=None,
            out_sig=None)

        self.message_port_register_out(pmt.intern('msg_out'))

        while(True):
            self.send_message('Hello World')
            time.sleep(period)

    def send_message(self, string):
        self.message_port_pub(pmt.intern('msg_out'), pmt.intern(string))

However there is no message published to the Message Debug block. 


reply via email to

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