2 * Copyright (C) 2016 CSI Project. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __CSI_WIFI_WPS_H__
18 #define __CSI_WIFI_WPS_H__
24 /** \defgroup WiFi_APIs WiFi Related APIs
28 /** @addtogroup WiFi_APIs
32 /** \defgroup WPS_APIs WPS APIs
35 * WPS can only be used when station is enabled.
39 /** @addtogroup WPS_APIs
43 #define CSI_ERR_WIFI_REGISTRAR (CSI_DRV_ERRNO_WIFI_BASE + 51) /*!< WPS registrar is not supported */
44 #define CSI_ERR_WIFI_WPS_TYPE (CSI_DRV_ERRNO_WIFI_BASE + 52) /*!< WPS type error */
45 #define CSI_ERR_WIFI_WPS_SM (CSI_DRV_ERRNO_WIFI_BASE + 53) /*!< WPS state machine is not initialized */
47 typedef enum wps_type {
55 * @brief Enable Wi-Fi WPS function.
57 * @attention WPS can only be used when station is enabled.
59 * @param wps_type : WPS type, so far only WPS_TYPE_PBC and WPS_TYPE_PIN is supported
63 * - CSI_ERR_WIFI_WPS_TYPE : wps type is invalid
64 * - CSI_ERR_WIFI_WPS_MODE : wifi is not in station mode or sniffer mode is on
65 * - CSI_ERR_WIFI_FAIL : wps initialization fails
67 int32_t csi_wifi_wps_enable(wps_type_t wps_type);
70 * @brief Disable Wi-Fi WPS function and release resource it taken.
74 * - CSI_ERR_WIFI_WPS_MODE : wifi is not in station mode or sniffer mode is on
76 int32_t csi_wifi_wps_disable(void);
79 * @brief WPS starts to work.
81 * @attention WPS can only be used when station is enabled.
83 * @param timeout_ms : maximum blocking time before API return.
85 * - 1~120000 : blocking time
89 * - CSI_ERR_WIFI_WPS_TYPE : wps type is invalid
90 * - CSI_ERR_WIFI_WPS_MODE : wifi is not in station mode or sniffer mode is on
91 * - CSI_ERR_WIFI_WPS_SM : wps state machine is not initialized
92 * - CSI_ERR_WIFI_FAIL : wps initialization fails
94 int32_t csi_wifi_wps_start(int timeout_ms);
100 #endif /* __CSI_WIFI_H__ */