def preset_p2p(self): self.go_name = "go_" + self.go_serial self.slave_name = "cli_" + self.cli_serial wifi_generic_steps.p2p_disconect_all(serial = self.go_serial)() #wifi_generic_steps.p2p_disconect_all(serial = self.cli_serial)() #disconnect from one side only wifi_generic_steps.p2p_forget_all_groups(serial = self.go_serial)() wifi_generic_steps.p2p_forget_all_groups(serial = self.cli_serial)() wifi_generic_steps.p2p_rename_device(serial = self.go_serial, new_name = self.go_name)() wifi_generic_steps.p2p_rename_device(serial = self.cli_serial, new_name = self.slave_name)()
def reconnect_persistent(self, serial): if self.scenario == "CLI-Reconnect-Persistent-P2P": slave_name = self.go_name master_name = self.slave_name inviting_serial = self.cli_serial receiving_serial = self.go_serial else: slave_name = self.slave_name master_name = self.go_name inviting_serial = self.go_serial receiving_serial = self.cli_serial # disconnet p2p wifi_generic_steps.p2p_disconect_all(serial = serial)() # reconnect persistent wifi_generic_steps.p2p_connect_devices(serial=inviting_serial, slave_name=slave_name, master_name=master_name, serial2=receiving_serial, known_device=True)()
def dismiss_cli(self, serial): wifi_generic_steps.p2p_disconect_all(serial = serial)()
def leave_group(self, serial): #wifi_generic_steps.p2p_forget_all_groups(serial = serial)() wifi_generic_steps.p2p_disconect_all(serial = serial)()
# get the DUT ip. # In case that ip is 192.168.43.1 we need to turn off the hotspot dut_ip = wifi_utils.get_connection_parameter(parameter="ip_address", serial=serial) # turn of the hotspot before start the test if dut_ip == wifi_defaults.wifi["hotSpot_ip"]: # turn off the HotSpot in case that hotspot is on wifi_generic_steps.set_hotSpot(serial=serial, hotSpot_state="OFF")() # make sure there are no saved networks wifi_generic_steps.clear_saved_networks(serial=serial)() # make sure there are no p2p connections wifi_generic_steps.p2p_disconect_all(serial=serial)() # turn on the airplane mode wifi_generic_steps.set_airplane_mode(serial=serial, state="ON")() # navigate to Tethering & portable hotspot view # and check the Portable Wi-Fi hotspot ui_steps.click_button(serial=serial, view_to_find={"text": "Tethering & portable hotspot"}, view_to_check={"text": "USB tethering"})() ui_steps.wait_for_view(serial=serial, view_to_find={ "className": "android.widget.TextView", "textContains": "Portable Wi", "enabled": "false"