@@ -159,33 +159,33 @@ void WiFiManager::WifiMgmtEventHandler(net_mgmt_event_callback * cb, uint32_t mg
159
159
CHIP_ERROR WiFiManager::Init ()
160
160
{
161
161
// 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);
167
167
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);
171
171
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))
183
173
{
184
- return CHIP_ERROR_INCORRECT_STATE ;
174
+ net_if_ipv6_maddr_join (iface, maddr) ;
185
175
}
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
+ }
186
186
187
- return CHIP_NO_ERROR;
188
- });
187
+ return CHIP_NO_ERROR;
188
+ });
189
189
190
190
net_mgmt_init_event_callback (&mWiFiMgmtClbk , WifiMgmtEventHandler, kWifiManagementEvents );
191
191
net_mgmt_add_event_callback (&mWiFiMgmtClbk );
0 commit comments