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

Function getPPSSourceFromPath

cmd/ptpcheck/cmd/ts2phc.go:104–115  ·  view source on GitHub ↗
(srcDevicePath string, pinIndex uint)

Source from the content-addressed store, hash-verified

102}
103
104func getPPSSourceFromPath(srcDevicePath string, pinIndex uint) (*phc.PPSSource, error) {
105 srcDeviceFile, err := os.OpenFile(srcDevicePath, os.O_RDWR, 0)
106 if err != nil {
107 return nil, fmt.Errorf("error opening source device: %w", err)
108 }
109 ppsSource, err := phc.ActivatePPSSource(phc.FromFile(srcDeviceFile), pinIndex)
110 if err != nil {
111 return nil, fmt.Errorf("error activating PPS Source for PHC: %w", err)
112 }
113
114 return ppsSource, nil
115}
116
117// phcDeviceFromName returns a PHC device from a device name, which can be either an interface name or a PHC device path
118func phcDeviceFromName(dstDeviceName string) (*phc.Device, error) {

Callers 1

ts2phcRunFunction · 0.85

Calls 2

ActivatePPSSourceFunction · 0.92
FromFileFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…