New initializes new PTPv2 unicast client
(cfg *Config, callback func(*MeasurementResult))
| 135 | |
| 136 | // New initializes new PTPv2 unicast client |
| 137 | func New(cfg *Config, callback func(*MeasurementResult)) *Client { |
| 138 | c := &Client{ |
| 139 | inChan: make(chan *inPacket, 10), |
| 140 | m: newMeasurements(), |
| 141 | cfg: cfg, |
| 142 | callback: callback, |
| 143 | } |
| 144 | return c |
| 145 | } |
| 146 | |
| 147 | func (c *Client) sendGeneralMsg(p ptp.Packet) (uint16, error) { |
| 148 | seq := c.genSequence |