Skip to content

Commit 2feb25f

Browse files
Fix Zephyr WiFIManager build (#33707)
* Fix Zephyr WiFIManager build * Restyled by clang-format --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 923854b commit 2feb25f

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/platform/Zephyr/wifi/WiFiManager.cpp

+22-22
Original file line numberDiff line numberDiff line change
@@ -159,33 +159,33 @@ void WiFiManager::WifiMgmtEventHandler(net_mgmt_event_callback * cb, uint32_t mg
159159
CHIP_ERROR WiFiManager::Init()
160160
{
161161
// TODO: consider moving these to ConnectivityManagerImpl to be prepared for handling multiple interfaces on a single device.
162-
Inet::UDPEndPointImplSockets::SetMulticastGroupHandler(
163-
[](Inet::InterfaceId interfaceId, const Inet::IPAddress & address, UDPEndPointImplSockets::MulticastOperation operation) {
164-
const in6_addr addr = InetUtils::ToZephyrAddr(address);
165-
net_if * iface = InetUtils::GetInterface(interfaceId);
166-
VerifyOrReturnError(iface != nullptr, INET_ERROR_UNKNOWN_INTERFACE);
162+
Inet::UDPEndPointImplSockets::SetMulticastGroupHandler([](Inet::InterfaceId interfaceId, const Inet::IPAddress & address,
163+
Inet::UDPEndPointImplSockets::MulticastOperation operation) {
164+
const in6_addr addr = InetUtils::ToZephyrAddr(address);
165+
net_if * iface = InetUtils::GetInterface(interfaceId);
166+
VerifyOrReturnError(iface != nullptr, INET_ERROR_UNKNOWN_INTERFACE);
167167

168-
if (operation == UDPEndPointImplSockets::MulticastOperation::kJoin)
169-
{
170-
net_if_mcast_addr * maddr = net_if_ipv6_maddr_add(iface, &addr);
168+
if (operation == Inet::UDPEndPointImplSockets::MulticastOperation::kJoin)
169+
{
170+
net_if_mcast_addr * maddr = net_if_ipv6_maddr_add(iface, &addr);
171171

172-
if (maddr && !net_if_ipv6_maddr_is_joined(maddr) && !net_ipv6_is_addr_mcast_link_all_nodes(&addr))
173-
{
174-
net_if_ipv6_maddr_join(iface, maddr);
175-
}
176-
}
177-
else if (operation == UDPEndPointImplSockets::MulticastOperation::kLeave)
178-
{
179-
VerifyOrReturnError(net_ipv6_is_addr_mcast_link_all_nodes(&addr) || net_if_ipv6_maddr_rm(iface, &addr),
180-
CHIP_ERROR_INVALID_ADDRESS);
181-
}
182-
else
172+
if (maddr && !net_if_ipv6_maddr_is_joined(maddr) && !net_ipv6_is_addr_mcast_link_all_nodes(&addr))
183173
{
184-
return CHIP_ERROR_INCORRECT_STATE;
174+
net_if_ipv6_maddr_join(iface, maddr);
185175
}
176+
}
177+
else if (operation == Inet::UDPEndPointImplSockets::MulticastOperation::kLeave)
178+
{
179+
VerifyOrReturnError(net_ipv6_is_addr_mcast_link_all_nodes(&addr) || net_if_ipv6_maddr_rm(iface, &addr),
180+
CHIP_ERROR_INVALID_ADDRESS);
181+
}
182+
else
183+
{
184+
return CHIP_ERROR_INCORRECT_STATE;
185+
}
186186

187-
return CHIP_NO_ERROR;
188-
});
187+
return CHIP_NO_ERROR;
188+
});
189189

190190
net_mgmt_init_event_callback(&mWiFiMgmtClbk, WifiMgmtEventHandler, kWifiManagementEvents);
191191
net_mgmt_add_event_callback(&mWiFiMgmtClbk);

0 commit comments

Comments
 (0)