Merge pull request #1 from Grissess/master

Allow library path to be specified in env
This commit is contained in:
陈豪 | Jacob Chen 2020-03-18 10:19:53 +08:00 committed by GitHub
commit 79e6cdf4c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,7 +13,7 @@ logging.basicConfig()
logger = logging.getLogger('HackRf Core')
logger.setLevel(logging.DEBUG)
libhackrf = CDLL('/usr/local/lib/libhackrf.so')
libhackrf = CDLL(os.environ.get('LIBHACKRF', '/usr/local/lib/libhackrf.so'))
def enum(*sequential, **named):
enums = dict(zip(sequential, range(len(sequential))), **named)
@ -535,4 +535,4 @@ class HackRf(object):
bytes2 = bytes[0:size * 2]
iq.real, iq.imag = bytes2[::2], bytes2[1::2]
iq /= 128.0
return iq
return iq