Lines Matching refs:self

31     def __init__(self, handle, acl_stream, device):  argument
32 self.handle = int(handle)
33 self.device = device
35 self.our_acl_stream = FilteringEventStream(acl_stream, None)
37 def send(self, pb_flag, b_flag, data): argument
39 … handle=self.handle, packet_boundary_flag=int(pb_flag), broadcast_flag=int(b_flag), data=data)
40 self.device.hci.SendAclData(acl_msg)
42 def send_first(self, data): argument
43 self.send(hci_packets.PacketBoundaryFlag.FIRST_AUTOMATICALLY_FLUSHABLE,
46 def send_continuing(self, data): argument
47self.send(hci_packets.PacketBoundaryFlag.CONTINUING_FRAGMENT, hci_packets.BroadcastFlag.POINT_TO_P…
50 def get_event_queue(self): argument
51 return self.our_acl_stream.get_event_queue()
60 def __init__(self, device, acl_streaming=False): argument
66 self.device = device
67 self._setup_event_stream()
68 self._setup_le_event_stream()
70self.register_for_events(hci_packets.EventCode.ROLE_CHANGE, hci_packets.EventCode.CONNECTION_REQUE…
73 self._setup_acl_stream()
75 def _setup_event_stream(self): argument
76 self.event_stream = EventStream(self.device.hci.FetchEvents(empty_proto.Empty()))
78 def _setup_le_event_stream(self): argument
79 self.le_event_stream = EventStream(self.device.hci.FetchLeSubevents(empty_proto.Empty()))
81 def _setup_acl_stream(self): argument
82 self.acl_stream = EventStream(self.device.hci.FetchAclPackets(empty_proto.Empty()))
84 def close(self): argument
85 safeClose(self.event_stream)
86 safeClose(self.le_event_stream)
87 safeClose(self.acl_stream)
89 def get_event_stream(self): argument
90 return self.event_stream
92 def get_le_event_stream(self): argument
93 return self.le_event_stream
95 def get_raw_acl_stream(self): argument
96 if self.acl_stream is None:
97 … raise Exception("Please construct '%s' with acl_streaming=True!" % self.__class__.__name__)
98 return self.acl_stream
100 def register_for_events(self, *event_codes): argument
103 self.device.hci.RegisterEventHandler(msg)
105 def register_for_le_events(self, *event_codes): argument
108 self.device.hci.RegisterLeEventHandler(msg)
110 def send_command_with_complete(self, command): argument
113 self.device.hci.EnqueueCommandWithComplete(cmd)
115 def send_command_with_status(self, command): argument
118 self.device.hci.EnqueueCommandWithStatus(cmd)
120 def enable_inquiry_and_page_scan(self): argument
121 self.send_command_with_complete(
124 def read_own_address(self): argument
125 self.send_command_with_complete(hci_packets.ReadBdAddrBuilder())
127 assertThat(self.event_stream).emits(read_bd_addr)
130 def initiate_connection(self, remote_addr): argument
131 self.send_command_with_status(
140 def accept_connection(self): argument
142 assertThat(self.event_stream).emits(connection_request)
144 self.send_command_with_status(
147 return self.complete_connection()
149 def complete_connection(self): argument
151 assertThat(self.event_stream).emits(connection_complete)
154 if self.acl_stream is None:
155 … raise Exception("Please construct '%s' with acl_streaming=True!" % self.__class__.__name__)
156 return PyHciAclConnection(handle, self.acl_stream, self.device)