bladerf_common Class Reference

`#include <bladerf_common.h>`

Inheritance diagram for bladerf_common:

## Public Member Functions

| bladerf_common ()

## Protected Member Functions

void | init (dict_t const &dict, bladerf_direction direction)
bladerf_board_type | get_board_type ()
size_t | get_max_channels (bladerf_direction direction)
void | set_channel_enable (bladerf_channel ch, bool enable)
bool | get_channel_enable (bladerf_channel ch)
void | set_verbosity (std::string const &verbosity)
bladerf_channel | str2channel (std::string const &ch)
std::string | channel2str (bladerf_channel ch)
int | channel2rfport (bladerf_channel ch)
bladerf_channel | chan2channel (bladerf_direction direction, size_t chan=0)
osmosdr::meta_range_t | sample_rates (bladerf_channel ch)
double | set_sample_rate (double rate, bladerf_channel ch)
double | get_sample_rate (bladerf_channel ch)
osmosdr::freq_range_t | freq_range (bladerf_channel ch)
double | set_center_freq (double freq, bladerf_channel ch)
double | get_center_freq (bladerf_channel ch)
osmosdr::freq_range_t | filter_bandwidths (bladerf_channel ch)
double | set_bandwidth (double bandwidth, bladerf_channel ch)
double | get_bandwidth (bladerf_channel ch)
std::vector< std::string > | get_gain_names (bladerf_channel ch)
osmosdr::gain_range_t | get_gain_range (bladerf_channel ch)
osmosdr::gain_range_t | get_gain_range (std::string const &name, bladerf_channel ch)
bool | set_gain_mode (bool automatic, bladerf_channel ch, bladerf_gain_mode agc_mode=BLADERF_GAIN_DEFAULT)
bool | get_gain_mode (bladerf_channel ch)
double | set_gain (double gain, bladerf_channel ch)
double | set_gain (double gain, std::string const &name, bladerf_channel ch)
double | get_gain (bladerf_channel ch)
double | get_gain (std::string const &name, bladerf_channel ch)
std::vector< std::string > | get_antennas (bladerf_direction dir)
bool | set_antenna (bladerf_direction dir, size_t chan, const std::string &antenna)
int | set_dc_offset (std::complex< double > const &offset, bladerf_channel ch)
int | set_iq_balance (std::complex< double > const &balance, bladerf_channel ch)
std::vector< std::string > | get_clock_sources (size_t mboard=0)
void | set_clock_source (std::string const &source, size_t mboard=0)
std::string | get_clock_source (size_t mboard=0)
void | set_smb_frequency (double frequency)
double | get_smb_frequency ()

## Static Protected Member Functions

static std::vector< std::string > | devices ()

## Protected Attributes

bladerf_sptr | _dev
std::string | _pfx
unsigned int | _failures
size_t | _num_buffers
size_t | _samples_per_buffer
size_t | _num_transfers
unsigned int | _stream_timeout
bladerf_feature | _feature
bladerf_format | _format
bladerf_channel_map | _chanmap
bladerf_channel_enable_map | _enables

## Static Protected Attributes

static const unsigned int | MAX_CONSECUTIVE_FAILURES = 3
static const int16_t | DCOFF_SCALE = 2048
static const int16_t | GAIN_SCALE = 4096
static const int16_t | PHASE_SCALE = 4096

## Detailed Description

Common class for bladeRF interaction

## Constructor & Destructor Documentation

## bladerf_common()

bladerf_common::bladerf_common | ( |  | ) |

## Member Function Documentation

## chan2channel()

bladerf_channel bladerf_common::chan2channel | ( | bladerf_direction | direction,
|  | size_t | chan = 0 )

protected

## channel2rfport()

int bladerf_common::channel2rfport | ( | bladerf_channel | ch | ) |

protected

## channel2str()

std::string bladerf_common::channel2str | ( | bladerf_channel | ch | ) |

protected

## devices()

std::vector< std::string > bladerf_common::devices | ( |  | ) |

static protected

## filter_bandwidths()

osmosdr::freq_range_t bladerf_common::filter_bandwidths | ( | bladerf_channel | ch | ) |

protected

## freq_range()

osmosdr::freq_range_t bladerf_common::freq_range | ( | bladerf_channel | ch | ) |

protected

## get_antennas()

std::vector< std::string > bladerf_common::get_antennas | ( | bladerf_direction | dir | ) |

protected

## get_bandwidth()

double bladerf_common::get_bandwidth | ( | bladerf_channel | ch | ) |

protected

## get_board_type()

bladerf_board_type bladerf_common::get_board_type | ( |  | ) |

protected

## get_center_freq()

double bladerf_common::get_center_freq | ( | bladerf_channel | ch | ) |

protected

## get_channel_enable()

bool bladerf_common::get_channel_enable | ( | bladerf_channel | ch | ) |

protected

## get_clock_source()

std::string bladerf_common::get_clock_source | ( | size_t | mboard = 0 | ) |

protected

## get_clock_sources()

std::vector< std::string > bladerf_common::get_clock_sources | ( | size_t | mboard = 0 | ) |

protected

## get_gain() [1/2]

double bladerf_common::get_gain | ( | bladerf_channel | ch | ) |

protected

## get_gain() [2/2]

double bladerf_common::get_gain | ( | std::string const & | name,
|  | bladerf_channel | ch )

protected

## get_gain_mode()

bool bladerf_common::get_gain_mode | ( | bladerf_channel | ch | ) |

protected

## get_gain_names()

std::vector< std::string > bladerf_common::get_gain_names | ( | bladerf_channel | ch | ) |

protected

## get_gain_range() [1/2]

osmosdr::gain_range_t bladerf_common::get_gain_range | ( | bladerf_channel | ch | ) |

protected

