SoapySDR: SoapySDR Namespace Reference

| SoapySDR 0.7.2-ARCH Vendor and platform neutral SDR interface library

Classes | Typedefs | Functions | Variables
SoapySDR Namespace Reference

## Classes
class | ArgInfo
class | ConverterRegistry
class | Device
class | Range
class | Registry

## Typedefs
typedef SoapySDRLogLevel | LogLevel
typedef SoapySDRLogHandler | LogHandler
typedef KwargsList(* | FindFunction) (const Kwargs &)
| typedef for a device enumeration function More...
typedef Device *(* | MakeFunction) (const Kwargs &)
| typedef for a device factory function More...
typedef std::map< std::string, FindFunction > | FindFunctions
| typedef for a dictionary of find functions More...
typedef std::map< std::string, MakeFunction > | MakeFunctions
| typedef for a dictionary of make functions More...
typedef std::map< std::string, std::string > | Kwargs
| Typedef for a dictionary of key-value string arguments. More...
typedef std::vector< Kwargs > | KwargsList
| Typedef for a list of key-word dictionaries. More...
typedef std::vector< Range > | RangeList
typedef std::vector< ArgInfo > | ArgInfoList

## Functions
int32_t | F32toS32 (float from)
float | S32toF32 (int32_t from)
int16_t | F32toS16 (float from)
float | S16toF32 (int16_t from)
int8_t | F32toS8 (float from)
float | S8toF32 (int8_t from)
int32_t | U32toS32 (uint32_t from)
uint32_t | S32toU32 (int32_t from)
int16_t | U16toS16 (uint16_t from)
uint16_t | S16toU16 (int16_t from)
int8_t | U8toS8 (uint8_t from)
uint8_t | S8toU8 (int8_t from)
int16_t | S32toS16 (int32_t from)
int32_t | S16toS32 (int16_t from)
int8_t | S16toS8 (int16_t from)
int16_t | S8toS16 (int8_t from)
uint32_t | F32toU32 (float from)
float | U32toF32 (uint32_t from)
uint16_t | F32toU16 (float from)
float | U16toF32 (uint16_t from)
uint8_t | F32toU8 (float from)
float | U8toF32 (uint8_t from)
uint16_t | S32toU16 (int32_t from)
int32_t | U16toS32 (uint16_t from)
uint8_t | S32toU8 (int32_t from)
int32_t | U8toS32 (uint8_t from)
uint8_t | S16toU8 (int16_t from)
int16_t | U8toS16 (uint8_t from)
uint16_t | S8toU16 (int8_t from)
int8_t | U16toS8 (uint16_t from)
const SOAPY_SDR_API char * | errToStr (const int errorCode)
SOAPY_SDR_API size_t | formatToSize (const std::string &format)
SOAPY_SDR_API void | log (const LogLevel logLevel, const std::string &message)
SOAPY_SDR_API void | vlogf (const SoapySDRLogLevel logLevel, const char *format, va_list argList)
static void | logf (const SoapySDRLogLevel logLevel, const char *format,...)
SOAPY_SDR_API void | registerLogHandler (const LogHandler &handler)
SOAPY_SDR_API void | setLogLevel (const LogLevel logLevel)
SOAPY_SDR_API std::string | getRootPath (void)
| Query the root installation path. More...
SOAPY_SDR_API std::vector< std::string > | listSearchPaths (void)
SOAPY_SDR_API std::vector< std::string > | listModules (void)
SOAPY_SDR_API std::vector< std::string > | listModules (const std::string &path)
SOAPY_SDR_API std::string | loadModule (const std::string &path)
SOAPY_SDR_API Kwargs | getLoaderResult (const std::string &path)
SOAPY_SDR_API std::string | getModuleVersion (const std::string &path)
SOAPY_SDR_API std::string | unloadModule (const std::string &path)
SOAPY_SDR_API void | loadModules (void)
static long long | ticksToTimeNs (const long long ticks, const double rate)
static long long | timeNsToTicks (const long long timeNs, const double rate)
SOAPY_SDR_API Kwargs | KwargsFromString (const std::string &markup)
SOAPY_SDR_API std::string | KwargsToString (const Kwargs &args)
SOAPY_SDR_API std::string | getAPIVersion (void)
SOAPY_SDR_API std::string | getABIVersion (void)
SOAPY_SDR_API std::string | getLibVersion (void)

