Soapy interface

.makeDevice

Loads and connect a SoapySDR device to the Virtual Machine. A JSRadio object is created, with a unique name so it can be shared between different tasks. The returned object is of type JSRadio, refer to the Using radio introduction for examples.

JSRadio object = Soapy.makeDevice( JSON descriptor ) ;

The JSON descriptor describes what Soapy Driver has to be loaded, sets the name for the shared object and passes optional parameters.

{   
    'query' : string,
    'device_name' : string, 
    'settings' : string 
}

  • 'query' : this is the device query passed to SoapySDR,
  • 'device_name' : a unique name for this device to be able to reuse it anywhere in the Virtual Machine,
  • 'settings' : custom settings for the SoapySDR API.

To reuse the device in another task :

Creator task :

var device = Soapy.makeDevice( {'query' : 'xxx', 'device_name' : 'a_unique_name' });

User task :

var device = new JSRadio('a_unique_name');

The Virtual Machine engine handles concurrent access to the receiver but does not handle concurrent frequency tuning, gain etc. on the radio. If the device is shared between different tasks, it is recommended to make sure that the valid settings are applied, or use a dedicated task with message passing.

Examples

  • RTLSDR
var radio = Soapy.makeDevice({'query' : 'driver=rtlsdr' }) ;
  • PlutoSDR
var radio = Soapy.makeDevice({'query' : 'driver=plutosdr' }) ;
  • BladeRF
var rx = Soapy.makeDevice( {'query' : 'driver=bladerf' });
Last update: March 26, 2023