Lines Matching refs:event
35 def irq(event, data): argument
36 if event == _IRQ_CENTRAL_CONNECT:
39 waiting_events[event] = conn_handle
40 elif event == _IRQ_CENTRAL_DISCONNECT:
42 elif event == _IRQ_PERIPHERAL_CONNECT:
45 waiting_events[event] = conn_handle
46 elif event == _IRQ_PERIPHERAL_DISCONNECT:
48 elif event == _IRQ_L2CAP_ACCEPT:
51 waiting_events[event] = (conn_handle, cid, psm)
52 elif event == _IRQ_L2CAP_CONNECT:
55 waiting_events[event] = (conn_handle, cid, psm, our_mtu, peer_mtu)
56 elif event == _IRQ_L2CAP_DISCONNECT:
59 elif event == _IRQ_L2CAP_RECV:
61 elif event == _IRQ_L2CAP_SEND_READY:
64 if event not in waiting_events:
65 waiting_events[event] = None
68 def wait_for_event(event, timeout_ms): argument
71 if event in waiting_events:
72 return waiting_events.pop(event)
74 raise ValueError("Timeout waiting for {}".format(event))