rtl2832.h File Reference
`#include <stdio.h>`
`#include <stdarg.h>`
`#include <libusb/libusb.h>`
`#include <vector>`
`#include <map>`
`#include <string>`
Include dependency graph for rtl2832.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes

class | RTL2832_NAMESPACE::log_sink
class | RTL2832_NAMESPACE::i2c_interface
class | RTL2832_NAMESPACE::named_interface
class | RTL2832_NAMESPACE::tuner
struct | RTL2832_NAMESPACE::tuner::params
class | RTL2832_NAMESPACE::tuner_skeleton
class | RTL2832_NAMESPACE::i2c_repeater_scope
struct | RTL2832_NAMESPACE::device_info
class | RTL2832_NAMESPACE::demod
struct | RTL2832_NAMESPACE::demod::params

## Namespaces

namespace | RTL2832_NAMESPACE

## Macros

#define | RTL2832_API
#define | RTL2832_TEMPLATE
#define | CURRENT_FUNCTION __PRETTY_FUNCTION__
#define | DEBUG_TUNER_I2C(t, r)
#define | RTL2832_NAMESPACE rtl2832
#define | TUNERS_NAMESPACE tuners
#define | TUNER_FACTORY_FN_NAME Factory
#define | TUNER_PROBE_FN_NAME Probe
#define | DECLARE_TUNER_FACTORY()
#define | IMPLEMENT_TUNER_FACTORY(class_name)
#define | IMPLEMENT_INLINE_TUNER_FACTORY(class_name)
#define | I2C_REPEATER_SCOPE(p) i2c_repeater_scope _i2c_repeater_scope(p, CURRENT_FUNCTION, __LINE__, p->name())
#define | THIS_I2C_REPEATER_SCOPE() I2C_REPEATER_SCOPE(this)
#define | CHECK_LIBUSB_RESULT(r) check_libusb_result(r, false, CURRENT_FUNCTION, __LINE__, #r)
#define | CHECK_LIBUSB_NEG_RESULT(r) check_libusb_result(r, true, CURRENT_FUNCTION, __LINE__, #r)
#define | CHECK_LIBUSB_RESULT_EX(r, f, l, s) check_libusb_result(r, false, f, l, s)
#define | CHECK_LIBUSB_RESULT_RETURN_EX(d, r)
#define | CHECK_LIBUSB_NEG_RESULT_RETURN_EX(d, r)
#define | CHECK_LIBUSB_RESULT_RETURN(r) CHECK_LIBUSB_RESULT_RETURN_EX(this,r)
#define | CHECK_LIBUSB_NEG_RESULT_RETURN(d, r) CHECK_LIBUSB_NEG_RESULT_RETURN_EX(this,r)
#define | RTL2832_FIR_COEFF_COUNT 20
#define | RTL2832_TUNER_NAME_LEN (32+1)

## Typedefs

typedef std::pair< double, double > | RTL2832_NAMESPACE::range_t
typedef std::vector< double > | RTL2832_NAMESPACE::values_t
typedef std::map< int, std::string > | RTL2832_NAMESPACE::num_name_map_t
typedef struct RTL2832_NAMESPACE::device_info | RTL2832_NAMESPACE::DEVICE_INFO
typedef struct RTL2832_NAMESPACE::device_info * | RTL2832_NAMESPACE::PDEVICE_INFO

## Enumerations

enum | RTL2832_NAMESPACE::result_code { RTL2832_NAMESPACE::FAILURE = 0 , RTL2832_NAMESPACE::SUCCESS = 1 }

## Functions

RTL2832_API int | get_map_index (int value, const int *map, int pair_count)
RTL2832_API const char * | libusb_result_to_string (int res)
bool | RTL2832_NAMESPACE::values_to_range (const values_t &v, range_t &r)
bool | RTL2832_NAMESPACE::is_valid_range (const range_t &r)
bool | RTL2832_NAMESPACE::in_range (const range_t &r, double d)
bool | RTL2832_NAMESPACE::in_valid_range (const range_t &r, double d)
double | RTL2832_NAMESPACE::calc_range (const range_t &r)

## Macro Definition Documentation

## CHECK_LIBUSB_NEG_RESULT

#define CHECK_LIBUSB_NEG_RESULT | ( |  | r | ) | check_libusb_result(r, true, CURRENT_FUNCTION, __LINE__, #r)

## CHECK_LIBUSB_NEG_RESULT_RETURN

#define CHECK_LIBUSB_NEG_RESULT_RETURN | ( |  | d,
|  |  | r
| ) |  | CHECK_LIBUSB_NEG_RESULT_RETURN_EX(this,r)

