mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-21 06:22:21 +02:00
feat(wifi_remote): Added generation step for wifi_remote based on IDF
This commit is contained in:
@ -1,16 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#define ESP_WIFI_MAX_CONN_NUM (15) /**< max number of stations which can connect to ESP32/ESP32S3/ESP32S2 soft-AP */
|
||||
|
||||
/** @brief List of stations associated with the Soft-AP */
|
||||
typedef struct wifi_sta_list_t {
|
||||
wifi_sta_info_t sta[ESP_WIFI_MAX_CONN_NUM]; /**< station list */
|
||||
int num; /**< number of stations in the list (other entries are invalid) */
|
||||
} wifi_sta_list_t;
|
@ -5,59 +5,45 @@
|
||||
*/
|
||||
#pragma once
|
||||
#include "esp_wifi.h"
|
||||
#include "esp_wifi_remote_api.h"
|
||||
|
||||
/**
|
||||
* @brief Remote channel Rx function pointer
|
||||
*/
|
||||
typedef esp_err_t (*esp_remote_channel_rx_fn_t)(void *h, void *buffer, void *buff_to_free, size_t len);
|
||||
|
||||
/**
|
||||
* @brief Remote channel Tx function pointer
|
||||
*/
|
||||
typedef esp_err_t (*esp_remote_channel_tx_fn_t)(void *h, void *buffer, size_t len);
|
||||
|
||||
/**
|
||||
* @brief Remote channel handle
|
||||
*/
|
||||
typedef struct esp_remote_channel *esp_remote_channel_t;
|
||||
|
||||
/**
|
||||
* @brief Remote channel configuration
|
||||
*/
|
||||
typedef struct esp_remote_channel_config *esp_remote_channel_config_t;
|
||||
|
||||
// Public API
|
||||
esp_err_t remote_esp_wifi_connect(void);
|
||||
esp_err_t remote_esp_wifi_disconnect(void);
|
||||
esp_err_t remote_esp_wifi_init(const wifi_init_config_t *config);
|
||||
esp_err_t remote_esp_wifi_deinit(void);
|
||||
esp_err_t remote_esp_wifi_set_mode(wifi_mode_t mode);
|
||||
esp_err_t remote_esp_wifi_get_mode(wifi_mode_t *mode);
|
||||
esp_err_t remote_esp_wifi_set_config(wifi_interface_t ifx, wifi_config_t *conf);
|
||||
esp_err_t remote_esp_wifi_get_config(wifi_interface_t interface, wifi_config_t *conf);
|
||||
esp_err_t remote_esp_wifi_start(void);
|
||||
esp_err_t remote_esp_wifi_stop(void);
|
||||
esp_err_t remote_esp_wifi_get_mac(wifi_interface_t ifx, uint8_t mac[6]);
|
||||
esp_err_t remote_esp_wifi_set_mac(wifi_interface_t ifx, const uint8_t mac[6]);
|
||||
esp_err_t remote_esp_wifi_scan_start(const wifi_scan_config_t *config, bool block);
|
||||
esp_err_t remote_esp_wifi_scan_stop(void);
|
||||
esp_err_t remote_esp_wifi_scan_get_ap_num(uint16_t *number);
|
||||
esp_err_t remote_esp_wifi_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records);
|
||||
esp_err_t remote_esp_wifi_clear_ap_list(void);
|
||||
esp_err_t remote_esp_wifi_restore(void);
|
||||
esp_err_t remote_esp_wifi_clear_fast_connect(void);
|
||||
esp_err_t remote_esp_wifi_deauth_sta(uint16_t aid);
|
||||
esp_err_t remote_esp_wifi_sta_get_ap_info(wifi_ap_record_t *ap_info);
|
||||
esp_err_t remote_esp_wifi_set_ps(wifi_ps_type_t type);
|
||||
esp_err_t remote_esp_wifi_get_ps(wifi_ps_type_t *type);
|
||||
esp_err_t remote_esp_wifi_set_storage(wifi_storage_t storage);
|
||||
esp_err_t remote_esp_wifi_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw);
|
||||
esp_err_t remote_esp_wifi_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw);
|
||||
esp_err_t remote_esp_wifi_set_channel(uint8_t primary, wifi_second_chan_t second);
|
||||
esp_err_t remote_esp_wifi_get_channel(uint8_t *primary, wifi_second_chan_t *second);
|
||||
esp_err_t remote_esp_wifi_set_country_code(const char *country, bool ieee80211d_enabled);
|
||||
esp_err_t remote_esp_wifi_get_country_code(char *country);
|
||||
esp_err_t remote_esp_wifi_set_country(const wifi_country_t *country);
|
||||
esp_err_t remote_esp_wifi_get_country(wifi_country_t *country);
|
||||
esp_err_t remote_esp_wifi_ap_get_sta_list(wifi_sta_list_t *sta);
|
||||
esp_err_t remote_esp_wifi_ap_get_sta_aid(const uint8_t mac[6], uint16_t *aid);
|
||||
esp_err_t remote_esp_wifi_sta_get_rssi(int *rssi);
|
||||
esp_err_t remote_esp_wifi_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap);
|
||||
esp_err_t remote_esp_wifi_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap);
|
||||
|
||||
|
||||
// TODO: Move this to private include
|
||||
// Private API
|
||||
esp_err_t remote_esp_wifi_init_slave(void);
|
||||
|
||||
// handling channels
|
||||
/**
|
||||
* @brief Receive packet to the esp_wifi network layers
|
||||
* @param h Channel handle
|
||||
* @param buffer Packet buffer ptr
|
||||
* @param buff_to_free Packet ptr to free
|
||||
* @param len Packet len
|
||||
* @return ESP_OK on success
|
||||
*/
|
||||
esp_err_t esp_wifi_remote_channel_rx(void *h, void *buffer, void *buff_to_free, size_t len);
|
||||
|
||||
/**
|
||||
* @brief Sets Tx callback for the remote channel
|
||||
* @param ifx Wifi interface
|
||||
* @param h Channel handle
|
||||
* @param tx_cb Callback type
|
||||
* @return ESP_OK on success
|
||||
*/
|
||||
esp_err_t esp_wifi_remote_channel_set(wifi_interface_t ifx, void *h, esp_remote_channel_tx_fn_t tx_cb);
|
||||
esp_err_t esp_wifi_remote_rpc_channel_rx(void *h, void *buffer, size_t len);
|
||||
esp_err_t esp_wifi_remote_rpc_channel_set(void *h, esp_remote_channel_tx_fn_t tx_cb);
|
||||
|
84
components/esp_wifi_remote/include/esp_wifi_remote_api.h
Normal file
84
components/esp_wifi_remote/include/esp_wifi_remote_api.h
Normal file
@ -0,0 +1,84 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
// This file is auto-generated
|
||||
#pragma once
|
||||
esp_err_t esp_wifi_remote_init(const wifi_init_config_t *config);
|
||||
esp_err_t esp_wifi_remote_deinit(void);
|
||||
esp_err_t esp_wifi_remote_set_mode(wifi_mode_t mode);
|
||||
esp_err_t esp_wifi_remote_get_mode(wifi_mode_t *mode);
|
||||
esp_err_t esp_wifi_remote_start(void);
|
||||
esp_err_t esp_wifi_remote_stop(void);
|
||||
esp_err_t esp_wifi_remote_restore(void);
|
||||
esp_err_t esp_wifi_remote_connect(void);
|
||||
esp_err_t esp_wifi_remote_disconnect(void);
|
||||
esp_err_t esp_wifi_remote_clear_fast_connect(void);
|
||||
esp_err_t esp_wifi_remote_deauth_sta(uint16_t aid);
|
||||
esp_err_t esp_wifi_remote_scan_start(const wifi_scan_config_t *config, _Bool block);
|
||||
esp_err_t esp_wifi_remote_scan_stop(void);
|
||||
esp_err_t esp_wifi_remote_scan_get_ap_num(uint16_t *number);
|
||||
esp_err_t esp_wifi_remote_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records);
|
||||
esp_err_t esp_wifi_remote_scan_get_ap_record(wifi_ap_record_t *ap_record);
|
||||
esp_err_t esp_wifi_remote_clear_ap_list(void);
|
||||
esp_err_t esp_wifi_remote_sta_get_ap_info(wifi_ap_record_t *ap_info);
|
||||
esp_err_t esp_wifi_remote_set_ps(wifi_ps_type_t type);
|
||||
esp_err_t esp_wifi_remote_get_ps(wifi_ps_type_t *type);
|
||||
esp_err_t esp_wifi_remote_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap);
|
||||
esp_err_t esp_wifi_remote_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap);
|
||||
esp_err_t esp_wifi_remote_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw);
|
||||
esp_err_t esp_wifi_remote_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw);
|
||||
esp_err_t esp_wifi_remote_set_channel(uint8_t primary, wifi_second_chan_t second);
|
||||
esp_err_t esp_wifi_remote_get_channel(uint8_t *primary, wifi_second_chan_t *second);
|
||||
esp_err_t esp_wifi_remote_set_country(const wifi_country_t *country);
|
||||
esp_err_t esp_wifi_remote_get_country(wifi_country_t *country);
|
||||
esp_err_t esp_wifi_remote_set_mac(wifi_interface_t ifx, const uint8_t mac[6]);
|
||||
esp_err_t esp_wifi_remote_get_mac(wifi_interface_t ifx, uint8_t mac[6]);
|
||||
esp_err_t esp_wifi_remote_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb);
|
||||
esp_err_t esp_wifi_remote_set_promiscuous(_Bool en);
|
||||
esp_err_t esp_wifi_remote_get_promiscuous(_Bool *en);
|
||||
esp_err_t esp_wifi_remote_set_promiscuous_filter(const wifi_promiscuous_filter_t *filter);
|
||||
esp_err_t esp_wifi_remote_get_promiscuous_filter(wifi_promiscuous_filter_t *filter);
|
||||
esp_err_t esp_wifi_remote_set_promiscuous_ctrl_filter(const wifi_promiscuous_filter_t *filter);
|
||||
esp_err_t esp_wifi_remote_get_promiscuous_ctrl_filter(wifi_promiscuous_filter_t *filter);
|
||||
esp_err_t esp_wifi_remote_set_config(wifi_interface_t interface, wifi_config_t *conf);
|
||||
esp_err_t esp_wifi_remote_get_config(wifi_interface_t interface, wifi_config_t *conf);
|
||||
esp_err_t esp_wifi_remote_ap_get_sta_list(wifi_sta_list_t *sta);
|
||||
esp_err_t esp_wifi_remote_ap_get_sta_aid(const uint8_t mac[6], uint16_t *aid);
|
||||
esp_err_t esp_wifi_remote_set_storage(wifi_storage_t storage);
|
||||
esp_err_t esp_wifi_remote_set_vendor_ie(_Bool enable, wifi_vendor_ie_type_t type, wifi_vendor_ie_id_t idx, const void *vnd_ie);
|
||||
esp_err_t esp_wifi_remote_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx);
|
||||
esp_err_t esp_wifi_remote_set_max_tx_power(int8_t power);
|
||||
esp_err_t esp_wifi_remote_get_max_tx_power(int8_t *power);
|
||||
esp_err_t esp_wifi_remote_set_event_mask(uint32_t mask);
|
||||
esp_err_t esp_wifi_remote_get_event_mask(uint32_t *mask);
|
||||
esp_err_t esp_wifi_remote_80211_tx(wifi_interface_t ifx, const void *buffer, int len, _Bool en_sys_seq);
|
||||
esp_err_t esp_wifi_remote_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx);
|
||||
esp_err_t esp_wifi_remote_set_csi_config(const wifi_csi_config_t *config);
|
||||
esp_err_t esp_wifi_remote_set_csi(_Bool en);
|
||||
esp_err_t esp_wifi_remote_set_ant_gpio(const wifi_ant_gpio_config_t *config);
|
||||
esp_err_t esp_wifi_remote_get_ant_gpio(wifi_ant_gpio_config_t *config);
|
||||
esp_err_t esp_wifi_remote_set_ant(const wifi_ant_config_t *config);
|
||||
esp_err_t esp_wifi_remote_get_ant(wifi_ant_config_t *config);
|
||||
int64_t esp_wifi_remote_get_tsf_time(wifi_interface_t interface);
|
||||
esp_err_t esp_wifi_remote_set_inactive_time(wifi_interface_t ifx, uint16_t sec);
|
||||
esp_err_t esp_wifi_remote_get_inactive_time(wifi_interface_t ifx, uint16_t *sec);
|
||||
esp_err_t esp_wifi_remote_statis_dump(uint32_t modules);
|
||||
esp_err_t esp_wifi_remote_set_rssi_threshold(int32_t rssi);
|
||||
esp_err_t esp_wifi_remote_ftm_initiate_session(wifi_ftm_initiator_cfg_t *cfg);
|
||||
esp_err_t esp_wifi_remote_ftm_end_session(void);
|
||||
esp_err_t esp_wifi_remote_ftm_resp_set_offset(int16_t offset_cm);
|
||||
esp_err_t esp_wifi_remote_ftm_get_report(wifi_ftm_report_entry_t *report, uint8_t num_entries);
|
||||
esp_err_t esp_wifi_remote_config_11b_rate(wifi_interface_t ifx, _Bool disable);
|
||||
esp_err_t esp_wifi_remote_connectionless_module_set_wake_interval(uint16_t wake_interval);
|
||||
esp_err_t esp_wifi_remote_force_wakeup_acquire(void);
|
||||
esp_err_t esp_wifi_remote_force_wakeup_release(void);
|
||||
esp_err_t esp_wifi_remote_set_country_code(const char *country, _Bool ieee80211d_enabled);
|
||||
esp_err_t esp_wifi_remote_get_country_code(char *country);
|
||||
esp_err_t esp_wifi_remote_config_80211_tx_rate(wifi_interface_t ifx, wifi_phy_rate_t rate);
|
||||
esp_err_t esp_wifi_remote_disable_pmf_config(wifi_interface_t ifx);
|
||||
esp_err_t esp_wifi_remote_sta_get_aid(uint16_t *aid);
|
||||
esp_err_t esp_wifi_remote_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode);
|
||||
esp_err_t esp_wifi_remote_set_dynamic_cs(_Bool enabled);
|
||||
esp_err_t esp_wifi_remote_sta_get_rssi(int *rssi);
|
386
components/esp_wifi_remote/include/esp_wifi_remote_with_hosted.h
Normal file
386
components/esp_wifi_remote/include/esp_wifi_remote_with_hosted.h
Normal file
@ -0,0 +1,386 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "esp_hosted_wifi_api.h"
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_init(const wifi_init_config_t *config)
|
||||
{
|
||||
return esp_hosted_wifi_init(config);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_deinit(void)
|
||||
{
|
||||
return esp_hosted_wifi_deinit();
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_mode(wifi_mode_t mode)
|
||||
{
|
||||
return esp_hosted_wifi_set_mode(mode);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_get_mode(wifi_mode_t *mode)
|
||||
{
|
||||
return esp_hosted_wifi_get_mode(mode);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_start(void)
|
||||
{
|
||||
return esp_hosted_wifi_start();
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_stop(void)
|
||||
{
|
||||
return esp_hosted_wifi_stop();
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_restore(void)
|
||||
{
|
||||
return esp_hosted_wifi_restore();
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_connect(void)
|
||||
{
|
||||
return esp_hosted_wifi_connect();
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_disconnect(void)
|
||||
{
|
||||
return esp_hosted_wifi_disconnect();
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_clear_fast_connect(void)
|
||||
{
|
||||
return esp_hosted_wifi_clear_fast_connect();
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_deauth_sta(uint16_t aid)
|
||||
{
|
||||
return esp_hosted_wifi_deauth_sta(aid);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_scan_start(const wifi_scan_config_t *config, _Bool block)
|
||||
{
|
||||
return esp_hosted_wifi_scan_start(config, block);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_scan_stop(void)
|
||||
{
|
||||
return esp_hosted_wifi_scan_stop();
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_scan_get_ap_num(uint16_t *number)
|
||||
{
|
||||
return esp_hosted_wifi_scan_get_ap_num(number);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records)
|
||||
{
|
||||
return esp_hosted_wifi_scan_get_ap_records(number, ap_records);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_scan_get_ap_record(wifi_ap_record_t *ap_record)
|
||||
{
|
||||
return esp_hosted_wifi_scan_get_ap_record(ap_record);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_clear_ap_list(void)
|
||||
{
|
||||
return esp_hosted_wifi_clear_ap_list();
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_sta_get_ap_info(wifi_ap_record_t *ap_info)
|
||||
{
|
||||
return esp_hosted_wifi_sta_get_ap_info(ap_info);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_ps(wifi_ps_type_t type)
|
||||
{
|
||||
return esp_hosted_wifi_set_ps(type);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_get_ps(wifi_ps_type_t *type)
|
||||
{
|
||||
return esp_hosted_wifi_get_ps(type);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap)
|
||||
{
|
||||
return esp_hosted_wifi_set_protocol(ifx, protocol_bitmap);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap)
|
||||
{
|
||||
return esp_hosted_wifi_get_protocol(ifx, protocol_bitmap);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw)
|
||||
{
|
||||
return esp_hosted_wifi_set_bandwidth(ifx, bw);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw)
|
||||
{
|
||||
return esp_hosted_wifi_get_bandwidth(ifx, bw);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_channel(uint8_t primary, wifi_second_chan_t second)
|
||||
{
|
||||
return esp_hosted_wifi_set_channel(primary, second);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_get_channel(uint8_t *primary, wifi_second_chan_t *second)
|
||||
{
|
||||
return esp_hosted_wifi_get_channel(primary, second);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_country(const wifi_country_t *country)
|
||||
{
|
||||
return esp_hosted_wifi_set_country(country);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_get_country(wifi_country_t *country)
|
||||
{
|
||||
return esp_hosted_wifi_get_country(country);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_mac(wifi_interface_t ifx, const uint8_t mac[6])
|
||||
{
|
||||
return esp_hosted_wifi_set_mac(ifx, mac);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_get_mac(wifi_interface_t ifx, uint8_t mac[6])
|
||||
{
|
||||
return esp_hosted_wifi_get_mac(ifx, mac);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb)
|
||||
{
|
||||
return esp_hosted_wifi_set_promiscuous_rx_cb(cb);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_promiscuous(_Bool en)
|
||||
{
|
||||
return esp_hosted_wifi_set_promiscuous(en);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_get_promiscuous(_Bool *en)
|
||||
{
|
||||
return esp_hosted_wifi_get_promiscuous(en);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_promiscuous_filter(const wifi_promiscuous_filter_t *filter)
|
||||
{
|
||||
return esp_hosted_wifi_set_promiscuous_filter(filter);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_get_promiscuous_filter(wifi_promiscuous_filter_t *filter)
|
||||
{
|
||||
return esp_hosted_wifi_get_promiscuous_filter(filter);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_promiscuous_ctrl_filter(const wifi_promiscuous_filter_t *filter)
|
||||
{
|
||||
return esp_hosted_wifi_set_promiscuous_ctrl_filter(filter);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_get_promiscuous_ctrl_filter(wifi_promiscuous_filter_t *filter)
|
||||
{
|
||||
return esp_hosted_wifi_get_promiscuous_ctrl_filter(filter);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_config(wifi_interface_t interface, wifi_config_t *conf)
|
||||
{
|
||||
return esp_hosted_wifi_set_config(interface, conf);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_get_config(wifi_interface_t interface, wifi_config_t *conf)
|
||||
{
|
||||
return esp_hosted_wifi_get_config(interface, conf);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_ap_get_sta_list(wifi_sta_list_t *sta)
|
||||
{
|
||||
return esp_hosted_wifi_ap_get_sta_list(sta);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_ap_get_sta_aid(const uint8_t mac[6], uint16_t *aid)
|
||||
{
|
||||
return esp_hosted_wifi_ap_get_sta_aid(mac, aid);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_storage(wifi_storage_t storage)
|
||||
{
|
||||
return esp_hosted_wifi_set_storage(storage);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_vendor_ie(_Bool enable, wifi_vendor_ie_type_t type, wifi_vendor_ie_id_t idx, const void *vnd_ie)
|
||||
{
|
||||
return esp_hosted_wifi_set_vendor_ie(enable, type, idx, vnd_ie);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx)
|
||||
{
|
||||
return esp_hosted_wifi_set_vendor_ie_cb(cb, ctx);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_max_tx_power(int8_t power)
|
||||
{
|
||||
return esp_hosted_wifi_set_max_tx_power(power);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_get_max_tx_power(int8_t *power)
|
||||
{
|
||||
return esp_hosted_wifi_get_max_tx_power(power);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_event_mask(uint32_t mask)
|
||||
{
|
||||
return esp_hosted_wifi_set_event_mask(mask);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_get_event_mask(uint32_t *mask)
|
||||
{
|
||||
return esp_hosted_wifi_get_event_mask(mask);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_80211_tx(wifi_interface_t ifx, const void *buffer, int len, _Bool en_sys_seq)
|
||||
{
|
||||
return esp_hosted_wifi_80211_tx(ifx, buffer, len, en_sys_seq);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx)
|
||||
{
|
||||
return esp_hosted_wifi_set_csi_rx_cb(cb, ctx);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_csi_config(const wifi_csi_config_t *config)
|
||||
{
|
||||
return esp_hosted_wifi_set_csi_config(config);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_csi(_Bool en)
|
||||
{
|
||||
return esp_hosted_wifi_set_csi(en);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_ant_gpio(const wifi_ant_gpio_config_t *config)
|
||||
{
|
||||
return esp_hosted_wifi_set_ant_gpio(config);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_get_ant_gpio(wifi_ant_gpio_config_t *config)
|
||||
{
|
||||
return esp_hosted_wifi_get_ant_gpio(config);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_ant(const wifi_ant_config_t *config)
|
||||
{
|
||||
return esp_hosted_wifi_set_ant(config);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_get_ant(wifi_ant_config_t *config)
|
||||
{
|
||||
return esp_hosted_wifi_get_ant(config);
|
||||
}
|
||||
|
||||
static inline int64_t esp_wifi_remote_get_tsf_time(wifi_interface_t interface)
|
||||
{
|
||||
return esp_hosted_wifi_get_tsf_time(interface);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_inactive_time(wifi_interface_t ifx, uint16_t sec)
|
||||
{
|
||||
return esp_hosted_wifi_set_inactive_time(ifx, sec);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_get_inactive_time(wifi_interface_t ifx, uint16_t *sec)
|
||||
{
|
||||
return esp_hosted_wifi_get_inactive_time(ifx, sec);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_statis_dump(uint32_t modules)
|
||||
{
|
||||
return esp_hosted_wifi_statis_dump(modules);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_rssi_threshold(int32_t rssi)
|
||||
{
|
||||
return esp_hosted_wifi_set_rssi_threshold(rssi);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_ftm_initiate_session(wifi_ftm_initiator_cfg_t *cfg)
|
||||
{
|
||||
return esp_hosted_wifi_ftm_initiate_session(cfg);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_ftm_end_session(void)
|
||||
{
|
||||
return esp_hosted_wifi_ftm_end_session();
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_ftm_resp_set_offset(int16_t offset_cm)
|
||||
{
|
||||
return esp_hosted_wifi_ftm_resp_set_offset(offset_cm);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_config_11b_rate(wifi_interface_t ifx, _Bool disable)
|
||||
{
|
||||
return esp_hosted_wifi_config_11b_rate(ifx, disable);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_connectionless_module_set_wake_interval(uint16_t wake_interval)
|
||||
{
|
||||
return esp_hosted_wifi_connectionless_module_set_wake_interval(wake_interval);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_force_wakeup_acquire(void)
|
||||
{
|
||||
return esp_hosted_wifi_force_wakeup_acquire();
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_force_wakeup_release(void)
|
||||
{
|
||||
return esp_hosted_wifi_force_wakeup_release();
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_country_code(const char *country, _Bool ieee80211d_enabled)
|
||||
{
|
||||
return esp_hosted_wifi_set_country_code(country, ieee80211d_enabled);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_get_country_code(char *country)
|
||||
{
|
||||
return esp_hosted_wifi_get_country_code(country);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_config_80211_tx_rate(wifi_interface_t ifx, wifi_phy_rate_t rate)
|
||||
{
|
||||
return esp_hosted_wifi_config_80211_tx_rate(ifx, rate);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_disable_pmf_config(wifi_interface_t ifx)
|
||||
{
|
||||
return esp_hosted_wifi_disable_pmf_config(ifx);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_sta_get_aid(uint16_t *aid)
|
||||
{
|
||||
return esp_hosted_wifi_sta_get_aid(aid);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode)
|
||||
{
|
||||
return esp_hosted_wifi_sta_get_negotiated_phymode(phymode);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_set_dynamic_cs(_Bool enabled)
|
||||
{
|
||||
return esp_hosted_wifi_set_dynamic_cs(enabled);
|
||||
}
|
||||
|
||||
static inline esp_err_t esp_wifi_remote_sta_get_rssi(int *rssi)
|
||||
{
|
||||
return esp_hosted_wifi_sta_get_rssi(rssi);
|
||||
}
|
134
components/esp_wifi_remote/include/esp_wifi_types_native.h
Normal file
134
components/esp_wifi_remote/include/esp_wifi_types_native.h
Normal file
@ -0,0 +1,134 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "sdkconfig.h"
|
||||
#include "esp_wifi_types_generic.h"
|
||||
#if CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT
|
||||
#include "esp_wifi_he_types.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if CONFIG_SLAVE_IDF_TARGET_ESP32C2
|
||||
#define ESP_WIFI_MAX_CONN_NUM (4) /**< max number of stations which can connect to ESP32C2 soft-AP */
|
||||
#elif CONFIG_SLAVE_IDF_TARGET_ESP32C3 || CONFIG_SLAVE_IDF_TARGET_ESP32C6
|
||||
#define ESP_WIFI_MAX_CONN_NUM (10) /**< max number of stations which can connect to ESP32C3 soft-AP */
|
||||
#else
|
||||
#define ESP_WIFI_MAX_CONN_NUM (15) /**< max number of stations which can connect to ESP32/ESP32S3/ESP32S2 soft-AP */
|
||||
#endif
|
||||
|
||||
/** @brief List of stations associated with the Soft-AP */
|
||||
typedef struct wifi_sta_list_t {
|
||||
wifi_sta_info_t sta[ESP_WIFI_MAX_CONN_NUM]; /**< station list */
|
||||
int num; /**< number of stations in the list (other entries are invalid) */
|
||||
} wifi_sta_list_t;
|
||||
|
||||
#if CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT
|
||||
typedef esp_wifi_rxctrl_t wifi_pkt_rx_ctrl_t;
|
||||
#else
|
||||
/** @brief Received packet radio metadata header, this is the common header at the beginning of all promiscuous mode RX callback buffers */
|
||||
typedef struct {
|
||||
signed rssi:8; /**< Received Signal Strength Indicator(RSSI) of packet. unit: dBm */
|
||||
unsigned rate:5; /**< PHY rate encoding of the packet. Only valid for non HT(11bg) packet */
|
||||
unsigned :1; /**< reserved */
|
||||
unsigned sig_mode:2; /**< Protocol of the reveived packet, 0: non HT(11bg) packet; 1: HT(11n) packet; 3: VHT(11ac) packet */
|
||||
unsigned :16; /**< reserved */
|
||||
unsigned mcs:7; /**< Modulation Coding Scheme. If is HT(11n) packet, shows the modulation, range from 0 to 76(MSC0 ~ MCS76) */
|
||||
unsigned cwb:1; /**< Channel Bandwidth of the packet. 0: 20MHz; 1: 40MHz */
|
||||
unsigned :16; /**< reserved */
|
||||
unsigned smoothing:1; /**< Set to 1 indicates that channel estimate smoothing is recommended.
|
||||
Set to 0 indicates that only per-carrierindependent (unsmoothed) channel estimate is recommended. */
|
||||
unsigned not_sounding:1; /**< Set to 0 indicates that PPDU is a sounding PPDU. Set to 1indicates that the PPDU is not a sounding PPDU.
|
||||
sounding PPDU is used for channel estimation by the request receiver */
|
||||
unsigned :1; /**< reserved */
|
||||
unsigned aggregation:1; /**< Aggregation. 0: MPDU packet; 1: AMPDU packet */
|
||||
unsigned stbc:2; /**< Space Time Block Code(STBC). 0: non STBC packet; 1: STBC packet */
|
||||
unsigned fec_coding:1; /**< Forward Error Correction(FEC). Flag is set for 11n packets which are LDPC */
|
||||
unsigned sgi:1; /**< Short Guide Interval(SGI). 0: Long GI; 1: Short GI */
|
||||
#if CONFIG_SLAVE_IDF_TARGET_ESP32
|
||||
signed noise_floor:8; /**< noise floor of Radio Frequency Module(RF). unit: dBm*/
|
||||
#elif CONFIG_SLAVE_IDF_TARGET_ESP32S2 || CONFIG_SLAVE_IDF_TARGET_ESP32S3 || CONFIG_SLAVE_IDF_TARGET_ESP32C3 || CONFIG_SLAVE_IDF_TARGET_ESP32C2
|
||||
unsigned :8; /**< reserved */
|
||||
#endif
|
||||
unsigned ampdu_cnt:8; /**< the number of subframes aggregated in AMPDU */
|
||||
unsigned channel:4; /**< primary channel on which this packet is received */
|
||||
unsigned secondary_channel:4; /**< secondary channel on which this packet is received. 0: none; 1: above; 2: below */
|
||||
unsigned :8; /**< reserved */
|
||||
unsigned timestamp:32; /**< timestamp. The local time when this packet is received. It is precise only if modem sleep or light sleep is not enabled. unit: microsecond */
|
||||
unsigned :32; /**< reserved */
|
||||
#if CONFIG_SLAVE_IDF_TARGET_ESP32S2
|
||||
unsigned :32; /**< reserved */
|
||||
#elif CONFIG_SLAVE_IDF_TARGET_ESP32S3 || CONFIG_SLAVE_IDF_TARGET_ESP32C3 || CONFIG_SLAVE_IDF_TARGET_ESP32C2
|
||||
signed noise_floor:8; /**< noise floor of Radio Frequency Module(RF). unit: dBm*/
|
||||
unsigned :24; /**< reserved */
|
||||
unsigned :32; /**< reserved */
|
||||
#endif
|
||||
unsigned :31; /**< reserved */
|
||||
unsigned ant:1; /**< antenna number from which this packet is received. 0: WiFi antenna 0; 1: WiFi antenna 1 */
|
||||
#if CONFIG_SLAVE_IDF_TARGET_ESP32S2
|
||||
signed noise_floor:8; /**< noise floor of Radio Frequency Module(RF). unit: dBm*/
|
||||
unsigned :24; /**< reserved */
|
||||
#elif CONFIG_SLAVE_IDF_TARGET_ESP32S3 || CONFIG_SLAVE_IDF_TARGET_ESP32C3 || CONFIG_SLAVE_IDF_TARGET_ESP32C2
|
||||
unsigned :32; /**< reserved */
|
||||
unsigned :32; /**< reserved */
|
||||
unsigned :32; /**< reserved */
|
||||
#endif
|
||||
unsigned sig_len:12; /**< length of packet including Frame Check Sequence(FCS) */
|
||||
unsigned :12; /**< reserved */
|
||||
unsigned rx_state:8; /**< state of the packet. 0: no error; others: error numbers which are not public */
|
||||
} wifi_pkt_rx_ctrl_t;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Channel state information(CSI) configuration type
|
||||
*
|
||||
*/
|
||||
#if CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT
|
||||
typedef wifi_csi_acquire_config_t wifi_csi_config_t;
|
||||
#else
|
||||
typedef struct {
|
||||
bool lltf_en; /**< enable to receive legacy long training field(lltf) data. Default enabled */
|
||||
bool htltf_en; /**< enable to receive HT long training field(htltf) data. Default enabled */
|
||||
bool stbc_htltf2_en; /**< enable to receive space time block code HT long training field(stbc-htltf2) data. Default enabled */
|
||||
bool ltf_merge_en; /**< enable to generate htlft data by averaging lltf and ht_ltf data when receiving HT packet. Otherwise, use ht_ltf data directly. Default enabled */
|
||||
bool channel_filter_en; /**< enable to turn on channel filter to smooth adjacent sub-carrier. Disable it to keep independence of adjacent sub-carrier. Default enabled */
|
||||
bool manu_scale; /**< manually scale the CSI data by left shifting or automatically scale the CSI data. If set true, please set the shift bits. false: automatically. true: manually. Default false */
|
||||
uint8_t shift; /**< manually left shift bits of the scale of the CSI data. The range of the left shift bits is 0~15 */
|
||||
bool dump_ack_en; /**< enable to dump 802.11 ACK frame, default disabled */
|
||||
} wifi_csi_config_t;
|
||||
#endif // !CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT
|
||||
|
||||
|
||||
/** @brief Payload passed to 'buf' parameter of promiscuous mode RX callback.
|
||||
*/
|
||||
typedef struct {
|
||||
wifi_pkt_rx_ctrl_t rx_ctrl; /**< metadata header */
|
||||
uint8_t payload[0]; /**< Data or management payload. Length of payload is described by rx_ctrl.sig_len. Type of content determined by packet type argument of callback. */
|
||||
} wifi_promiscuous_pkt_t;
|
||||
|
||||
/**
|
||||
* @brief CSI data type
|
||||
*
|
||||
*/
|
||||
typedef struct wifi_csi_info_t {
|
||||
wifi_pkt_rx_ctrl_t rx_ctrl;/**< received packet radio metadata header of the CSI data */
|
||||
uint8_t mac[6]; /**< source MAC address of the CSI data */
|
||||
uint8_t dmac[6]; /**< destination MAC address of the CSI data */
|
||||
bool first_word_invalid; /**< first four bytes of the CSI data is invalid or not, true indicates the first four bytes is invalid due to hardware limition */
|
||||
int8_t *buf; /**< valid buffer of CSI data */
|
||||
uint16_t len; /**< valid length of CSI data */
|
||||
uint8_t *hdr; /**< header of the wifi packet */
|
||||
uint8_t *payload; /**< payload of the wifi packet */
|
||||
uint16_t payload_len; /**< payload len of the wifi packet */
|
||||
} wifi_csi_info_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user