Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ typings/

# next.js build output
.next
/.idea/
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Supports [Node.js](https://nodejs.org/) and [WebUSB](https://wicg.github.io/webu

### Software

* [Node.js](https://nodejs.org/) 8.x or later + [node-usb requirements](https://github.com/tessel/node-usb#installation)
* [Node.js](https://nodejs.org/) v14.13.0 or later + [node-usb requirements](https://github.com/tessel/node-usb#installation)
* [Web browser that supports WebUSB](https://caniuse.com/#feat=webusb)

## Setup
Expand All @@ -21,17 +21,17 @@ Supports [Node.js](https://nodejs.org/) and [WebUSB](https://wicg.github.io/webu

Install: `npm i rtlsdrjs`

Require: `const RtlSdr = require('rtlsdrjs');`
Import: `import {RtlSdr, nodejsUsb} from 'rtlsdrjs';`

### Browser

Download a `rtlsdr.js` build from a [release](https://github.com/sandeepmistry/rtlsdrjs/releases).

Include `rtlsdr.js` in you HTML page: `<script src="path/of/rtlsdr.js"></script>`
Import: `import {RtlSdr, webUsb} from 'rtlsdrjs';`

## Usage

```javascript
import {RtlSdr, webUsb} from 'rtlsdrjs';

let readSamples = true;

async function start() {
Expand All @@ -42,7 +42,7 @@ async function start() {
//
// RtlSdr.getDevices() can be used to get a list of all RTL SDR's attached to system
//
const sdr = await RtlSdr.requestDevice();
const sdr = await RtlSdr.requestDevice(usb);

//
// open the device
Expand Down
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
module.exports = require('./lib/rtlsdr');
import {RtlSdr} from './lib/rtlsdr';
import {USB as webUsb} from './lib/web-usb';
import {USB as nodejsUsb} from './lib/usb';

export {RtlSdr, webUsb, nodejsUsb};
Loading