frontend

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2024 License: BSD-3-Clause Imports: 9 Imported by: 4

Documentation

Overview

Package frontend provides interface to Linux DVB frontend device

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SecParam

func SecParam(freq int64, polarization rune) (f uint32, t Tone, v Voltage)

SecParam calculates intermediate frequency, tone and voltage for given absolute frequency (HZ) and polarization ('h' or 'v').

Types

type API3

type API3 struct {
	Device
}

API3 provides Linux DVB API v3 interface to frontend device

func (API3) BER

func (f API3) BER() (ber uint32, err error)

func (API3) Info

func (f API3) Info() (*Info, error)

func (API3) SNR

func (f API3) SNR() (snr int16, err error)

func (API3) SignalStrength

func (f API3) SignalStrength() (ss int16, err error)

func (API3) Status

func (f API3) Status() (status Status, err error)

func (API3) UncorrectedBlocks

func (f API3) UncorrectedBlocks() (ublocks uint32, err error)

func (API3) WaitEvent

func (f API3) WaitEvent(ev *Event, deadline time.Time) (bool, error)

WaitEvent can return dvb.ErrOverflow. If deadline is non zero time WaitEvent returns true if it doesn't receive any event up to deatline.

type Bandwidth

type Bandwidth uint32
const (
	Bandwidth8MHz Bandwidth = iota
	Bandwidth7MHz
	Bandwidth6MHz
	BandwidthAuto
	Bandwidth5Mhz
	Bandwidth10Mhz
	Bandwidth1712kHz
)

func (Bandwidth) String

func (b Bandwidth) String() string

type Caps

type Caps uint32
const (
	CanInversionAuto Caps = 1 << iota
	CanFEC12
	CanFEC23
	CanFEC34
	CanFEC45
	CanFEC56
	CanFEC67
	CanFEC78
	CanFEC89
	CanFECAuto
	CanQPSK
	CanQAM16
	CanQAM32
	CanQAM64
	CanQAM128
	CanQAM256
	CanQAMAuto
	CanTxModeAuto
	CanBandwidthAuto
	CanGuardAuto
	CanHierarchyAuto
	Can8VSB
	Can16VSB
	HasExtendedCaps
)
const (
	CanTurboFEC Caps = 0x8000000 << iota
	Can2GModulation
	NeedsBending
	CanRecover
	CanMuteTS
)
const IsStupid Caps = 0

func (Caps) String

func (c Caps) String() string

Returns string representation of Caps.

type Device

type Device struct {
	// contains filtered or unexported fields
}

func Open

func Open(filepath string) (d Device, err error)

func OpenRO

func OpenRO(filepath string) (d Device, err error)

func (Device) Bandwidth

func (d Device) Bandwidth() (uint32, error)

Bandwidth returns bandwidth in Hz

func (Device) Clear

func (d Device) Clear() error

func (Device) Close

func (d Device) Close() error

func (Device) CodeRateHP

func (d Device) CodeRateHP() (dvb.CodeRate, error)

func (Device) CodeRateLP

func (d Device) CodeRateLP() (dvb.CodeRate, error)

func (Device) DeliverySystem

func (d Device) DeliverySystem() (dvb.DeliverySystem, error)

func (Device) Fd

func (d Device) Fd() uintptr

func (Device) Frequency

func (d Device) Frequency() (uint32, error)

func (Device) Guard

func (d Device) Guard() (dvb.Guard, error)

func (Device) Hierarchy

func (d Device) Hierarchy() (dvb.Hierarchy, error)

func (Device) InnerFEC

func (d Device) InnerFEC() (dvb.CodeRate, error)

func (Device) Inversion

func (d Device) Inversion() (dvb.Inversion, error)

func (Device) Modulation

func (d Device) Modulation() (dvb.Modulation, error)

func (Device) Pilot

func (d Device) Pilot() (dvb.Pilot, error)

func (Device) Rolloff

func (d Device) Rolloff() (dvb.Rolloff, error)

func (Device) SetBandwidth

func (d Device) SetBandwidth(hz uint32) error

func (Device) SetCodeRateHP

func (d Device) SetCodeRateHP(r dvb.CodeRate) error

func (Device) SetCodeRateLP

func (d Device) SetCodeRateLP(r dvb.CodeRate) error

func (Device) SetDeliverySystem

func (d Device) SetDeliverySystem(ds dvb.DeliverySystem) error

func (Device) SetFrequency

func (d Device) SetFrequency(f uint32) error

func (Device) SetGuard

func (d Device) SetGuard(g dvb.Guard) error

func (Device) SetHierarchy

func (d Device) SetHierarchy(h dvb.Hierarchy) error

func (Device) SetInnerFEC

func (d Device) SetInnerFEC(r dvb.CodeRate) error

func (Device) SetInversion

func (d Device) SetInversion(i dvb.Inversion) error

func (Device) SetModulation

func (d Device) SetModulation(m dvb.Modulation) error

func (Device) SetPilot

func (d Device) SetPilot(p dvb.Pilot) error

func (Device) SetRolloff

func (d Device) SetRolloff(r dvb.Rolloff) error

func (Device) SetSymbolRate

func (d Device) SetSymbolRate(bd uint32) error

func (Device) SetTone

func (d Device) SetTone(t Tone) error

func (Device) SetTxMode

