dut1.start_app()
# Parse BLE devname
- devname = dut1.expect(re.compile(r"(?:[\s\S]*) Provisioning started with BLE devname : (PROV_\S\S\S\S\S\S)"))[0]
+ devname = dut1.expect(re.compile(r"Provisioning started with BLE devname : '(PROV_\S\S\S\S\S\S)'"), timeout=60)[0]
print("BLE Device Alias for DUT :", devname)
# Match additional headers sent in the request
- dut1.expect("BLE Provisioning started")
+ dut1.expect("BLE Provisioning started", timeout=30)
print("Starting Provisioning")
verbose = False
return ESP_FAIL;
}
- ESP_LOGI(TAG, "Provisioning started with BLE devname : %s", config.device_name);
+ ESP_LOGI(TAG, "Provisioning started with BLE devname : '%s'", config.device_name);
return ESP_OK;
}
dut1.start_app()
# Parse IP address of STA
- dut1.expect("Starting WiFi SoftAP provisioning")
- dut1.expect("SoftAP started")
- [ssid, password] = dut1.expect(re.compile(r"(?:[\s\S]*)SoftAP Provisioning started with SSID '(\S+)', Password '(\S+)'"))
+ dut1.expect("Starting WiFi SoftAP provisioning", timeout=60)
+ dut1.expect("SoftAP started", timeout=30)
+ [ssid, password] = dut1.expect(re.compile(r"SoftAP Provisioning started with SSID '(\S+)', Password '(\S+)'"), timeout=30)
iface = wifi_tools.get_wiface_name()
if iface == None:
ctrl = wifi_tools.wpa_cli(iface, reset_on_exit = True)
print("Connecting to DUT SoftAP...")
ip = ctrl.connect(ssid, password)
+ got_ip = dut1.expect(re.compile(r"softAP assign IP to station,IP is: (\d+.\d+.\d+.\d+)"), timeout=30)[0]
+ if ip != got_ip:
+ raise RuntimeError("SoftAP connected to another host! " + ip + "!=" + got_ip)
print("Connected to DUT SoftAP")
print("Starting Provisioning")
break
if srv_path == None:
+ self.device.Disconnect(dbus_interface='org.bluez.Device1')
+ self.device = None
raise RuntimeError("Provisioning service not found")
self.characteristics = dict()
self.device.Disconnect(dbus_interface='org.bluez.Device1')
if self.adapter:
self.adapter.RemoveDevice(self.device)
+ self.device = None
if self.adapter_props:
self.adapter_props.Set("org.bluez.Adapter1", "Powered", dbus.Boolean(0))