Ejemplo n.º 1
0
    def __init__(self, pad_for_usrp=True, *args, **kwargs):
        """
	Hierarchical block for the 802_15_4 O-QPSK  modulation.

        Packets to be sent are enqueued by calling send_pkt.
        The output is the complex modulated signal at baseband.

        @param msgq_limit: maximum number of messages in message queue
        @type msgq_limit: int
        @param pad_for_usrp: If true, packets are padded such that they end up a multiple of 128 samples

        See 802_15_4_mod for remaining parameters
        """
        try:
            self.msgq_limit = kwargs.pop('msgq_limit')
            self.log = kwargs.get('log')
        except KeyError:
            pass

        gr.hier_block2.__init__(
            self,
            "ieee802_15_4_mod_pkts",
            gr.io_signature(0, 0, 0),  # Input
            gr.io_signature(1, 1, gr.sizeof_gr_complex))  # Output
        self.pad_for_usrp = pad_for_usrp

        # accepts messages from the outside world
        self.pkt_input = gr.message_source(gr.sizeof_char, self.msgq_limit)
        self.ieee802_15_4_mod = ieee802_15_4.ieee802_15_4_mod(
            self, *args, **kwargs)
        self.connect(self.pkt_input, self.ieee802_15_4_mod, self)

        if self.log:
            self.connect(self.pkt_input,
                         gr.file_sink(gr.sizeof_char, 'tx-input.dat'))
Ejemplo n.º 2
0
    def __init__(self, *args, **kwargs):
        """
	Hierarchical block for the 802_15_4 O-QPSK  modulation.

        Packets to be sent are enqueued by calling send_pkt.
        The output is the complex modulated signal at baseband.

        @param msgq_limit: maximum number of messages in message queue
        @type msgq_limit: int
        @param pad_for_usrp: If true, packets are padded such that they end up a multiple of 128 samples

        See 802_15_4_mod for remaining parameters
        """

        try:
            self.pad_for_usrp = kwargs.pop('pad_for_usrp')
            self.msgq_limit = kwargs.pop('msgq_limit')
        except KeyError:
            pass

	gr.hier_block2.__init__(self, "ieee802_15_4_mod_pkts",
				gr.io_signature(0, 0, 0),  # Input
                                gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output
        #self.pad_for_usrp = pad_for_usrp

        # accepts messages from the outside world
        self.pkt_input = gr.message_source(gr.sizeof_char, self.msgq_limit)
        self.ieee802_15_4_mod = ieee802_15_4.ieee802_15_4_mod(*args, **kwargs)

        print "GR: ieee802_15_4_pkt: Connecting packet input and modulator."
        self.connect(self.pkt_input, self.ieee802_15_4_mod, self)
Ejemplo n.º 3
0
    def __init__(self, fg, msgq_limit=2, pad_for_usrp=True, *args, **kwargs):
        """
	Hierarchical block for the 802_15_4 O-QPSK  modulation.

        Packets to be sent are enqueued by calling send_pkt.
        The output is the complex modulated signal at baseband.

	@param fg: flow graph
	@type fg: flow graph
        @param msgq_limit: maximum number of messages in message queue
        @type msgq_limit: int
        @param pad_for_usrp: If true, packets are padded such that they end up a multiple of 128 samples

        See 802_15_4_mod for remaining parameters
        """
        self.pad_for_usrp = pad_for_usrp

        # accepts messages from the outside world
        self.pkt_input = gr.message_source(gr.sizeof_char, msgq_limit)
        self.ieee802_15_4_mod = ieee802_15_4.ieee802_15_4_mod(fg, *args, **kwargs)
        fg.connect(self.pkt_input, self.ieee802_15_4_mod)
        gr.hier_block.__init__(self, fg, None, self.ieee802_15_4_mod)