clkmgr 2.0
Clock Manager API library to receive events from the PTP service
Loading...
Searching...
No Matches
event.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 SPDX-FileCopyrightText: Copyright © 2025 Intel Corporation. */
3
24#ifndef EVENT_H
25#define EVENT_H
26
27#include "pub/clkmgr/utility.h"
28#include "pub/clkmgr/types.h"
29
30#include <string>
31
33
34class ClockEventHandler;
35
47{
48 public:
53 int64_t getClockOffset() const;
54
60 bool isOffsetInRange() const;
61
70
79 uint64_t getSyncInterval() const;
80
87 uint64_t getGmIdentity() const;
88
95 std::string getGmIdentityStr() const;
96
103 bool isGmChanged() const;
104
111 uint32_t getGmChangedEventCount() const;
112
119 uint64_t getNotificationTimestamp() const;
120
121 protected:
125 ClockEventBase() = default;
126 friend class ClockEventHandler;
127 int64_t clockOffset = 0;
128 uint64_t syncInterval = 0;
129 uint64_t gmClockUUID = 0;
131 uint64_t notificationTimestamp = 0;
132 uint32_t offsetInRangeCount = 0;
133 uint32_t gmChangedCount = 0;
134 bool offsetInRange = true;
135 bool gmChanged = false;
137};
138
147{
148 public:
154 bool isSyncedWithGm() const;
155
164
169 bool isAsCapable() const;
170
178 uint32_t getAsCapableEventCount() const;
179
187
195 uint32_t getCompositeEventCount() const;
196
197 protected:
198 PTPClockEvent() = default;
199
200 private:
201 friend class ClockEventHandler;
202 friend class ClockSyncData;
203 friend class TimeBaseState;
204 uint32_t syncedWithGmCount = 0;
205 uint32_t asCapableCount = 0;
206 uint32_t compositeEventCount = 0;
207 bool syncedWithGm = false;
208 bool asCapable = false;
209 bool compositeEvent = false;
210};
211
218{
219 protected:
220 SysClockEvent() = default;
221
222 private:
223 friend class ClockEventHandler;
224 friend class ClockSyncData;
225 friend class TimeBaseState;
226};
227
234{
235 public:
240 ClockSyncData() = default;
241
246 bool havePTP() const;
247
253
258 bool haveSys() const;
259
265
266 private:
267 friend class ClockSyncBaseHandler;
268 PTPClockEvent ptpClockSync;
269 SysClockEvent sysClockSync;
270 bool ptpAvailable = false;
271 bool sysAvailable = false;
272};
273
275
276#endif /* EVENT_H */
Definition event.h:47
uint64_t getGmIdentity() const
uint32_t getOffsetInRangeEventCount() const
bool isGmChanged() const
std::string getGmIdentityStr() const
uint64_t getNotificationTimestamp() const
int64_t getClockOffset() const
uint32_t getGmChangedEventCount() const
uint64_t getSyncInterval() const
bool isOffsetInRange() const
Definition event.h:234
ClockSyncData()=default
PTPClockEvent & getPtp()
bool havePTP() const
SysClockEvent & getSysClock()
bool haveSys() const
Definition event.h:147
uint32_t getCompositeEventCount() const
uint32_t getSyncedWithGmEventCount() const
bool isCompositeEventMet() const
uint32_t getAsCapableEventCount() const
bool isAsCapable() const
bool isSyncedWithGm() const
Definition event.h:218
Enumerator types.
Helper macros.
#define __CLKMGR_NAMESPACE_BEGIN
Definition utility.h:19
#define __CLKMGR_NAMESPACE_END
Definition utility.h:21