diff --git a/src/controller/python/chip/ble/LinuxImpl.cpp b/src/controller/python/chip/ble/LinuxImpl.cpp index 4e03d41e14949c..09aa0056f084f9 100644 --- a/src/controller/python/chip/ble/LinuxImpl.cpp +++ b/src/controller/python/chip/ble/LinuxImpl.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/platform/Linux/ConnectivityManagerImpl.cpp b/src/platform/Linux/ConnectivityManagerImpl.cpp index 0ba16f90d874a9..050eab734bdceb 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.cpp +++ b/src/platform/Linux/ConnectivityManagerImpl.cpp @@ -84,13 +84,13 @@ namespace chip { #if CHIP_DEVICE_CONFIG_ENABLE_WPA template <> -struct GAutoPtrDeleter +struct GAutoPtrDeleter { using deleter = GObjectDeleter; }; template <> -struct GAutoPtrDeleter +struct GAutoPtrDeleter { using deleter = GObjectDeleter; }; @@ -234,7 +234,7 @@ bool ConnectivityManagerImpl::_IsWiFiStationConnected() return false; } - state = wpa_fi_w1_wpa_supplicant1_interface_get_state(mWpaSupplicant.iface); + state = wpa_supplicant_1_interface_get_state(mWpaSupplicant.iface); if (g_strcmp0(state, "completed") == 0) { mConnectivityFlag.Set(ConnectivityFlags::kHaveIPv4InternetConnectivity) @@ -263,7 +263,7 @@ bool ConnectivityManagerImpl::_IsWiFiStationProvisioned() return false; } - bss = wpa_fi_w1_wpa_supplicant1_interface_get_current_bss(mWpaSupplicant.iface); + bss = wpa_supplicant_1_interface_get_current_bss(mWpaSupplicant.iface); if (g_str_match_string("BSSs", bss, true)) { ret = true; @@ -285,7 +285,7 @@ void ConnectivityManagerImpl::_ClearWiFiStationProvision() if (mWiFiStationMode != kWiFiStationMode_ApplicationControlled) { GAutoPtr err; - wpa_fi_w1_wpa_supplicant1_interface_call_remove_all_networks_sync(mWpaSupplicant.iface, nullptr, &err.GetReceiver()); + wpa_supplicant_1_interface_call_remove_all_networks_sync(mWpaSupplicant.iface, nullptr, &err.GetReceiver()); if (err != nullptr) { @@ -394,7 +394,7 @@ void ConnectivityManagerImpl::UpdateNetworkStatus() MakeOptional(GetDisconnectReason())); } -void ConnectivityManagerImpl::_OnWpaPropertiesChanged(WpaFiW1Wpa_supplicant1Interface * proxy, GVariant * changedProperties) +void ConnectivityManagerImpl::_OnWpaPropertiesChanged(WpaSupplicant1Interface * proxy, GVariant * changedProperties) { std::lock_guard lock(mWpaSupplicantMutex); @@ -422,7 +422,7 @@ void ConnectivityManagerImpl::_OnWpaPropertiesChanged(WpaFiW1Wpa_supplicant1Inte } else if (g_strcmp0(value_str.get(), "\'disconnected\'") == 0) { - gint reason = wpa_fi_w1_wpa_supplicant1_interface_get_disconnect_reason(mWpaSupplicant.iface); + gint reason = wpa_supplicant_1_interface_get_disconnect_reason(mWpaSupplicant.iface); if (delegate) { @@ -444,13 +444,13 @@ void ConnectivityManagerImpl::_OnWpaPropertiesChanged(WpaFiW1Wpa_supplicant1Inte case WLAN_REASON_DISASSOC_LOW_ACK: case WLAN_REASON_BSS_TRANSITION_DISASSOC: associationFailureCause = static_cast(AssociationFailureCauseEnum::kAssociationFailed); - status = wpa_fi_w1_wpa_supplicant1_interface_get_assoc_status_code(mWpaSupplicant.iface); + status = wpa_supplicant_1_interface_get_assoc_status_code(mWpaSupplicant.iface); break; case WLAN_REASON_PREV_AUTH_NOT_VALID: case WLAN_REASON_DEAUTH_LEAVING: case WLAN_REASON_IEEE_802_1X_AUTH_FAILED: associationFailureCause = static_cast(AssociationFailureCauseEnum::kAuthenticationFailed); - status = wpa_fi_w1_wpa_supplicant1_interface_get_auth_status_code(mWpaSupplicant.iface); + status = wpa_supplicant_1_interface_get_auth_status_code(mWpaSupplicant.iface); break; default: break; @@ -515,7 +515,7 @@ void ConnectivityManagerImpl::_OnWpaInterfaceProxyReady(GObject * sourceObject, std::lock_guard lock(mWpaSupplicantMutex); - WpaFiW1Wpa_supplicant1Interface * iface = wpa_fi_w1_wpa_supplicant1_interface_proxy_new_for_bus_finish(res, &err.GetReceiver()); + WpaSupplicant1Interface * iface = wpa_supplicant_1_interface_proxy_new_for_bus_finish(res, &err.GetReceiver()); if (mWpaSupplicant.iface) { @@ -529,14 +529,13 @@ void ConnectivityManagerImpl::_OnWpaInterfaceProxyReady(GObject * sourceObject, mWpaSupplicant.state = GDBusWpaSupplicant::WpaState::INTERFACE_CONNECTED; ChipLogProgress(DeviceLayer, "wpa_supplicant: connected to wpa_supplicant interface proxy"); - g_signal_connect( - mWpaSupplicant.iface, "properties-changed", - G_CALLBACK(+[](WpaFiW1Wpa_supplicant1Interface * proxy, GVariant * properties, ConnectivityManagerImpl * self) { - return self->_OnWpaPropertiesChanged(proxy, properties); - }), - this); + g_signal_connect(mWpaSupplicant.iface, "properties-changed", + G_CALLBACK(+[](WpaSupplicant1Interface * proxy, GVariant * properties, ConnectivityManagerImpl * self) { + return self->_OnWpaPropertiesChanged(proxy, properties); + }), + this); g_signal_connect(mWpaSupplicant.iface, "scan-done", - G_CALLBACK(+[](WpaFiW1Wpa_supplicant1Interface * proxy, gboolean success, ConnectivityManagerImpl * self) { + G_CALLBACK(+[](WpaSupplicant1Interface * proxy, gboolean success, ConnectivityManagerImpl * self) { return self->_OnWpaInterfaceScanDone(proxy, success); }), this); @@ -569,7 +568,7 @@ void ConnectivityManagerImpl::_OnWpaBssProxyReady(GObject * sourceObject, GAsync std::lock_guard lock(mWpaSupplicantMutex); - WpaFiW1Wpa_supplicant1BSS * bss = wpa_fi_w1_wpa_supplicant1_bss_proxy_new_for_bus_finish(res, &err.GetReceiver()); + WpaSupplicant1BSS * bss = wpa_supplicant_1_bss_proxy_new_for_bus_finish(res, &err.GetReceiver()); if (mWpaSupplicant.bss) { @@ -599,14 +598,14 @@ void ConnectivityManagerImpl::_OnWpaInterfaceReady(GObject * sourceObject, GAsyn std::lock_guard lock(mWpaSupplicantMutex); - gboolean result = wpa_fi_w1_wpa_supplicant1_call_get_interface_finish(mWpaSupplicant.proxy, &mWpaSupplicant.interfacePath, res, - &err.GetReceiver()); + gboolean result = + wpa_supplicant_1_call_get_interface_finish(mWpaSupplicant.proxy, &mWpaSupplicant.interfacePath, res, &err.GetReceiver()); if (result) { mWpaSupplicant.state = GDBusWpaSupplicant::WpaState::GOT_INTERFACE_PATH; ChipLogProgress(DeviceLayer, "wpa_supplicant: WiFi interface: %s", mWpaSupplicant.interfacePath); - wpa_fi_w1_wpa_supplicant1_interface_proxy_new_for_bus( + wpa_supplicant_1_interface_proxy_new_for_bus( G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, kWpaSupplicantServiceName, mWpaSupplicant.interfacePath, nullptr, reinterpret_cast( +[](GObject * sourceObject_, GAsyncResult * res_, ConnectivityManagerImpl * self) { @@ -614,7 +613,7 @@ void ConnectivityManagerImpl::_OnWpaInterfaceReady(GObject * sourceObject, GAsyn }), this); - wpa_fi_w1_wpa_supplicant1_bss_proxy_new_for_bus( + wpa_supplicant_1_bss_proxy_new_for_bus( G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, kWpaSupplicantServiceName, mWpaSupplicant.interfacePath, nullptr, reinterpret_cast( +[](GObject * sourceObject_, GAsyncResult * res_, ConnectivityManagerImpl * self) { @@ -637,8 +636,8 @@ void ConnectivityManagerImpl::_OnWpaInterfaceReady(GObject * sourceObject, GAsyn g_variant_builder_add(&builder, "{sv}", "Ifname", g_variant_new_string(CHIP_DEVICE_CONFIG_WIFI_STATION_IF_NAME)); args = g_variant_builder_end(&builder); - result = wpa_fi_w1_wpa_supplicant1_call_create_interface_sync(mWpaSupplicant.proxy, args, &mWpaSupplicant.interfacePath, - nullptr, &error.GetReceiver()); + result = wpa_supplicant_1_call_create_interface_sync(mWpaSupplicant.proxy, args, &mWpaSupplicant.interfacePath, nullptr, + &error.GetReceiver()); if (result) { @@ -647,7 +646,7 @@ void ConnectivityManagerImpl::_OnWpaInterfaceReady(GObject * sourceObject, GAsyn Platform::CopyString(sWiFiIfName, CHIP_DEVICE_CONFIG_WIFI_STATION_IF_NAME); - wpa_fi_w1_wpa_supplicant1_interface_proxy_new_for_bus( + wpa_supplicant_1_interface_proxy_new_for_bus( G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, kWpaSupplicantServiceName, mWpaSupplicant.interfacePath, nullptr, reinterpret_cast( +[](GObject * sourceObject_, GAsyncResult * res_, ConnectivityManagerImpl * self) { @@ -655,7 +654,7 @@ void ConnectivityManagerImpl::_OnWpaInterfaceReady(GObject * sourceObject, GAsyn }), this); - wpa_fi_w1_wpa_supplicant1_bss_proxy_new_for_bus( + wpa_supplicant_1_bss_proxy_new_for_bus( G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, kWpaSupplicantServiceName, mWpaSupplicant.interfacePath, nullptr, reinterpret_cast( +[](GObject * sourceObject_, GAsyncResult * res_, ConnectivityManagerImpl * self) { @@ -679,7 +678,7 @@ void ConnectivityManagerImpl::_OnWpaInterfaceReady(GObject * sourceObject, GAsyn } } -void ConnectivityManagerImpl::_OnWpaInterfaceAdded(WpaFiW1Wpa_supplicant1 * proxy, const char * path, GVariant * properties) +void ConnectivityManagerImpl::_OnWpaInterfaceAdded(WpaSupplicant1 * proxy, const char * path, GVariant * properties) { // When creating D-Bus proxy object, the thread default context must be initialized. Otherwise, // all D-Bus signals will be delivered to the GLib global default main context. @@ -698,7 +697,7 @@ void ConnectivityManagerImpl::_OnWpaInterfaceAdded(WpaFiW1Wpa_supplicant1 * prox mWpaSupplicant.state = GDBusWpaSupplicant::WpaState::GOT_INTERFACE_PATH; ChipLogProgress(DeviceLayer, "wpa_supplicant: WiFi interface added: %s", mWpaSupplicant.interfacePath); - wpa_fi_w1_wpa_supplicant1_interface_proxy_new_for_bus( + wpa_supplicant_1_interface_proxy_new_for_bus( G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, kWpaSupplicantServiceName, mWpaSupplicant.interfacePath, nullptr, reinterpret_cast( +[](GObject * sourceObject_, GAsyncResult * res_, ConnectivityManagerImpl * self) { @@ -706,7 +705,7 @@ void ConnectivityManagerImpl::_OnWpaInterfaceAdded(WpaFiW1Wpa_supplicant1 * prox }), this); - wpa_fi_w1_wpa_supplicant1_bss_proxy_new_for_bus( + wpa_supplicant_1_bss_proxy_new_for_bus( G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, kWpaSupplicantServiceName, mWpaSupplicant.interfacePath, nullptr, reinterpret_cast( +[](GObject * sourceObject_, GAsyncResult * res_, ConnectivityManagerImpl * self) { @@ -716,7 +715,7 @@ void ConnectivityManagerImpl::_OnWpaInterfaceAdded(WpaFiW1Wpa_supplicant1 * prox } } -void ConnectivityManagerImpl::_OnWpaInterfaceRemoved(WpaFiW1Wpa_supplicant1 * proxy, const char * path, GVariant * properties) +void ConnectivityManagerImpl::_OnWpaInterfaceRemoved(WpaSupplicant1 * proxy, const char * path, GVariant * properties) { std::lock_guard lock(mWpaSupplicantMutex); @@ -763,7 +762,7 @@ void ConnectivityManagerImpl::_OnWpaProxyReady(GObject * sourceObject, GAsyncRes std::lock_guard lock(mWpaSupplicantMutex); - mWpaSupplicant.proxy = wpa_fi_w1_wpa_supplicant1_proxy_new_for_bus_finish(res, &err.GetReceiver()); + mWpaSupplicant.proxy = wpa_supplicant_1_proxy_new_for_bus_finish(res, &err.GetReceiver()); if (mWpaSupplicant.proxy != nullptr && err.get() == nullptr) { mWpaSupplicant.state = GDBusWpaSupplicant::WpaState::CONNECTED; @@ -771,22 +770,23 @@ void ConnectivityManagerImpl::_OnWpaProxyReady(GObject * sourceObject, GAsyncRes g_signal_connect( mWpaSupplicant.proxy, "interface-added", - G_CALLBACK(+[](WpaFiW1Wpa_supplicant1 * proxy, const char * path, GVariant * properties, - ConnectivityManagerImpl * self) { return self->_OnWpaInterfaceAdded(proxy, path, properties); }), + G_CALLBACK(+[](WpaSupplicant1 * proxy, const char * path, GVariant * properties, ConnectivityManagerImpl * self) { + return self->_OnWpaInterfaceAdded(proxy, path, properties); + }), this); g_signal_connect( mWpaSupplicant.proxy, "interface-removed", - G_CALLBACK(+[](WpaFiW1Wpa_supplicant1 * proxy, const char * path, GVariant * properties, - ConnectivityManagerImpl * self) { return self->_OnWpaInterfaceRemoved(proxy, path, properties); }), + G_CALLBACK(+[](WpaSupplicant1 * proxy, const char * path, GVariant * properties, ConnectivityManagerImpl * self) { + return self->_OnWpaInterfaceRemoved(proxy, path, properties); + }), this); - wpa_fi_w1_wpa_supplicant1_call_get_interface( - mWpaSupplicant.proxy, sWiFiIfName, nullptr, - reinterpret_cast( - +[](GObject * sourceObject_, GAsyncResult * res_, ConnectivityManagerImpl * self) { - return self->_OnWpaInterfaceReady(sourceObject_, res_); - }), - this); + wpa_supplicant_1_call_get_interface(mWpaSupplicant.proxy, sWiFiIfName, nullptr, + reinterpret_cast( + +[](GObject * sourceObject_, GAsyncResult * res_, ConnectivityManagerImpl * self) { + return self->_OnWpaInterfaceReady(sourceObject_, res_); + }), + this); } else { @@ -878,11 +878,11 @@ CHIP_ERROR ConnectivityManagerImpl::_WiFiPAFPublish(ConnectivityManager::WiFiPAF MAX_PAF_PUBLISH_SSI_BUFLEN - strlen(args)); VerifyOrReturnError(ret == CHIP_NO_ERROR, ret); ChipLogProgress(DeviceLayer, "WiFi-PAF: publish: [%s]", args); - wpa_fi_w1_wpa_supplicant1_interface_call_nanpublish_sync(mWpaSupplicant.iface, args, &publish_id, nullptr, &err.GetReceiver()); + wpa_supplicant_1_interface_call_nanpublish_sync(mWpaSupplicant.iface, args, &publish_id, nullptr, &err.GetReceiver()); ChipLogProgress(DeviceLayer, "WiFi-PAF: publish_id: %d ! ", publish_id); g_signal_connect(mWpaSupplicant.iface, "nan-receive", - G_CALLBACK(+[](WpaFiW1Wpa_supplicant1Interface * proxy, GVariant * obj, ConnectivityManagerImpl * self) { + G_CALLBACK(+[](WpaSupplicant1Interface * proxy, GVariant * obj, ConnectivityManagerImpl * self) { return self->OnNanReceive(obj); }), this); @@ -896,7 +896,7 @@ CHIP_ERROR ConnectivityManagerImpl::_WiFiPAFCancelPublish() ChipLogProgress(DeviceLayer, "WiFi-PAF: cancel publish_id: %d ! ", mpaf_info.peer_publish_id); snprintf(args, sizeof(args), "publish_id=%d", mpaf_info.peer_publish_id); - wpa_fi_w1_wpa_supplicant1_interface_call_nancancel_publish_sync(mWpaSupplicant.iface, args, nullptr, &err.GetReceiver()); + wpa_supplicant_1_interface_call_nancancel_publish_sync(mWpaSupplicant.iface, args, nullptr, &err.GetReceiver()); return CHIP_NO_ERROR; } @@ -1020,7 +1020,7 @@ void ConnectivityManagerImpl::DriveAPState() { GAutoPtr error(nullptr); - gboolean result = wpa_fi_w1_wpa_supplicant1_interface_call_remove_network_sync( + gboolean result = wpa_supplicant_1_interface_call_remove_network_sync( mWpaSupplicant.iface, mWpaSupplicant.networkPath, nullptr, &error.GetReceiver()); if (result) @@ -1085,8 +1085,8 @@ CHIP_ERROR ConnectivityManagerImpl::ConfigureWiFiAP() g_variant_builder_add(&builder, "{sv}", "frequency", g_variant_new_int32(channel)); args = g_variant_builder_end(&builder); - gboolean result = wpa_fi_w1_wpa_supplicant1_interface_call_add_network_sync( - mWpaSupplicant.iface, args, &mWpaSupplicant.networkPath, nullptr, &err.GetReceiver()); + gboolean result = wpa_supplicant_1_interface_call_add_network_sync(mWpaSupplicant.iface, args, &mWpaSupplicant.networkPath, + nullptr, &err.GetReceiver()); if (result) { @@ -1094,8 +1094,8 @@ CHIP_ERROR ConnectivityManagerImpl::ConfigureWiFiAP() ChipLogProgress(DeviceLayer, "wpa_supplicant: added network: SSID: %s: %s", ssid, mWpaSupplicant.networkPath); - result = wpa_fi_w1_wpa_supplicant1_interface_call_select_network_sync(mWpaSupplicant.iface, mWpaSupplicant.networkPath, - nullptr, &error.GetReceiver()); + result = wpa_supplicant_1_interface_call_select_network_sync(mWpaSupplicant.iface, mWpaSupplicant.networkPath, nullptr, + &error.GetReceiver()); if (result) { ChipLogProgress(DeviceLayer, "wpa_supplicant: succeeded to start softAP: SSID: %s", ssid); @@ -1148,15 +1148,15 @@ ConnectivityManagerImpl::_ConnectWiFiNetworkAsync(GVariant * args, GAutoPtr err; gboolean result; - const gchar * networkPath = wpa_fi_w1_wpa_supplicant1_interface_get_current_network(mWpaSupplicant.iface); + const gchar * networkPath = wpa_supplicant_1_interface_get_current_network(mWpaSupplicant.iface); // wpa_supplicant DBus API: if network path of current network is not "/", means we have already selected some network. if (strcmp(networkPath, "/") != 0) { GAutoPtr error; - result = wpa_fi_w1_wpa_supplicant1_interface_call_remove_network_sync(mWpaSupplicant.iface, networkPath, nullptr, - &error.GetReceiver()); + result = + wpa_supplicant_1_interface_call_remove_network_sync(mWpaSupplicant.iface, networkPath, nullptr, &error.GetReceiver()); if (result) { @@ -1177,18 +1177,18 @@ ConnectivityManagerImpl::_ConnectWiFiNetworkAsync(GVariant * args, SuccessOrExit(ret); } - result = wpa_fi_w1_wpa_supplicant1_interface_call_add_network_sync(mWpaSupplicant.iface, args, &mWpaSupplicant.networkPath, - nullptr, &err.GetReceiver()); + result = wpa_supplicant_1_interface_call_add_network_sync(mWpaSupplicant.iface, args, &mWpaSupplicant.networkPath, nullptr, + &err.GetReceiver()); if (result) { // Note: wpa_supplicant will return immediately if the network is already connected, but it will still try reconnect in the // background. The client still need to wait for a few seconds for this reconnect operation. So we always disconnect from // the network we are connected and ignore any errors. - wpa_fi_w1_wpa_supplicant1_interface_call_disconnect_sync(mWpaSupplicant.iface, nullptr, nullptr); + wpa_supplicant_1_interface_call_disconnect_sync(mWpaSupplicant.iface, nullptr, nullptr); ChipLogProgress(DeviceLayer, "wpa_supplicant: added network: %s", mWpaSupplicant.networkPath); - wpa_fi_w1_wpa_supplicant1_interface_call_select_network( + wpa_supplicant_1_interface_call_select_network( mWpaSupplicant.iface, mWpaSupplicant.networkPath, nullptr, reinterpret_cast( +[](GObject * sourceObject_, GAsyncResult * res_, ConnectivityManagerImpl * self) { @@ -1243,14 +1243,14 @@ ConnectivityManagerImpl::ConnectWiFiNetworkAsync(ByteSpan ssid, ByteSpan credent } #if CHIP_DEVICE_CONFIG_ENABLE_WIFI_PDC -static CHIP_ERROR AddOrReplaceBlob(WpaFiW1Wpa_supplicant1Interface * iface, const char * nameOrRef, ByteSpan data) +static CHIP_ERROR AddOrReplaceBlob(WpaSupplicant1Interface * iface, const char * nameOrRef, ByteSpan data) { // Strip the blob:// prefix off the name (if present), so we don't need as many string constants. constexpr auto refPrefix = "blob://"_span; const char * name = (strncmp(nameOrRef, refPrefix.data(), refPrefix.size()) == 0) ? nameOrRef + refPrefix.size() : nameOrRef; GAutoPtr err; - if (!wpa_fi_w1_wpa_supplicant1_interface_call_remove_blob_sync(iface, name, nullptr, &err.GetReceiver())) + if (!wpa_supplicant_1_interface_call_remove_blob_sync(iface, name, nullptr, &err.GetReceiver())) { GAutoPtr remoteError(g_dbus_error_get_remote_error(err.get())); if (!(remoteError && strcmp(remoteError.get(), kWpaSupplicantBlobUnknown) == 0)) @@ -1260,7 +1260,7 @@ static CHIP_ERROR AddOrReplaceBlob(WpaFiW1Wpa_supplicant1Interface * iface, cons } err.reset(); } - if (!wpa_fi_w1_wpa_supplicant1_interface_call_add_blob_sync( + if (!wpa_supplicant_1_interface_call_add_blob_sync( iface, name, g_variant_new_fixed_array(G_VARIANT_TYPE_BYTE, data.data(), data.size(), 1), nullptr, &err.GetReceiver())) { ChipLogError(DeviceLayer, "wpa_supplicant: failed to add blob: %s", err ? err->message : "unknown error"); @@ -1489,27 +1489,27 @@ CHIP_ERROR ConnectivityManagerImpl::_WiFiPAFConnect(const SetupDiscriminator & c VerifyOrReturnError(ret == CHIP_NO_ERROR, ret); ChipLogProgress(DeviceLayer, "WiFi-PAF: subscribe: [%s]", args); - wpa_fi_w1_wpa_supplicant1_interface_call_nansubscribe_sync(mWpaSupplicant.iface, args, &subscribe_id, nullptr, - &err.GetReceiver()); + wpa_supplicant_1_interface_call_nansubscribe_sync(mWpaSupplicant.iface, args, &subscribe_id, nullptr, &err.GetReceiver()); ChipLogProgress(DeviceLayer, "WiFi-PAF: subscribe_id: [%d]", subscribe_id); mpresubscribe_id = subscribe_id; mOnPafSubscribeComplete = onSuccess; mOnPafSubscribeError = onError; g_signal_connect(mWpaSupplicant.iface, "nan-discoveryresult", - G_CALLBACK(+[](WpaFiW1Wpa_supplicant1Interface * proxy, gboolean success, GVariant * obj, + G_CALLBACK(+[](WpaSupplicant1Interface * proxy, gboolean success, GVariant * obj, ConnectivityManagerImpl * self) { return self->OnDiscoveryResult(success, obj); }), this); g_signal_connect(mWpaSupplicant.iface, "nan-receive", - G_CALLBACK(+[](WpaFiW1Wpa_supplicant1Interface * proxy, GVariant * obj, ConnectivityManagerImpl * self) { + G_CALLBACK(+[](WpaSupplicant1Interface * proxy, GVariant * obj, ConnectivityManagerImpl * self) { return self->OnNanReceive(obj); }), this); g_signal_connect( mWpaSupplicant.iface, "nan-subscribeterminated", - G_CALLBACK(+[](WpaFiW1Wpa_supplicant1Interface * proxy, gint term_subscribe_id, gint reason, - ConnectivityManagerImpl * self) { return self->OnNanSubscribeTerminated(term_subscribe_id, reason); }), + G_CALLBACK(+[](WpaSupplicant1Interface * proxy, gint term_subscribe_id, gint reason, ConnectivityManagerImpl * self) { + return self->OnNanSubscribeTerminated(term_subscribe_id, reason); + }), this); return CHIP_NO_ERROR; @@ -1525,7 +1525,7 @@ CHIP_ERROR ConnectivityManagerImpl::_WiFiPAFCancelConnect() gchar args[MAX_PAF_PUBLISH_SSI_BUFLEN]; snprintf(args, sizeof(args), "subscribe_id=%d", mpresubscribe_id); - wpa_fi_w1_wpa_supplicant1_interface_call_nancancel_subscribe_sync(mWpaSupplicant.iface, args, nullptr, &err.GetReceiver()); + wpa_supplicant_1_interface_call_nancancel_subscribe_sync(mWpaSupplicant.iface, args, nullptr, &err.GetReceiver()); return CHIP_NO_ERROR; } @@ -1570,7 +1570,7 @@ CHIP_ERROR ConnectivityManagerImpl::_WiFiPAFSend(System::PacketBufferHandle && m MAX_PAF_TX_SSI_BUFLEN - strlen(args)); VerifyOrReturnError(ret == CHIP_NO_ERROR, ret); ChipLogProgress(DeviceLayer, "WiFi-PAF: ssi: [%s]", args); - wpa_fi_w1_wpa_supplicant1_interface_call_nantransmit_sync(mWpaSupplicant.iface, args, nullptr, &err.GetReceiver()); + wpa_supplicant_1_interface_call_nantransmit_sync(mWpaSupplicant.iface, args, nullptr, &err.GetReceiver()); ChipLogProgress(Controller, "WiFi-PAF: Outbound message (%lu) done", msgBuf->DataLength()); return ret; } @@ -1584,8 +1584,7 @@ void ConnectivityManagerImpl::_ConnectWiFiNetworkAsyncCallback(GObject * sourceO std::lock_guard lock(mWpaSupplicantMutex); { - gboolean result = - wpa_fi_w1_wpa_supplicant1_interface_call_select_network_finish(mWpaSupplicant.iface, res, &err.GetReceiver()); + gboolean result = wpa_supplicant_1_interface_call_select_network_finish(mWpaSupplicant.iface, res, &err.GetReceiver()); if (!result) { ChipLogError(DeviceLayer, "Failed to perform connect network: %s", err == nullptr ? "unknown error" : err->message); @@ -1602,7 +1601,7 @@ void ConnectivityManagerImpl::_ConnectWiFiNetworkAsyncCallback(GObject * sourceO return; } - result = wpa_fi_w1_wpa_supplicant1_interface_call_save_config_sync(mWpaSupplicant.iface, nullptr, &err.GetReceiver()); + result = wpa_supplicant_1_interface_call_save_config_sync(mWpaSupplicant.iface, nullptr, &err.GetReceiver()); if (result) { ChipLogProgress(DeviceLayer, "wpa_supplicant: save config succeeded!"); @@ -1677,7 +1676,7 @@ CHIP_ERROR ConnectivityManagerImpl::CommitConfig() ChipLogProgress(DeviceLayer, "wpa_supplicant: save config"); - result = wpa_fi_w1_wpa_supplicant1_interface_call_save_config_sync(mWpaSupplicant.iface, nullptr, &err.GetReceiver()); + result = wpa_supplicant_1_interface_call_save_config_sync(mWpaSupplicant.iface, nullptr, &err.GetReceiver()); if (!result) { @@ -1744,7 +1743,7 @@ CHIP_ERROR ConnectivityManagerImpl::GetWiFiSecurityType(SecurityTypeEnum & secur return CHIP_ERROR_INCORRECT_STATE; } - mode = wpa_fi_w1_wpa_supplicant1_interface_get_current_auth_mode(mWpaSupplicant.iface); + mode = wpa_supplicant_1_interface_get_current_auth_mode(mWpaSupplicant.iface); ChipLogProgress(DeviceLayer, "wpa_supplicant: current Wi-Fi security type: %s", StringOrNullMarker(mode)); if (strncmp(mode, "WPA-PSK", 7) == 0) @@ -1796,7 +1795,7 @@ int32_t ConnectivityManagerImpl::GetDisconnectReason() std::lock_guard lock(mWpaSupplicantMutex); GAutoPtr err; - gint errorValue = wpa_fi_w1_wpa_supplicant1_interface_get_disconnect_reason(mWpaSupplicant.iface); + gint errorValue = wpa_supplicant_1_interface_get_disconnect_reason(mWpaSupplicant.iface); // wpa_supplicant DBus API: DisconnectReason: The most recent IEEE 802.11 reason code for disconnect. Negative value // indicates locally generated disconnection. return errorValue; @@ -1818,7 +1817,7 @@ CHIP_ERROR ConnectivityManagerImpl::GetConfiguredNetwork(NetworkCommissioning::N return CHIP_ERROR_INCORRECT_STATE; } - const gchar * networkPath = wpa_fi_w1_wpa_supplicant1_interface_get_current_network(mWpaSupplicant.iface); + const gchar * networkPath = wpa_supplicant_1_interface_get_current_network(mWpaSupplicant.iface); // wpa_supplicant DBus API: if network path of current network is "/", means no networks is currently selected. if ((networkPath == nullptr) || (strcmp(networkPath, "/") == 0)) @@ -1826,15 +1825,15 @@ CHIP_ERROR ConnectivityManagerImpl::GetConfiguredNetwork(NetworkCommissioning::N return CHIP_ERROR_KEY_NOT_FOUND; } - GAutoPtr networkInfo(wpa_fi_w1_wpa_supplicant1_network_proxy_new_for_bus_sync( + GAutoPtr networkInfo(wpa_supplicant_1_network_proxy_new_for_bus_sync( G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, kWpaSupplicantServiceName, networkPath, nullptr, &err.GetReceiver())); if (networkInfo == nullptr) { return CHIP_ERROR_INTERNAL; } - network.connected = wpa_fi_w1_wpa_supplicant1_network_get_enabled(networkInfo.get()); - GVariant * properties = wpa_fi_w1_wpa_supplicant1_network_get_properties(networkInfo.get()); + network.connected = wpa_supplicant_1_network_get_enabled(networkInfo.get()); + GVariant * properties = wpa_supplicant_1_network_get_properties(networkInfo.get()); GAutoPtr ssid(g_variant_lookup_value(properties, "ssid", nullptr)); gsize length; const gchar * ssidStr = g_variant_get_string(ssid.get(), &length); @@ -1857,8 +1856,8 @@ CHIP_ERROR ConnectivityManagerImpl::StopAutoScan() ChipLogDetail(DeviceLayer, "wpa_supplicant: disabling auto scan"); - result = wpa_fi_w1_wpa_supplicant1_interface_call_auto_scan_sync( - mWpaSupplicant.iface, "" /* empty string means disabling auto scan */, nullptr, &err.GetReceiver()); + result = wpa_supplicant_1_interface_call_auto_scan_sync(mWpaSupplicant.iface, "" /* empty string means disabling auto scan */, + nullptr, &err.GetReceiver()); if (!result) { ChipLogError(DeviceLayer, "wpa_supplicant: Failed to stop auto network scan: %s", err ? err->message : "unknown"); @@ -1888,7 +1887,7 @@ CHIP_ERROR ConnectivityManagerImpl::StartWiFiScan(ByteSpan ssid, WiFiDriver::Sca g_variant_builder_add(&builder, "{sv}", "Type", g_variant_new_string("active")); args = g_variant_builder_end(&builder); - result = wpa_fi_w1_wpa_supplicant1_interface_call_scan_sync(mWpaSupplicant.iface, args, nullptr, &err.GetReceiver()); + result = wpa_supplicant_1_interface_call_scan_sync(mWpaSupplicant.iface, args, nullptr, &err.GetReceiver()); if (result) { @@ -2015,7 +2014,7 @@ bool ConnectivityManagerImpl::_GetBssInfo(const gchar * bssPath, NetworkCommissi // with the proxy object. GAutoPtr err; - GAutoPtr bss(wpa_fi_w1_wpa_supplicant1_bss_proxy_new_for_bus_sync( + GAutoPtr bss(wpa_supplicant_1_bss_proxy_new_for_bus_sync( G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, kWpaSupplicantServiceName, bssPath, nullptr, &err.GetReceiver())); if (bss == nullptr) @@ -2023,7 +2022,7 @@ bool ConnectivityManagerImpl::_GetBssInfo(const gchar * bssPath, NetworkCommissi return false; } - WpaFiW1Wpa_supplicant1BSSProxy * bssProxy = WPA_FI_W1_WPA_SUPPLICANT1_BSS_PROXY(bss.get()); + WpaSupplicant1BSSProxy * bssProxy = WPA_SUPPLICANT_1_BSS_PROXY(bss.get()); GAutoPtr ssid(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(bssProxy), "SSID")); GAutoPtr bssid(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(bssProxy), "BSSID")); @@ -2041,8 +2040,8 @@ bool ConnectivityManagerImpl::_GetBssInfo(const gchar * bssPath, NetworkCommissi char bssidStr[2 * 6 + 5 + 1] = { 0 }; gsize ssidLen = 0; gsize bssidLen = 0; - gint16 signal = wpa_fi_w1_wpa_supplicant1_bss_get_signal(bss.get()); - guint16 frequency = wpa_fi_w1_wpa_supplicant1_bss_get_frequency(bss.get()); + gint16 signal = wpa_supplicant_1_bss_get_signal(bss.get()); + guint16 frequency = wpa_supplicant_1_bss_get_frequency(bss.get()); ssidStr = reinterpret_cast(g_variant_get_fixed_array(ssid.get(), &ssidLen, sizeof(guchar))); bssidBuf = reinterpret_cast(g_variant_get_fixed_array(bssid.get(), &bssidLen, sizeof(guchar))); @@ -2135,7 +2134,7 @@ bool ConnectivityManagerImpl::_GetBssInfo(const gchar * bssPath, NetworkCommissi return res; }; - auto GetNetworkSecurityType = [IsNetworkWPAPSK, IsNetworkWPA2PSK](WpaFiW1Wpa_supplicant1BSSProxy * proxy) -> uint8_t { + auto GetNetworkSecurityType = [IsNetworkWPAPSK, IsNetworkWPA2PSK](WpaSupplicant1BSSProxy * proxy) -> uint8_t { GAutoPtr wpa(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(proxy), "WPA")); GAutoPtr rsn(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(proxy), "RSN")); @@ -2174,12 +2173,12 @@ bool ConnectivityManagerImpl::_GetBssInfo(const gchar * bssPath, NetworkCommissi return true; } -void ConnectivityManagerImpl::_OnWpaInterfaceScanDone(WpaFiW1Wpa_supplicant1Interface * proxy, gboolean success) +void ConnectivityManagerImpl::_OnWpaInterfaceScanDone(WpaSupplicant1Interface * proxy, gboolean success) { std::lock_guard lock(mWpaSupplicantMutex); ChipLogProgress(DeviceLayer, "wpa_supplicant: network scan done"); - gchar ** bsss = wpa_fi_w1_wpa_supplicant1_interface_dup_bsss(mWpaSupplicant.iface); + gchar ** bsss = wpa_supplicant_1_interface_dup_bsss(mWpaSupplicant.iface); gchar ** oldBsss = bsss; if (bsss == nullptr) { @@ -2235,7 +2234,7 @@ CHIP_ERROR ConnectivityManagerImpl::_StartWiFiManagement() VerifyOrDie(g_main_context_get_thread_default() != nullptr); ChipLogProgress(DeviceLayer, "wpa_supplicant: Start WiFi management"); - wpa_fi_w1_wpa_supplicant1_proxy_new_for_bus( + wpa_supplicant_1_proxy_new_for_bus( G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, kWpaSupplicantServiceName, kWpaSupplicantObjectPath, nullptr, reinterpret_cast(+[](GObject * sourceObject_, GAsyncResult * res_, ConnectivityManagerImpl * self) { return self->_OnWpaProxyReady(sourceObject_, res_); diff --git a/src/platform/Linux/ConnectivityManagerImpl.h b/src/platform/Linux/ConnectivityManagerImpl.h index 2025f228532961..deb014a00e1610 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.h +++ b/src/platform/Linux/ConnectivityManagerImpl.h @@ -86,13 +86,13 @@ struct GDBusWpaSupplicant SCANNING, }; - WpaState state = WpaState::INIT; - WpaScanningState scanState = WpaScanningState::IDLE; - WpaFiW1Wpa_supplicant1 * proxy = nullptr; - WpaFiW1Wpa_supplicant1Interface * iface = nullptr; - WpaFiW1Wpa_supplicant1BSS * bss = nullptr; - gchar * interfacePath = nullptr; - gchar * networkPath = nullptr; + WpaState state = WpaState::INIT; + WpaScanningState scanState = WpaScanningState::IDLE; + WpaSupplicant1 * proxy = nullptr; + WpaSupplicant1Interface * iface = nullptr; + WpaSupplicant1BSS * bss = nullptr; + gchar * interfacePath = nullptr; + gchar * networkPath = nullptr; }; #endif @@ -222,10 +222,10 @@ class ConnectivityManagerImpl final : public ConnectivityManager, CHIP_ERROR StopAutoScan(); void _OnWpaProxyReady(GObject * sourceObject, GAsyncResult * res); - void _OnWpaInterfaceRemoved(WpaFiW1Wpa_supplicant1 * proxy, const char * path, GVariant * properties); - void _OnWpaInterfaceAdded(WpaFiW1Wpa_supplicant1 * proxy, const char * path, GVariant * properties); - void _OnWpaPropertiesChanged(WpaFiW1Wpa_supplicant1Interface * proxy, GVariant * properties); - void _OnWpaInterfaceScanDone(WpaFiW1Wpa_supplicant1Interface * proxy, gboolean success); + void _OnWpaInterfaceRemoved(WpaSupplicant1 * proxy, const char * path, GVariant * properties); + void _OnWpaInterfaceAdded(WpaSupplicant1 * proxy, const char * path, GVariant * properties); + void _OnWpaPropertiesChanged(WpaSupplicant1Interface * proxy, GVariant * properties); + void _OnWpaInterfaceScanDone(WpaSupplicant1Interface * proxy, gboolean success); void _OnWpaInterfaceReady(GObject * sourceObject, GAsyncResult * res); void _OnWpaInterfaceProxyReady(GObject * sourceObject, GAsyncResult * res); void _OnWpaBssProxyReady(GObject * sourceObject, GAsyncResult * res); diff --git a/src/platform/Linux/ThreadStackManagerImpl.cpp b/src/platform/Linux/ThreadStackManagerImpl.cpp index 76fd478a050f89..a67942be8dac06 100644 --- a/src/platform/Linux/ThreadStackManagerImpl.cpp +++ b/src/platform/Linux/ThreadStackManagerImpl.cpp @@ -51,7 +51,7 @@ namespace { struct SetActiveDatasetContext { - OpenthreadIoOpenthreadBorderRouter * proxy; + OpenthreadBorderRouter * proxy; ByteSpan netInfo; }; @@ -67,7 +67,7 @@ CHIP_ERROR GLibMatterContextSetActiveDataset(SetActiveDatasetContext * context) GAutoPtr value(g_variant_new_from_bytes(G_VARIANT_TYPE_BYTESTRING, bytes.release(), true)); if (!value) return CHIP_ERROR_NO_MEMORY; - openthread_io_openthread_border_router_set_active_dataset_tlvs(context->proxy, value.release()); + openthread_border_router_set_active_dataset_tlvs(context->proxy, value.release()); return CHIP_NO_ERROR; } @@ -82,9 +82,9 @@ CHIP_ERROR ThreadStackManagerImpl::GLibMatterContextInitThreadStack(ThreadStackM VerifyOrDie(g_main_context_get_thread_default() != nullptr); GAutoPtr err; - self->mProxy.reset(openthread_io_openthread_border_router_proxy_new_for_bus_sync( - G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, kDBusOpenThreadService, kDBusOpenThreadObjectPath, nullptr, - &err.GetReceiver())); + self->mProxy.reset(openthread_border_router_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, + kDBusOpenThreadService, kDBusOpenThreadObjectPath, nullptr, + &err.GetReceiver())); VerifyOrReturnError( self->mProxy != nullptr, CHIP_ERROR_INTERNAL, ChipLogError(DeviceLayer, "openthread: failed to create openthread dbus proxy %s", err ? err->message : "unknown error")); @@ -103,7 +103,7 @@ CHIP_ERROR ThreadStackManagerImpl::_InitThreadStack() // If get property is called inside dbus thread (we are going to make it so), XXX_get_XXX can be used instead of XXX_dup_XXX // which is a little bit faster and the returned object doesn't need to be freed. Same for all following get properties. - GAutoPtr role(openthread_io_openthread_border_router_dup_device_role(mProxy.get())); + GAutoPtr role(openthread_border_router_dup_device_role(mProxy.get())); if (role) { ThreadDeviceRoleChangedHandler(role.get()); @@ -112,7 +112,7 @@ CHIP_ERROR ThreadStackManagerImpl::_InitThreadStack() return CHIP_NO_ERROR; } -void ThreadStackManagerImpl::OnDbusPropertiesChanged(OpenthreadIoOpenthreadBorderRouter * proxy, GVariant * changed_properties, +void ThreadStackManagerImpl::OnDbusPropertiesChanged(OpenthreadBorderRouter * proxy, GVariant * changed_properties, const gchar * const * invalidated_properties, gpointer user_data) { ThreadStackManagerImpl * me = reinterpret_cast(user_data); @@ -182,7 +182,7 @@ bool ThreadStackManagerImpl::_HaveRouteToAddress(const Inet::IPAddress & destAdd return true; } - GAutoPtr routes(openthread_io_openthread_border_router_dup_external_routes(mProxy.get())); + GAutoPtr routes(openthread_border_router_dup_external_routes(mProxy.get())); if (!routes) return false; @@ -368,7 +368,7 @@ bool ThreadStackManagerImpl::_IsThreadAttached() const CHIP_ERROR ThreadStackManagerImpl::GLibMatterContextCallAttach(ThreadStackManagerImpl * self) { VerifyOrDie(g_main_context_get_thread_default() != nullptr); - openthread_io_openthread_border_router_call_attach(self->mProxy.get(), nullptr, _OnThreadBrAttachFinished, self); + openthread_border_router_call_attach(self->mProxy.get(), nullptr, _OnThreadBrAttachFinished, self); return CHIP_NO_ERROR; } @@ -383,7 +383,7 @@ CHIP_ERROR ThreadStackManagerImpl::_SetThreadEnabled(bool val) else { GAutoPtr err; - gboolean result = openthread_io_openthread_border_router_call_reset_sync(mProxy.get(), nullptr, &err.GetReceiver()); + gboolean result = openthread_border_router_call_reset_sync(mProxy.get(), nullptr, &err.GetReceiver()); if (err) { ChipLogError(DeviceLayer, "openthread: _SetThreadEnabled calling %s failed: %s", "Reset", err->message); @@ -405,7 +405,7 @@ void ThreadStackManagerImpl::_OnThreadBrAttachFinished(GObject * source_object, GAutoPtr attachRes; GAutoPtr err; { - gboolean result = openthread_io_openthread_border_router_call_attach_finish(this_->mProxy.get(), res, &err.GetReceiver()); + gboolean result = openthread_border_router_call_attach_finish(this_->mProxy.get(), res, &err.GetReceiver()); if (!result) { ChipLogError(DeviceLayer, "Failed to perform finish Thread network scan: %s", @@ -442,7 +442,7 @@ ConnectivityManager::ThreadDeviceType ThreadStackManagerImpl::_GetThreadDeviceTy return ConnectivityManager::ThreadDeviceType::kThreadDeviceType_NotSupported; } - GAutoPtr role(openthread_io_openthread_border_router_dup_device_role(mProxy.get())); + GAutoPtr role(openthread_border_router_dup_device_role(mProxy.get())); if (!role) return ConnectivityManager::ThreadDeviceType::kThreadDeviceType_NotSupported; if (strcmp(role.get(), kOpenthreadDeviceRoleDetached) == 0 || strcmp(role.get(), kOpenthreadDeviceRoleDisabled) == 0) @@ -451,7 +451,7 @@ ConnectivityManager::ThreadDeviceType ThreadStackManagerImpl::_GetThreadDeviceTy } if (strcmp(role.get(), kOpenthreadDeviceRoleChild) == 0) { - GAutoPtr linkMode(openthread_io_openthread_border_router_dup_link_mode(mProxy.get())); + GAutoPtr linkMode(openthread_border_router_dup_link_mode(mProxy.get())); if (!linkMode) return ConnectivityManager::ThreadDeviceType::kThreadDeviceType_NotSupported; gboolean rx_on_when_idle; @@ -499,7 +499,7 @@ CHIP_ERROR ThreadStackManagerImpl::_SetThreadDeviceType(ConnectivityManager::Thr GAutoPtr linkMode(g_variant_new("(bbb)", rx_on_when_idle, device_type, network_data)); if (!linkMode) return CHIP_ERROR_NO_MEMORY; - openthread_io_openthread_border_router_set_link_mode(mProxy.get(), linkMode.release()); + openthread_border_router_set_link_mode(mProxy.get(), linkMode.release()); } return CHIP_NO_ERROR; @@ -546,7 +546,7 @@ CHIP_ERROR ThreadStackManagerImpl::_GetAndLogThreadTopologyFull() CHIP_ERROR ThreadStackManagerImpl::_GetPrimary802154MACAddress(uint8_t * buf) { VerifyOrReturnError(mProxy, CHIP_ERROR_INCORRECT_STATE); - guint64 extAddr = openthread_io_openthread_border_router_get_extended_address(mProxy.get()); + guint64 extAddr = openthread_border_router_get_extended_address(mProxy.get()); for (size_t i = 0; i < sizeof(extAddr); i++) { @@ -579,7 +579,7 @@ CHIP_ERROR ThreadStackManagerImpl::_GetPollPeriod(uint32_t & buf) CHIP_ERROR ThreadStackManagerImpl::GLibMatterContextCallScan(ThreadStackManagerImpl * self) { VerifyOrDie(g_main_context_get_thread_default() != nullptr); - openthread_io_openthread_border_router_call_scan(self->mProxy.get(), nullptr, _OnNetworkScanFinished, self); + openthread_border_router_call_scan(self->mProxy.get(), nullptr, _OnNetworkScanFinished, self); return CHIP_NO_ERROR; } @@ -604,8 +604,8 @@ void ThreadStackManagerImpl::_OnNetworkScanFinished(GAsyncResult * res) GAutoPtr scan_result; GAutoPtr err; { - gboolean result = openthread_io_openthread_border_router_call_scan_finish(mProxy.get(), &scan_result.GetReceiver(), res, - &err.GetReceiver()); + gboolean result = + openthread_border_router_call_scan_finish(mProxy.get(), &scan_result.GetReceiver(), res, &err.GetReceiver()); if (!result) { ChipLogError(DeviceLayer, "Failed to perform finish Thread network scan: %s", diff --git a/src/platform/Linux/ThreadStackManagerImpl.h b/src/platform/Linux/ThreadStackManagerImpl.h index 685348a4ae4a72..20cf85f2faf54c 100755 --- a/src/platform/Linux/ThreadStackManagerImpl.h +++ b/src/platform/Linux/ThreadStackManagerImpl.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -31,7 +31,7 @@ namespace chip { template <> -struct GAutoPtrDeleter +struct GAutoPtrDeleter { using deleter = GObjectDeleter; }; @@ -149,12 +149,12 @@ class ThreadStackManagerImpl : public ThreadStackManager uint8_t lqi; }; - GAutoPtr mProxy; + GAutoPtr mProxy; static CHIP_ERROR GLibMatterContextInitThreadStack(ThreadStackManagerImpl * self); static CHIP_ERROR GLibMatterContextCallAttach(ThreadStackManagerImpl * self); static CHIP_ERROR GLibMatterContextCallScan(ThreadStackManagerImpl * self); - static void OnDbusPropertiesChanged(OpenthreadIoOpenthreadBorderRouter * proxy, GVariant * changed_properties, + static void OnDbusPropertiesChanged(OpenthreadBorderRouter * proxy, GVariant * changed_properties, const gchar * const * invalidated_properties, gpointer user_data); void ThreadDeviceRoleChangedHandler(const gchar * role); diff --git a/src/platform/Linux/bluez/AdapterIterator.cpp b/src/platform/Linux/bluez/AdapterIterator.cpp index dd51ea470ae319..b2f9e394f2de69 100644 --- a/src/platform/Linux/bluez/AdapterIterator.cpp +++ b/src/platform/Linux/bluez/AdapterIterator.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include "BluezObjectIterator.h" #include "BluezObjectList.h" diff --git a/src/platform/Linux/bluez/AdapterIterator.h b/src/platform/Linux/bluez/AdapterIterator.h index 3de2db068fb634..8a85795dfb9424 100644 --- a/src/platform/Linux/bluez/AdapterIterator.h +++ b/src/platform/Linux/bluez/AdapterIterator.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include "BluezObjectIterator.h" #include "BluezObjectManager.h" diff --git a/src/platform/Linux/bluez/BluezAdvertisement.cpp b/src/platform/Linux/bluez/BluezAdvertisement.cpp index 859c1bf64fa07b..40db7a17032e1f 100644 --- a/src/platform/Linux/bluez/BluezAdvertisement.cpp +++ b/src/platform/Linux/bluez/BluezAdvertisement.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include "BluezEndpoint.h" diff --git a/src/platform/Linux/bluez/BluezAdvertisement.h b/src/platform/Linux/bluez/BluezAdvertisement.h index fcae7713a43efc..9b69e297cef524 100644 --- a/src/platform/Linux/bluez/BluezAdvertisement.h +++ b/src/platform/Linux/bluez/BluezAdvertisement.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include "BluezEndpoint.h" #include "Types.h" diff --git a/src/platform/Linux/bluez/BluezConnection.cpp b/src/platform/Linux/bluez/BluezConnection.cpp index d39411d18d6aef..24c9c2d7f3df14 100644 --- a/src/platform/Linux/bluez/BluezConnection.cpp +++ b/src/platform/Linux/bluez/BluezConnection.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/platform/Linux/bluez/BluezConnection.h b/src/platform/Linux/bluez/BluezConnection.h index f4efb3a5b22f2b..773b3928e2e57d 100644 --- a/src/platform/Linux/bluez/BluezConnection.h +++ b/src/platform/Linux/bluez/BluezConnection.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include "Types.h" diff --git a/src/platform/Linux/bluez/BluezEndpoint.cpp b/src/platform/Linux/bluez/BluezEndpoint.cpp index 9915abceb49712..9b873a707ff99b 100644 --- a/src/platform/Linux/bluez/BluezEndpoint.cpp +++ b/src/platform/Linux/bluez/BluezEndpoint.cpp @@ -66,7 +66,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/platform/Linux/bluez/BluezEndpoint.h b/src/platform/Linux/bluez/BluezEndpoint.h index 01821bf11c6507..457062e7bb5292 100644 --- a/src/platform/Linux/bluez/BluezEndpoint.h +++ b/src/platform/Linux/bluez/BluezEndpoint.h @@ -55,7 +55,7 @@ #include #include #include -#include +#include #include "BluezConnection.h" #include "BluezObjectManager.h" diff --git a/src/platform/Linux/bluez/BluezObjectIterator.h b/src/platform/Linux/bluez/BluezObjectIterator.h index 6b177acd03027b..4df65295c6ca54 100644 --- a/src/platform/Linux/bluez/BluezObjectIterator.h +++ b/src/platform/Linux/bluez/BluezObjectIterator.h @@ -22,7 +22,7 @@ #include #include -#include +#include namespace chip { namespace DeviceLayer { diff --git a/src/platform/Linux/bluez/BluezObjectList.h b/src/platform/Linux/bluez/BluezObjectList.h index c79141f6a73cad..bff461e0d82626 100644 --- a/src/platform/Linux/bluez/BluezObjectList.h +++ b/src/platform/Linux/bluez/BluezObjectList.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include "BluezObjectIterator.h" diff --git a/src/platform/Linux/bluez/BluezObjectManager.cpp b/src/platform/Linux/bluez/BluezObjectManager.cpp index 3a694dd64601d3..c11e15c07a27ef 100644 --- a/src/platform/Linux/bluez/BluezObjectManager.cpp +++ b/src/platform/Linux/bluez/BluezObjectManager.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include "Types.h" diff --git a/src/platform/Linux/bluez/ChipDeviceScanner.h b/src/platform/Linux/bluez/ChipDeviceScanner.h index 274af60d32d442..e0043e83172718 100644 --- a/src/platform/Linux/bluez/ChipDeviceScanner.h +++ b/src/platform/Linux/bluez/ChipDeviceScanner.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include "BluezObjectManager.h" diff --git a/src/platform/Linux/bluez/Types.h b/src/platform/Linux/bluez/Types.h index 4bd2c89d9a7966..3c1d60cdd4c234 100644 --- a/src/platform/Linux/bluez/Types.h +++ b/src/platform/Linux/bluez/Types.h @@ -50,7 +50,7 @@ #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#include +#include namespace chip { diff --git a/src/platform/Linux/dbus/bluez/BUILD.gn b/src/platform/Linux/dbus/bluez/BUILD.gn index 308feccb9b8b35..a90c3429a01619 100644 --- a/src/platform/Linux/dbus/bluez/BUILD.gn +++ b/src/platform/Linux/dbus/bluez/BUILD.gn @@ -17,7 +17,7 @@ import("//build_overrides/chip.gni") import("${chip_root}/build/chip/linux/gdbus_library.gni") gdbus_library("bluez") { - sources = [ "DbusBluez.xml" ] + sources = [ "DBusBluez.xml" ] c_namespace = "Bluez" interface_prefix = "org.bluez" diff --git a/src/platform/Linux/dbus/bluez/DbusBluez.xml b/src/platform/Linux/dbus/bluez/DBusBluez.xml similarity index 96% rename from src/platform/Linux/dbus/bluez/DbusBluez.xml rename to src/platform/Linux/dbus/bluez/DBusBluez.xml index 1e193ceafb8586..601a555365c9cb 100644 --- a/src/platform/Linux/dbus/bluez/DbusBluez.xml +++ b/src/platform/Linux/dbus/bluez/DBusBluez.xml @@ -1,4 +1,3 @@ - + @@ -158,9 +159,9 @@ diff --git a/src/platform/Linux/dbus/openthread/BUILD.gn b/src/platform/Linux/dbus/openthread/BUILD.gn index b18b534c2e1b6d..9aca9d806d7301 100644 --- a/src/platform/Linux/dbus/openthread/BUILD.gn +++ b/src/platform/Linux/dbus/openthread/BUILD.gn @@ -17,9 +17,10 @@ import("//build_overrides/chip.gni") import("${chip_root}/build/chip/linux/gdbus_library.gni") gdbus_library("openthread") { - sources = [ "introspect.xml" ] + sources = [ "DBusOpenthread.xml" ] c_namespace = "Openthread" + interface_prefix = "io.openthread" c_generate_object_manager = false dbus_out_dir = "platform/Linux/dbus/openthread" } diff --git a/src/platform/Linux/dbus/openthread/DBusOpenthread.xml b/src/platform/Linux/dbus/openthread/DBusOpenthread.xml new file mode 100644 index 00000000000000..3e48e5ca625d0e --- /dev/null +++ b/src/platform/Linux/dbus/openthread/DBusOpenthread.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/platform/Linux/dbus/openthread/introspect.xml b/src/platform/Linux/dbus/openthread/introspect.xml deleted file mode 100644 index a520c0afbfae5f..00000000000000 --- a/src/platform/Linux/dbus/openthread/introspect.xml +++ /dev/null @@ -1,476 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/platform/Linux/dbus/wpa/BUILD.gn b/src/platform/Linux/dbus/wpa/BUILD.gn index 5080622540339c..2cd77d02eb23a2 100644 --- a/src/platform/Linux/dbus/wpa/BUILD.gn +++ b/src/platform/Linux/dbus/wpa/BUILD.gn @@ -24,7 +24,8 @@ gdbus_library("wpa") { "DBusWpaNetwork.xml", ] - c_namespace = "Wpa" + c_namespace = "WpaSupplicant" + interface_prefix = "fi.w1.wpa_supplicant" c_generate_object_manager = false dbus_out_dir = "platform/Linux/dbus/wpa" } diff --git a/src/platform/Linux/dbus/wpa/DBusWpa.xml b/src/platform/Linux/dbus/wpa/DBusWpa.xml index f43d6916e76b10..395dc3f3542eb9 100644 --- a/src/platform/Linux/dbus/wpa/DBusWpa.xml +++ b/src/platform/Linux/dbus/wpa/DBusWpa.xml @@ -1,36 +1,42 @@ - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/platform/Linux/dbus/wpa/DBusWpaBss.xml b/src/platform/Linux/dbus/wpa/DBusWpaBss.xml index 8ec5c4aa749dcb..feabafdc42b14a 100644 --- a/src/platform/Linux/dbus/wpa/DBusWpaBss.xml +++ b/src/platform/Linux/dbus/wpa/DBusWpaBss.xml @@ -1,19 +1,25 @@ - - + + + + - - - - - - - - - - - - diff --git a/src/platform/Linux/dbus/wpa/DBusWpaInterface.xml b/src/platform/Linux/dbus/wpa/DBusWpaInterface.xml index 721ca0033cca09..1669c2ae0f0fd1 100644 --- a/src/platform/Linux/dbus/wpa/DBusWpaInterface.xml +++ b/src/platform/Linux/dbus/wpa/DBusWpaInterface.xml @@ -1,33 +1,57 @@ - - + + + + + + + - - - + + - - - + + + - - - - - + @@ -35,266 +59,47 @@ - - - - + - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - diff --git a/src/platform/Linux/dbus/wpa/DBusWpaNetwork.xml b/src/platform/Linux/dbus/wpa/DBusWpaNetwork.xml index 1b0ea70f4d0ca6..ec78e6fe229ce9 100644 --- a/src/platform/Linux/dbus/wpa/DBusWpaNetwork.xml +++ b/src/platform/Linux/dbus/wpa/DBusWpaNetwork.xml @@ -1,10 +1,25 @@ - - + + + + - - - diff --git a/src/platform/NuttX/ThreadStackManagerImpl.h b/src/platform/NuttX/ThreadStackManagerImpl.h index ce66d51c2201a2..b511da0f3b7af3 100644 --- a/src/platform/NuttX/ThreadStackManagerImpl.h +++ b/src/platform/NuttX/ThreadStackManagerImpl.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/platform/webos/ThreadStackManagerImpl.h b/src/platform/webos/ThreadStackManagerImpl.h index 64c3b8f6200bb8..5a70e882e595ee 100644 --- a/src/platform/webos/ThreadStackManagerImpl.h +++ b/src/platform/webos/ThreadStackManagerImpl.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include namespace chip { namespace DeviceLayer {