## CHECK_LIBUSB_NEG_RESULT_RETURN_EX

#define CHECK_LIBUSB_NEG_RESULT_RETURN_EX | ( |  | d,
|  |  | r
| ) |  |

Value:
{ int res = d->CHECK_LIBUSB_NEG_RESULT(r); \
if (res < 0) return res; }

## CHECK_LIBUSB_RESULT

#define CHECK_LIBUSB_RESULT | ( |  | r | ) | check_libusb_result(r, false, CURRENT_FUNCTION, __LINE__, #r)

## CHECK_LIBUSB_RESULT_EX

#define CHECK_LIBUSB_RESULT_EX | ( |  | r,
|  |  | f,
|  |  | l,
|  |  | s
| ) |  | check_libusb_result(r, false, f, l, s)

## CHECK_LIBUSB_RESULT_RETURN

#define CHECK_LIBUSB_RESULT_RETURN | ( |  | r | ) | CHECK_LIBUSB_RESULT_RETURN_EX(this,r)

## CHECK_LIBUSB_RESULT_RETURN_EX

#define CHECK_LIBUSB_RESULT_RETURN_EX | ( |  | d,
|  |  | r
| ) |  |

Value:
{ int res = d->CHECK_LIBUSB_RESULT(r); \
if (res <= 0) return res; }

## CURRENT_FUNCTION

#define CURRENT_FUNCTION __PRETTY_FUNCTION__

## DEBUG_TUNER_I2C

#define DEBUG_TUNER_I2C | ( |  | t,
|  |  | r
| ) |  |

Value:
if (t->params().message_output && function && (line_number >= 0) && (line)) \
t->params().message_output->on_log_message_ex(RTL2832_NAMESPACE::log_sink::LOG_LEVEL_ERROR, "%s: %s [%i] @ %s:%i \"%s\"\n", __FUNCTION__, libusb_result_to_string(r), r, function, line_number, line);
libusb_result_to_string
RTL2832_API const char * libusb_result_to_string(int res)

## DECLARE_TUNER_FACTORY

#define DECLARE_TUNER_FACTORY | ( |  | ) |

Value:
public: \
static tuner* TUNER_FACTORY_FN_NAME(demod* p); \
static int TUNER_PROBE_FN_NAME(demod* d);
TUNER_FACTORY_FN_NAME
#define TUNER_FACTORY_FN_NAME
Definition rtl2832.h:68
TUNER_PROBE_FN_NAME
#define TUNER_PROBE_FN_NAME
Definition rtl2832.h:69

## I2C_REPEATER_SCOPE

#define I2C_REPEATER_SCOPE | ( |  | p | ) | i2c_repeater_scope _i2c_repeater_scope(p, CURRENT_FUNCTION, __LINE__, p->name())

## IMPLEMENT_INLINE_TUNER_FACTORY

#define IMPLEMENT_INLINE_TUNER_FACTORY | ( |  | class_name | ) |

Value:
public: \
static tuner* TUNER_FACTORY_FN_NAME(demod* p) \
{ return new class_name(p); } \
static int TUNER_PROBE_FN_NAME(demod* d);

## IMPLEMENT_TUNER_FACTORY

#define IMPLEMENT_TUNER_FACTORY | ( |  | class_name | ) |

Value:
tuner* class_name::TUNER_FACTORY_FN_NAME(demod* p) \
{ return new class_name(p); }

## RTL2832_API

#define RTL2832_API

## RTL2832_FIR_COEFF_COUNT

#define RTL2832_FIR_COEFF_COUNT 20

## RTL2832_NAMESPACE

#define RTL2832_NAMESPACE rtl2832

## RTL2832_TEMPLATE

#define RTL2832_TEMPLATE

## RTL2832_TUNER_NAME_LEN

#define RTL2832_TUNER_NAME_LEN (32+1)

## THIS_I2C_REPEATER_SCOPE

#define THIS_I2C_REPEATER_SCOPE | ( |  | ) | I2C_REPEATER_SCOPE(this)

## TUNER_FACTORY_FN_NAME

#define TUNER_FACTORY_FN_NAME Factory

## TUNER_PROBE_FN_NAME

#define TUNER_PROBE_FN_NAME Probe

## TUNERS_NAMESPACE

#define TUNERS_NAMESPACE tuners

## Function Documentation

## get_map_index()

RTL2832_API int get_map_index | ( | int | value,
|  | const int * | map,
|  | int | pair_count
| ) |  |

extern

## libusb_result_to_string()

RTL2832_API const char * libusb_result_to_string | ( | int | res | ) |

extern