Skip to content

Commit 0533c47

Browse files
authored
Merge branch 'espressif:master' into work
2 parents 23b9655 + cf01523 commit 0533c47

File tree

6 files changed

+67
-8
lines changed

6 files changed

+67
-8
lines changed

docs/source/api/wifi.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The Wi-Fi API provides support for the 802.11b/g/n protocol driver. This API inc
1111

1212
* AP mode (aka Soft-AP mode or Access Point mode). Devices connect to the ESP32
1313

14-
* Security modes (WPA, WPA2, WEP, etc.)
14+
* Security modes (WPA2, WPA3 etc.)
1515

1616
* Scanning for access points
1717

@@ -477,6 +477,19 @@ Function used to get the automatic reconnection if the connection is lost.
477477
478478
The function will return ``true`` if this setting is enabled.
479479

480+
setMinSecurity
481+
**************
482+
483+
Function used to set the minimum security for AP to be considered connectable.
484+
485+
.. code-block:: arduino
486+
487+
bool setMinSecurity(wifi_auth_mode_t minSecurity);
488+
489+
Where:
490+
491+
* ``minSecurity`` is the minimum security for AP to be considered connectable. Default is ``WIFI_AUTH_WPA2_PSK``.
492+
480493
WiFiMulti
481494
---------
482495

docs/source/troubleshooting.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,42 @@ Solution
8080
* Change the USB port.
8181
* Check your power supply.
8282
* Check if the board is damaged or defective.
83+
84+
Wi-Fi
85+
-----
86+
87+
Why does the board not connect to WEP/WPA-"encrypted" Wi-Fi?
88+
************************************************************
89+
90+
Please note that WEP/WPA has significant security vulnerabilities and its use is strongly discouraged.
91+
The support may therefore be removed in the future. Please migrate to WPA2 or newer.
92+
93+
Solution
94+
^^^^^^^^
95+
96+
Nevertheless, it may be necessary to connect to insecure networks. To do this, the security requirement of the ESP32 must be lowered to an insecure level by using:
97+
98+
.. code-block:: arduino
99+
100+
WiFi.setMinSecurity(WIFI_AUTH_WEP); // Lower min security to WEP.
101+
// or
102+
WiFi.setMinSecurity(WIFI_AUTH_WPA_PSK); // Lower min security to WPA.
103+
104+
Why does the board not connect to WPA3-encrypted Wi-Fi?
105+
*******************************************************
106+
107+
WPA3 support is resource intensive and may not be compiled into the used SDK.
108+
109+
Solution
110+
^^^^^^^^
111+
112+
* Check WPA3 support by your SDK.
113+
* Compile your custom SDK with WPA3 support.
114+
115+
Sample code to check SDK WPA3 support at compile time:
116+
117+
.. code-block:: arduino
118+
119+
#ifndef CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE
120+
#warning "No WPA3 support."
121+
#endif

libraries/BLE/src/BLE2902.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ void BLE2902::setIndications(bool flag) {
4646
uint8_t *pValue = getValue();
4747
if (flag) pValue[0] |= 1 << 1;
4848
else pValue[0] &= ~(1 << 1);
49+
setValue(pValue, 2);
4950
} // setIndications
5051

5152

@@ -57,6 +58,7 @@ void BLE2902::setNotifications(bool flag) {
5758
uint8_t *pValue = getValue();
5859
if (flag) pValue[0] |= 1 << 0;
5960
else pValue[0] &= ~(1 << 0);
61+
setValue(pValue, 2);
6062
} // setNotifications
6163

6264
#endif

libraries/BLE/src/BLEDescriptor.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ BLEDescriptor::BLEDescriptor(const char* uuid, uint16_t len) : BLEDescriptor(BLE
3232
BLEDescriptor::BLEDescriptor(BLEUUID uuid, uint16_t max_len) {
3333
m_bleUUID = uuid;
3434
m_value.attr_len = 0; // Initial length is 0.
35-
m_value.attr_max_len = max_len; // Maximum length of the data.
35+
m_value.attr_max_len = max_len; // Maximum length of the data.
3636
m_handle = NULL_HANDLE; // Handle is initially unknown.
3737
m_pCharacteristic = nullptr; // No initial characteristic.
3838
m_pCallback = nullptr; // No initial callback.
@@ -235,6 +235,10 @@ void BLEDescriptor::setValue(uint8_t* data, size_t length) {
235235
}
236236
m_value.attr_len = length;
237237
memcpy(m_value.attr_value, data, length);
238+
if (m_handle != NULL_HANDLE) {
239+
esp_ble_gatts_set_attr_value(m_handle, length, (const uint8_t *)data);
240+
log_d("Set the value in the GATTS database using handle 0x%x", m_handle);
241+
}
238242
} // setValue
239243

240244

libraries/BLE/src/BLEDescriptor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class BLEDescriptor {
5151
uint16_t m_handle;
5252
BLEDescriptorCallbacks* m_pCallback;
5353
BLECharacteristic* m_pCharacteristic;
54-
esp_gatt_perm_t m_permissions = ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE;
54+
esp_gatt_perm_t m_permissions = ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE;
5555
FreeRTOS::Semaphore m_semaphoreCreateEvt = FreeRTOS::Semaphore("CreateEvt");
5656
esp_attr_value_t m_value;
5757

libraries/WiFi/src/WiFiSTA.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,10 @@ bool WiFiSTAClass::reconnect()
337337
}
338338

339339
/**
340-
* Disconnect from the network
341-
* @param wifioff
342-
* @return one value of wl_status_t enum
340+
* Disconnect from the network.
341+
* @param wifioff `true` to turn the Wi-Fi radio off.
342+
* @param eraseap `true` to erase the AP configuration from the NVS memory.
343+
* @return `true` when successful.
343344
*/
344345
bool WiFiSTAClass::disconnect(bool wifioff, bool eraseap)
345346
{
@@ -398,8 +399,8 @@ bool WiFiSTAClass::isConnected()
398399
}
399400

400401
/**
401-
* Set the minimum security for AP to be considered connectable
402-
* Must be called before WiFi.begin()
402+
* Set the minimum security for AP to be considered connectable.
403+
* Must be called before WiFi.begin().
403404
* @param minSecurity wifi_auth_mode_t
404405
*/
405406
void WiFiSTAClass::setMinSecurity(wifi_auth_mode_t minSecurity)

0 commit comments

Comments
 (0)