Skip to content

Commit

Permalink
update of requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Schmied committed Nov 17, 2022
1 parent 8b62f09 commit d8e6994
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
A python wrapper for the bladerf python bindings from Nuand. It provides synchronous as well as asynchronous functionality to send and receive data to and from the BladeRF SDR.

## Installation

- To install the requirements for this package: `python3 -m pip install -r requirements.txt
`
- To install system-wide: `sudo python3 setup.py install`
- To install for your user: `python3 setup.py install`

Expand Down
28 changes: 28 additions & 0 deletions example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import asyncio
import bladerf
from bladerfsdraio import AioBladeRF


async def main():
with AioBladeRF() as sdr:
ch_rx = sdr.Channel(bladerf.CHANNEL_RX(0))
ch_rx.sample_rate = 1e6
ch_rx.frequency = 1e9

async def stream_samples(sdr: AioBladeRF):
async for samples in sdr.stream_samples_async(ch_rx, chunk_size=int(1e6)):
# .. handle samples
print(samples.max())

async def cancel_after(secs: float, sdr: AioBladeRF):
await asyncio.sleep(secs)
sdr.cancel_receive()

await asyncio.gather(
stream_samples(sdr),
cancel_after(5, sdr)
)


if __name__ == '__main__':
asyncio.run(main())
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
setuptools~=49.2.1
numpy~=1.21.2
bladerf
humanize
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
license='MIT',
keywords='bladerf sdr cffi radio libbladerf asyncio',
platforms=['any'],
install_requires=['cffi', 'bladerf'],
install_requires=['cffi', 'bladerf', 'humanize', 'numpy'],
packages=find_packages(exclude=['tests*']))

0 comments on commit d8e6994

Please sign in to comment.