Extending the X_NUCLEO_IDW01M1 to allow configuration of the board as an access point
Dependents: X_NUCLEO_IDW01M1_AP_Test
Fork of X_NUCLEO_IDW01M1 by
Spwf/inc/wifi_interface.h@8:0f302a13e21b, 2016-05-12 (annotated)
- Committer:
- mridup
- Date:
- Thu May 12 07:36:13 2016 +0000
- Revision:
- 8:0f302a13e21b
- Parent:
- 1:bd9db471d47d
- Child:
- 18:b265b3b696f1
support 2048B sock write, sock_write returns no. of bytes written, delay of 10ms in sock-recv.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mridup | 0:dc55f40eb04f | 1 | /** |
mridup | 0:dc55f40eb04f | 2 | ****************************************************************************** |
mridup | 0:dc55f40eb04f | 3 | * @file wifi_interface.h |
mridup | 0:dc55f40eb04f | 4 | * @author Central LAB |
mridup | 0:dc55f40eb04f | 5 | * @version V2.0.0 |
mridup | 0:dc55f40eb04f | 6 | * @date 10-February-2016 |
mridup | 0:dc55f40eb04f | 7 | * @brief Header file for X-CUBE-WIFI1 API |
mridup | 0:dc55f40eb04f | 8 | ****************************************************************************** |
mridup | 0:dc55f40eb04f | 9 | * @attention |
mridup | 0:dc55f40eb04f | 10 | * |
mridup | 0:dc55f40eb04f | 11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
mridup | 0:dc55f40eb04f | 12 | * |
mridup | 0:dc55f40eb04f | 13 | * Redistribution and use in source and binary forms, with or without modification, |
mridup | 0:dc55f40eb04f | 14 | * are permitted provided that the following conditions are met: |
mridup | 0:dc55f40eb04f | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
mridup | 0:dc55f40eb04f | 16 | * this list of conditions and the following disclaimer. |
mridup | 0:dc55f40eb04f | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mridup | 0:dc55f40eb04f | 18 | * this list of conditions and the following disclaimer in the documentation |
mridup | 0:dc55f40eb04f | 19 | * and/or other materials provided with the distribution. |
mridup | 0:dc55f40eb04f | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mridup | 0:dc55f40eb04f | 21 | * may be used to endorse or promote products derived from this software |
mridup | 0:dc55f40eb04f | 22 | * without specific prior written permission. |
mridup | 0:dc55f40eb04f | 23 | * |
mridup | 0:dc55f40eb04f | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mridup | 0:dc55f40eb04f | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mridup | 0:dc55f40eb04f | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mridup | 0:dc55f40eb04f | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mridup | 0:dc55f40eb04f | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mridup | 0:dc55f40eb04f | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mridup | 0:dc55f40eb04f | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mridup | 0:dc55f40eb04f | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mridup | 0:dc55f40eb04f | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mridup | 0:dc55f40eb04f | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mridup | 0:dc55f40eb04f | 34 | * |
mridup | 0:dc55f40eb04f | 35 | ****************************************************************************** |
mridup | 0:dc55f40eb04f | 36 | */ |
mridup | 0:dc55f40eb04f | 37 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mridup | 0:dc55f40eb04f | 38 | #ifndef __WIFI_INTERFACE_H |
mridup | 0:dc55f40eb04f | 39 | #define __WIFI_INTERFACE_H |
mridup | 0:dc55f40eb04f | 40 | |
mridup | 0:dc55f40eb04f | 41 | #ifdef __cplusplus |
mridup | 0:dc55f40eb04f | 42 | extern "C" { |
mridup | 0:dc55f40eb04f | 43 | #endif |
mridup | 0:dc55f40eb04f | 44 | |
mridup | 0:dc55f40eb04f | 45 | /* Includes ------------------------------------------------------------------*/ |
mridup | 0:dc55f40eb04f | 46 | #include<stdint.h> |
mridup | 0:dc55f40eb04f | 47 | |
mridup | 0:dc55f40eb04f | 48 | /** @addtogroup MIDDLEWARES |
mridup | 0:dc55f40eb04f | 49 | * @{ |
mridup | 0:dc55f40eb04f | 50 | */ |
mridup | 0:dc55f40eb04f | 51 | |
mridup | 0:dc55f40eb04f | 52 | |
mridup | 0:dc55f40eb04f | 53 | /** @addtogroup NUCLEO_WIFI_API |
mridup | 0:dc55f40eb04f | 54 | * @brief Wi-Fi_interface API |
mridup | 0:dc55f40eb04f | 55 | * @{ |
mridup | 0:dc55f40eb04f | 56 | */ |
mridup | 0:dc55f40eb04f | 57 | |
mridup | 0:dc55f40eb04f | 58 | |
mridup | 0:dc55f40eb04f | 59 | /** @addtogroup NUCLEO_WIFI_API_Private_Macros |
mridup | 0:dc55f40eb04f | 60 | * @{ |
mridup | 0:dc55f40eb04f | 61 | */ |
mridup | 0:dc55f40eb04f | 62 | |
mridup | 0:dc55f40eb04f | 63 | |
mridup | 0:dc55f40eb04f | 64 | /** |
mridup | 0:dc55f40eb04f | 65 | * @} |
mridup | 0:dc55f40eb04f | 66 | */ |
mridup | 0:dc55f40eb04f | 67 | |
mridup | 0:dc55f40eb04f | 68 | |
mridup | 0:dc55f40eb04f | 69 | /** @addtogroup NUCLEO_WIFI_API_Private_Variables |
mridup | 0:dc55f40eb04f | 70 | * @{ |
mridup | 0:dc55f40eb04f | 71 | */ |
mridup | 0:dc55f40eb04f | 72 | /* Private variables ---------------------------------------------------------*/ |
mridup | 0:dc55f40eb04f | 73 | |
mridup | 0:dc55f40eb04f | 74 | |
mridup | 0:dc55f40eb04f | 75 | /* Exported macro ------------------------------------------------------------*/ |
mridup | 0:dc55f40eb04f | 76 | #define _ARG6(_0, _1, _2, _3, _4, _5, _6, ...) _6 |
mridup | 0:dc55f40eb04f | 77 | #define NARG6(...) _ARG6(__VA_ARGS__, 6, 5, 4, 3, 2, 1, 0) |
mridup | 0:dc55f40eb04f | 78 | #define _FIVE_OR_SIX_ARGS_5(NAME, a, b, c, d, e) a, b, c, d, e, 1453727657 |
mridup | 0:dc55f40eb04f | 79 | #define _FIVE_OR_SIX_ARGS_6(NAME, a, b, c, d, e, f) a, b, c, d, e, f |
mridup | 0:dc55f40eb04f | 80 | #define __FIVE_OR_SIX_ARGS(NAME, N, ...) _FIVE_OR_SIX_ARGS_ ## N (NAME, __VA_ARGS__) |
mridup | 0:dc55f40eb04f | 81 | #define _FIVE_OR_SIX_ARGS(NAME, N, ...) __FIVE_OR_SIX_ARGS(NAME, N, __VA_ARGS__) |
mridup | 0:dc55f40eb04f | 82 | #define FIVE_OR_SIX_ARGS(NAME, ...) NAME(_FIVE_OR_SIX_ARGS(NAME, NARG6(__VA_ARGS__), __VA_ARGS__)) |
mridup | 0:dc55f40eb04f | 83 | |
mridup | 0:dc55f40eb04f | 84 | #define wifi_socket_client_security(...) FIVE_OR_SIX_ARGS(wifi_socket_client_security, __VA_ARGS__) |
mridup | 0:dc55f40eb04f | 85 | |
mridup | 0:dc55f40eb04f | 86 | /* Exported constants --------------------------------------------------------*/ |
mridup | 0:dc55f40eb04f | 87 | #define GPIO_IN "in" |
mridup | 0:dc55f40eb04f | 88 | #define GPIO_OUT "out" |
mridup | 0:dc55f40eb04f | 89 | |
mridup | 0:dc55f40eb04f | 90 | #define GPIO_Off '0' |
mridup | 0:dc55f40eb04f | 91 | #define GPIO_Rising 'R' |
mridup | 0:dc55f40eb04f | 92 | #define GPIO_Falling 'F' |
mridup | 0:dc55f40eb04f | 93 | #define GPIO_Both 'B' |
mridup | 0:dc55f40eb04f | 94 | |
mridup | 0:dc55f40eb04f | 95 | typedef enum GpioWriteValue |
mridup | 0:dc55f40eb04f | 96 | { |
mridup | 0:dc55f40eb04f | 97 | GPIO_OFF = 0, |
mridup | 0:dc55f40eb04f | 98 | GPIO_ON, |
mridup | 0:dc55f40eb04f | 99 | } GpioWriteValue; |
mridup | 0:dc55f40eb04f | 100 | |
mridup | 0:dc55f40eb04f | 101 | typedef enum GpioPin |
mridup | 0:dc55f40eb04f | 102 | { |
mridup | 0:dc55f40eb04f | 103 | GPIO_PIN0 = 0, |
mridup | 0:dc55f40eb04f | 104 | GPIO_PIN1, |
mridup | 0:dc55f40eb04f | 105 | GPIO_PIN2, |
mridup | 0:dc55f40eb04f | 106 | GPIO_PIN3, |
mridup | 0:dc55f40eb04f | 107 | GPIO_PIN4, |
mridup | 0:dc55f40eb04f | 108 | GPIO_PIN5, |
mridup | 0:dc55f40eb04f | 109 | GPIO_PIN6, |
mridup | 0:dc55f40eb04f | 110 | GPIO_PIN7, |
mridup | 0:dc55f40eb04f | 111 | GPIO_PIN8, |
mridup | 0:dc55f40eb04f | 112 | GPIO_PIN9, |
mridup | 0:dc55f40eb04f | 113 | GPIO_PIN10, |
mridup | 0:dc55f40eb04f | 114 | GPIO_PIN11, |
mridup | 0:dc55f40eb04f | 115 | GPIO_PIN12, |
mridup | 0:dc55f40eb04f | 116 | GPIO_PIN13, |
mridup | 0:dc55f40eb04f | 117 | GPIO_PIN14, |
mridup | 0:dc55f40eb04f | 118 | GPIO_PIN15 |
mridup | 0:dc55f40eb04f | 119 | } GpioPin; |
mridup | 0:dc55f40eb04f | 120 | |
mridup | 0:dc55f40eb04f | 121 | typedef enum wifi_bool |
mridup | 0:dc55f40eb04f | 122 | { |
mridup | 0:dc55f40eb04f | 123 | WIFI_FALSE = 0, |
mridup | 0:dc55f40eb04f | 124 | WIFI_TRUE = 1, |
mridup | 0:dc55f40eb04f | 125 | Undefine = 0xFF |
mridup | 0:dc55f40eb04f | 126 | } wifi_bool; |
mridup | 0:dc55f40eb04f | 127 | |
mridup | 0:dc55f40eb04f | 128 | typedef enum WiFi_Priv_Mode |
mridup | 0:dc55f40eb04f | 129 | { |
mridup | 0:dc55f40eb04f | 130 | None = 0, |
mridup | 0:dc55f40eb04f | 131 | WEP = 1, |
mridup | 0:dc55f40eb04f | 132 | WPA_Personal = 2, |
mridup | 0:dc55f40eb04f | 133 | } WiFi_Priv_Mode; |
mridup | 0:dc55f40eb04f | 134 | |
mridup | 0:dc55f40eb04f | 135 | /********** Wi-Fi Error *************/ |
mridup | 0:dc55f40eb04f | 136 | typedef enum WiFi_Status_t |
mridup | 0:dc55f40eb04f | 137 | { |
mridup | 0:dc55f40eb04f | 138 | WiFi_MODULE_SUCCESS = 0, |
mridup | 0:dc55f40eb04f | 139 | WiFi_TIME_OUT_ERROR = 1, |
mridup | 0:dc55f40eb04f | 140 | WiFi_MODULE_ERROR, |
mridup | 0:dc55f40eb04f | 141 | WiFi_HAL_OK, |
mridup | 0:dc55f40eb04f | 142 | WiFi_NOT_SUPPORTED, |
mridup | 0:dc55f40eb04f | 143 | WiFi_NOT_READY, |
mridup | 0:dc55f40eb04f | 144 | WiFi_SCAN_FAILED, |
mridup | 0:dc55f40eb04f | 145 | WiFi_AT_CMD_BUSY, |
mridup | 0:dc55f40eb04f | 146 | WiFi_SSID_ERROR, |
mridup | 0:dc55f40eb04f | 147 | WiFi_SecKey_ERROR, |
mridup | 0:dc55f40eb04f | 148 | WiFi_CONFIG_ERROR, |
mridup | 0:dc55f40eb04f | 149 | WiFi_STA_MODE_ERROR, |
mridup | 0:dc55f40eb04f | 150 | WiFi_AP_MODE_ERROR, |
mridup | 0:dc55f40eb04f | 151 | WiFi_AT_CMD_RESP_ERROR, |
mridup | 0:dc55f40eb04f | 152 | WiFi_AT_FILE_LENGTH_ERROR, |
mridup | 0:dc55f40eb04f | 153 | WiFi_HAL_UART_ERROR, |
mridup | 0:dc55f40eb04f | 154 | WiFi_IN_LOW_POWER_ERROR, |
mridup | 0:dc55f40eb04f | 155 | WiFi_HW_FAILURE_ERROR, |
mridup | 0:dc55f40eb04f | 156 | WiFi_HEAP_TOO_SMALL_WARNING, |
mridup | 0:dc55f40eb04f | 157 | WiFi_STACK_OVERFLOW_ERROR, |
mridup | 0:dc55f40eb04f | 158 | WiFi_HARD_FAULT_ERROR, |
mridup | 0:dc55f40eb04f | 159 | WiFi_MALLOC_FAILED_ERROR, |
mridup | 0:dc55f40eb04f | 160 | WiFi_INIT_ERROR, |
mridup | 0:dc55f40eb04f | 161 | WiFi_POWER_SAVE_WARNING, |
mridup | 0:dc55f40eb04f | 162 | WiFi_SIGNAL_LOW_WARNING, |
mridup | 0:dc55f40eb04f | 163 | WiFi_JOIN_FAILED, |
mridup | 0:dc55f40eb04f | 164 | WiFi_SCAN_BLEWUP, |
mridup | 0:dc55f40eb04f | 165 | WiFi_START_FAILED_ERROR, |
mridup | 0:dc55f40eb04f | 166 | WiFi_EXCEPTION_ERROR, |
mridup | 0:dc55f40eb04f | 167 | WiFi_DE_AUTH, |
mridup | 0:dc55f40eb04f | 168 | WiFi_DISASSOCIATION, |
mridup | 0:dc55f40eb04f | 169 | WiFi_UNHANDLED_IND_ERROR, |
mridup | 0:dc55f40eb04f | 170 | WiFi_RX_MGMT, |
mridup | 0:dc55f40eb04f | 171 | WiFi_RX_DATA, |
mridup | 0:dc55f40eb04f | 172 | WiFi_RX_UNK |
mridup | 0:dc55f40eb04f | 173 | } WiFi_Status_t; |
mridup | 0:dc55f40eb04f | 174 | |
mridup | 0:dc55f40eb04f | 175 | typedef enum power_mode |
mridup | 0:dc55f40eb04f | 176 | { |
mridup | 0:dc55f40eb04f | 177 | wifi_active = 0, |
mridup | 0:dc55f40eb04f | 178 | wifi_reactive = 1, |
mridup | 0:dc55f40eb04f | 179 | wifi_sleep = 2, |
mridup | 0:dc55f40eb04f | 180 | } power_mode; |
mridup | 0:dc55f40eb04f | 181 | |
mridup | 0:dc55f40eb04f | 182 | typedef enum tx_power_level |
mridup | 0:dc55f40eb04f | 183 | { |
mridup | 0:dc55f40eb04f | 184 | low = 0, |
mridup | 0:dc55f40eb04f | 185 | medium = 1, |
mridup | 0:dc55f40eb04f | 186 | high = 2, |
mridup | 0:dc55f40eb04f | 187 | max = 3, |
mridup | 0:dc55f40eb04f | 188 | } tx_power_level; |
mridup | 0:dc55f40eb04f | 189 | |
mridup | 0:dc55f40eb04f | 190 | typedef enum dhcp_mode |
mridup | 0:dc55f40eb04f | 191 | { |
mridup | 0:dc55f40eb04f | 192 | off = 0, |
mridup | 0:dc55f40eb04f | 193 | on = 1, |
mridup | 0:dc55f40eb04f | 194 | custom = 2, |
mridup | 0:dc55f40eb04f | 195 | } dhcp_mode; |
mridup | 0:dc55f40eb04f | 196 | |
mridup | 0:dc55f40eb04f | 197 | typedef struct wifi_security |
mridup | 0:dc55f40eb04f | 198 | { |
mridup | 0:dc55f40eb04f | 199 | wifi_bool wpa; |
mridup | 0:dc55f40eb04f | 200 | wifi_bool wpa2; |
mridup | 0:dc55f40eb04f | 201 | wifi_bool wps; |
mridup | 0:dc55f40eb04f | 202 | } wifi_security; |
mridup | 0:dc55f40eb04f | 203 | |
mridup | 0:dc55f40eb04f | 204 | typedef struct wifi_scan |
mridup | 0:dc55f40eb04f | 205 | { |
mridup | 0:dc55f40eb04f | 206 | uint8_t channel_num; |
mridup | 0:dc55f40eb04f | 207 | int rssi; |
mridup | 0:dc55f40eb04f | 208 | char ssid[30]; |
mridup | 0:dc55f40eb04f | 209 | wifi_security sec_type; |
mridup | 0:dc55f40eb04f | 210 | } wifi_scan; |
mridup | 0:dc55f40eb04f | 211 | |
mridup | 0:dc55f40eb04f | 212 | typedef struct wifi_config |
mridup | 0:dc55f40eb04f | 213 | { |
mridup | 0:dc55f40eb04f | 214 | wifi_bool ht_mode; |
mridup | 0:dc55f40eb04f | 215 | power_mode power; |
mridup | 0:dc55f40eb04f | 216 | tx_power_level power_level; |
mridup | 0:dc55f40eb04f | 217 | dhcp_mode dhcp; |
mridup | 0:dc55f40eb04f | 218 | char* ip_addr; |
mridup | 0:dc55f40eb04f | 219 | char* netmask_addr; |
mridup | 0:dc55f40eb04f | 220 | char* gateway_addr; |
mridup | 0:dc55f40eb04f | 221 | char* dns_addr; |
mridup | 0:dc55f40eb04f | 222 | char* host_name; |
mridup | 0:dc55f40eb04f | 223 | wifi_bool web_server; |
mridup | 0:dc55f40eb04f | 224 | char* ap_domain_name; |
mridup | 0:dc55f40eb04f | 225 | char* ap_config_page_name; |
mridup | 0:dc55f40eb04f | 226 | uint32_t http_timeout; |
mridup | 0:dc55f40eb04f | 227 | uint32_t dhcp_timeout; |
mridup | 0:dc55f40eb04f | 228 | uint8_t wifi_region; |
mridup | 0:dc55f40eb04f | 229 | uint32_t wifi_baud_rate; |
mridup | 0:dc55f40eb04f | 230 | } wifi_config; |
mridup | 0:dc55f40eb04f | 231 | |
mridup | 0:dc55f40eb04f | 232 | /* Exported functions ------------------------------------------------------- */ |
mridup | 0:dc55f40eb04f | 233 | |
mridup | 0:dc55f40eb04f | 234 | #ifdef WIFI_USE_VCOM |
mridup | 0:dc55f40eb04f | 235 | void wifi_vcom(void); |
mridup | 0:dc55f40eb04f | 236 | #endif |
mridup | 0:dc55f40eb04f | 237 | |
mridup | 0:dc55f40eb04f | 238 | WiFi_Status_t wifi_init(wifi_config* config); |
mridup | 0:dc55f40eb04f | 239 | WiFi_Status_t wifi_restore(void); |
mridup | 0:dc55f40eb04f | 240 | WiFi_Status_t wifi_enable(wifi_bool enable); |
mridup | 0:dc55f40eb04f | 241 | WiFi_Status_t wifi_disconnect(void); |
mridup | 0:dc55f40eb04f | 242 | WiFi_Status_t wifi_connect(char * ssid, char * sec_key, WiFi_Priv_Mode priv_mode); |
mridup | 0:dc55f40eb04f | 243 | WiFi_Status_t wifi_ap_start(uint8_t * ssid, uint8_t channel_num); |
mridup | 0:dc55f40eb04f | 244 | WiFi_Status_t wifi_adhoc_create(uint8_t * ssid, WiFi_Priv_Mode priv_mode); |
mridup | 0:dc55f40eb04f | 245 | WiFi_Status_t wifi_network_scan(wifi_scan *scan_result, uint16_t max_scan_number); |
mridup | 0:dc55f40eb04f | 246 | void wifi_reset(void); |
mridup | 0:dc55f40eb04f | 247 | |
mridup | 0:dc55f40eb04f | 248 | /******** Wi-Fi Socket Function **********/ |
mridup | 0:dc55f40eb04f | 249 | WiFi_Status_t wifi_socket_client_open(uint8_t * hostname, uint32_t port_number, uint8_t * protocol, uint8_t * sock_id); |
mridup | 8:0f302a13e21b | 250 | int wifi_socket_client_write(uint8_t sock_id, uint16_t DataLength,char * pData); |
mridup | 0:dc55f40eb04f | 251 | WiFi_Status_t wifi_socket_client_close(uint8_t sock_close_id); |
mridup | 0:dc55f40eb04f | 252 | WiFi_Status_t wifi_socket_client_security(uint8_t* tls_mode, uint8_t* root_ca_server, uint8_t* client_cert, uint8_t* client_key, uint8_t* client_domain, uint32_t tls_epoch_time); |
mridup | 0:dc55f40eb04f | 253 | |
mridup | 0:dc55f40eb04f | 254 | /********* Wi-Fi Socket Server ********/ |
mridup | 0:dc55f40eb04f | 255 | WiFi_Status_t wifi_socket_server_open(uint32_t port_number, uint8_t * protocol); |
mridup | 8:0f302a13e21b | 256 | int wifi_socket_server_write(uint16_t DataLength,char * pData); |
mridup | 0:dc55f40eb04f | 257 | WiFi_Status_t wifi_socket_server_close(void); |
mridup | 0:dc55f40eb04f | 258 | |
mridup | 0:dc55f40eb04f | 259 | /*** FileSystem Request ***********/ |
mridup | 0:dc55f40eb04f | 260 | WiFi_Status_t wifi_file_create(char *pFileName,uint16_t alength,char * databuff); |
mridup | 0:dc55f40eb04f | 261 | WiFi_Status_t wifi_file_delete(char * pFileName); |
mridup | 0:dc55f40eb04f | 262 | WiFi_Status_t wifi_file_list(void); |
mridup | 0:dc55f40eb04f | 263 | WiFi_Status_t wifi_file_show(uint8_t * pFileName); |
mridup | 0:dc55f40eb04f | 264 | WiFi_Status_t wifi_file_image_create(uint8_t * pHostName,uint8_t * pFileName, uint32_t port_number); |
mridup | 0:dc55f40eb04f | 265 | WiFi_Status_t wifi_file_erase_external_flash(void); |
mridup | 0:dc55f40eb04f | 266 | |
mridup | 0:dc55f40eb04f | 267 | /*** HTTP File Request ***********/ |
mridup | 0:dc55f40eb04f | 268 | WiFi_Status_t wifi_http_get(uint8_t * hostname, uint8_t * path, uint32_t port_number); |
mridup | 0:dc55f40eb04f | 269 | WiFi_Status_t wifi_http_post(uint8_t * url_path); |
mridup | 0:dc55f40eb04f | 270 | |
mridup | 0:dc55f40eb04f | 271 | WiFi_Status_t wifi_fw_update(uint8_t * hostname, uint8_t * filename_path, uint32_t port_number); |
mridup | 0:dc55f40eb04f | 272 | |
mridup | 0:dc55f40eb04f | 273 | /*** Power Configuration **********/ |
mridup | 0:dc55f40eb04f | 274 | WiFi_Status_t wifi_standby(uint8_t arg_standby_time); |
mridup | 0:dc55f40eb04f | 275 | WiFi_Status_t wifi_wakeup(wifi_bool enable); |
mridup | 0:dc55f40eb04f | 276 | |
mridup | 0:dc55f40eb04f | 277 | /*** GPIO Configuration **********/ |
mridup | 0:dc55f40eb04f | 278 | uint8_t wifi_gpio_init(GpioPin pin, char* dir, char irq); |
mridup | 0:dc55f40eb04f | 279 | uint8_t wifi_gpio_read(GpioPin pin, uint8_t *val, uint8_t *dir); |
mridup | 0:dc55f40eb04f | 280 | uint8_t wifi_gpio_write(GpioPin pin, GpioWriteValue value); |
mridup | 0:dc55f40eb04f | 281 | |
mridup | 0:dc55f40eb04f | 282 | WiFi_Status_t WiFi_Get_IP_Address(uint8_t *ip_addr); |
mridup | 0:dc55f40eb04f | 283 | WiFi_Status_t WiFi_Get_MAC_Address(uint8_t *mac_addr); |
mridup | 0:dc55f40eb04f | 284 | |
mridup | 0:dc55f40eb04f | 285 | void UART_Configuration(uint32_t baud_rate); |
mridup | 0:dc55f40eb04f | 286 | void GPIO_Configuration(void); |
mridup | 0:dc55f40eb04f | 287 | void Timer_Config(void); |
mridup | 0:dc55f40eb04f | 288 | void UART_Msg_Gpio_Init(void); |
mridup | 0:dc55f40eb04f | 289 | void USART_PRINT_MSG_Configuration(uint32_t baud_rate); |
mridup | 0:dc55f40eb04f | 290 | |
mridup | 0:dc55f40eb04f | 291 | /******** Wi-Fi Indication User Callback: For User to implement *********/ |
mridup | 0:dc55f40eb04f | 292 | void ind_wifi_warning(WiFi_Status_t warning_code); |
mridup | 0:dc55f40eb04f | 293 | void ind_wifi_error(WiFi_Status_t error_code); |
mridup | 0:dc55f40eb04f | 294 | void ind_wifi_connection_error(WiFi_Status_t status_code); |
mridup | 0:dc55f40eb04f | 295 | void ind_wifi_connected(void); |
mridup | 0:dc55f40eb04f | 296 | void ind_wifi_ap_ready(void); |
mridup | 0:dc55f40eb04f | 297 | void ind_wifi_ap_client_joined(uint8_t * client_mac_address); |
mridup | 0:dc55f40eb04f | 298 | void ind_wifi_ap_client_left(uint8_t * client_mac_address); |
mridup | 0:dc55f40eb04f | 299 | void ind_wifi_on(void); |
mridup | 0:dc55f40eb04f | 300 | void ind_wifi_packet_lost(WiFi_Status_t status_code); |
mridup | 0:dc55f40eb04f | 301 | void ind_wifi_gpio_changed(void); |
mridup | 0:dc55f40eb04f | 302 | void ind_wifi_socket_data_received(uint8_t socket_id, uint8_t * data_ptr, uint32_t message_size, uint32_t chunk_size); |
mridup | 0:dc55f40eb04f | 303 | void ind_wifi_socket_client_remote_server_closed(uint8_t * socketID); |
mridup | 0:dc55f40eb04f | 304 | void ind_wifi_socket_server_data_lost(void); |
mridup | 0:dc55f40eb04f | 305 | void ind_socket_server_client_joined(void); |
mridup | 0:dc55f40eb04f | 306 | void ind_socket_server_client_left(void); |
mridup | 0:dc55f40eb04f | 307 | void ind_wifi_http_data_available(uint8_t * data_ptr,uint32_t message_size); |
mridup | 0:dc55f40eb04f | 308 | void ind_wifi_file_data_available(uint8_t * data_ptr); |
mridup | 0:dc55f40eb04f | 309 | void ind_wifi_resuming(void); |
mridup | 0:dc55f40eb04f | 310 | |
mridup | 0:dc55f40eb04f | 311 | |
mridup | 0:dc55f40eb04f | 312 | /** |
mridup | 0:dc55f40eb04f | 313 | * @} |
mridup | 0:dc55f40eb04f | 314 | */ |
mridup | 0:dc55f40eb04f | 315 | |
mridup | 0:dc55f40eb04f | 316 | /** |
mridup | 0:dc55f40eb04f | 317 | * @} |
mridup | 0:dc55f40eb04f | 318 | */ |
mridup | 0:dc55f40eb04f | 319 | |
mridup | 0:dc55f40eb04f | 320 | /** |
mridup | 0:dc55f40eb04f | 321 | * @} |
mridup | 0:dc55f40eb04f | 322 | */ |
mridup | 0:dc55f40eb04f | 323 | |
mridup | 0:dc55f40eb04f | 324 | /** |
mridup | 0:dc55f40eb04f | 325 | * @} |
mridup | 0:dc55f40eb04f | 326 | */ |
mridup | 0:dc55f40eb04f | 327 | |
mridup | 0:dc55f40eb04f | 328 | #ifdef __cplusplus |
mridup | 0:dc55f40eb04f | 329 | } |
mridup | 0:dc55f40eb04f | 330 | #endif |
mridup | 0:dc55f40eb04f | 331 | |
mridup | 0:dc55f40eb04f | 332 | #endif /* __WIFI_INTERFACE_H */ |