## Variables
const uint32_t | U32_ZERO_OFFSET = uint32_t(1<<31)
const uint16_t | U16_ZERO_OFFSET = uint16_t(1<<15)
const uint8_t | U8_ZERO_OFFSET = uint8_t(1<<7)
const uint32_t | S32_FULL_SCALE = uint32_t(1<<31)
const uint16_t | S16_FULL_SCALE = uint16_t(1<<15)
const uint8_t | S8_FULL_SCALE = uint8_t(1<<7)

## Typedef Documentation

## ◆ ArgInfoList

typedef std::vector<ArgInfo> SoapySDR::ArgInfoList

Typedef for a list of Argument infos.

## ◆ FindFunction

typedef KwargsList(* SoapySDR::FindFunction) (const Kwargs &)

typedef for a device enumeration function

## ◆ FindFunctions

typedef std::map<std::string, FindFunction> SoapySDR::FindFunctions

typedef for a dictionary of find functions

## ◆ Kwargs

typedef std::map<std::string, std::string> SoapySDR::Kwargs

Typedef for a dictionary of key-value string arguments.

## ◆ KwargsList

typedef std::vector<Kwargs> SoapySDR::KwargsList

Typedef for a list of key-word dictionaries.

## ◆ LogHandler

typedef SoapySDRLogHandler SoapySDR::LogHandler

Typedef for the registered log handler function.

## ◆ LogLevel

typedef SoapySDRLogLevel SoapySDR::LogLevel

## ◆ MakeFunction

typedef Device*(* SoapySDR::MakeFunction) (const Kwargs &)

typedef for a device factory function

## ◆ MakeFunctions

typedef std::map<std::string, MakeFunction> SoapySDR::MakeFunctions

typedef for a dictionary of make functions

## ◆ RangeList

typedef std::vector<Range> SoapySDR::RangeList

Typedef for a list of min/max range pairs. Overall minimum: rl.front().minimum(); Overall maximum: rl.back().maximum();

## Function Documentation

## ◆ errToStr()

const SOAPY_SDR_API char* SoapySDR::errToStr | ( | const int | errorCode | ) |

Convert a error code to a string for printing purposes. If the error code is unrecognized, errToStr returns "UNKNOWN".

Parameters

  errorCode | a negative integer return code

Returns
  a pointer to a string representing the error

## ◆ F32toS16()

int16_t SoapySDR::F32toS16 | ( | float | from | ) |
| inline

## ◆ F32toS32()

int32_t SoapySDR::F32toS32 | ( | float | from | ) |
| inline

Conversion Primitives for converting real values between Soapy formats.

Parameters

  from | the value to convert from

Returns
  the converted value

## ◆ F32toS8()

int8_t SoapySDR::F32toS8 | ( | float | from | ) |
| inline

## ◆ F32toU16()

uint16_t SoapySDR::F32toU16 | ( | float | from | ) |
| inline

## ◆ F32toU32()

uint32_t SoapySDR::F32toU32 | ( | float | from | ) |
| inline

## ◆ F32toU8()

uint8_t SoapySDR::F32toU8 | ( | float | from | ) |
| inline

## ◆ formatToSize()

SOAPY_SDR_API size_t SoapySDR::formatToSize | ( | const std::string & | format | ) |

Get the size of a single element in the specified format.

Parameters

  format | a supported format string

Returns
  the size of an element in bytes

## ◆ getABIVersion()

SOAPY_SDR_API std::string SoapySDR::getABIVersion | ( | void |  | ) |

Get the ABI version string that the library was built against. A client can compare SOAPY_SDR_ABI_VERSION to getABIVersion() to check for ABI incompatibility before using the library. If the values are not equal then the client code was compiled against a different ABI than the library.

## ◆ getAPIVersion()

SOAPY_SDR_API std::string SoapySDR::getAPIVersion | ( | void |  | ) |

Get the SoapySDR library API version as a string. The format of the version string is major.minor.increment, where the digits are taken directly from SOAPY_SDR_API_VERSION.

## ◆ getLibVersion()

SOAPY_SDR_API std::string SoapySDR::getLibVersion | ( | void |  | ) |

Get the library version and build information string. The format of the version string is major.minor.patch-buildInfo. This function is commonly used to identify the software back-end to the user for command-line utilities and graphical applications.

