setPinFunc sets the function on a single PTP pin descriptor
(index uint, pf int, ch uint)
| 118 | |
| 119 | // setPinFunc sets the function on a single PTP pin descriptor |
| 120 | func (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 |
| 133 | func (dev *Device) MaxFreqAdjPPB() (maxFreq float64, err error) { |
nothing calls this directly
no test coverage detected