## get_gain_range() [2/2]

osmosdr::gain_range_t bladerf_common::get_gain_range | ( | std::string const & | name,
|  | bladerf_channel | ch )

protected

## get_max_channels()

size_t bladerf_common::get_max_channels | ( | bladerf_direction | direction | ) |

protected

## get_sample_rate()

double bladerf_common::get_sample_rate | ( | bladerf_channel | ch | ) |

protected

## get_smb_frequency()

double bladerf_common::get_smb_frequency | ( |  | ) |

protected

## init()

void bladerf_common::init | ( | dict_t const & | dict,
|  | bladerf_direction | direction )

protected

Handle initialization and parameters common to both source & sink

Specify arguments in key=value,key=value format, e.g. bladerf=0,buffers=512

Recognized arguments:

## Key Allowed values

REQUIRED: bladerf a valid instance or serial number USB INTERFACE CONTROL: buffers (default: NUM_BUFFERS) buflen (default: NUM_SAMPLES_PER_BUFFER) stream_timeout valid time in milliseconds (default: 3000) transfers (default: NUM_TRANSFERS) FPGA CONTROL: enable_metadata 1 to enable metadata fpga a path to a valid .rbf file fpga-reload 1 to force reloading the FPGA unconditionally RF CONTROL: agc 1 to enable, 0 to disable (default: hardware-dependent) agc_mode default, manual, fast, slow, hybrid (default: default) loopback bb_txlpf_rxvga2, bb_txlpf_rxlpf, bb_txvga1_rxvga2, bb_txvga1_rxlpf, rf_lna1, rf_lna2, rf_lna3, firmware, ad9361_bist, none (default: none) ** Note: valid on receive channels only rxmux baseband, 12bit, 32bit, digital (default: baseband) ** Note: valid on receive channels only smb a valid frequency tamer internal, external_1pps, external (default: internal) xb200 auto, auto3db, 50M, 144M, 222M, custom (default: auto) MISC: verbosity verbose, debug, info, warning, error, critical, silent (default: info) ** Note: applies only to libbladeRF logging

## sample_rates()

osmosdr::meta_range_t bladerf_common::sample_rates | ( | bladerf_channel | ch | ) |

protected

## set_antenna()

bool bladerf_common::set_antenna | ( | bladerf_direction | dir,
|  | size_t | chan,
|  | const std::string & | antenna )

protected

## set_bandwidth()

double bladerf_common::set_bandwidth | ( | double | bandwidth,
|  | bladerf_channel | ch )

protected

## set_center_freq()

double bladerf_common::set_center_freq | ( | double | freq,
|  | bladerf_channel | ch )

protected

## set_channel_enable()

void bladerf_common::set_channel_enable | ( | bladerf_channel | ch,
|  | bool | enable )

protected

## set_clock_source()

void bladerf_common::set_clock_source | ( | std::string const & | source,
|  | size_t | mboard = 0 )

protected

## set_dc_offset()

int bladerf_common::set_dc_offset | ( | std::complex< double > const & | offset,
|  | bladerf_channel | ch )

protected

## set_gain() [1/2]

double bladerf_common::set_gain | ( | double | gain,
|  | bladerf_channel | ch )

protected

## set_gain() [2/2]

double bladerf_common::set_gain | ( | double | gain,
|  | std::string const & | name,
|  | bladerf_channel | ch )

protected

## set_gain_mode()

bool bladerf_common::set_gain_mode | ( | bool | automatic,
|  | bladerf_channel | ch,
|  | bladerf_gain_mode | agc_mode = BLADERF_GAIN_DEFAULT )

protected

## set_iq_balance()

int bladerf_common::set_iq_balance | ( | std::complex< double > const & | balance,
|  | bladerf_channel | ch )

protected

## set_sample_rate()

double bladerf_common::set_sample_rate | ( | double | rate,
|  | bladerf_channel | ch )

protected

## set_smb_frequency()

void bladerf_common::set_smb_frequency | ( | double | frequency | ) |

protected

## set_verbosity()

void bladerf_common::set_verbosity | ( | std::string const & | verbosity | ) |

protected

## str2channel()

bladerf_channel bladerf_common::str2channel | ( | std::string const & | ch | ) |

protected

## Member Data Documentation

## _chanmap

bladerf_channel_map bladerf_common::_chanmap

protected

map of antennas to channels

## _dev

bladerf_sptr bladerf_common::_dev

protected

shared pointer for the active device

## _enables

bladerf_channel_enable_map bladerf_common::_enables

protected

enabled channels

## _failures

unsigned int bladerf_common::_failures

protected

counter for consecutive rx/tx failures

## _feature

bladerf_feature bladerf_common::_feature

protected

feature assigned to board

## _format

bladerf_format bladerf_common::_format

protected

sample format to use

## _num_buffers

size_t bladerf_common::_num_buffers

protected

number of buffers to allocate

## _num_transfers

size_t bladerf_common::_num_transfers

protected

number of active backend transfers

## _pfx

std::string bladerf_common::_pfx

protected

prefix for console messages

## _samples_per_buffer

size_t bladerf_common::_samples_per_buffer

protected

how many samples per buffer

## _stream_timeout

unsigned int bladerf_common::_stream_timeout

protected

timeout for backend transfers

## DCOFF_SCALE

const int16_t bladerf_common::DCOFF_SCALE = 2048

static protected

## GAIN_SCALE

const int16_t bladerf_common::GAIN_SCALE = 4096

static protected

## MAX_CONSECUTIVE_FAILURES

const unsigned int bladerf_common::MAX_CONSECUTIVE_FAILURES = 3

static protected

## PHASE_SCALE

const int16_t bladerf_common::PHASE_SCALE = 4096

static protected

The documentation for this class was generated from the following file:

- bladerf_common.h