+ return self._create_value_from_ptr_and_get_ref(ptr)
+
+ @property
+ def name(self):
+ return native_bt.clock_class_get_name(self._ptr)
+
+ @property
+ def description(self):
+ return native_bt.clock_class_get_description(self._ptr)
+
+ @property
+ def frequency(self):
+ return native_bt.clock_class_get_frequency(self._ptr)
+
+ @property
+ def precision(self):
+ precision = native_bt.clock_class_get_precision(self._ptr)
+ return precision
+
+ @property
+ def offset(self):
+ offset_s, offset_cycles = native_bt.clock_class_get_offset(self._ptr)
+ return ClockClassOffset(offset_s, offset_cycles)
+
+ @property
+ def origin_is_unix_epoch(self):
+ return native_bt.clock_class_origin_is_unix_epoch(self._ptr)
+
+ @property
+ def uuid(self):
+ uuid_bytes = native_bt.clock_class_get_uuid(self._ptr)
+
+ if uuid_bytes is None:
+ return
+
+ return uuidp.UUID(bytes=uuid_bytes)
+
+ def cycles_to_ns_from_origin(self, cycles):
+ utils._check_uint64(cycles)
+ status, ns = native_bt.clock_class_cycles_to_ns_from_origin(self._ptr, cycles)
+ error_msg = "cannot convert clock value to nanoseconds from origin for given clock class"
+ utils._handle_func_status(status, error_msg)
+ return ns
+
+
+class _ClockClass(_ClockClassConst):
+ _create_value_from_ptr_and_get_ref = staticmethod(
+ bt2_value._create_from_ptr_and_get_ref
+ )