(srcDevicePath string, pinIndex uint)
| 102 | } |
| 103 | |
| 104 | func 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 |
| 118 | func phcDeviceFromName(dstDeviceName string) (*phc.Device, error) { |
no test coverage detected
searching dependent graphs…