MCPcopy Create free account
hub / github.com/facebook/time / setPinFunc

Method setPinFunc

phc/device.go:120–130  ·  view source on GitHub ↗

setPinFunc sets the function on a single PTP pin descriptor

(index uint, pf int, ch uint)

Source from the content-addressed store, hash-verified

118
119// setPinFunc sets the function on a single PTP pin descriptor
120func (dev *Device) setPinFunc(index uint, pf int, ch uint) error {
121 raw := unix.PtpPinDesc{
122 Index: uint32(index), //#nosec G115
123 Func: uint32(pf), //#nosec G115
124 Chan: uint32(ch), //#nosec G115
125 }
126 if err := unix.IoctlPtpPinSetfunc(int(dev.Fd()), &raw); err != nil {
127 return fmt.Errorf("%s: ioctl(PTP_PIN_SETFUNC) failed: %w", dev.File().Name(), err)
128 }
129 return nil
130}
131
132// MaxFreqAdjPPB reads max value for frequency adjustments (in PPB) from ptp device
133func (dev *Device) MaxFreqAdjPPB() (maxFreq float64, err error) {

Callers

nothing calls this directly

Calls 4

FdMethod · 0.95
FileMethod · 0.95
IoctlPtpPinSetfuncFunction · 0.92
NameMethod · 0.65

Tested by

no test coverage detected