pyhackrf.py 发送和接收 记住原数据是bytes类型 发送和接收一样

 建议先接收 得到文件 然后用接收的文件发送

pyhackrf.py 发送程序:

import pyhackrf as pyhackrf
import numpy as np 

hackrf = pyhackrf.HackRF()
hackrf.set_sample_rate_manual(10e6,1)
hackrf.set_freq(91.4e6)
hackrf.set_lna_gain(40)
hackrf.set_txvga_gain(62)
hackrf.set_baseband_filter_bandwidth(1000000)

with open("1.data","rb") as fd:
    raw = bytearray(fd.read())

pyhackrf.count = 5
pyhackrf.txbuffer = raw
print("start tx ......")
hackrf.send_package()




 pyhackrf.py 接收程序:

import pyhackrf as pyhackrf
import numpy as np

hackrf = pyhackrf.HackRF()
hackrf.sample_rate = 10e6
hackrf.set_freq(91.4e6)
hackrf.set_lna_gain(40)
hackrf.set_vga_gain(62)
hackrf.set_baseband_filter_bandwidth(1000000)

samples,data2 = hackrf.read_samples(20e6,0)

with open("1.data","wb") as fd:
    fd.write(data2)

pyhackrf.py 文件在这个链接里: 

pyhackrf.py 我已经修复了发送功能 (更新)(这次不用再写发送的回调函数了)-CSDN博客

你可能感兴趣的:(python,linux)