|
17 | 17 |
|
18 | 18 | #pragma once
|
19 | 19 |
|
20 |
| -#ifdef WF200_WIFI |
21 |
| -#include "FreeRTOS.h" |
22 |
| -#include "event_groups.h" |
23 |
| -#include "semphr.h" |
24 |
| -#include "sl_wfx_cmd_api.h" |
25 |
| -#include "sl_wfx_constants.h" |
26 |
| -#include "task.h" |
27 |
| -#include "timers.h" |
28 |
| - |
29 |
| -#define WLAN_TASK_PRIORITY (1) |
30 |
| -typedef struct __attribute__((__packed__)) sl_wfx_get_counters_cnf_body_s |
31 |
| -{ |
32 |
| - uint32_t status; |
33 |
| - uint16_t mib_id; |
34 |
| - uint16_t length; |
35 |
| - uint32_t rcpi; |
36 |
| - uint32_t count_plcp_errors; |
37 |
| - uint32_t count_fcs_errors; |
38 |
| - uint32_t count_tx_packets; |
39 |
| - uint32_t count_rx_packets; |
40 |
| - uint32_t count_rx_packet_errors; |
41 |
| - uint32_t count_rx_decryption_failures; |
42 |
| - uint32_t count_rx_mic_failures; |
43 |
| - uint32_t count_rx_no_key_failures; |
44 |
| - uint32_t count_tx_multicast_frames; |
45 |
| - uint32_t count_tx_frames_success; |
46 |
| - uint32_t count_tx_frame_failures; |
47 |
| - uint32_t count_tx_frames_retried; |
48 |
| - uint32_t count_tx_frames_multi_retried; |
49 |
| - uint32_t count_rx_frame_duplicates; |
50 |
| - uint32_t count_rts_success; |
51 |
| - uint32_t count_rts_failures; |
52 |
| - uint32_t count_ack_failures; |
53 |
| - uint32_t count_rx_multicast_frames; |
54 |
| - uint32_t count_rx_frames_success; |
55 |
| - uint32_t count_rx_cmacicv_errors; |
56 |
| - uint32_t count_rx_cmac_replays; |
57 |
| - uint32_t count_rx_mgmt_ccmp_replays; |
58 |
| - uint32_t count_rx_bipmic_errors; |
59 |
| - uint32_t count_rx_beacon; |
60 |
| - uint32_t count_miss_beacon; |
61 |
| - uint32_t reserved[15]; |
62 |
| -} sl_wfx_get_counters_cnf_body_t; |
63 |
| - |
64 |
| -typedef struct __attribute__((__packed__)) sl_wfx_get_counters_cnf_s |
65 |
| -{ |
66 |
| - /** Common message header. */ |
67 |
| - sl_wfx_header_t header; |
68 |
| - /** Confirmation message body. */ |
69 |
| - sl_wfx_get_counters_cnf_body_t body; |
70 |
| -} sl_wfx_get_counters_cnf_t; |
71 |
| - |
72 |
| -typedef struct __attribute__((__packed__)) sl_wfx_mib_req_body_s |
73 |
| -{ |
74 |
| - uint16_t mib_id; ///< ID of the MIB to be read. |
75 |
| - uint16_t reserved; |
76 |
| -} sl_wfx_mib_req_body_t; |
77 |
| - |
78 |
| -typedef struct __attribute__((__packed__)) sl_wfx_header_mib_s |
79 |
| -{ |
80 |
| - uint16_t length; ///< Message length in bytes including this uint16_t. |
81 |
| - ///< Maximum value is 8188 but maximum Request size is FW dependent and reported in the |
82 |
| - ///< ::sl_wfx_startup_ind_body_t::size_inp_ch_buf. |
83 |
| - uint8_t id; ///< Contains the message Id indexed by sl_wfx_general_commands_ids_t or sl_wfx_message_ids_t. |
84 |
| - uint8_t reserved : 1; |
85 |
| - uint8_t interface : 2; |
86 |
| - uint8_t seqnum : 3; |
87 |
| - uint8_t encrypted : 2; |
88 |
| -} sl_wfx_header_mib_t; |
89 |
| - |
90 |
| -typedef struct __attribute__((__packed__)) sl_wfx_mib_req_s |
91 |
| -{ |
92 |
| - /** Common message header. */ |
93 |
| - sl_wfx_header_mib_t header; |
94 |
| - /** Request message body. */ |
95 |
| - sl_wfx_mib_req_body_t body; |
96 |
| -} sl_wfx_mib_req_t; |
97 |
| - |
98 |
| -#else /* End WF200 else RS9116,917 NCP and 917 SoC */ |
| 20 | +#include "sl_status.h" |
| 21 | +#include <stdbool.h> |
99 | 22 |
|
100 |
| -#include "wfx_msgs.h" |
| 23 | +/* LwIP includes. */ |
| 24 | +#include "lwip/ip_addr.h" |
| 25 | +#include "lwip/netif.h" |
| 26 | +#include "lwip/netifapi.h" |
| 27 | +#include "lwip/tcpip.h" |
101 | 28 |
|
102 | 29 | #if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
|
| 30 | +#include "rsi_common_apis.h" |
103 | 31 | #include "sl_si91x_types.h"
|
104 |
| -#include "sl_status.h" |
105 | 32 | #include "sl_wifi_constants.h"
|
106 |
| -#include "stdbool.h" |
107 |
| - |
108 |
| -#include "rsi_common_apis.h" |
109 | 33 | #include "sl_wifi_device.h"
|
110 | 34 |
|
111 |
| -#define SL_WIFI_ALLOCATE_COMMAND_BUFFER_WAIT_TIME_MS (1000) |
112 |
| -#endif //(SLI_SI91X_MCU_INTERFACE | EXP_BOARD) |
113 |
| - |
114 |
| -/* Wi-Fi events*/ |
115 |
| -#define SL_WFX_STARTUP_IND_ID (1) |
116 |
| -#define SL_WFX_CONNECT_IND_ID (2) |
117 |
| -#define SL_WFX_DISCONNECT_IND_ID (3) |
118 |
| -#define SL_WFX_SCAN_COMPLETE_ID (4) |
119 |
| -#endif /* WF200_WIFI */ |
120 |
| - |
121 |
| -#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD) |
122 | 35 | // MAX SSID LENGTH excluding NULL character
|
123 | 36 | #define WFX_MAX_SSID_LENGTH (32)
|
124 | 37 | // MAX PASSKEY LENGTH including NULL character
|
125 | 38 | #define WFX_MAX_PASSKEY_LENGTH (SL_WIFI_MAX_PSK_LENGTH)
|
| 39 | +#define SL_WIFI_ALLOCATE_COMMAND_BUFFER_WAIT_TIME_MS (1000) |
126 | 40 | #else
|
127 | 41 | // MAX SSID LENGTH excluding NULL character
|
128 | 42 | #define WFX_MAX_SSID_LENGTH (32)
|
129 | 43 | // MAX PASSKEY LENGTH including NULL character
|
130 | 44 | #define WFX_MAX_PASSKEY_LENGTH (64)
|
131 | 45 | #endif // (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
|
132 | 46 |
|
133 |
| -#include "sl_status.h" |
134 |
| -#include "stdbool.h" |
135 |
| - |
136 |
| -/* LwIP includes. */ |
137 |
| -#include "lwip/ip_addr.h" |
138 |
| -#include "lwip/netif.h" |
139 |
| -#include "lwip/netifapi.h" |
140 |
| -#include "lwip/tcpip.h" |
141 |
| - |
142 | 47 | #define CONVERT_SEC_TO_MS(TimeInS) (TimeInS * 1000)
|
143 | 48 |
|
144 | 49 | /* Wi-Fi bitmask events - for the task */
|
@@ -226,7 +131,6 @@ typedef struct __attribute__((__packed__)) sl_wfx_mib_req_s
|
226 | 131 | #define STATION (0)
|
227 | 132 |
|
228 | 133 | #define SPI_CONFIG_SUCCESS (0)
|
229 |
| - |
230 | 134 | typedef enum
|
231 | 135 | {
|
232 | 136 | WIFI_EVENT,
|
@@ -302,6 +206,94 @@ typedef enum
|
302 | 206 | } sl_wfx_interface_t;
|
303 | 207 | #endif /* RS911X_WIFI */
|
304 | 208 |
|
| 209 | +#ifdef WF200_WIFI |
| 210 | +#include "FreeRTOS.h" |
| 211 | +#include "event_groups.h" |
| 212 | +#include "semphr.h" |
| 213 | +#include "sl_wfx_cmd_api.h" |
| 214 | +#include "sl_wfx_constants.h" |
| 215 | +#include "task.h" |
| 216 | +#include "timers.h" |
| 217 | + |
| 218 | +#define WLAN_TASK_PRIORITY (1) |
| 219 | +typedef struct __attribute__((__packed__)) sl_wfx_get_counters_cnf_body_s |
| 220 | +{ |
| 221 | + uint32_t status; |
| 222 | + uint16_t mib_id; |
| 223 | + uint16_t length; |
| 224 | + uint32_t rcpi; |
| 225 | + uint32_t count_plcp_errors; |
| 226 | + uint32_t count_fcs_errors; |
| 227 | + uint32_t count_tx_packets; |
| 228 | + uint32_t count_rx_packets; |
| 229 | + uint32_t count_rx_packet_errors; |
| 230 | + uint32_t count_rx_decryption_failures; |
| 231 | + uint32_t count_rx_mic_failures; |
| 232 | + uint32_t count_rx_no_key_failures; |
| 233 | + uint32_t count_tx_multicast_frames; |
| 234 | + uint32_t count_tx_frames_success; |
| 235 | + uint32_t count_tx_frame_failures; |
| 236 | + uint32_t count_tx_frames_retried; |
| 237 | + uint32_t count_tx_frames_multi_retried; |
| 238 | + uint32_t count_rx_frame_duplicates; |
| 239 | + uint32_t count_rts_success; |
| 240 | + uint32_t count_rts_failures; |
| 241 | + uint32_t count_ack_failures; |
| 242 | + uint32_t count_rx_multicast_frames; |
| 243 | + uint32_t count_rx_frames_success; |
| 244 | + uint32_t count_rx_cmacicv_errors; |
| 245 | + uint32_t count_rx_cmac_replays; |
| 246 | + uint32_t count_rx_mgmt_ccmp_replays; |
| 247 | + uint32_t count_rx_bipmic_errors; |
| 248 | + uint32_t count_rx_beacon; |
| 249 | + uint32_t count_miss_beacon; |
| 250 | + uint32_t reserved[15]; |
| 251 | +} sl_wfx_get_counters_cnf_body_t; |
| 252 | + |
| 253 | +typedef struct __attribute__((__packed__)) sl_wfx_get_counters_cnf_s |
| 254 | +{ |
| 255 | + /** Common message header. */ |
| 256 | + sl_wfx_header_t header; |
| 257 | + /** Confirmation message body. */ |
| 258 | + sl_wfx_get_counters_cnf_body_t body; |
| 259 | +} sl_wfx_get_counters_cnf_t; |
| 260 | + |
| 261 | +typedef struct __attribute__((__packed__)) sl_wfx_mib_req_body_s |
| 262 | +{ |
| 263 | + uint16_t mib_id; ///< ID of the MIB to be read. |
| 264 | + uint16_t reserved; |
| 265 | +} sl_wfx_mib_req_body_t; |
| 266 | + |
| 267 | +typedef struct __attribute__((__packed__)) sl_wfx_header_mib_s |
| 268 | +{ |
| 269 | + uint16_t length; ///< Message length in bytes including this uint16_t. |
| 270 | + ///< Maximum value is 8188 but maximum Request size is FW dependent and reported in the |
| 271 | + ///< ::sl_wfx_startup_ind_body_t::size_inp_ch_buf. |
| 272 | + uint8_t id; ///< Contains the message Id indexed by sl_wfx_general_commands_ids_t or sl_wfx_message_ids_t. |
| 273 | + uint8_t reserved : 1; |
| 274 | + uint8_t interface : 2; |
| 275 | + uint8_t seqnum : 3; |
| 276 | + uint8_t encrypted : 2; |
| 277 | +} sl_wfx_header_mib_t; |
| 278 | + |
| 279 | +typedef struct __attribute__((__packed__)) sl_wfx_mib_req_s |
| 280 | +{ |
| 281 | + /** Common message header. */ |
| 282 | + sl_wfx_header_mib_t header; |
| 283 | + /** Request message body. */ |
| 284 | + sl_wfx_mib_req_body_t body; |
| 285 | +} sl_wfx_mib_req_t; |
| 286 | + |
| 287 | +#else /* End WF200 else RS9116,917 NCP and 917 SoC */ |
| 288 | + |
| 289 | +#include "wfx_msgs.h" |
| 290 | +/* Wi-Fi events*/ |
| 291 | +#define SL_WFX_STARTUP_IND_ID (1) |
| 292 | +#define SL_WFX_CONNECT_IND_ID (2) |
| 293 | +#define SL_WFX_DISCONNECT_IND_ID (3) |
| 294 | +#define SL_WFX_SCAN_COMPLETE_ID (4) |
| 295 | +#endif /* WF200_WIFI */ |
| 296 | + |
305 | 297 | #ifdef __cplusplus
|
306 | 298 | extern "C" {
|
307 | 299 | #endif
|
@@ -351,6 +343,7 @@ void wfx_dhcp_got_ipv4(uint32_t);
|
351 | 343 | void wfx_ip_changed_notify(int got_ip);
|
352 | 344 | #endif /* CHIP_DEVICE_CONFIG_ENABLE_IPV4 */
|
353 | 345 | void wfx_ipv6_notify(int got_ip);
|
| 346 | +void wfx_retry_connection(uint16_t retryAttempt); |
354 | 347 |
|
355 | 348 | #ifdef RS911X_WIFI
|
356 | 349 | #if !(EXP_BOARD) // for RS9116
|
@@ -387,8 +380,6 @@ void sl_button_on_change(uint8_t btn, uint8_t btnAction);
|
387 | 380 | #endif /* SL_ICD_ENABLED */
|
388 | 381 | #endif /* SLI_SI91X_MCU_INTERFACE */
|
389 | 382 |
|
390 |
| -void wfx_retry_connection(uint16_t retryAttempt); |
391 |
| - |
392 | 383 | #ifdef __cplusplus
|
393 | 384 | }
|
394 | 385 | #endif
|
0 commit comments