def __init__(self, hci_thread, cb_thread):
self.connections = set()
self.hci = hci_thread
self.cb_thread = cb_thread
self.is_initiating = False
self.lock = RLock()
def _is_le_connection_event_filter(packet):
return packet.getlayer(HCI_LE_Meta_Connection_Complete) is not None
self.cb_thread.add_callback(
_is_le_connection_event_filter, self.handle_connection_packet)
def _is_disconnection_event_filter(packet):
return packet.getlayer(HCI_Event_Disconnection_Complete) is not None
self.cb_thread.add_callback(
_is_disconnection_event_filter, self.handle_disconnection_packet)
评论列表
文章目录