## ◆ getLoaderResult()

SOAPY_SDR_API Kwargs SoapySDR::getLoaderResult | ( | const std::string & | path | ) |

List all registration loader errors for a given module path. The resulting dictionary contains all registry entry names provided by the specified module. The value of each entry is an error message string or empty on successful load.

Parameters

  path | the path to a specific module file

Returns
  a dictionary of registry names to error messages

## ◆ getModuleVersion()

SOAPY_SDR_API std::string SoapySDR::getModuleVersion | ( | const std::string & | path | ) |

Get a version string for the specified module. Modules may optionally provide version strings.

Parameters

  path | the path to a specific module file

Returns
  a version string or empty if no version provided

## ◆ getRootPath()

SOAPY_SDR_API std::string SoapySDR::getRootPath | ( | void |  | ) |

Query the root installation path.

## ◆ KwargsFromString()

SOAPY_SDR_API Kwargs SoapySDR::KwargsFromString | ( | const std::string & | markup | ) |

Convert a markup string to a key-value map. The markup format is: "key0=value0, key1=value1"

## ◆ KwargsToString()

SOAPY_SDR_API std::string SoapySDR::KwargsToString | ( | const Kwargs & | args | ) |

Convert a key-value map to a markup string. The markup format is: "key0=value0, key1=value1"

## ◆ listModules() [1/2]

SOAPY_SDR_API std::vector<std::string> SoapySDR::listModules | ( | const std::string & | path | ) |

List all modules found in the given path.

Parameters

  path | a directory on the system

Returns
  a list of file paths to loadable modules

## ◆ listModules() [2/2]

SOAPY_SDR_API std::vector<std::string> SoapySDR::listModules | ( | void |  | ) |

List all modules found in default path.

Returns
  a list of file paths to loadable modules

## ◆ listSearchPaths()

SOAPY_SDR_API std::vector<std::string> SoapySDR::listSearchPaths | ( | void |  | ) |

The list of paths automatically searched by loadModules().

Returns
  a list of automatically searched file paths

## ◆ loadModule()

SOAPY_SDR_API std::string SoapySDR::loadModule | ( | const std::string & | path | ) |

Load a single module given its file system path.

Parameters

  path | the path to a specific module file

Returns
  an error message, empty on success

## ◆ loadModules()

SOAPY_SDR_API void SoapySDR::loadModules | ( | void |  | ) |

Load the support modules installed on this system. This call will only actually perform the load once. Subsequent calls are a NOP.

## ◆ log()

SOAPY_SDR_API void SoapySDR::log | ( | const LogLevel | logLevel,
|  | const std::string & | message
| ) |  |

Send a message to the registered logger.

Parameters

  logLevel | a possible logging level
  message | a logger message string

## ◆ logf()

static void SoapySDR::logf | ( | const SoapySDRLogLevel | logLevel,
|  | const char * | format,
|  |  | ...
| ) |  |
| inlinestatic

Send a message to the registered logger.

Parameters

  logLevel | a possible logging level
  format | a printf style format string

## ◆ registerLogHandler()

SOAPY_SDR_API void SoapySDR::registerLogHandler | ( | const LogHandler & | handler | ) |

Register a new system log handler. Platforms should call this to replace the default stdio handler. Passing `nullptr` restores the default.

## ◆ S16toF32()

float SoapySDR::S16toF32 | ( | int16_t | from | ) |
| inline

## ◆ S16toS32()

int32_t SoapySDR::S16toS32 | ( | int16_t | from | ) |
| inline

## ◆ S16toS8()

int8_t SoapySDR::S16toS8 | ( | int16_t | from | ) |
| inline

## ◆ S16toU16()

uint16_t SoapySDR::S16toU16 | ( | int16_t | from | ) |
| inline

## ◆ S16toU8()

uint8_t SoapySDR::S16toU8 | ( | int16_t | from | ) |
| inline

## ◆ S32toF32()

float SoapySDR::S32toF32 | ( | int32_t | from | ) |
| inline

## ◆ S32toS16()

int16_t SoapySDR::S32toS16 | ( | int32_t | from | ) |
| inline

## ◆ S32toU16()

uint16_t SoapySDR::S32toU16 | ( | int32_t | from | ) |
| inline

## ◆ S32toU32()

