MythTV  master
Macros | Enumerations | Functions | Variables
diseqc.cpp File Reference
#include <cstring>
#include <cmath>
#include <unistd.h>
#include <sys/time.h>
#include <QString>
#include "libmythbase/compat.h"
#include "libmythbase/mythcorecontext.h"
#include "libmythbase/mythdb.h"
#include "libmythbase/mythlogging.h"
#include "diseqc.h"
#include "dtvmultiplex.h"
#include "recorders/dvbtypes.h"
Include dependency graph for diseqc.cpp:

Go to the source code of this file.

Macros

#define LOC   QString("DiSEqCDevTree: ")
 

Enumerations

enum  DISEQC_ADRS : std::uint8_t {
  DISEQC_ADR_ALL = 0x00, DISEQC_ADR_SW_ALL = 0x10, DISEQC_ADR_LNB = 0x11, DISEQC_ADR_LNB_SW = 0x12,
  DISEQC_ADR_SW_BLK = 0x14, DISEQC_ADR_SW = 0x15, DISEQC_ADR_SMATV = 0x18, DISEQC_ADR_POL_ALL = 0x20,
  DISEQC_ADR_POL_LIN = 0x21, DISEQC_ADR_POS_ALL = 0x30, DISEQC_ADR_POS_AZ = 0x31, DISEQC_ADR_POS_EL = 0x32
}
 
enum  DISEQC_CMDS : std::uint8_t {
  DISEQC_CMD_RESET = 0x00, DISEQC_CMD_CLR_RESET = 0x01, DISEQC_CMD_WRITE_N0 = 0x38, DISEQC_CMD_WRITE_N1 = 0x39,
  DISEQC_CMD_WRITE_FREQ = 0x58, DISEQC_CMD_ODU = 0x5A, DISEQC_CMD_ODU_MDU = 0x5C, DISEQC_CMD_HALT = 0x60,
  DISEQC_CMD_LMT_OFF = 0x63, DISEQC_CMD_LMT_E = 0x66, DISEQC_CMD_LMT_W = 0x67, DISEQC_CMD_DRIVE_E = 0x68,
  DISEQC_CMD_DRIVE_W = 0x69, DISEQC_CMD_STORE_POS = 0x6a, DISEQC_CMD_GOTO_POS = 0x6b, DISEQC_CMD_GOTO_X = 0x6e
}
 

Functions

static bool send_diseqc (int fd, const dvb_diseqc_master_cmd cmd)
 
static bool set_tone (int fd, fe_sec_tone_mode tone)
 
static bool set_voltage (int fd, fe_sec_voltage volt)
 
static bool mini_diseqc (int fd, fe_sec_mini_cmd cmd)
 
static double GetCurTimeFloating (void)
 

Variables

static constexpr useconds_t DISEQC_SHORT_WAIT { 15 * 1000 }
 
static constexpr useconds_t DISEQC_LONG_WAIT { 100 * 1000 }
 
static constexpr useconds_t DISEQC_POWER_ON_WAIT { 500 * 1000 }
 
static constexpr useconds_t DISEQC_POWER_OFF_WAIT { (1000 * 1000) - 1 }
 
static constexpr uint8_t TIMEOUT_RETRIES { 10 }
 
static constexpr useconds_t TIMEOUT_WAIT { 250 * 1000 }
 
static constexpr uint8_t DISEQC_FRM { 0xe0 }
 
static constexpr uint8_t DISEQC_FRM_REPEAT {1 << 0}
 
static constexpr double TO_RADS { M_PI / 180.0 }
 
static constexpr double TO_DEC { 180.0 / M_PI }
 
static constexpr double EPS { 1E-4 }
 
bool diseqc_bus_already_reset = false
 

Macro Definition Documentation

◆ LOC

#define LOC   QString("DiSEqCDevTree: ")

Definition at line 93 of file diseqc.cpp.

Enumeration Type Documentation

◆ DISEQC_ADRS

enum DISEQC_ADRS : std::uint8_t
Enumerator
DISEQC_ADR_ALL 
DISEQC_ADR_SW_ALL 
DISEQC_ADR_LNB 
DISEQC_ADR_LNB_SW 
DISEQC_ADR_SW_BLK 
DISEQC_ADR_SW 
DISEQC_ADR_SMATV 
DISEQC_ADR_POL_ALL 
DISEQC_ADR_POL_LIN 
DISEQC_ADR_POS_ALL 
DISEQC_ADR_POS_AZ 
DISEQC_ADR_POS_EL 