func (d Device) SetTxMode(m dvb.TxMode) error

func (Device) SetVoltage

func (d Device) SetVoltage(v Voltage) error

func (Device) Stat

func (d Device) Stat() (*Stat, error)

func (Device) SymbolRate

func (d Device) SymbolRate() (uint32, error)

func (Device) Tone

func (d Device) Tone() (Tone, error)

func (Device) Tune

func (d Device) Tune() error

func (Device) TxMode

func (d Device) TxMode() (dvb.TxMode, error)

func (Device) Version

func (d Device) Version() (major, minor int, err error)

func (Device) Voltage

func (d Device) Voltage() (Voltage, error)

type Error

type Error struct {
	Op   string
	What string
	Err  error
}

func (Error) Error

func (e Error) Error() string

type Event

type Event struct {
	// contains filtered or unexported fields
}

func (*Event) ParamDVBC

func (e *Event) ParamDVBC() *ParamDVBC

func (*Event) ParamDVBS

func (e *Event) ParamDVBS() *ParamDVBS

func (*Event) ParamDVBT

func (e *Event) ParamDVBT() *ParamDVBT

func (*Event) Status

func (e *Event) Status() Status

type Info

type Info struct {
	Name          [128]byte
	Type          Type // DEPRECATED. Use Device.DeliverySystem() instead
	FreqMin       uint32
	FreqMax       uint32
	FreqStepSize  uint32
	FreqTolerance uint32
	SRMin         uint32
	SRMax         uint32
	SRTolerance   uint32 // ppm
	NotiferDelay  uint32 // DEPRECATED
	Caps          Caps
}

func (*Info) String

func (i *Info) String() string

type Param

type Param struct {
	// contains filtered or unexported fields
}

func (Param) Counter

func (p Param) Counter() uint64

func (Param) Decibel

func (p Param) Decibel() float64

func (Param) Format

func (p Param) Format(f fmt.State, _ rune)

func (Param) Relative

func (p Param) Relative() float64

func (Param) Scale

func (p Param) Scale() Scale

type ParamDVBC

type ParamDVBC struct {
	Freq       uint32        // frequency in Hz
	Inversion  dvb.Inversion // spectral inversion
	SymbolRate uint32
	CodeRate   dvb.CodeRate
	Modulation dvb.Modulation
}

func (*ParamDVBC) Tune

func (p *ParamDVBC) Tune(f API3) error

type ParamDVBS

type ParamDVBS struct {
	Freq       uint32        // frequency in Hz
	Inversion  dvb.Inversion // spectral inversion
	SymbolRate uint32
	InnerFEC   dvb.CodeRate
}

func (*ParamDVBS) Tune

func (p *ParamDVBS) Tune(f API3) error

type ParamDVBT

type ParamDVBT struct {
	Freq       uint32        // frequency in Hz
	Inversion  dvb.Inversion // spectral inversion
	Bandwidth  Bandwidth
	CodeRateHP dvb.CodeRate
	CodeRateLP dvb.CodeRate
	Modulation dvb.Modulation
	TxMode     dvb.TxMode
	Guard      dvb.Guard
	Hierarchy  dvb.Hierarchy
}

func DefaultParamDVBT

func DefaultParamDVBT(c Caps, country string) *ParamDVBT

DefaultParamDVBT returns pointer to ParamDVBT initialized according to regulations in specific country. TODO: DefaultParamDVBT always setup ParamDVBT for Poland. Add support for other countries.

func (*ParamDVBT) Tune

func (p *ParamDVBT) Tune(f API3) error

type Scale

type Scale byte
const (
	ScaleNotAvailable Scale = iota
	ScaleDecibel
	ScaleRelative
	ScaleCounter
)

func (Scale) String

func (s Scale) String() string

type Stat

type Stat struct {
	Signal     []Param // Signal strength level at the analog part of the tuner or of the demod.
	CNR        []Param // Signal to Noise ratio for the main carrier.
	PreErrBit  []Param // Number of bit errors before FEC on the inner coding block (Viterbi, LDPC, ...).
	PreTotBit  []Param // Number of bits received before the inner code block.
	PostErrBit []Param // Number of bit errors after FEC done by inner code block (Viterbi, LDPC, ...).
	PostTotBit []Param // Number of bits received after the inner coding.
	ErrBlk     []Param // Number of block errors after the outer FEC (Reed-Solomon, ...).
	TotBlk     []Param // Total number of blocks received.
}

type Status

type Status uint32
const (
	HasSignal  Status = 1 << iota // found something above the noise level
	HasCarrier                    // found a DVB signal
	HasViterbi                    // FEC is stable
	HasSync                       // found sync bytes
	HasLock                       // everything's working...
	Timedout                      // no lock within the last ~2 seconds
	Reinit                        // frontend was reinitialized, application is recommned to reset DiSEqC, tone and parameters
)

func (Status) String

func (s Status) String() string

type Tone

type Tone uint32

Satellite equipment control (SEC) tone

const (
	ToneOn Tone = iota
	ToneOff
)

type Type

type Type uint32
const (
	DVBS Type = iota
	DVBC
	DVBT
	ATSC
)

func (Type) String

func (t Type) String() string

type Voltage

type Voltage uint32

Satellite equipment control (SEC) voltage

const (
	Voltage13 Voltage = iota
	Voltage18
	VoltageOff
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL