Update IDF to de750e9 and add BLE (#723)

* Update IDF to de750e9

* Add BLE Library submodule
This commit is contained in:
Me No Dev
2017-10-13 22:07:41 +03:00
committed by GitHub
parent e6a5b68e40
commit 60b8b47455
74 changed files with 264 additions and 45 deletions

View File

@ -64,4 +64,16 @@ void esp_spiram_writeback_cache();
/**
* @brief Reserve a pool of internal memory for specific DMA/internal allocations
*
* @param size Size of reserved pool in bytes
*
* @return
* - ESP_OK on success
* - ESP_ERR_NO_MEM when no memory available for pool
*/
esp_err_t esp_spiram_reserve_dma_pool(size_t size);
#endif

View File

@ -517,23 +517,34 @@ esp_err_t esp_wifi_set_channel(uint8_t primary, wifi_second_chan_t second);
esp_err_t esp_wifi_get_channel(uint8_t *primary, wifi_second_chan_t *second);
/**
* @brief Set country code
* The default value is WIFI_COUNTRY_CN
* @brief configure country info
*
* @param country country type
* @attention 1. The default country is {.cc="CN", .schan=1, .nchan=13, policy=WIFI_COUNTRY_POLICY_AUTO}
* @attention 2. When the country policy is WIFI_COUNTRY_POLICY_AUTO, use the country info of AP to which
* the station is connected. E.g. if the configured country info is {.cc="USA", .schan=1, .nchan=11},
* the country info of the AP to which the station is connected is {.cc="JP", .schan=1, .nchan=14},
* then our country info is {.cc="JP", .schan=1, .nchan=14}. If the station disconnected
* from the AP, the country info back to {.cc="USA", .schan=1, .nchan=11} again.
* @attention 3. When the country policy is WIFI_COUNTRY_POLICY_MANUAL, always use the configured country info.
* @attention 4. When the country info is changed because of configuration or because the station connects to a different
* external AP, the country IE in probe response/beacon of the soft-AP is changed also.
* @attention 5. The country configuration is not stored into flash
* @attention 6. This API doesn't validate the per-country rules, it's up to the user to fill in all fields according to
* local regulations.
*
* @param country the configured country info
*
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_WIFI_ARG: invalid argument
* - others: refer to error code in esp_err.h
*/
esp_err_t esp_wifi_set_country(wifi_country_t country);
esp_err_t esp_wifi_set_country(wifi_country_t *country);
/**
* @brief Get country code
* @brief get the current country info
*
* @param country store current country
* @param country country info
*
* @return
* - ESP_OK: succeed
@ -542,6 +553,7 @@ esp_err_t esp_wifi_set_country(wifi_country_t country);
*/
esp_err_t esp_wifi_get_country(wifi_country_t *country);
/**
* @brief Set MAC address of the ESP32 WiFi station or the soft-AP interface.
*

View File

@ -40,11 +40,15 @@ typedef esp_interface_t wifi_interface_t;
#define WIFI_IF_AP ESP_IF_WIFI_AP
typedef enum {
WIFI_COUNTRY_CN = 0, /**< country China, channel range [1, 14] */
WIFI_COUNTRY_JP, /**< country Japan, channel range [1, 14] */
WIFI_COUNTRY_US, /**< country USA, channel range [1, 11] */
WIFI_COUNTRY_EU, /**< country Europe, channel range [1, 13] */
WIFI_COUNTRY_MAX
WIFI_COUNTRY_POLICY_AUTO, /**< Country policy is auto, use the country info of AP to which the station is connected */
WIFI_COUNTRY_POLICY_MANUAL, /**< Country policy is manual, always use the configured country info */
} wifi_country_policy_t;
typedef struct {
char cc[3]; /**< country code string */
uint8_t schan; /**< start channel */
uint8_t nchan; /**< total channel number */
wifi_country_policy_t policy; /**< country policy */
} wifi_country_t;
typedef enum {
@ -121,6 +125,16 @@ typedef struct {
wifi_scan_time_t scan_time; /**< scan time per channel */
} wifi_scan_config_t;
typedef enum {
WIFI_CIPHER_TYPE_NONE = 0, /**< the cipher type is none */
WIFI_CIPHER_TYPE_WEP40, /**< the cipher type is WEP40 */
WIFI_CIPHER_TYPE_WEP104, /**< the cipher type is WEP104 */
WIFI_CIPHER_TYPE_TKIP, /**< the cipher type is TKIP */
WIFI_CIPHER_TYPE_CCMP, /**< the cipher type is CCMP */
WIFI_CIPHER_TYPE_TKIP_CCMP, /**< the cipher type is TKIP and CCMP */
WIFI_CIPHER_TYPE_UNKNOWN, /**< the cipher type is unknown */
} wifi_cipher_type_t;
typedef struct {
uint8_t bssid[6]; /**< MAC address of AP */
uint8_t ssid[33]; /**< SSID of AP */
@ -128,8 +142,14 @@ typedef struct {
wifi_second_chan_t second; /**< second channel of AP */
int8_t rssi; /**< signal strength of AP */
wifi_auth_mode_t authmode; /**< authmode of AP */
uint32_t low_rate_enable:1; /**< bit: 0 flag to identify if low rate is enabled or not */
uint32_t reserved:31; /**< bit: 1..31 reserved */
wifi_cipher_type_t pairwise_cipher; /**< pairwise cipher of AP */
wifi_cipher_type_t group_cipher; /**< group cipher of AP */
uint32_t phy_11b:1; /**< bit: 0 flag to identify if 11b mode is enabled or not */
uint32_t phy_11g:1; /**< bit: 1 flag to identify if 11g mode is enabled or not */
uint32_t phy_11n:1; /**< bit: 2 flag to identify if 11n mode is enabled or not */
uint32_t phy_lr:1; /**< bit: 3 flag to identify if low rate is enabled or not */
uint32_t wps:1; /**< bit: 4 flag to identify if WPS is supported or not */
uint32_t reserved:27; /**< bit: 5..31 reserved */
} wifi_ap_record_t;
typedef enum {