Definition at line 53 of file diseqc.cpp.

◆ DISEQC_CMDS

enum DISEQC_CMDS : std::uint8_t
Enumerator
DISEQC_CMD_RESET 
DISEQC_CMD_CLR_RESET 
DISEQC_CMD_WRITE_N0 
DISEQC_CMD_WRITE_N1 
DISEQC_CMD_WRITE_FREQ 
DISEQC_CMD_ODU 
DISEQC_CMD_ODU_MDU 
DISEQC_CMD_HALT 
DISEQC_CMD_LMT_OFF 
DISEQC_CMD_LMT_E 
DISEQC_CMD_LMT_W 
DISEQC_CMD_DRIVE_E 
DISEQC_CMD_DRIVE_W 
DISEQC_CMD_STORE_POS 
DISEQC_CMD_GOTO_POS 
DISEQC_CMD_GOTO_X 

Definition at line 69 of file diseqc.cpp.

Function Documentation

◆ send_diseqc()

static bool send_diseqc ( int  fd,
const dvb_diseqc_master_cmd  cmd 
)
static

Definition at line 642 of file diseqc.cpp.

◆ set_tone()

static bool set_tone ( int  fd,
fe_sec_tone_mode  tone 
)
static

Definition at line 1429 of file diseqc.cpp.

Referenced by DiSEqCDevSwitch::ExecuteTone().

◆ set_voltage()

static bool set_voltage ( int  fd,
fe_sec_voltage  volt 
)
static

Definition at line 1451 of file diseqc.cpp.

Referenced by DiSEqCDevSwitch::ExecuteVoltage().

◆ mini_diseqc()

static bool mini_diseqc ( int  fd,
fe_sec_mini_cmd  cmd 
)
static

Definition at line 1473 of file diseqc.cpp.

Referenced by DiSEqCDevSwitch::ExecuteMiniDiSEqC().

◆ GetCurTimeFloating()

static double GetCurTimeFloating ( void  )
static

Variable Documentation

◆ DISEQC_SHORT_WAIT

constexpr useconds_t DISEQC_SHORT_WAIT { 15 * 1000 }
staticconstexpr

Definition at line 36 of file diseqc.cpp.

Referenced by DiSEqCDevTree::Execute().

◆ DISEQC_LONG_WAIT

constexpr useconds_t DISEQC_LONG_WAIT { 100 * 1000 }
staticconstexpr

◆ DISEQC_POWER_ON_WAIT

constexpr useconds_t DISEQC_POWER_ON_WAIT { 500 * 1000 }
staticconstexpr

Definition at line 38 of file diseqc.cpp.

Referenced by DiSEqCDevTree::ResetDiseqc().

◆ DISEQC_POWER_OFF_WAIT

constexpr useconds_t DISEQC_POWER_OFF_WAIT { (1000 * 1000) - 1 }
staticconstexpr

Definition at line 39 of file diseqc.cpp.

Referenced by DiSEqCDevTree::ResetDiseqc().

◆ TIMEOUT_RETRIES

constexpr uint8_t TIMEOUT_RETRIES { 10 }
staticconstexpr

◆ TIMEOUT_WAIT

constexpr useconds_t TIMEOUT_WAIT { 250 * 1000 }
staticconstexpr

◆ DISEQC_FRM

constexpr uint8_t DISEQC_FRM { 0xe0 }
staticconstexpr

Definition at line 47 of file diseqc.cpp.

◆ DISEQC_FRM_REPEAT

constexpr uint8_t DISEQC_FRM_REPEAT {1 << 0}
staticconstexpr

Definition at line 48 of file diseqc.cpp.

◆ TO_RADS

constexpr double TO_RADS { M_PI / 180.0 }
staticconstexpr

Definition at line 88 of file diseqc.cpp.

Referenced by DiSEqCDevRotor::CalculateAzimuth().

◆ TO_DEC

constexpr double TO_DEC { 180.0 / M_PI }
staticconstexpr

Definition at line 89 of file diseqc.cpp.

Referenced by DiSEqCDevRotor::CalculateAzimuth().

◆ EPS

constexpr double EPS { 1E-4 }
staticconstexpr

Definition at line 91 of file diseqc.cpp.

Referenced by DiSEqCDevRotor::ExecuteRotor().

◆ diseqc_bus_already_reset

bool diseqc_bus_already_reset = false

Definition at line 95 of file diseqc.cpp.

Referenced by DiSEqCDevTree::ResetDiseqc().