writeClockDataV2 serializes a DataV2 into a section's 56-byte data buffer.
(buf []byte, d DataV2)
| 207 | |
| 208 | // writeClockDataV2 serializes a DataV2 into a section's 56-byte data buffer. |
| 209 | func writeClockDataV2(buf []byte, d DataV2) { |
| 210 | binary.LittleEndian.PutUint64(buf[0:8], uint64(d.IngressTimeNS)) //nolint:gosec |
| 211 | binary.LittleEndian.PutUint32(buf[8:12], Uint64ToUint32(d.ErrorBoundNS)) |
| 212 | binary.LittleEndian.PutUint32(buf[12:16], FloatAsUint32(d.HoldoverMultiplierNS)) |
| 213 | binary.LittleEndian.PutUint64(buf[16:24], d.SmearingStartS) |
| 214 | binary.LittleEndian.PutUint16(buf[24:26], uint16(d.UTCOffsetPreS)) //nolint:gosec |
| 215 | binary.LittleEndian.PutUint16(buf[26:28], uint16(d.UTCOffsetPostS)) //nolint:gosec |
| 216 | binary.LittleEndian.PutUint32(buf[28:32], d.ClockID) |
| 217 | binary.LittleEndian.PutUint64(buf[32:40], uint64(d.PHCTimeNS)) //nolint:gosec |
| 218 | binary.LittleEndian.PutUint64(buf[40:48], uint64(d.SysclockTimeNS)) //nolint:gosec |
| 219 | binary.LittleEndian.PutUint64(buf[48:56], uint64(d.CoefPPB)) //nolint:gosec |
| 220 | } |
| 221 | |
| 222 | // readClockDataV2 deserializes a DataV2 from a section's 56-byte data buffer. |
| 223 | func readClockDataV2(buf []byte) *DataV2 { |
no test coverage detected
searching dependent graphs…