Lines Matching refs:event
53 def irq(event, data): argument
54 if event == _IRQ_CENTRAL_CONNECT:
56 waiting_events[event] = data[0]
57 elif event == _IRQ_CENTRAL_DISCONNECT:
59 elif event == _IRQ_GATTS_WRITE:
61 elif event == _IRQ_PERIPHERAL_CONNECT:
63 waiting_events[event] = data[0]
64 elif event == _IRQ_PERIPHERAL_DISCONNECT:
66 elif event == _IRQ_GATTC_CHARACTERISTIC_RESULT:
69 waiting_events[event] = data[2]
72 elif event == _IRQ_GATTC_CHARACTERISTIC_DONE:
74 elif event == _IRQ_GATTC_WRITE_DONE:
76 elif event == _IRQ_GATTC_NOTIFY:
78 elif event == _IRQ_MTU_EXCHANGED:
80 waiting_events[event] = data[-1]
82 if event not in waiting_events:
83 waiting_events[event] = None
86 def wait_for_event(event, timeout_ms): argument
89 if event in waiting_events:
90 return waiting_events.pop(event)
92 raise ValueError("Timeout waiting for {}".format(event))