uint32_t SoapySDR::S32toU32 | ( | int32_t | from | ) |
| inline

## ◆ S32toU8()

uint8_t SoapySDR::S32toU8 | ( | int32_t | from | ) |
| inline

## ◆ S8toF32()

float SoapySDR::S8toF32 | ( | int8_t | from | ) |
| inline

## ◆ S8toS16()

int16_t SoapySDR::S8toS16 | ( | int8_t | from | ) |
| inline

## ◆ S8toU16()

uint16_t SoapySDR::S8toU16 | ( | int8_t | from | ) |
| inline

## ◆ S8toU8()

uint8_t SoapySDR::S8toU8 | ( | int8_t | from | ) |
| inline

## ◆ setLogLevel()

SOAPY_SDR_API void SoapySDR::setLogLevel | ( | const LogLevel | logLevel | ) |

Set the log level threshold. Log messages with lower priority are dropped.

## ◆ ticksToTimeNs()

static long long SoapySDR::ticksToTimeNs | ( | const long long | ticks,
|  | const double | rate
| ) |  |
| inlinestatic

Convert a tick count into a time in nanoseconds using the tick rate.

Parameters

  ticks | a integer tick count
  rate | the ticks per second

Returns
  the time in nanoseconds

## ◆ timeNsToTicks()

static long long SoapySDR::timeNsToTicks | ( | const long long | timeNs,
|  | const double | rate
| ) |  |
| inlinestatic

Convert a time in nanoseconds into a tick count using the tick rate.

Parameters

  timeNs | time in nanoseconds
  rate | the ticks per second

Returns
  the integer tick count

## ◆ U16toF32()

float SoapySDR::U16toF32 | ( | uint16_t | from | ) |
| inline

## ◆ U16toS16()

int16_t SoapySDR::U16toS16 | ( | uint16_t | from | ) |
| inline

## ◆ U16toS32()

int32_t SoapySDR::U16toS32 | ( | uint16_t | from | ) |
| inline

## ◆ U16toS8()

int8_t SoapySDR::U16toS8 | ( | uint16_t | from | ) |
| inline

## ◆ U32toF32()

float SoapySDR::U32toF32 | ( | uint32_t | from | ) |
| inline

## ◆ U32toS32()

int32_t SoapySDR::U32toS32 | ( | uint32_t | from | ) |
| inline

## ◆ U8toF32()

float SoapySDR::U8toF32 | ( | uint8_t | from | ) |
| inline

## ◆ U8toS16()

int16_t SoapySDR::U8toS16 | ( | uint8_t | from | ) |
| inline

## ◆ U8toS32()

int32_t SoapySDR::U8toS32 | ( | uint8_t | from | ) |
| inline

## ◆ U8toS8()

int8_t SoapySDR::U8toS8 | ( | uint8_t | from | ) |
| inline

## ◆ unloadModule()

SOAPY_SDR_API std::string SoapySDR::unloadModule | ( | const std::string & | path | ) |

Unload a module that was loaded with loadModule().

Parameters

  path | the path to a specific module file

Returns
  an error message, empty on success

## ◆ vlogf()

SOAPY_SDR_API void SoapySDR::vlogf | ( | const SoapySDRLogLevel | logLevel,
|  | const char * | format,
|  | va_list | argList
| ) |  |

Send a message to the registered logger.

Parameters

  logLevel | a possible logging level
  format | a printf style format string
  argList | an argument list for the formatter

## Variable Documentation

## ◆ S16_FULL_SCALE

const uint16_t SoapySDR::S16_FULL_SCALE = uint16_t(1<<15)

## ◆ S32_FULL_SCALE

const uint32_t SoapySDR::S32_FULL_SCALE = uint32_t(1<<31)

## ◆ S8_FULL_SCALE

const uint8_t SoapySDR::S8_FULL_SCALE = uint8_t(1<<7)

## ◆ U16_ZERO_OFFSET

const uint16_t SoapySDR::U16_ZERO_OFFSET = uint16_t(1<<15)

## ◆ U32_ZERO_OFFSET

const uint32_t SoapySDR::U32_ZERO_OFFSET = uint32_t(1<<31)

## ◆ U8_ZERO_OFFSET

const uint8_t SoapySDR::U8_ZERO_OFFSET = uint8_t(1<<7)