1 /* 2 * Copyright (C) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef OHOS_WIFI_STATE_MACHINE_H 16 #define OHOS_WIFI_STATE_MACHINE_H 17 18 #include <regex.h> 19 #include <sys/types.h> 20 #include <fstream> 21 #include <vector> 22 23 #include "wifi_internal_msg.h" 24 #include "wifi_log.h" 25 #include "wifi_errcode.h" 26 #include "wifi_msg.h" 27 #include "state_machine.h" 28 #include "sta_network_check.h" 29 #include "i_dhcp_result_notify.h" 30 #include "sta_service_callback.h" 31 #include "i_dhcp_service.h" 32 #include "sta_define.h" 33 #ifndef OHOS_ARCH_LITE 34 #include "wifi_net_agent.h" 35 #endif 36 37 namespace OHOS { 38 namespace Wifi { 39 constexpr int STA_CONNECT_MODE = 1; 40 constexpr int STA_SCAN_ONLY_MODE = 2; 41 constexpr int STA_CAN_ONLY_WITH_WIFI_OFF_MODE = 3; 42 constexpr int STA_DISABLED_MODE = 4; 43 44 constexpr int CMD_NETWORK_CONNECT_TIMEOUT = 0X01; 45 constexpr int CMD_SIGNAL_POLL = 0X02; 46 constexpr int CMD_START_NETCHECK = 0X03; 47 48 constexpr int STA_NETWORK_CONNECTTING_DELAY = 20 * 1000; 49 constexpr int STA_SIGNAL_POLL_DELAY = 3 * 1000; 50 51 /* pincode length */ 52 constexpr int PIN_CODE_LEN = 8; 53 54 /* DHCP timeout interval */ 55 constexpr int DHCP_TIME = 15; 56 /* rssi thresholds */ 57 constexpr int INVALID_RSSI_VALUE = -127; 58 constexpr int MAX_RSSI_VALUE = 200; 59 constexpr int SIGNAL_INFO = 256; 60 61 /* 2.4g and 5g frequency thresholds */ 62 constexpr int FREQ_2G_MIN = 2412; 63 constexpr int FREQ_2G_MAX = 2472; 64 constexpr int FREQ_5G_MIN = 5170; 65 constexpr int FREQ_5G_MAX = 5825; 66 constexpr int CHANNEL_14_FREQ = 2484; 67 constexpr int CHANNEL_14 = 14; 68 constexpr int CENTER_FREQ_DIFF = 5; 69 constexpr int CHANNEL_2G_MIN = 1; 70 constexpr int CHANNEL_5G_MIN = 34; 71 72 constexpr int MULTI_AP = 0; 73 74 /* 75 * During the WPS PIN connection, the WPA_SUPPLICANT blocklist is cleared every 10 seconds 76 * until the network connection is successful. 77 */ 78 constexpr int BLOCK_LIST_CLEAR_TIMER = 20 * 1000; 79 80 /* Signal levels are classified into: 0 1 2 3 4 ,the max is 4. */ 81 constexpr int MAX_LEVEL = 4; 82 const std::string WPA_BSSID_ANY = "any"; 83 const std::string IF_NAME = "wlan0"; 84 85 class StaStateMachine : public StateMachine { 86 FRIEND_GTEST(StaStateMachine); 87 public: 88 StaStateMachine(); 89 ~StaStateMachine(); 90 using staSmHandleFunc = void (StaStateMachine::*)(InternalMessage *msg); 91 using StaSmHandleFuncMap = std::map<int, staSmHandleFunc>; 92 /** 93 * @Description Definition of member function of State base class in StaStateMachine. 94 * 95 */ 96 class RootState : public State { 97 public: 98 explicit RootState(); 99 ~RootState() override; 100 void GoInState() override; 101 void GoOutState() override; 102 bool ExecuteStateMsg(InternalMessage *msg) override; 103 }; 104 /** 105 * @Description : Definition of member function of InitState class in StaStateMachine. 106 * 107 */ 108 class InitState : public State { 109 public: 110 explicit InitState(StaStateMachine *staStateMachine); 111 ~InitState() override; 112 void GoInState() override; 113 void GoOutState() override; 114 bool ExecuteStateMsg(InternalMessage *msg) override; 115 116 private: 117 StaStateMachine *pStaStateMachine; 118 }; 119 /** 120 * @Description : Definition of member function of WpaStartingState class in StaStateMachine. 121 * 122 */ 123 class WpaStartingState : public State { 124 public: 125 explicit WpaStartingState(StaStateMachine *staStateMachine); 126 ~WpaStartingState() override; 127 void InitWpsSettings(); 128 void GoInState() override; 129 void GoOutState() override; 130 bool ExecuteStateMsg(InternalMessage *msg) override; 131 132 private: 133 StaStateMachine *pStaStateMachine; 134 }; 135 /** 136 * @Description Definition of member function of WpaStartedState class in StaStateMachine. 137 * 138 */ 139 class WpaStartedState : public State { 140 public: 141 explicit WpaStartedState(StaStateMachine *staStateMachine); 142 ~WpaStartedState() override; 143 void GoInState() override; 144 void GoOutState() override; 145 bool ExecuteStateMsg(InternalMessage *msg) override; 146 147 private: 148 StaStateMachine *pStaStateMachine; 149 }; 150 /** 151 * @Description Definition of member function of WpaStoppingState class in StaStateMachine. 152 * 153 */ 154 class WpaStoppingState : public State { 155 public: 156 explicit WpaStoppingState(StaStateMachine *staStateMachine); 157 ~WpaStoppingState() override; 158 void GoInState() override; 159 void GoOutState() override; 160 bool ExecuteStateMsg(InternalMessage *msg) override; 161 162 private: 163 StaStateMachine *pStaStateMachine; 164 }; 165 /** 166 * @Description Definition of member function of LinkState class in StaStateMachine. 167 * 168 */ 169 class LinkState : public State { 170 public: 171 explicit LinkState(StaStateMachine *staStateMachine); 172 ~LinkState() override; 173 void GoInState() override; 174 void GoOutState() override; 175 bool ExecuteStateMsg(InternalMessage *msg) override; 176 177 private: 178 StaStateMachine *pStaStateMachine; 179 }; 180 /** 181 * @Description Definition of member function of SeparatingState class in StaStateMachine. 182 * 183 */ 184 class SeparatingState : public State { 185 public: 186 explicit SeparatingState(); 187 ~SeparatingState() override; 188 void GoInState() override; 189 void GoOutState() override; 190 bool ExecuteStateMsg(InternalMessage *msg) override; 191 }; 192 /** 193 * @Description Definition of member function of SeparatedState class in StaStateMachine. 194 * 195 */ 196 class SeparatedState : public State { 197 public: 198 explicit SeparatedState(StaStateMachine *staStateMachine); 199 ~SeparatedState() override; 200 void GoInState() override; 201 void GoOutState() override; 202 bool ExecuteStateMsg(InternalMessage *msg) override; 203 204 private: 205 StaStateMachine *pStaStateMachine; 206 }; 207 /** 208 * @Description Definition of member function of ApLinkedState class in StaStateMachine. 209 * 210 */ 211 class ApLinkedState : public State { 212 public: 213 explicit ApLinkedState(StaStateMachine *staStateMachine); 214 ~ApLinkedState() override; 215 void GoInState() override; 216 void GoOutState() override; 217 bool ExecuteStateMsg(InternalMessage *msg) override; 218 219 private: 220 StaStateMachine *pStaStateMachine; 221 }; 222 /** 223 * @Description Definition of member function of WpsState class in StaStateMachine. 224 * 225 */ 226 class StaWpsState : public State { 227 public: 228 explicit StaWpsState(StaStateMachine *staStateMachine); 229 ~StaWpsState() override; 230 void GoInState() override; 231 void GoOutState() override; 232 bool ExecuteStateMsg(InternalMessage *msg) override; 233 234 private: 235 StaStateMachine *pStaStateMachine; 236 }; 237 /** 238 * @Description Definition of member function of GetIpState class in StaStateMachine. 239 * 240 */ 241 class GetIpState : public State { 242 public: 243 explicit GetIpState(StaStateMachine *staStateMachine); 244 ~GetIpState() override; 245 void GoInState() override; 246 void GoOutState() override; 247 bool ExecuteStateMsg(InternalMessage *msg) override; 248 249 private: 250 StaStateMachine *pStaStateMachine; 251 }; 252 /** 253 * @Description Definition of member function of LinkedState class in StaStateMachine. 254 * 255 */ 256 class LinkedState : public State { 257 public: 258 explicit LinkedState(StaStateMachine *staStateMachine); 259 ~LinkedState() override; 260 void GoInState() override; 261 void GoOutState() override; 262 bool ExecuteStateMsg(InternalMessage *msg) override; 263 264 private: 265 StaStateMachine *pStaStateMachine; 266 }; 267 /** 268 * @Description Definition of member function of ApRoamingState class in StaStateMachine. 269 * 270 */ 271 class ApRoamingState : public State { 272 public: 273 explicit ApRoamingState(StaStateMachine *staStateMachine); 274 ~ApRoamingState() override; 275 void GoInState() override; 276 void GoOutState() override; 277 bool ExecuteStateMsg(InternalMessage *msg) override; 278 279 private: 280 StaStateMachine *pStaStateMachine; 281 }; 282 283 class DhcpResultNotify : public IDhcpResultNotify { 284 public: 285 /** 286 * @Description : Construct a new dhcp result notify object 287 * 288 */ 289 explicit DhcpResultNotify(StaStateMachine *staStateMachine); 290 291 /** 292 * @Description : Destroy the dhcp result notify object 293 * 294 */ 295 ~DhcpResultNotify() override; 296 297 /** 298 * @Description : Get dhcp result of specified interface success notify asynchronously 299 * 300 * @param status - int 301 * @param ifname - interface name,eg:wlan0 302 * @param result - dhcp result 303 */ 304 void OnSuccess(int status, const std::string &ifname, DhcpResult &result) override; 305 306 /** 307 * @Description : Get dhcp result of specified interface failed notify asynchronously 308 * 309 * @param status - int 310 * @param ifname - interface name,eg:wlan0 311 * @param reason - failed reason 312 */ 313 void OnFailed(int status, const std::string &ifname, const std::string &reason) override; 314 315 /** 316 * @Description : Get the abnormal exit notify of dhcp server process. 317 * 318 * @param ifname - interface name,eg:wlan0 319 */ 320 void OnSerExitNotify(const std::string& ifname) override; 321 322 void TryToCloseDhcpClient(int iptype); 323 324 void TryToSaveIpV4Result(IpInfo &ipInfo, IpV6Info &ipv6Info, DhcpResult &result); 325 326 void TryToSaveIpV6Result(IpInfo &ipInfo, IpV6Info &ipv6Info, DhcpResult &result); 327 328 private: 329 StaStateMachine *pStaStateMachine; 330 }; 331 332 public: 333 /** 334 * @Description Initialize StaStateMachine 335 * 336 * @Return: WIFI_OPT_SUCCESS - success WIFI_OPT_FAILED - failed 337 */ 338 ErrCode InitStaStateMachine(); 339 /** 340 * @Description Start roaming connection. 341 * 342 * @param bssid - the mac address of network(in) 343 */ 344 void StartRoamToNetwork(std::string bssid); 345 /** 346 * @Description if it is roaming now. 347 */ 348 bool IsRoaming(void); 349 /** 350 * @Description Connecting events 351 * 352 * @param networkId - the networkId of network which is going to be connected(in) 353 * @param bssid - bssid - the mac address of wifi(in) 354 */ 355 void OnNetworkConnectionEvent(int networkId, std::string bssid); 356 /** 357 * @Description Bssid change events 358 * 359 * @param reason: the reason of bssid changed(in) 360 * @param bssid: the mac address of wifi(in) 361 */ 362 void OnBssidChangedEvent(std::string reason, std::string bssid); 363 /** 364 * @Description dhcp result notify events 365 * 366 * @param result: true-success, false-fail(in) 367 */ 368 void OnDhcpResultNotifyEvent(bool result); 369 /** 370 * @Description Register sta callback function 371 * 372 * @param callbacks - Callback function pointer storage structure 373 */ 374 void RegisterStaServiceCallback(const StaServiceCallback &callbacks); 375 376 /** 377 * @Description Convert the deviceConfig structure and set it to wpa_supplicant 378 * 379 * @param config -The Network info(in) 380 * @Return success: WIFI_OPT_SUCCESS fail: WIFI_OPT_FAILED 381 */ 382 ErrCode ConvertDeviceCfg(const WifiDeviceConfig &config) const; 383 384 /** 385 * @Description Get linked info. 386 * 387 * @param linkedInfo - linked info 388 * @return int - operation result 389 */ 390 int GetLinkedInfo(WifiLinkedInfo& linkedInfo); 391 392 /** 393 * @Description Reupdate net link info 394 */ 395 void ReUpdateNetLinkInfo(const WifiDeviceConfig &config); 396 397 /** 398 * @Description On netmanager restart. 399 */ 400 void OnNetManagerRestart(void); 401 private: 402 /** 403 * @Description Destruct state. 404 * 405 */ 406 template<typename T> ParsePointer(T * & pointer)407 inline void ParsePointer(T *&pointer) 408 { 409 if (pointer != nullptr) { 410 delete pointer; 411 pointer = nullptr; 412 } 413 } 414 /** 415 * @Description Build state tree 416 * 417 */ 418 void BuildStateTree(); 419 /** 420 * @Description Determine whether it is empty during initialization 421 * 422 */ 423 template<typename T> JudgmentEmpty(T * & pointer)424 inline ErrCode JudgmentEmpty(T *&pointer) 425 { 426 if (pointer == nullptr) { 427 return WIFI_OPT_FAILED; 428 } 429 return WIFI_OPT_SUCCESS; 430 } 431 /** 432 * @Description Initializing state of Sta. 433 * 434 */ 435 ErrCode InitStaStates(); 436 /** 437 * @Description The process of initializing connected wifi information. 438 * 439 */ 440 void InitWifiLinkedInfo(); 441 /** 442 * @Description The process of initializing the last connected wifi information. 443 * 444 */ 445 void InitLastWifiLinkedInfo(); 446 /** 447 * @Description Setting linkedInfo in case of when wpa connects 448 automatically there isn't any connection information. 449 * 450 * @param networkId - the nerworkId of network which is saved in the WifiLinkedInfo.(in) 451 */ 452 void SetWifiLinkedInfo(int networkId); 453 454 /** 455 * @Description Save the current connected state into WifiLinkedInfo. 456 * 457 * @param state - current connecting state(in) 458 * @param detailState - the current detail state of StaStateMachine.(in) 459 */ 460 void SaveLinkstate(ConnState state, DetailedState detailState); 461 462 /** 463 * @Description Save the disconnected reason. 464 * 465 * @param discReason - disconnected reason(in) 466 */ 467 void SaveDiscReason(DisconnectedReason discReason); 468 469 /** 470 * @Description Translate frequency to band(2.4G or 5G). 471 * 472 * @param freQuency -the frequency needed to be translted into band.(in) 473 */ 474 void GetBandFromFreQuencies(const int &freQuency); 475 476 /** 477 * @Description Processing after a success response is returned after Wi-Fi 478 is enabled successfully, such as setting the MAC address and 479 saving the connection information. 480 * 481 */ 482 void StartWifiProcess(); 483 /** 484 * @Description Synchronize the deviceConfig structure to wpa_supplicant 485 */ 486 void SyncDeviceConfigToWpa() const; 487 /** 488 * @Description Update wifi status and save connection information. 489 * 490 * @param networkId - the networkId of selected network which is going to be connected(in) 491 * @param bssid - the mac address of wifi(in) 492 */ 493 void ConnectToNetworkProcess(InternalMessage *msg); 494 495 /** 496 * @Description On connect fail. 497 * 498 * @param networkId - the networkId of network which is going to be connected.(in) 499 */ 500 void OnConnectFailed(int networkId); 501 502 /** 503 * @Description Start to connect to network. 504 * 505 * @param networkId - the networkId of network which is going to be connected.(in) 506 * @Return success: WIFI_OPT_SUCCESS fail: WIFI_OPT_FAILED 507 */ 508 ErrCode StartConnectToNetwork(int networkId); 509 /** 510 * @Description Disable network 511 * 512 * @param networkId - the networkId of network which is going to be disabled.(in) 513 */ 514 ErrCode DisableNetwork(int networkId); 515 /** 516 * @Description Disconnect network 517 * 518 */ 519 void DisConnectProcess(); 520 /** 521 * @Description Disable wifi process. 522 * 523 */ 524 void StopWifiProcess(); 525 /** 526 * @Description Setting statemachine status during the process of enable or disable wifi. 527 * 528 * @param mode - operating mode(in) 529 */ 530 void SetOperationalMode(int mode); 531 void SetSuspendMode(bool enabled); 532 void SetPowerSave(bool enabled); 533 /** 534 * @Description Configure static ipaddress. 535 * 536 * @param staticIpAddress- static ip address(in) 537 */ 538 bool ConfigStaticIpAddress(StaticIpAddress &staticIpAddress); 539 int PortalHttpDetection(); 540 /** 541 * @Description the process of handling network check results. 542 * 543 * @param netState - the state of connecting network(in) 544 */ 545 void HandleNetCheckResult(StaNetState netState, const std::string portalUrl); 546 /** 547 * @Description Remove all device configurations before enabling WPS. 548 * 549 */ 550 void RemoveAllDeviceConfigs(); 551 /** 552 * @Description Synchronize all networks saved in the configuration center to the WPA. 553 * 554 */ 555 void SyncAllDeviceConfigs(); 556 /** 557 * @Description Initialize the connection state processing message map 558 * 559 */ 560 int InitStaSMHandleMap(); 561 /** 562 * @Description : Deal SignalPoll Result. 563 * 564 * @param msg - Message body received by the state machine[in] 565 */ 566 void DealSignalPollResult(InternalMessage *msg); 567 /** 568 * @Description : Converting frequencies to channels. 569 * 570 */ 571 void ConvertFreqToChannel(); 572 /** 573 * @Description : send packet direction to hisysevent 574 * 575 */ 576 void DealSignalPacketChanged(int txPackets, int rxPackets); 577 /** 578 * @Description Connect to selected network. 579 * 580 * @param msg - Message body received by the state machine[in] 581 */ 582 void DealConnectToSelectedNetCmd(InternalMessage *msg); 583 /** 584 * @Description : Ready to connect to the network selected by user. 585 * 586 * @param msg - Message body received by the state machine[in] 587 */ 588 void DealConnectToUserSelectedNetwork(InternalMessage *msg); 589 /** 590 * @Description Operations after the disconnection Event is reported. 591 * 592 * @param msg - Message body received by the state machine[in] 593 */ 594 void DealDisconnectEvent(InternalMessage *msg); 595 /** 596 * @Description Operations after the Connection Event is reported. 597 * 598 * @param msg - Message body received by the state machine[in] 599 */ 600 void DealConnectionEvent(InternalMessage *msg); 601 /** 602 * @Description Operations after Disable specified network commands. 603 * 604 * @param msg - Message body received by the state machine[in] 605 */ 606 void DealConnectTimeOutCmd(InternalMessage *msg); 607 /** 608 * @Description Operations after Clear blocklist is reported. 609 * 610 * @param msg - Message body received by the state machine[in] 611 */ 612 void DealWpaBlockListClearEvent(InternalMessage *msg); 613 /** 614 * @Description Operations after StartWps commands. 615 * 616 * @param msg - Message body received by the state machine[in] 617 */ 618 void DealStartWpsCmd(InternalMessage *msg); 619 /** 620 * @Description Operations after the Wps Connect TimeOut Event is reported. 621 * 622 * @param msg - Message body received by the state machine[in] 623 */ 624 void DealWpsConnectTimeOutEvent(InternalMessage *msg); 625 /** 626 * @Description Cancel wps connection 627 * 628 * @param msg - Message body received by the state machine[in] 629 */ 630 void DealCancelWpsCmd(InternalMessage *msg); 631 /** 632 * @Description Reconnect network 633 * 634 * @param msg - Message body received by the state machine[in] 635 */ 636 void DealReConnectCmd(InternalMessage *msg); 637 /** 638 * @Description Operations after the Reassociate lead is issued 639 * 640 * @param msg - Message body received by the state machine[in] 641 */ 642 void DealReassociateCmd(InternalMessage *msg); 643 /** 644 * @Description Roaming connection. 645 * 646 * @param msg - Message body received by the state machine[in] 647 */ 648 void DealStartRoamCmd(InternalMessage *msg); 649 /** 650 * @Description Operation after the password error is reported 651 * 652 * @param msg - Message body received by the state machine[in] 653 */ 654 void DealWpaLinkFailEvent(InternalMessage *msg); 655 /** 656 * @Description try to connect the saved network for three times 657 *@Return true: try to reconnect fail: try max 658 */ 659 bool DealReconnectSavedNetwork(); 660 /** 661 * @Description set sta connect failed count 662 *@Return void 663 */ 664 void DealSetStaConnectFailedCount(int count, bool set); 665 /** 666 * @Description Wps mode is ON 667 * 668 * @param msg - Message body received by the state machine[in] 669 */ 670 void StartWpsMode(InternalMessage *msg); 671 /** 672 * @Description Reassociate network. 673 * 674 */ 675 void ReassociateProcess(); 676 677 /** 678 * @Description Set a random MAC address. 679 * 680 * @param networkId - network id[in] 681 */ 682 bool SetRandomMac(int networkId); 683 /** 684 * @Description Generate a random MAC address. 685 * 686 * @param strMac - Randomly generated MAC address[out] 687 */ 688 void MacAddressGenerate(WifiStoreRandomMac &randomMacInfo); 689 /** 690 * @Description Compare the encryption mode of the current network with that of the network in the scanning result. 691 * 692 * @param scanInfoKeymgmt - Network encryption mode in the scanning result[in] 693 * @param deviceKeymgmt - Encryption mode of the current network[in] 694 */ 695 bool ComparedKeymgmt(const std::string scanInfoKeymgmt, const std::string deviceKeymgmt); 696 /** 697 * @Description : Deal network check cmd. 698 * 699 * @param msg - Message body received by the state machine[in] 700 */ 701 void DealNetworkCheck(InternalMessage *msg); 702 #ifndef OHOS_ARCH_LITE 703 /** 704 * @Description Subscribe system ability changed. 705 */ 706 void SubscribeSystemAbilityChanged(void); 707 /** 708 * @Description Reupdate net supplier info 709 */ 710 void ReUpdateNetSupplierInfo(sptr<NetManagerStandard::NetSupplierInfo> supplierInfo); 711 712 /** 713 * @Description save wificonfig for update mode. 714 * 715 * @param networkId - current connected networkId; 716 */ 717 void SaveWifiConfigForUpdate(int networkId); 718 #endif // OHOS_ARCH_LITE 719 720 private: 721 StaSmHandleFuncMap staSmHandleFuncMap; 722 StaServiceCallback staCallback; 723 #ifndef OHOS_ARCH_LITE 724 sptr<NetManagerStandard::NetSupplierInfo> NetSupplierInfo; 725 #endif 726 727 int lastNetworkId; 728 int operationalMode; 729 int targetNetworkId; 730 int pinCode; 731 SetupMethod wpsState; 732 int lastSignalLevel; 733 std::string targetRoamBssid; 734 int currentTpType; 735 IsWpsConnected isWpsConnect; 736 int getIpSucNum; 737 int getIpFailNum; 738 bool isRoam; 739 WifiLinkedInfo linkedInfo; 740 WifiLinkedInfo lastLinkedInfo; 741 std::unique_ptr<IDhcpService> pDhcpService; 742 DhcpResultNotify *pDhcpResultNotify; 743 StaNetworkCheck *pNetcheck; 744 745 RootState *pRootState; 746 InitState *pInitState; 747 WpaStartingState *pWpaStartingState; /* Starting wpa_supplicant state. */ 748 WpaStartedState *pWpaStartedState; /* Started wpa_supplicant state. */ 749 WpaStoppingState *pWpaStoppingState; /* Stopping wpa_supplicant state. */ 750 LinkState *pLinkState; 751 SeparatingState *pSeparatingState; 752 SeparatedState *pSeparatedState; 753 ApLinkedState *pApLinkedState; 754 StaWpsState *pWpsState; 755 GetIpState *pGetIpState; 756 LinkedState *pLinkedState; 757 ApRoamingState *pApRoamingState; 758 }; 759 } // namespace Wifi 760 } // namespace OHOS 761 #endif 762