Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions openpilot/system/ui/lib/wifi_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,11 @@ def _wait_for_wifi_device(self):
def _get_adapter(self, adapter_type: int) -> str | None:
# Return the first NetworkManager device path matching adapter_type
try:
device_paths = self._router_main.send_and_get_reply(new_method_call(self._nm, 'GetDevices')).body[0]
for device_path in device_paths:
reply = self._router_main.send_and_get_reply(new_method_call(self._nm, 'GetDevices'))
if reply.header.message_type == MessageType.error:
# NetworkManager is not available, body holds an error string instead of device paths
return None
for device_path in reply.body[0]:
dev_addr = DBusAddress(device_path, bus_name=NM, interface=NM_DEVICE_IFACE)
dev_type = self._router_main.send_and_get_reply(Properties(dev_addr).get('DeviceType')).body[0][1]
if dev_type == adapter_type:
Expand Down
Loading