dpll

package
v0.0.0-...-cba9a52 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DPLL_UNKNOWN       = -1
	DPLL_INVALID       = 0
	DPLL_FREERUN       = 1
	DPLL_LOCKED        = 2
	DPLL_LOCKED_HO_ACQ = 3
	DPLL_HOLDOVER      = 4

	LocalMaxHoldoverOffSet = 1500  //ns
	LocalHoldoverTimeout   = 14400 //secs
	MaxInSpecOffset        = 100   //ns

	LocalMaxHoldoverOffSetStr = "LocalMaxHoldoverOffSet"
	LocalHoldoverTimeoutStr   = "LocalHoldoverTimeout"
	MaxInSpecOffsetStr        = "MaxInSpecOffset"
	ClockIdStr                = "clockId"
	FaultyPhaseOffset         = 99999999999
)
View Source
const (
	SYSFS   dpllApiType = "sysfs"
	NETLINK dpllApiType = "netlink"
	MOCK    dpllApiType = "mock"
	NONE    dpllApiType = "none"
)

Variables

View Source
var MockDpllReplies chan *nl.DoDeviceGetReply

Functions

This section is empty.

Types

type DependingStates

type DependingStates struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*DependingStates) GetCurrentState

func (d *DependingStates) GetCurrentState() event.PTPState

GetCurrentState ... get current state

func (*DependingStates) UpdateState

func (d *DependingStates) UpdateState(source event.EventSource)

type DpllConfig

type DpllConfig struct {
	LocalMaxHoldoverOffSet uint64
	LocalHoldoverTimeout   uint64
	MaxInSpecOffset        uint64

	sync.Mutex
	// contains filtered or unexported fields
}

DpllConfig ... DPLL configuration

func NewDpll

func NewDpll(clockId uint64, localMaxHoldoverOffSet, localHoldoverTimeout, maxInSpecOffset uint64,
	iface string, dependsOn []event.EventSource, apiType dpllApiType, phaseOffsetPinFilter map[string]map[string]string) *DpllConfig

NewDpll ... create new DPLL process

func (*DpllConfig) CmdInit

func (d *DpllConfig) CmdInit()

CmdInit ... init command

func (*DpllConfig) CmdRun

func (d *DpllConfig) CmdRun(stdToSocket bool)

CmdRun ... run command

func (*DpllConfig) CmdStop

func (d *DpllConfig) CmdStop()

CmdStop ... stop command

func (*DpllConfig) DependsOn

func (d *DpllConfig) DependsOn() []event.EventSource

DependsOn ... depends on other events

func (*DpllConfig) ExitCh

func (d *DpllConfig) ExitCh() chan struct{}

ExitCh ... exit channel

func (*DpllConfig) FrequencyStatus

func (d *DpllConfig) FrequencyStatus() int64

FrequencyStatus ... get frequency status

func (*DpllConfig) InSpec

func (d *DpllConfig) InSpec() bool

func (*DpllConfig) MonitorDpll

func (d *DpllConfig) MonitorDpll()

MonitorDpll monitors DPLL on the discovered API, if any

func (*DpllConfig) MonitorDpllMock

func (d *DpllConfig) MonitorDpllMock()
func (d *DpllConfig) MonitorDpllNetlink()

MonitorDpllNetlink monitors DPLL through netlink

func (*DpllConfig) MonitorDpllSysfs

func (d *DpllConfig) MonitorDpllSysfs()

MonitorDpllSysfs ... monitor dpPPS_STATUSll events

func (*DpllConfig) MonitorProcess

func (d *DpllConfig) MonitorProcess(processCfg config.ProcessConfig)

MonitorProcess is initiating monitoring of DPLL associated with a process

func (*DpllConfig) Name

func (d *DpllConfig) Name() string

Name ... name of the process

func (*DpllConfig) PhaseOffset

func (d *DpllConfig) PhaseOffset() int64

PhaseOffset ... get phase offset

func (*DpllConfig) PhaseOffsetPin

func (d *DpllConfig) PhaseOffsetPin(pin *nl.DoPinGetReply) bool

func (*DpllConfig) PhaseStatus

func (d *DpllConfig) PhaseStatus() int64

PhaseStatus get phase status

func (*DpllConfig) SetDependsOn

func (d *DpllConfig) SetDependsOn(dependsOn []event.EventSource)

SetDependsOn ... set depends on ..

func (*DpllConfig) SetPhaseOffset

func (d *DpllConfig) SetPhaseOffset(phaseOffset int64)

SetPhaseOffset ... set phaseOffset Measured phase offset values are fractional with 3-digit decimal places and shall be divided by DPLL_PIN_PHASE_OFFSET_DIVIDER to get integer part The units are picoseconds. We further divide it by 1000 to report nanoseconds

func (*DpllConfig) SetSourceLost

func (d *DpllConfig) SetSourceLost(sourceLost bool)

SetSourceLost ... set source status

func (*DpllConfig) Slope

func (d *DpllConfig) Slope() float64

func (*DpllConfig) SourceLost

func (d *DpllConfig) SourceLost() bool

SourceLost ... get source status

func (*DpllConfig) State

func (d *DpllConfig) State() event.PTPState

State ... get dpll state

func (*DpllConfig) Stopped

func (d *DpllConfig) Stopped() bool

Stopped ... stopped

func (*DpllConfig) Timer

func (d *DpllConfig) Timer() int64

type DpllSubscriber

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

DpllSubscriber ... event subscriber

func (DpllSubscriber) ID

func (s DpllSubscriber) ID() string

func (DpllSubscriber) Monitor

func (s DpllSubscriber) Monitor()

Monitor ...

func (DpllSubscriber) Notify

func (s DpllSubscriber) Notify(source event.EventSource, state event.PTPState)

Notify ... event notification

func (DpllSubscriber) Topic

func (s DpllSubscriber) Topic() event.EventSource

Topic ... event topic

Jump to

Keyboard shortcuts

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