Line data Source code
1 : /*
2 : *
3 : * Copyright (c) 2020 Project CHIP Authors
4 : * Copyright (c) 2018 Nest Labs, Inc.
5 : *
6 : * Licensed under the Apache License, Version 2.0 (the "License");
7 : * you may not use this file except in compliance with the License.
8 : * You may obtain a copy of the License at
9 : *
10 : * http://www.apache.org/licenses/LICENSE-2.0
11 : *
12 : * Unless required by applicable law or agreed to in writing, software
13 : * distributed under the License is distributed on an "AS IS" BASIS,
14 : * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 : * See the License for the specific language governing permissions and
16 : * limitations under the License.
17 : */
18 :
19 : /**
20 : * @file
21 : * Defines the public interface for the Device Layer ConnectivityManager object.
22 : */
23 :
24 : #pragma once
25 : #include <memory>
26 :
27 : #include <app/icd/server/ICDServerConfig.h>
28 : #include <inet/UDPEndPoint.h>
29 : #include <lib/support/CodeUtils.h>
30 : #include <platform/CHIPDeviceConfig.h>
31 : #include <platform/CHIPDeviceEvent.h>
32 :
33 : #include <app/util/basic-types.h>
34 :
35 : #if INET_CONFIG_ENABLE_TCP_ENDPOINT
36 : #include <inet/TCPEndPoint.h>
37 : #endif
38 : #if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
39 : #include <transport/raw/WiFiPAF.h>
40 : #endif
41 :
42 : namespace chip {
43 :
44 : namespace Ble {
45 : class BleLayer;
46 : class BLEEndPoint;
47 : } // namespace Ble
48 :
49 : namespace DeviceLayer {
50 :
51 : namespace Internal {
52 : template <class>
53 : class GenericPlatformManagerImpl;
54 : template <class>
55 : class GenericPlatformManagerImpl_CMSISOS;
56 : template <class>
57 : class GenericPlatformManagerImpl_FreeRTOS;
58 : template <class>
59 : class GenericPlatformManagerImpl_POSIX;
60 : } // namespace Internal
61 :
62 : class ConnectivityManager;
63 : class ConnectivityManagerImpl;
64 :
65 : /**
66 : * Defines the delegate class of Connectivity Manager to notify connectivity updates.
67 : */
68 : class ConnectivityManagerDelegate
69 : {
70 : public:
71 : virtual ~ConnectivityManagerDelegate() {}
72 :
73 : /**
74 : * @brief
75 : * Called when any network interface on the Node is changed
76 : *
77 : */
78 : virtual void OnNetworkInfoChanged() {}
79 : };
80 :
81 : /**
82 : * Provides control of network connectivity for a chip device.
83 : */
84 : class ConnectivityManager
85 : {
86 : using ImplClass = ::chip::DeviceLayer::ConnectivityManagerImpl;
87 :
88 : public:
89 : // ===== Members that define the public interface of the ConnectivityManager
90 :
91 : enum WiFiStationMode
92 : {
93 : kWiFiStationMode_NotSupported = 0,
94 : kWiFiStationMode_ApplicationControlled = 1,
95 : kWiFiStationMode_Disabled = 2,
96 : kWiFiStationMode_Enabled = 3,
97 : };
98 :
99 : enum WiFiAPMode
100 : {
101 : kWiFiAPMode_NotSupported = 0,
102 : kWiFiAPMode_ApplicationControlled = 1,
103 : kWiFiAPMode_Disabled = 2,
104 : kWiFiAPMode_Enabled = 3,
105 : kWiFiAPMode_OnDemand = 4,
106 : kWiFiAPMode_OnDemand_NoStationProvision = 5,
107 : };
108 :
109 : enum WiFiStationState
110 : {
111 : kWiFiStationState_NotConnected,
112 : kWiFiStationState_Connecting,
113 : kWiFiStationState_Connecting_Succeeded,
114 : kWiFiStationState_Connecting_Failed,
115 : kWiFiStationState_Connected,
116 : kWiFiStationState_Disconnecting,
117 : };
118 :
119 : enum WiFiAPState
120 : {
121 : kWiFiAPState_NotActive,
122 : kWiFiAPState_Activating,
123 : kWiFiAPState_Active,
124 : kWiFiAPState_Deactivating,
125 : };
126 :
127 : enum CHIPoBLEServiceMode
128 : {
129 : kCHIPoBLEServiceMode_NotSupported = 0,
130 : kCHIPoBLEServiceMode_Enabled = 1,
131 : kCHIPoBLEServiceMode_Disabled = 2,
132 : };
133 :
134 : enum ThreadDeviceType
135 : {
136 : kThreadDeviceType_NotSupported = 0,
137 : kThreadDeviceType_Router = 1,
138 : kThreadDeviceType_FullEndDevice = 2,
139 : kThreadDeviceType_MinimalEndDevice = 3,
140 : kThreadDeviceType_SleepyEndDevice = 4,
141 : kThreadDeviceType_SynchronizedSleepyEndDevice = 5,
142 : };
143 :
144 : enum BLEAdvertisingMode
145 : {
146 : kFastAdvertising = 0,
147 : kSlowAdvertising = 1,
148 : kExtendedAdvertising = 2,
149 : };
150 :
151 : enum class SEDIntervalMode
152 : {
153 : Idle = 0,
154 : Active = 1,
155 : };
156 :
157 : struct SEDIntervalsConfig;
158 :
159 : void SetDelegate(ConnectivityManagerDelegate * delegate) { mDelegate = delegate; }
160 : ConnectivityManagerDelegate * GetDelegate() const { return mDelegate; }
161 :
162 : chip::Inet::EndPointManager<Inet::UDPEndPoint> & UDPEndPointManager();
163 :
164 : #if INET_CONFIG_ENABLE_TCP_ENDPOINT
165 : chip::Inet::EndPointManager<Inet::TCPEndPoint> & TCPEndPointManager();
166 : #endif
167 :
168 : // WiFi station methods
169 : WiFiStationMode GetWiFiStationMode();
170 : CHIP_ERROR SetWiFiStationMode(WiFiStationMode val);
171 : bool IsWiFiStationEnabled();
172 : bool IsWiFiStationApplicationControlled();
173 : bool IsWiFiStationConnected();
174 : System::Clock::Timeout GetWiFiStationReconnectInterval();
175 : CHIP_ERROR SetWiFiStationReconnectInterval(System::Clock::Timeout val);
176 : bool IsWiFiStationProvisioned();
177 : void ClearWiFiStationProvision();
178 : CHIP_ERROR GetAndLogWiFiStatsCounters();
179 : #if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
180 : struct WiFiPAFAdvertiseParam;
181 :
182 : CHIP_ERROR SetWiFiPAFAdvertisingEnabled(WiFiPAFAdvertiseParam & args);
183 : typedef void (*OnConnectionCompleteFunct)(void * appState);
184 : typedef void (*OnConnectionErrorFunct)(void * appState, CHIP_ERROR err);
185 : CHIP_ERROR WiFiPAFConnect(const SetupDiscriminator & connDiscriminator, void * appState, OnConnectionCompleteFunct onSuccess,
186 : OnConnectionErrorFunct onError);
187 : CHIP_ERROR WiFiPAFCancelConnect();
188 : CHIP_ERROR WiFiPAFSend(System::PacketBufferHandle && msgBuf);
189 : Transport::WiFiPAFBase * GetWiFiPAF();
190 : void SetWiFiPAF(Transport::WiFiPAFBase * pmWiFiPAF);
191 : #endif
192 :
193 : // WiFi AP methods
194 : WiFiAPMode GetWiFiAPMode();
195 : CHIP_ERROR SetWiFiAPMode(WiFiAPMode val);
196 : bool IsWiFiAPActive();
197 : bool IsWiFiAPApplicationControlled();
198 : void DemandStartWiFiAP();
199 : void StopOnDemandWiFiAP();
200 : void MaintainOnDemandWiFiAP();
201 : System::Clock::Timeout GetWiFiAPIdleTimeout();
202 : void SetWiFiAPIdleTimeout(System::Clock::Timeout val);
203 : CHIP_ERROR DisconnectNetwork();
204 :
205 : // Thread Methods
206 : bool IsThreadEnabled();
207 : ThreadDeviceType GetThreadDeviceType();
208 : CHIP_ERROR SetThreadDeviceType(ThreadDeviceType deviceType);
209 : bool IsThreadAttached();
210 : bool IsThreadProvisioned();
211 : void ErasePersistentInfo();
212 : void ResetThreadNetworkDiagnosticsCounts();
213 :
214 : CHIP_ERROR SetPollingInterval(System::Clock::Milliseconds32 pollingInterval);
215 :
216 : // CHIPoBLE service methods
217 : Ble::BleLayer * GetBleLayer();
218 : bool IsBLEAdvertisingEnabled();
219 : /**
220 : * Enable or disable BLE advertising.
221 : *
222 : * @return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if BLE advertising is not
223 : * supported or other error on other failures.
224 : */
225 : CHIP_ERROR SetBLEAdvertisingEnabled(bool val);
226 : bool IsBLEAdvertising();
227 : CHIP_ERROR SetBLEAdvertisingMode(BLEAdvertisingMode mode);
228 : CHIP_ERROR GetBLEDeviceName(char * buf, size_t bufSize);
229 : CHIP_ERROR SetBLEDeviceName(const char * deviceName);
230 : uint16_t NumBLEConnections();
231 :
232 : // User selected mode methods
233 : bool IsUserSelectedModeActive();
234 : void SetUserSelectedMode(bool val);
235 : uint16_t GetUserSelectedModeTimeout();
236 : void SetUserSelectedModeTimeout(uint16_t val);
237 :
238 : // Support methods
239 : static const char * WiFiStationModeToStr(WiFiStationMode mode);
240 : static const char * WiFiAPModeToStr(WiFiAPMode mode);
241 : static const char * WiFiStationStateToStr(WiFiStationState state);
242 : static const char * WiFiAPStateToStr(WiFiAPState state);
243 : static const char * CHIPoBLEServiceModeToStr(CHIPoBLEServiceMode mode);
244 :
245 : private:
246 : ConnectivityManagerDelegate * mDelegate = nullptr;
247 :
248 : // ===== Members for internal use by the following friends.
249 :
250 : friend class PlatformManagerImpl;
251 : template <class>
252 : friend class Internal::GenericPlatformManagerImpl;
253 : template <class>
254 : friend class Internal::GenericPlatformManagerImpl_CMSISOS;
255 : template <class>
256 : friend class Internal::GenericPlatformManagerImpl_FreeRTOS;
257 : template <class>
258 : friend class Internal::GenericPlatformManagerImpl_POSIX;
259 :
260 : CHIP_ERROR Init();
261 : void OnPlatformEvent(const ChipDeviceEvent * event);
262 : bool CanStartWiFiScan();
263 : void OnWiFiScanDone();
264 : void OnWiFiStationProvisionChange();
265 :
266 : protected:
267 : // Construction/destruction limited to subclasses.
268 : ConnectivityManager() = default;
269 : ~ConnectivityManager() = default;
270 :
271 : // No copy, move or assignment.
272 : ConnectivityManager(const ConnectivityManager &) = delete;
273 : ConnectivityManager(const ConnectivityManager &&) = delete;
274 : ConnectivityManager & operator=(const ConnectivityManager &) = delete;
275 : };
276 :
277 : /**
278 : * Information describing the desired intervals for a sleepy end device (SED).
279 : */
280 : struct ConnectivityManager::SEDIntervalsConfig
281 : {
282 : /** Interval at which the device is able to communicate with its parent when there are active chip exchanges in progress. Only
283 : * meaningful when the device is acting as a sleepy end node. */
284 : System::Clock::Milliseconds32 ActiveIntervalMS;
285 :
286 : /** Interval at which the device is able to communicate with its parent when there are NO active chip exchanges in progress.
287 : * Only meaningful when the device is acting as a sleepy end node. */
288 : System::Clock::Milliseconds32 IdleIntervalMS;
289 : };
290 :
291 : #if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
292 : struct ConnectivityManager::WiFiPAFAdvertiseParam
293 : {
294 : /* To enable/disable WiFiPAF Commissioning */
295 : bool enable;
296 : /* The optional commands */
297 : const char * ExtCmds;
298 : };
299 : #endif
300 :
301 : /**
302 : * Returns a reference to the public interface of the ConnectivityManager singleton object.
303 : *
304 : * chip applications should use this to access features of the ConnectivityManager object
305 : * that are common to all platforms.
306 : */
307 : extern ConnectivityManager & ConnectivityMgr();
308 :
309 : /**
310 : * Returns the platform-specific implementation of the ConnectivityManager singleton object.
311 : *
312 : * chip applications can use this to gain access to features of the ConnectivityManager
313 : * that are specific to the selected platform.
314 : */
315 : extern ConnectivityManagerImpl & ConnectivityMgrImpl();
316 :
317 : } // namespace DeviceLayer
318 : } // namespace chip
319 :
320 : /* Include a header file containing the implementation of the ConfigurationManager
321 : * object for the selected platform.
322 : */
323 : #ifdef EXTERNAL_CONNECTIVITYMANAGERIMPL_HEADER
324 : #include EXTERNAL_CONNECTIVITYMANAGERIMPL_HEADER
325 : #elif defined(CHIP_DEVICE_LAYER_TARGET)
326 : #define CONNECTIVITYMANAGERIMPL_HEADER <platform/CHIP_DEVICE_LAYER_TARGET/ConnectivityManagerImpl.h>
327 : #include CONNECTIVITYMANAGERIMPL_HEADER
328 : #endif // defined(CHIP_DEVICE_LAYER_TARGET)
329 :
330 : namespace chip {
331 : namespace DeviceLayer {
332 :
333 21 : inline chip::Inet::EndPointManager<Inet::UDPEndPoint> & ConnectivityManager::UDPEndPointManager()
334 : {
335 21 : return static_cast<ImplClass *>(this)->_UDPEndPointManager();
336 : }
337 :
338 : #if INET_CONFIG_ENABLE_TCP_ENDPOINT
339 3 : inline chip::Inet::EndPointManager<Inet::TCPEndPoint> & ConnectivityManager::TCPEndPointManager()
340 : {
341 3 : return static_cast<ImplClass *>(this)->_TCPEndPointManager();
342 : }
343 : #endif
344 :
345 : inline ConnectivityManager::WiFiStationMode ConnectivityManager::GetWiFiStationMode()
346 : {
347 : return static_cast<ImplClass *>(this)->_GetWiFiStationMode();
348 : }
349 :
350 : inline CHIP_ERROR ConnectivityManager::SetWiFiStationMode(WiFiStationMode val)
351 : {
352 : return static_cast<ImplClass *>(this)->_SetWiFiStationMode(val);
353 : }
354 :
355 : inline bool ConnectivityManager::IsWiFiStationEnabled()
356 : {
357 : return static_cast<ImplClass *>(this)->_IsWiFiStationEnabled();
358 : }
359 :
360 : inline bool ConnectivityManager::IsWiFiStationApplicationControlled()
361 : {
362 : return static_cast<ImplClass *>(this)->_IsWiFiStationApplicationControlled();
363 : }
364 :
365 : inline bool ConnectivityManager::IsWiFiStationConnected()
366 : {
367 : return static_cast<ImplClass *>(this)->_IsWiFiStationConnected();
368 : }
369 :
370 : inline System::Clock::Timeout ConnectivityManager::GetWiFiStationReconnectInterval()
371 : {
372 : return static_cast<ImplClass *>(this)->_GetWiFiStationReconnectInterval();
373 : }
374 :
375 : inline CHIP_ERROR ConnectivityManager::SetWiFiStationReconnectInterval(System::Clock::Timeout val)
376 : {
377 : return static_cast<ImplClass *>(this)->_SetWiFiStationReconnectInterval(val);
378 : }
379 :
380 : inline bool ConnectivityManager::IsWiFiStationProvisioned()
381 : {
382 : return static_cast<ImplClass *>(this)->_IsWiFiStationProvisioned();
383 : }
384 :
385 : inline void ConnectivityManager::ClearWiFiStationProvision()
386 : {
387 : static_cast<ImplClass *>(this)->_ClearWiFiStationProvision();
388 : }
389 :
390 : inline ConnectivityManager::WiFiAPMode ConnectivityManager::GetWiFiAPMode()
391 : {
392 : return static_cast<ImplClass *>(this)->_GetWiFiAPMode();
393 : }
394 :
395 : inline CHIP_ERROR ConnectivityManager::SetWiFiAPMode(WiFiAPMode val)
396 : {
397 : return static_cast<ImplClass *>(this)->_SetWiFiAPMode(val);
398 : }
399 :
400 : inline bool ConnectivityManager::IsWiFiAPActive()
401 : {
402 : return static_cast<ImplClass *>(this)->_IsWiFiAPActive();
403 : }
404 :
405 : inline bool ConnectivityManager::IsWiFiAPApplicationControlled()
406 : {
407 : return static_cast<ImplClass *>(this)->_IsWiFiAPApplicationControlled();
408 : }
409 :
410 : inline void ConnectivityManager::DemandStartWiFiAP()
411 : {
412 : static_cast<ImplClass *>(this)->_DemandStartWiFiAP();
413 : }
414 :
415 : inline void ConnectivityManager::StopOnDemandWiFiAP()
416 : {
417 : static_cast<ImplClass *>(this)->_StopOnDemandWiFiAP();
418 : }
419 :
420 : inline void ConnectivityManager::MaintainOnDemandWiFiAP()
421 : {
422 : static_cast<ImplClass *>(this)->_MaintainOnDemandWiFiAP();
423 : }
424 :
425 : inline System::Clock::Timeout ConnectivityManager::GetWiFiAPIdleTimeout()
426 : {
427 : return static_cast<ImplClass *>(this)->_GetWiFiAPIdleTimeout();
428 : }
429 :
430 : inline void ConnectivityManager::SetWiFiAPIdleTimeout(System::Clock::Timeout val)
431 : {
432 : static_cast<ImplClass *>(this)->_SetWiFiAPIdleTimeout(val);
433 : }
434 :
435 : inline CHIP_ERROR ConnectivityManager::GetAndLogWiFiStatsCounters()
436 : {
437 : return static_cast<ImplClass *>(this)->_GetAndLogWiFiStatsCounters();
438 : }
439 :
440 : #if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
441 : inline CHIP_ERROR ConnectivityManager::SetWiFiPAFAdvertisingEnabled(WiFiPAFAdvertiseParam & args)
442 : {
443 : return static_cast<ImplClass *>(this)->_SetWiFiPAFAdvertisingEnabled(args);
444 : }
445 :
446 : inline CHIP_ERROR ConnectivityManager::WiFiPAFConnect(const SetupDiscriminator & connDiscriminator, void * appState,
447 : OnConnectionCompleteFunct onSuccess, OnConnectionErrorFunct onError)
448 : {
449 : return static_cast<ImplClass *>(this)->_WiFiPAFConnect(connDiscriminator, appState, onSuccess, onError);
450 : }
451 :
452 : inline CHIP_ERROR ConnectivityManager::WiFiPAFCancelConnect()
453 : {
454 : return static_cast<ImplClass *>(this)->_WiFiPAFCancelConnect();
455 : }
456 :
457 : inline CHIP_ERROR ConnectivityManager::WiFiPAFSend(chip::System::PacketBufferHandle && msgBuf)
458 : {
459 : return static_cast<ImplClass *>(this)->_WiFiPAFSend(std::move(msgBuf));
460 : }
461 : #endif
462 :
463 : inline bool ConnectivityManager::IsThreadEnabled()
464 : {
465 : return static_cast<ImplClass *>(this)->_IsThreadEnabled();
466 : }
467 :
468 : inline ConnectivityManager::ThreadDeviceType ConnectivityManager::GetThreadDeviceType()
469 : {
470 : return static_cast<ImplClass *>(this)->_GetThreadDeviceType();
471 : }
472 :
473 : inline CHIP_ERROR ConnectivityManager::SetThreadDeviceType(ThreadDeviceType deviceType)
474 : {
475 : return static_cast<ImplClass *>(this)->_SetThreadDeviceType(deviceType);
476 : }
477 :
478 39 : inline CHIP_ERROR ConnectivityManager::SetPollingInterval(System::Clock::Milliseconds32 pollingInterval)
479 : {
480 : #if CHIP_CONFIG_ENABLE_ICD_SERVER
481 : return static_cast<ImplClass *>(this)->_SetPollingInterval(pollingInterval);
482 : #else
483 39 : return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
484 : #endif
485 : }
486 :
487 : inline bool ConnectivityManager::IsThreadAttached()
488 : {
489 : return static_cast<ImplClass *>(this)->_IsThreadAttached();
490 : }
491 :
492 : inline bool ConnectivityManager::IsThreadProvisioned()
493 : {
494 : return static_cast<ImplClass *>(this)->_IsThreadProvisioned();
495 : }
496 :
497 : inline void ConnectivityManager::ErasePersistentInfo()
498 : {
499 : static_cast<ImplClass *>(this)->_ErasePersistentInfo();
500 : }
501 :
502 : inline void ConnectivityManager::ResetThreadNetworkDiagnosticsCounts()
503 : {
504 : static_cast<ImplClass *>(this)->_ResetThreadNetworkDiagnosticsCounts();
505 : }
506 :
507 : #if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
508 : inline Transport::WiFiPAFBase * ConnectivityManager::GetWiFiPAF()
509 : {
510 : return static_cast<ImplClass *>(this)->_GetWiFiPAF();
511 : }
512 :
513 : inline void ConnectivityManager::SetWiFiPAF(Transport::WiFiPAFBase * pWiFiPAF)
514 : {
515 : return static_cast<ImplClass *>(this)->_SetWiFiPAF(pWiFiPAF);
516 : }
517 : #endif
518 :
519 2 : inline Ble::BleLayer * ConnectivityManager::GetBleLayer()
520 : {
521 2 : return static_cast<ImplClass *>(this)->_GetBleLayer();
522 : }
523 :
524 : inline bool ConnectivityManager::IsBLEAdvertisingEnabled()
525 : {
526 : return static_cast<ImplClass *>(this)->_IsBLEAdvertisingEnabled();
527 : }
528 :
529 2 : inline CHIP_ERROR ConnectivityManager::SetBLEAdvertisingEnabled(bool val)
530 : {
531 2 : return static_cast<ImplClass *>(this)->_SetBLEAdvertisingEnabled(val);
532 : }
533 :
534 : inline bool ConnectivityManager::IsBLEAdvertising()
535 : {
536 : return static_cast<ImplClass *>(this)->_IsBLEAdvertising();
537 : }
538 :
539 : inline CHIP_ERROR ConnectivityManager::SetBLEAdvertisingMode(BLEAdvertisingMode mode)
540 : {
541 : return static_cast<ImplClass *>(this)->_SetBLEAdvertisingMode(mode);
542 : }
543 :
544 : inline CHIP_ERROR ConnectivityManager::GetBLEDeviceName(char * buf, size_t bufSize)
545 : {
546 : return static_cast<ImplClass *>(this)->_GetBLEDeviceName(buf, bufSize);
547 : }
548 :
549 : inline CHIP_ERROR ConnectivityManager::SetBLEDeviceName(const char * deviceName)
550 : {
551 : return static_cast<ImplClass *>(this)->_SetBLEDeviceName(deviceName);
552 : }
553 :
554 : inline uint16_t ConnectivityManager::NumBLEConnections()
555 : {
556 : return static_cast<ImplClass *>(this)->_NumBLEConnections();
557 : }
558 :
559 : inline bool ConnectivityManager::IsUserSelectedModeActive()
560 : {
561 : return static_cast<ImplClass *>(this)->_IsUserSelectedModeActive();
562 : }
563 :
564 : inline void ConnectivityManager::SetUserSelectedMode(bool val)
565 : {
566 : static_cast<ImplClass *>(this)->_SetUserSelectedMode(val);
567 : }
568 :
569 : inline uint16_t ConnectivityManager::GetUserSelectedModeTimeout()
570 : {
571 : return static_cast<ImplClass *>(this)->_GetUserSelectedModeTimeout();
572 : }
573 :
574 : inline void ConnectivityManager::SetUserSelectedModeTimeout(uint16_t val)
575 : {
576 : static_cast<ImplClass *>(this)->_SetUserSelectedModeTimeout(val);
577 : }
578 :
579 : inline const char * ConnectivityManager::WiFiStationModeToStr(WiFiStationMode mode)
580 : {
581 : return ImplClass::_WiFiStationModeToStr(mode);
582 : }
583 :
584 : inline const char * ConnectivityManager::WiFiAPModeToStr(WiFiAPMode mode)
585 : {
586 : return ImplClass::_WiFiAPModeToStr(mode);
587 : }
588 :
589 : inline const char * ConnectivityManager::WiFiStationStateToStr(WiFiStationState state)
590 : {
591 : return ImplClass::_WiFiStationStateToStr(state);
592 : }
593 :
594 : inline const char * ConnectivityManager::WiFiAPStateToStr(WiFiAPState state)
595 : {
596 : return ImplClass::_WiFiAPStateToStr(state);
597 : }
598 :
599 : inline const char * ConnectivityManager::CHIPoBLEServiceModeToStr(CHIPoBLEServiceMode mode)
600 : {
601 : return ImplClass::_CHIPoBLEServiceModeToStr(mode);
602 : }
603 :
604 : inline CHIP_ERROR ConnectivityManager::Init()
605 : {
606 : return static_cast<ImplClass *>(this)->_Init();
607 : }
608 :
609 : inline void ConnectivityManager::OnPlatformEvent(const ChipDeviceEvent * event)
610 : {
611 : static_cast<ImplClass *>(this)->_OnPlatformEvent(event);
612 : }
613 :
614 : inline bool ConnectivityManager::CanStartWiFiScan()
615 : {
616 : return static_cast<ImplClass *>(this)->_CanStartWiFiScan();
617 : }
618 :
619 : inline void ConnectivityManager::OnWiFiScanDone()
620 : {
621 : static_cast<ImplClass *>(this)->_OnWiFiScanDone();
622 : }
623 :
624 : inline void ConnectivityManager::OnWiFiStationProvisionChange()
625 : {
626 : static_cast<ImplClass *>(this)->_OnWiFiStationProvisionChange();
627 : }
628 :
629 : inline CHIP_ERROR ConnectivityManager::DisconnectNetwork()
630 : {
631 : return static_cast<ImplClass *>(this)->_DisconnectNetwork();
632 : }
633 :
634 : } // namespace DeviceLayer
635 : } // namespace chip
|