Skip to content
Josh Blum edited this page May 9, 2016 · 11 revisions

The driver API is what vendors write their hardware support modules with. To support hardware in SoapySDR, simply do the following:

  • Copy the ExampleDriver into your devices's build tree
  • Rename the "MyDevice" files and classes for your product
  • Implement overloads for a custom SoapySDR::Device class
  • Implement the discovery function to locate devices on the system
  • Implement the factory function to instantiate the device object

This section describes the necessary calls needed for creating drivers for SDR applications. Developers should overload these calls when creating hardware support modules to ensure that most SDR applications will be able to function properly.

The registration API is the entry point into SoapySDR. Every device must register a discovery function that can find your device on the system; and a factory function that can instantiate an instance of your overloaded Device class.

The discovery function finds devices on the system that are supported by this driver. It returns "KwargsList" or a list of keyword-argument maps, one map for each discovered device. Each map identifies a device on the system with arbitrary keywords which can represent anything that helps to identify the device - like device nodes to serial numbers. Run SoapySDRUtil --find to print available devices discovered by your new function.

The discovery function takes hints in the form of an input keyword map. The implementation of the discovery function should use these as hints to filter for specific devices. For example, if an input keyword specified a serial, than the discovery function should only return results with that serial. Run SoapySDRUtil --find="key=value" to test the the filtering capabilities.

The factory function instantiates a device class instance using arguments from one of the discovered keyword-argument maps. The map should be used in a meaningful way to open the relevant internal device nodes, handles, or sockets. The function should return an instance of the overloaded device class. Run SoapySDRUtil --make="key=value" to test the factory function.

Clone this wiki locally