Loading android/pandora/mmi2grpc/mmi2grpc/_audio.py +4 −6 Original line number Diff line number Diff line Loading @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Audio tools.""" import itertools Loading Loading @@ -101,7 +100,6 @@ class AudioSignal: index = np.where(frequency == SINE_FREQUENCY) amplitude = amplitudes[index][0] match_amplitude = math.isclose( amplitude, self.amplitude, rel_tol=1e-03) match_amplitude = math.isclose(amplitude, self.amplitude, rel_tol=1e-03) return match_amplitude android/pandora/mmi2grpc/mmi2grpc/gap.py +5 −10 Original line number Diff line number Diff line Loading @@ -134,8 +134,7 @@ class GAPProxy(ProfileProxy): if self.counter == 0: self.counter += 1 self.security_storage.DeleteBond(public=pts_addr) self.connection = self.host.ConnectLE(own_address_type=RANDOM, public=pts_addr).connection self.connection = self.host.ConnectLE(own_address_type=RANDOM, public=pts_addr).connection self.security.Secure(connection=self.connection, le=LE_LEVEL3) return "OK" Loading Loading @@ -257,8 +256,7 @@ class GAPProxy(ProfileProxy): Please prepare IUT to send an advertising report with TX Power Level. """ self.advertise = self.host.Advertise(own_address_type=PUBLIC, data=DataTypes(include_tx_power_level=True,)) self.advertise = self.host.Advertise(own_address_type=PUBLIC, data=DataTypes(include_tx_power_level=True,)) return "OK" Loading Loading @@ -457,8 +455,7 @@ class GAPProxy(ProfileProxy): for response in self.scan_responses: assert response.HasField("public") if (response.public == pts_addr and response.data.le_discoverability_mode == DISCOVERABLE_LIMITED): if (response.public == pts_addr and response.data.le_discoverability_mode == DISCOVERABLE_LIMITED): self.scan_responses.cancel() return "OK" Loading @@ -476,8 +473,7 @@ class GAPProxy(ProfileProxy): nonlocal discovered for response in self.scan_responses: assert response.HasField("public") if (response.public == pts_addr and response.data.le_discoverability_mode == DISCOVERABLE_GENERAL): if (response.public == pts_addr and response.data.le_discoverability_mode == DISCOVERABLE_GENERAL): self.scan_responses.cancel() discovered = True return Loading @@ -503,8 +499,7 @@ class GAPProxy(ProfileProxy): nonlocal discovered for response in self.scan_responses: assert response.HasField("public") if (response.public == pts_addr and response.data.le_discoverability_mode == DISCOVERABLE_LIMITED): if (response.public == pts_addr and response.data.le_discoverability_mode == DISCOVERABLE_LIMITED): self.inquiry_responses.cancel() discovered = True return Loading android/pandora/mmi2grpc/mmi2grpc/hogp.py +2 −0 Original line number Diff line number Diff line Loading @@ -42,8 +42,10 @@ class HOGPProxy(ProfileProxy): self.connection = self.host.ConnectLE(own_address_type=RANDOM, public=pts_addr).connection self.pairing_stream = self.security.OnPairing() def secure(): self.security.Secure(connection=self.connection, le=LE_LEVEL3) threading.Thread(target=secure).start() return "OK" Loading Loading
android/pandora/mmi2grpc/mmi2grpc/_audio.py +4 −6 Original line number Diff line number Diff line Loading @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Audio tools.""" import itertools Loading Loading @@ -101,7 +100,6 @@ class AudioSignal: index = np.where(frequency == SINE_FREQUENCY) amplitude = amplitudes[index][0] match_amplitude = math.isclose( amplitude, self.amplitude, rel_tol=1e-03) match_amplitude = math.isclose(amplitude, self.amplitude, rel_tol=1e-03) return match_amplitude
android/pandora/mmi2grpc/mmi2grpc/gap.py +5 −10 Original line number Diff line number Diff line Loading @@ -134,8 +134,7 @@ class GAPProxy(ProfileProxy): if self.counter == 0: self.counter += 1 self.security_storage.DeleteBond(public=pts_addr) self.connection = self.host.ConnectLE(own_address_type=RANDOM, public=pts_addr).connection self.connection = self.host.ConnectLE(own_address_type=RANDOM, public=pts_addr).connection self.security.Secure(connection=self.connection, le=LE_LEVEL3) return "OK" Loading Loading @@ -257,8 +256,7 @@ class GAPProxy(ProfileProxy): Please prepare IUT to send an advertising report with TX Power Level. """ self.advertise = self.host.Advertise(own_address_type=PUBLIC, data=DataTypes(include_tx_power_level=True,)) self.advertise = self.host.Advertise(own_address_type=PUBLIC, data=DataTypes(include_tx_power_level=True,)) return "OK" Loading Loading @@ -457,8 +455,7 @@ class GAPProxy(ProfileProxy): for response in self.scan_responses: assert response.HasField("public") if (response.public == pts_addr and response.data.le_discoverability_mode == DISCOVERABLE_LIMITED): if (response.public == pts_addr and response.data.le_discoverability_mode == DISCOVERABLE_LIMITED): self.scan_responses.cancel() return "OK" Loading @@ -476,8 +473,7 @@ class GAPProxy(ProfileProxy): nonlocal discovered for response in self.scan_responses: assert response.HasField("public") if (response.public == pts_addr and response.data.le_discoverability_mode == DISCOVERABLE_GENERAL): if (response.public == pts_addr and response.data.le_discoverability_mode == DISCOVERABLE_GENERAL): self.scan_responses.cancel() discovered = True return Loading @@ -503,8 +499,7 @@ class GAPProxy(ProfileProxy): nonlocal discovered for response in self.scan_responses: assert response.HasField("public") if (response.public == pts_addr and response.data.le_discoverability_mode == DISCOVERABLE_LIMITED): if (response.public == pts_addr and response.data.le_discoverability_mode == DISCOVERABLE_LIMITED): self.inquiry_responses.cancel() discovered = True return Loading
android/pandora/mmi2grpc/mmi2grpc/hogp.py +2 −0 Original line number Diff line number Diff line Loading @@ -42,8 +42,10 @@ class HOGPProxy(ProfileProxy): self.connection = self.host.ConnectLE(own_address_type=RANDOM, public=pts_addr).connection self.pairing_stream = self.security.OnPairing() def secure(): self.security.Secure(connection=self.connection, le=LE_LEVEL3) threading.Thread(target=secure).start() return "OK" Loading