clockDataV2ToC builds the C clockdata_v2 struct from a DataV2.
(d DataV2)
| 225 | |
| 226 | // clockDataV2ToC builds the C clockdata_v2 struct from a DataV2. |
| 227 | func clockDataV2ToC(d DataV2) *C.fbclock_clockdata_v2 { |
| 228 | return &C.fbclock_clockdata_v2{ |
| 229 | ingress_time_ns: C.int64_t(d.IngressTimeNS), |
| 230 | error_bound_ns: C.uint32_t(Uint64ToUint32(d.ErrorBoundNS)), |
| 231 | holdover_multiplier_ns: C.uint32_t(FloatAsUint32(d.HoldoverMultiplierNS)), |
| 232 | clock_smearing_start_s: C.uint64_t(d.SmearingStartS), |
| 233 | utc_offset_pre_s: C.int16_t(d.UTCOffsetPreS), |
| 234 | utc_offset_post_s: C.int16_t(d.UTCOffsetPostS), |
| 235 | clockId: C.uint32_t(d.ClockID), |
| 236 | phc_time_ns: C.int64_t(d.PHCTimeNS), |
| 237 | sysclock_time_ns: C.int64_t(d.SysclockTimeNS), |
| 238 | coef_ppb: C.int64_t(d.CoefPPB), |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | // clockDataV2FromC builds a DataV2 from the C clockdata_v2 struct. |
| 243 | func clockDataV2FromC(c *C.fbclock_clockdata_v2) *DataV2 { |
no test coverage detected
searching dependent graphs…