17777dab0Sopenharmony_ci/* 27777dab0Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 37777dab0Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 47777dab0Sopenharmony_ci * you may not use this file except in compliance with the License. 57777dab0Sopenharmony_ci * You may obtain a copy of the License at 67777dab0Sopenharmony_ci * 77777dab0Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 87777dab0Sopenharmony_ci * 97777dab0Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 107777dab0Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 117777dab0Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 127777dab0Sopenharmony_ci * See the License for the specific language governing permissions and 137777dab0Sopenharmony_ci * limitations under the License. 147777dab0Sopenharmony_ci */ 157777dab0Sopenharmony_ci 167777dab0Sopenharmony_ci/** 177777dab0Sopenharmony_ci * @addtogroup Wifi 187777dab0Sopenharmony_ci * @{ 197777dab0Sopenharmony_ci * 207777dab0Sopenharmony_ci * @brief Provide functions for querying the status of wifi switch. 217777dab0Sopenharmony_ci * @since 13 227777dab0Sopenharmony_ci */ 237777dab0Sopenharmony_ci/** 247777dab0Sopenharmony_ci * @file oh_wifi.h 257777dab0Sopenharmony_ci * @kit ConnectivityKit 267777dab0Sopenharmony_ci * @brief Define interfaces for querying wifi switch status. 277777dab0Sopenharmony_ci * @library libwifi.so 287777dab0Sopenharmony_ci * @syscap SystemCapability.Communication.WiFi.STA 297777dab0Sopenharmony_ci * @since 13 307777dab0Sopenharmony_ci */ 317777dab0Sopenharmony_ci 327777dab0Sopenharmony_ci#ifndef OH_WIFI_H 337777dab0Sopenharmony_ci#define OH_WIFI_H 347777dab0Sopenharmony_ci 357777dab0Sopenharmony_ci#ifdef __cplusplus 367777dab0Sopenharmony_ciextern "C" { 377777dab0Sopenharmony_ci#endif 387777dab0Sopenharmony_ci 397777dab0Sopenharmony_ci/** 407777dab0Sopenharmony_ci * @brief Enumerates the wifi result codes. 417777dab0Sopenharmony_ci * 427777dab0Sopenharmony_ci * @since 13 437777dab0Sopenharmony_ci */ 447777dab0Sopenharmony_citypedef enum Wifi_ResultCode { 457777dab0Sopenharmony_ci /** 467777dab0Sopenharmony_ci * @error The operation is successful. 477777dab0Sopenharmony_ci */ 487777dab0Sopenharmony_ci WIFI_SUCCESS = 0, 497777dab0Sopenharmony_ci /** 507777dab0Sopenharmony_ci * @error Permission verification failed. The application does not have the 517777dab0Sopenharmony_ci * permission required to call the API. 527777dab0Sopenharmony_ci */ 537777dab0Sopenharmony_ci WIFI_PERMISSION_DENIED = 201, 547777dab0Sopenharmony_ci /** 557777dab0Sopenharmony_ci * @error Parameter error. Possible reasons: 1. The input parameter is a null pointer;\n 567777dab0Sopenharmony_ci * 2. Parameter values exceed the defined range.\n 577777dab0Sopenharmony_ci */ 587777dab0Sopenharmony_ci WIFI_INVALID_PARAM = 401, 597777dab0Sopenharmony_ci /** 607777dab0Sopenharmony_ci * @error Capability not supported. Failed to call function due to limited device capabilities. 617777dab0Sopenharmony_ci */ 627777dab0Sopenharmony_ci WIFI_NOT_SUPPORTED = 801, 637777dab0Sopenharmony_ci /** 647777dab0Sopenharmony_ci * @error Operation failed. 657777dab0Sopenharmony_ci * Possible reasons: Internal execution failed. 667777dab0Sopenharmony_ci */ 677777dab0Sopenharmony_ci WIFI_OPERATION_FAILED = 2501000 687777dab0Sopenharmony_ci} Wifi_ResultCode; 697777dab0Sopenharmony_ci 707777dab0Sopenharmony_ci/** 717777dab0Sopenharmony_ci * @brief Check whether the wifi switch is enabled. 727777dab0Sopenharmony_ci * 737777dab0Sopenharmony_ci * @param enabled - It is a boolean pointer used to receive wifi switch status values.\n 747777dab0Sopenharmony_ci * Equal to true indicates that the wifi switch is turned on, false indicates that\n 757777dab0Sopenharmony_ci * the wifi switch is turned off.\n 767777dab0Sopenharmony_ci * The caller needs to pass in a non empty boolean pointer, otherwise an error will be returned.\n 777777dab0Sopenharmony_ci * @return wifi functions result code.\n 787777dab0Sopenharmony_ci * For a detailed definition, please refer to {@link Wifi_ResultCode}.\n 797777dab0Sopenharmony_ci * {@link WIFI_SUCCESS} Successfully obtained the wifi switch status.\n 807777dab0Sopenharmony_ci * {@link WIFI_INVALID_PARAM} The input parameter enabled is a null pointer.\n 817777dab0Sopenharmony_ci * {@link WIFI_OPERATION_FAILED} Internal execution failed.\n 827777dab0Sopenharmony_ci * @since 13 837777dab0Sopenharmony_ci */ 847777dab0Sopenharmony_ciWifi_ResultCode OH_Wifi_IsWifiEnabled(bool *enabled); 857777dab0Sopenharmony_ci 867777dab0Sopenharmony_ci#ifdef __cplusplus 877777dab0Sopenharmony_ci} 887777dab0Sopenharmony_ci#endif 897777dab0Sopenharmony_ci/** @} */ 907777dab0Sopenharmony_ci#endif // OH_WIFI_H