示例#1
0
    def __init__(self):
        gr.top_block.__init__(self, "CC430 Transmitter")

        ################################
        # TX Connections
        ################################

        self.sent_pkts = 0

        # 5555 5555 2c6e fd00 0071 da0b e2
        self.test_packet =  chr(0x55)*4                          # preamble
        self.test_packet += chr(0x2c) + chr(0x6e)                # sync
        self.test_packet += chr(0xfc)                            # length
        self.test_packet += chr(0x00) + chr(0x00) + chr(0x00)    # payload
        self.test_packet += chr(0xc3) + chr(0xdb)                # CRC16 (currently incorrect?)

        # Variables
        self.samp_rate = samp_rate = 125e3
        self.f_center = f_center = 510e6
        self.bandwidth = bandwidth = 125e3
        self.gain = gain = 25

        self.msgq = msgq = gr.msg_queue()

        # Blocks
        self.uhd_sink = uhd.usrp_sink(
            device_addr="serial=E4R11Y0B1", #panthro
            stream_args=uhd.stream_args(
                args="",
                cpu_format="fc32",
                channels=range(1),
                antenna="TX/RX"
            ),
        )
        self.uhd_sink.set_samp_rate(samp_rate)
        self.uhd_sink.set_center_freq(f_center, 0)
        self.uhd_sink.set_gain(gain, 0)
        self.uhd_sink.set_bandwidth(bandwidth, 0)

        self.msg_src = gr.message_source(1, msgq)

        self.msk = level.msk_mod_bc(
            samples_per_symbol=2,
            bt=0.3,
            ti_adj=False
        )
        
        self.connect(self.msg_src, self.msk, self.uhd_sink)
    def __init__(self):
        gr.top_block.__init__(self, "CC430 Transmitter")

        self.sent_pkts = 0

        # 5555 5555 2c6e fd00 0071 da0b e2
        self.packet =  chr(0x55)*4                          # preamble
        self.packet += chr(0x2c) + chr(0x6e)                # sync
        self.packet += chr(0xfc)                            # length
        self.packet += chr(0x00) + chr(0x00) + chr(0x00)    # payload
        self.packet += chr(0x71) + chr(0xda) + chr(0x0b) + chr(0xe2) # CRC (currently incorrect)

        # Variables
        self.samp_rate = samp_rate = 125e3
        self.f_center = f_center = 868e6
        self.bandwidth = bandwidth = 200e3
        self.gain = gain = 5

        self.msgq = msgq = gr.msg_queue()

        # Blocks
        self.uhd_sink = uhd.usrp_sink(
            device_addr="",
            stream_args=uhd.stream_args(
                cpu_format="fc32",
                channels=range(1),
            ),
        )
        self.uhd_sink.set_samp_rate(samp_rate)
        self.uhd_sink.set_center_freq(f_center, 0)
        self.uhd_sink.set_gain(gain, 0)
        self.uhd_sink.set_bandwidth(bandwidth, 0)

        self.msg_src = gr.message_source(1, msgq)

        self.msk = level.msk_mod_bc(
            samples_per_symbol=2,
            bt=0.3
        )
        
        # Connections
        self.connect(self.msg_src, self.msk, self.uhd_sink)
示例#3
0
    def __init__(self):
        gr.top_block.__init__(self, "CC430 Transmitter")

        self.sent_pkts = 0

        # 5555 5555 2c6e fd00 0071 da0b e2
        self.packet = chr(0x55) * 4  # preamble
        self.packet += chr(0x2c) + chr(0x6e)  # sync
        self.packet += chr(0xfc)  # length
        self.packet += chr(0x00) + chr(0x00) + chr(0x00)  # payload
        self.packet += chr(0x71) + chr(0xda) + chr(0x0b) + chr(
            0xe2)  # CRC (currently incorrect)

        # Variables
        self.samp_rate = samp_rate = 125e3
        self.f_center = f_center = 868e6
        self.bandwidth = bandwidth = 200e3
        self.gain = gain = 5

        self.msgq = msgq = gr.msg_queue()

        # Blocks
        self.uhd_sink = uhd.usrp_sink(
            device_addr="",
            stream_args=uhd.stream_args(
                cpu_format="fc32",
                channels=range(1),
            ),
        )
        self.uhd_sink.set_samp_rate(samp_rate)
        self.uhd_sink.set_center_freq(f_center, 0)
        self.uhd_sink.set_gain(gain, 0)
        self.uhd_sink.set_bandwidth(bandwidth, 0)

        self.msg_src = gr.message_source(1, msgq)

        self.msk = level.msk_mod_bc(samples_per_symbol=2, bt=0.3)

        # Connections
        self.connect(self.msg_src, self.msk, self.uhd_sink)
示例#4
0
    def __init__(self):
        gr.top_block.__init__(self, "CC1101 Burst Detector")

        def rx_callback():
            print "Callback Fired"

        # Variables
        self.samp_rate = samp_rate = 125e3
        self.f_center = f_center = 510e6
        self.bandwidth = bandwidth = 200e3
        self.gain = gain = 25

        # Blocks
        self.uhd_sink = uhd.usrp_sink(
            device_addr="serial=E4R11Y0B1", #cheetara
            stream_args=uhd.stream_args(
                cpu_format="fc32",
                channels=range(1),
            ),
        )

        self.uhd_sink.set_samp_rate(samp_rate)
        self.uhd_sink.set_center_freq(f_center, 0)
        self.uhd_sink.set_gain(gain, 0)
        self.uhd_sink.set_antenna("TX/RX", 0)
        self.uhd_sink.set_bandwidth(bandwidth, 0)

        self.uhd_sink.set_samp_rate(self.samp_rate)
        self.uhd_sink.set_center_freq(self.f_center, 0)
        self.uhd_sink.set_gain(self.gain, 0)

        self.src = gr.sig_source_f(samp_rate, gr.GR_COS_WAVE, 1000, 1, 0)
        self.f_to_b = gr.float_to_char()
        self.msk = level.msk_mod_bc()

        # Connections
        self.connect(self.src, self.f_to_b, self.msk, self.uhd_sink)