2018-03-02 17:30:32 -08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018, Texas Instruments Incorporated
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-09-14 10:43:44 -07:00
|
|
|
#ifndef ZEPHYR_DRIVERS_WIFI_SIMPLELINK_SIMPLELINK_SUPPORT_H_
|
|
|
|
#define ZEPHYR_DRIVERS_WIFI_SIMPLELINK_SIMPLELINK_SUPPORT_H_
|
2018-03-02 17:30:32 -08:00
|
|
|
|
2022-05-06 10:25:46 +02:00
|
|
|
#include <zephyr/net/wifi_mgmt.h>
|
2019-08-05 17:18:46 +03:00
|
|
|
|
2018-03-02 17:30:32 -08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define SSID_LEN_MAX (32)
|
|
|
|
#define BSSID_LEN_MAX (6)
|
|
|
|
|
|
|
|
/* Define ID for simplelink_wifi_cb to not conflict with WLAN event IDs: */
|
|
|
|
#define SIMPLELINK_WIFI_CB_IPACQUIRED \
|
2019-03-06 17:59:49 -08:00
|
|
|
(SL_WLAN_EVENT_MAX + SL_NETAPP_EVENT_IPV4_ACQUIRED)
|
|
|
|
#define SIMPLELINK_WIFI_CB_IPV6ACQUIRED \
|
|
|
|
(SL_WLAN_EVENT_MAX + SL_NETAPP_EVENT_IPV6_ACQUIRED)
|
2018-03-02 17:30:32 -08:00
|
|
|
|
|
|
|
struct sl_connect_state {
|
2020-05-27 11:26:57 -05:00
|
|
|
uint32_t gateway_ip;
|
|
|
|
uint8_t ssid[SSID_LEN_MAX + 1];
|
|
|
|
uint8_t bssid[BSSID_LEN_MAX];
|
|
|
|
uint32_t ip_addr;
|
|
|
|
uint32_t sta_ip;
|
|
|
|
uint32_t ipv6_addr[4];
|
|
|
|
int16_t error;
|
2018-03-02 17:30:32 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Callback from SimpleLink Event Handlers: */
|
2020-05-27 11:26:57 -05:00
|
|
|
typedef void (*simplelink_wifi_cb_t)(uint32_t mgmt_event,
|
2018-03-02 17:30:32 -08:00
|
|
|
struct sl_connect_state *conn);
|
|
|
|
|
2019-03-12 15:15:42 -06:00
|
|
|
extern int z_simplelink_start_scan(void);
|
|
|
|
extern void z_simplelink_get_scan_result(int index,
|
2018-03-02 17:30:32 -08:00
|
|
|
struct wifi_scan_result *scan_result);
|
2019-03-12 15:15:42 -06:00
|
|
|
extern void z_simplelink_get_mac(unsigned char *mac);
|
|
|
|
extern int z_simplelink_init(simplelink_wifi_cb_t wifi_cb);
|
|
|
|
extern int z_simplelink_connect(struct wifi_connect_req_params *params);
|
|
|
|
extern int z_simplelink_disconnect(void);
|
2018-03-02 17:30:32 -08:00
|
|
|
|
2022-03-30 14:16:42 +02:00
|
|
|
int simplelink_socket_create(int family, int type, int proto);
|
|
|
|
|
2018-03-02 17:30:32 -08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
2018-09-14 10:43:44 -07:00
|
|
|
#endif /* ZEPHYR_DRIVERS_WIFI_SIMPLELINK_SIMPLELINK_SUPPORT_H_ */
|