from bt2 import native_bt, object, utils
import bt2.clock_class_priority_map
+import bt2.clock_value
import bt2.packet
import bt2.stream
import bt2.event
return _NOTIF_TYPE_TO_CLS[notif_type]._create_from_ptr(ptr)
+def _notif_types_from_notif_classes(notification_types):
+ if notification_types is None:
+ notif_types = None
+ else:
+ for notif_cls in notification_types:
+ if notif_cls not in _NOTIF_TYPE_TO_CLS.values():
+ raise ValueError("'{}' is not a notification class".format(notif_cls))
+
+ notif_types = [notif_cls._TYPE for notif_cls in notification_types]
+
+ return notif_types
+
+
class _Notification(object._Object):
pass
if clock_value_ptr is None:
return
- clock_value = bt2.clock_class._create_clock_value_from_ptr(clock_value_ptr)
+ clock_value = bt2.clock_value._create_clock_value_from_ptr(clock_value_ptr)
return clock_value
def add_clock_value(self, clock_value):
- utils._check_type(clock_value, bt2.clock_class._ClockValue)
+ utils._check_type(clock_value, bt2.clock_value._ClockValue)
ret = native_bt.notification_inactivity_set_clock_value(self._ptr,
clock_value._ptr)
utils._handle_ret(ret, "cannot set inactivity notification object's clock value")
if clock_value_ptr is None:
return
- clock_value = bt2.clock_class._create_clock_value_from_ptr(clock_value_ptr)
+ clock_value = bt2.clock_value._create_clock_value_from_ptr(clock_value_ptr)
return clock_value
@property
if clock_value_ptr is None:
return
- clock_value = bt2.clock_class._create_clock_value_from_ptr(clock_value_ptr)
+ clock_value = bt2.clock_value._create_clock_value_from_ptr(clock_value_ptr)
return clock_value
if clock_value_ptr is None:
return
- clock_value = bt2.clock_class._create_clock_value_from_ptr(clock_value_ptr)
+ clock_value = bt2.clock_value._create_clock_value_from_ptr(clock_value_ptr)
return clock_value
@property
if clock_value_ptr is None:
return
- clock_value = bt2.clock_class._create_clock_value_from_ptr(clock_value_ptr)
+ clock_value = bt2.clock_value._create_clock_value_from_ptr(clock_value_ptr)
return clock_value