Skip to content

Commit 0da8ecb

Browse files
authoredFeb 20, 2023
Merge branch 'master' into release/v2.x
2 parents 1ca741e + 6d64a3b commit 0da8ecb

File tree

21 files changed

+422
-256
lines changed

21 files changed

+422
-256
lines changed
 

‎libraries/BLE/examples/BLE5_extended_scan/BLE5_extended_scan.ino

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,6 @@
1818
uint32_t scanTime = 100; //In 10ms (1000ms)
1919
BLEScan* pBLEScan;
2020

21-
/**
22-
* @brief extend adv report parameters
23-
*/
24-
//typedef struct {
25-
// esp_ble_gap_adv_type_t event_type; /*!< extend advertising type */
26-
// uint8_t addr_type; /*!< extend advertising address type */
27-
// esp_bd_addr_t addr; /*!< extend advertising address */
28-
// esp_ble_gap_pri_phy_t primary_phy; /*!< extend advertising primary phy */
29-
// esp_ble_gap_phy_t secondly_phy; /*!< extend advertising secondary phy */
30-
// uint8_t sid; /*!< extend advertising sid */
31-
// uint8_t tx_power; /*!< extend advertising tx power */
32-
// int8_t rssi; /*!< extend advertising rssi */
33-
// uint16_t per_adv_interval; /*!< periodic advertising interval */
34-
// uint8_t dir_addr_type; /*!< direct address type */
35-
// esp_bd_addr_t dir_addr; /*!< direct address */
36-
// esp_ble_gap_ext_adv_data_status_t data_status; /*!< data type */
37-
// uint8_t adv_data_len; /*!< extend advertising data length */
38-
// uint8_t adv_data[251]; /*!< extend advertising data */
39-
//} esp_ble_gap_ext_adv_reprot_t;
40-
4121
class MyBLEExtAdvertisingCallbacks: public BLEExtAdvertisingCallbacks {
4222
void onResult(esp_ble_gap_ext_adv_reprot_t report) {
4323
if(report.event_type & ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY){

‎libraries/BLE/examples/BLE5_periodic_sync/BLE5_periodic_sync.ino

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,6 @@ static esp_ble_gap_periodic_adv_sync_params_t periodic_adv_sync_params = {
2525
.sync_timeout = 1000, // timeout: 1000 * 10ms
2626
};
2727

28-
/**
29-
* @brief extend adv report parameters
30-
*/
31-
//typedef struct {
32-
// esp_ble_gap_adv_type_t event_type; /*!< extend advertising type */
33-
// uint8_t addr_type; /*!< extend advertising address type */
34-
// esp_bd_addr_t addr; /*!< extend advertising address */
35-
// esp_ble_gap_pri_phy_t primary_phy; /*!< extend advertising primary phy */
36-
// esp_ble_gap_phy_t secondly_phy; /*!< extend advertising secondary phy */
37-
// uint8_t sid; /*!< extend advertising sid */
38-
// uint8_t tx_power; /*!< extend advertising tx power */
39-
// int8_t rssi; /*!< extend advertising rssi */
40-
// uint16_t per_adv_interval; /*!< periodic advertising interval */
41-
// uint8_t dir_addr_type; /*!< direct address type */
42-
// esp_bd_addr_t dir_addr; /*!< direct address */
43-
// esp_ble_gap_ext_adv_data_status_t data_status; /*!< data type */
44-
// uint8_t adv_data_len; /*!< extend advertising data length */
45-
// uint8_t adv_data[251]; /*!< extend advertising data */
46-
//} esp_ble_gap_ext_adv_reprot_t;
47-
4828
class MyBLEExtAdvertisingCallbacks : public BLEExtAdvertisingCallbacks
4929
{
5030
void onResult(esp_ble_gap_ext_adv_reprot_t params)

‎libraries/BLE/examples/BLE_Beacon_Scanner/BLE_Beacon_Scanner.ino

Lines changed: 50 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
#include <BLEEddystoneTLM.h>
1515
#include <BLEBeacon.h>
1616

17-
#define ENDIAN_CHANGE_U16(x) ((((x)&0xFF00) >> 8) + (((x)&0xFF) << 8))
18-
1917
int scanTime = 5; //In seconds
2018
BLEScan *pBLEScan;
2119

@@ -37,58 +35,66 @@ class MyAdvertisedDeviceCallbacks : public BLEAdvertisedDeviceCallbacks
3735
Serial.println(devUUID.toString().c_str());
3836
Serial.println("");
3937
}
40-
else
38+
39+
if (advertisedDevice.haveManufacturerData() == true)
4140
{
42-
if (advertisedDevice.haveManufacturerData() == true)
43-
{
44-
std::string strManufacturerData = advertisedDevice.getManufacturerData();
41+
std::string strManufacturerData = advertisedDevice.getManufacturerData();
4542

46-
uint8_t cManufacturerData[100];
47-
strManufacturerData.copy((char *)cManufacturerData, strManufacturerData.length(), 0);
43+
uint8_t cManufacturerData[100];
44+
strManufacturerData.copy((char *)cManufacturerData, strManufacturerData.length(), 0);
4845

49-
if (strManufacturerData.length() == 25 && cManufacturerData[0] == 0x4C && cManufacturerData[1] == 0x00)
50-
{
51-
Serial.println("Found an iBeacon!");
52-
BLEBeacon oBeacon = BLEBeacon();
53-
oBeacon.setData(strManufacturerData);
54-
Serial.printf("iBeacon Frame\n");
55-
Serial.printf("ID: %04X Major: %d Minor: %d UUID: %s Power: %d\n", oBeacon.getManufacturerId(), ENDIAN_CHANGE_U16(oBeacon.getMajor()), ENDIAN_CHANGE_U16(oBeacon.getMinor()), oBeacon.getProximityUUID().toString().c_str(), oBeacon.getSignalPower());
56-
}
57-
else
46+
if (strManufacturerData.length() == 25 && cManufacturerData[0] == 0x4C && cManufacturerData[1] == 0x00)
47+
{
48+
Serial.println("Found an iBeacon!");
49+
BLEBeacon oBeacon = BLEBeacon();
50+
oBeacon.setData(strManufacturerData);
51+
Serial.printf("iBeacon Frame\n");
52+
Serial.printf("ID: %04X Major: %d Minor: %d UUID: %s Power: %d\n", oBeacon.getManufacturerId(), ENDIAN_CHANGE_U16(oBeacon.getMajor()), ENDIAN_CHANGE_U16(oBeacon.getMinor()), oBeacon.getProximityUUID().toString().c_str(), oBeacon.getSignalPower());
53+
}
54+
else
55+
{
56+
Serial.println("Found another manufacturers beacon!");
57+
Serial.printf("strManufacturerData: %d ", strManufacturerData.length());
58+
for (int i = 0; i < strManufacturerData.length(); i++)
5859
{
59-
Serial.println("Found another manufacturers beacon!");
60-
Serial.printf("strManufacturerData: %d ", strManufacturerData.length());
61-
for (int i = 0; i < strManufacturerData.length(); i++)
62-
{
63-
Serial.printf("[%X]", cManufacturerData[i]);
64-
}
65-
Serial.printf("\n");
60+
Serial.printf("[%X]", cManufacturerData[i]);
6661
}
62+
Serial.printf("\n");
6763
}
68-
return;
6964
}
7065

7166
uint8_t *payLoad = advertisedDevice.getPayload();
67+
// search for Eddystone Service Data in the advertising payload
68+
// *payload shall point to eddystone data or to its end when not found
69+
const uint8_t serviceDataEddystone[3] = {0x16, 0xAA, 0xFE}; // it has Eddystone BLE UUID
70+
const size_t payLoadLen = advertisedDevice.getPayloadLength();
71+
uint8_t *payLoadEnd = payLoad + payLoadLen - 1; // address of the end of payLoad space
72+
while (payLoad < payLoadEnd) {
73+
if (payLoad[1] == serviceDataEddystone[0] && payLoad[2] == serviceDataEddystone[1] && payLoad[3] == serviceDataEddystone[2]) {
74+
// found!
75+
payLoad += 4;
76+
break;
77+
}
78+
payLoad += *payLoad + 1; // payLoad[0] has the field Length
79+
}
7280

73-
BLEUUID checkUrlUUID = (uint16_t)0xfeaa;
74-
75-
if (advertisedDevice.getServiceUUID().equals(checkUrlUUID))
81+
if (payLoad < payLoadEnd) // Eddystone Service Data and respective BLE UUID were found
7682
{
77-
if (payLoad[11] == 0x10)
83+
if (*payLoad == 0x10)
7884
{
7985
Serial.println("Found an EddystoneURL beacon!");
8086
BLEEddystoneURL foundEddyURL = BLEEddystoneURL();
81-
std::string eddyContent((char *)&payLoad[11]); // incomplete EddystoneURL struct!
82-
83-
foundEddyURL.setData(eddyContent);
87+
uint8_t URLLen = *(payLoad - 4) - 3; // Get Field Length less 3 bytes (type and UUID)
88+
foundEddyURL.setData(std::string((char*)payLoad, URLLen));
8489
std::string bareURL = foundEddyURL.getURL();
8590
if (bareURL[0] == 0x00)
8691
{
87-
size_t payLoadLen = advertisedDevice.getPayloadLength();
92+
// dumps all bytes in advertising payload
8893
Serial.println("DATA-->");
94+
uint8_t *payLoad = advertisedDevice.getPayload();
8995
for (int idx = 0; idx < payLoadLen; idx++)
9096
{
91-
Serial.printf("0x%08X ", payLoad[idx]);
97+
Serial.printf("0x%02X ", payLoad[idx]);
9298
}
9399
Serial.println("\nInvalid Data");
94100
return;
@@ -98,30 +104,19 @@ class MyAdvertisedDeviceCallbacks : public BLEAdvertisedDeviceCallbacks
98104
Serial.printf("Decoded URL: %s\n", foundEddyURL.getDecodedURL().c_str());
99105
Serial.printf("TX power %d\n", foundEddyURL.getPower());
100106
Serial.println("\n");
101-
}
102-
else if (payLoad[11] == 0x20)
107+
}
108+
else if (*payLoad == 0x20)
103109
{
104110
Serial.println("Found an EddystoneTLM beacon!");
105-
BLEEddystoneTLM foundEddyURL = BLEEddystoneTLM();
106-
std::string eddyContent((char *)&payLoad[11]); // incomplete EddystoneURL struct!
107-
108-
eddyContent = "01234567890123";
109-
110-
for (int idx = 0; idx < 14; idx++)
111-
{
112-
eddyContent[idx] = payLoad[idx + 11];
113-
}
114-
115-
foundEddyURL.setData(eddyContent);
116-
Serial.printf("Reported battery voltage: %dmV\n", foundEddyURL.getVolt());
117-
Serial.printf("Reported temperature from TLM class: %.2fC\n", (double)foundEddyURL.getTemp());
118-
int temp = (int)payLoad[16] + (int)(payLoad[15] << 8);
119-
float calcTemp = temp / 256.0f;
120-
Serial.printf("Reported temperature from data: %.2fC\n", calcTemp);
121-
Serial.printf("Reported advertise count: %d\n", foundEddyURL.getCount());
122-
Serial.printf("Reported time since last reboot: %ds\n", foundEddyURL.getTime());
111+
112+
BLEEddystoneTLM eddystoneTLM;
113+
eddystoneTLM.setData(std::string((char*)payLoad, 14));
114+
Serial.printf("Reported battery voltage: %dmV\n", eddystoneTLM.getVolt());
115+
Serial.printf("Reported temperature: %.2f°C (raw data=0x%04X)\n", eddystoneTLM.getTemp(), eddystoneTLM.getRawTemp());
116+
Serial.printf("Reported advertise count: %d\n", eddystoneTLM.getCount());
117+
Serial.printf("Reported time since last reboot: %ds\n", eddystoneTLM.getTime());
123118
Serial.println("\n");
124-
Serial.print(foundEddyURL.toString().c_str());
119+
Serial.print(eddystoneTLM.toString().c_str());
125120
Serial.println("\n");
126121
}
127122
}

‎libraries/BLE/examples/BLE_EddystoneTLM_Beacon/BLE_EddystoneTLM_Beacon.ino

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
5. Stop advertising.
1414
6. deep sleep
1515
16+
To read data advertised by this beacon use second ESP with example sketch BLE_Beacon_Scanner
1617
*/
1718
#include "sys/time.h"
1819

@@ -22,7 +23,7 @@
2223
#include "BLEUtils.h"
2324
#include "BLEBeacon.h"
2425
#include "BLEAdvertising.h"
25-
#include "BLEEddystoneURL.h"
26+
#include "BLEEddystoneTLM.h"
2627

2728
#include "esp_sleep.h"
2829

@@ -48,10 +49,10 @@ void setBeacon()
4849
char beacon_data[25];
4950
uint16_t beconUUID = 0xFEAA;
5051
uint16_t volt = random(2800, 3700); // 3300mV = 3.3V
51-
float tempFloat = random(2000, 3100) / 100.0f;
52-
Serial.printf("Random temperature is %.2fC\n", tempFloat);
53-
int temp = (int)(tempFloat * 256); //(uint16_t)((float)23.00);
54-
Serial.printf("Converted to 8.8 format %0X%0X\n", (temp >> 8), (temp & 0xFF));
52+
float tempFloat = random(-3000, 3000) / 100.0f;
53+
Serial.printf("Random temperature is %.2f°C\n", tempFloat);
54+
int temp = (int)(tempFloat * 256);
55+
Serial.printf("Converted to 8.8 format %0X%0X\n", (temp >> 8) & 0xFF, (temp & 0xFF));
5556

5657
BLEAdvertisementData oAdvertisementData = BLEAdvertisementData();
5758
BLEAdvertisementData oScanResponseData = BLEAdvertisementData();
@@ -82,13 +83,11 @@ void setBeacon()
8283

8384
void setup()
8485
{
85-
8686
Serial.begin(115200);
8787
gettimeofday(&nowTimeStruct, NULL);
8888

89-
Serial.printf("start ESP32 %d\n", bootcount++);
90-
91-
Serial.printf("deep sleep (%lds since last reset, %lds since last boot)\n", nowTimeStruct.tv_sec, nowTimeStruct.tv_sec - last);
89+
Serial.printf("Starting ESP32. Bootcount = %d\n", bootcount++);
90+
Serial.printf("Deep sleep (%lds since last reset, %lds since last boot)\n", nowTimeStruct.tv_sec, nowTimeStruct.tv_sec - last);
9291

9392
last = nowTimeStruct.tv_sec;
9493
lastTenth = nowTimeStruct.tv_sec * 10; // Time since last reset as 0.1 second resolution counter
@@ -103,12 +102,11 @@ void setup()
103102
setBeacon();
104103
// Start advertising
105104
pAdvertising->start();
106-
Serial.println("Advertizing started for 10s ...");
105+
Serial.println("Advertising started for 10s ...");
107106
delay(10000);
108107
pAdvertising->stop();
109-
Serial.printf("enter deep sleep for 10s\n");
108+
Serial.printf("Enter deep sleep for 10s\n");
110109
esp_deep_sleep(1000000LL * GPIO_DEEP_SLEEP_DURATION);
111-
Serial.printf("in deep sleep\n");
112110
}
113111

114112
void loop()

‎libraries/BLE/src/BLEBeacon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ uint16_t BLEBeacon::getMinor() {
4040
}
4141

4242
BLEUUID BLEBeacon::getProximityUUID() {
43-
return BLEUUID(m_beaconData.proximityUUID, 16, false);
43+
return BLEUUID(m_beaconData.proximityUUID, 16, true);
4444
}
4545

4646
int8_t BLEBeacon::getSignalPower() {

‎libraries/BLE/src/BLEEddystoneTLM.cpp

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
#include "BLEEddystoneTLM.h"
1818

1919
static const char LOG_TAG[] = "BLEEddystoneTLM";
20-
#define ENDIAN_CHANGE_U16(x) ((((x)&0xFF00)>>8) + (((x)&0xFF)<<8))
21-
#define ENDIAN_CHANGE_U32(x) ((((x)&0xFF000000)>>24) + (((x)&0x00FF0000)>>8)) + ((((x)&0xFF00)<<8) + (((x)&0xFF)<<24))
2220

2321
BLEEddystoneTLM::BLEEddystoneTLM() {
2422
beaconUUID = 0xFEAA;
@@ -47,9 +45,13 @@ uint16_t BLEEddystoneTLM::getVolt() {
4745
} // getVolt
4846

4947
float BLEEddystoneTLM::getTemp() {
50-
return ENDIAN_CHANGE_U16(m_eddystoneData.temp) / 256.0f;
48+
return EDDYSTONE_TEMP_U16_TO_FLOAT(m_eddystoneData.temp);
5149
} // getTemp
5250

51+
uint16_t BLEEddystoneTLM::getRawTemp() {
52+
return ENDIAN_CHANGE_U16(m_eddystoneData.temp);
53+
} // getRawTemp
54+
5355
uint32_t BLEEddystoneTLM::getCount() {
5456
return ENDIAN_CHANGE_U32(m_eddystoneData.advCount);
5557
} // getCount
@@ -73,7 +75,7 @@ std::string BLEEddystoneTLM::toString() {
7375
out += " mV\n";
7476

7577
out += "Temperature ";
76-
snprintf(val, sizeof(val), "%.2f", ENDIAN_CHANGE_U16(m_eddystoneData.temp) / 256.0f);
78+
snprintf(val, sizeof(val), "%.2f", ((int16_t)ENDIAN_CHANGE_U16(m_eddystoneData.temp)) / 256.0f);
7779
out += val;
7880
out += " C\n";
7981

@@ -110,6 +112,21 @@ std::string BLEEddystoneTLM::toString() {
110112

111113
/**
112114
* Set the raw data for the beacon record.
115+
* Example:
116+
* uint8_t *payLoad = advertisedDevice.getPayload();
117+
* eddystoneTLM.setData(std::string((char*)payLoad+22, advertisedDevice.getPayloadLength() - 22));
118+
* Note: the offset 22 works for current implementation of example BLE_EddystoneTLM Beacon.ino, however it is not static and will be reimplemented
119+
* Data frame:
120+
* | Field || Len | Type | UUID | EddyStone TLM |
121+
* | Offset || 0 | 1 | 2 | 4 |
122+
* | Len || 1 B | 1 B | 2 B | 14 B |
123+
* | Data || ?? | ?? | 0xAA | 0xFE | ??? |
124+
*
125+
* EddyStone TLM frame:
126+
* | Field || Type | Version | Batt mV | Beacon temp | Cnt since boot | Time since boot |
127+
* | Offset || 0 | 1 | 2 | 4 | 6 | 10 |
128+
* | Len || 1 B | 1 B | 2 B | 2 B | 4 B | 4 B |
129+
* | Data || 0x20 | ?? | ?? | ?? | ?? | ?? | | | | | | | | |
113130
*/
114131
void BLEEddystoneTLM::setData(std::string data) {
115132
if (data.length() != sizeof(m_eddystoneData)) {
@@ -132,7 +149,7 @@ void BLEEddystoneTLM::setVolt(uint16_t volt) {
132149
} // setVolt
133150

134151
void BLEEddystoneTLM::setTemp(float temp) {
135-
m_eddystoneData.temp = (uint16_t)temp;
152+
m_eddystoneData.temp = EDDYSTONE_TEMP_FLOAT_TO_U16(temp);
136153
} // setTemp
137154

138155
void BLEEddystoneTLM::setCount(uint32_t advCount) {

‎libraries/BLE/src/BLEEddystoneTLM.h

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#include "BLEUUID.h"
1111

1212
#define EDDYSTONE_TLM_FRAME_TYPE 0x20
13+
#define ENDIAN_CHANGE_U16(x) ((((x)&0xFF00)>>8) + (((x)&0xFF)<<8))
14+
#define ENDIAN_CHANGE_U32(x) ((((x)&0xFF000000)>>24) + (((x)&0x00FF0000)>>8)) + ((((x)&0xFF00)<<8) + (((x)&0xFF)<<24))
15+
#define EDDYSTONE_TEMP_U16_TO_FLOAT(tempU16) (((int16_t)ENDIAN_CHANGE_U16(tempU16)) / 256.0f)
16+
#define EDDYSTONE_TEMP_FLOAT_TO_U16(tempFloat) (ENDIAN_CHANGE_U16(((int)((tempFloat) * 256))))
1317

1418
/**
1519
* @brief Representation of a beacon.
@@ -18,33 +22,34 @@
1822
*/
1923
class BLEEddystoneTLM {
2024
public:
21-
BLEEddystoneTLM();
22-
std::string getData();
23-
BLEUUID getUUID();
24-
uint8_t getVersion();
25-
uint16_t getVolt();
26-
float getTemp();
27-
uint32_t getCount();
28-
uint32_t getTime();
29-
std::string toString();
30-
void setData(std::string data);
31-
void setUUID(BLEUUID l_uuid);
32-
void setVersion(uint8_t version);
33-
void setVolt(uint16_t volt);
34-
void setTemp(float temp);
35-
void setCount(uint32_t advCount);
36-
void setTime(uint32_t tmil);
25+
BLEEddystoneTLM();
26+
std::string getData();
27+
BLEUUID getUUID();
28+
uint8_t getVersion();
29+
uint16_t getVolt();
30+
float getTemp();
31+
uint16_t getRawTemp();
32+
uint32_t getCount();
33+
uint32_t getTime();
34+
std::string toString();
35+
void setData(std::string data);
36+
void setUUID(BLEUUID l_uuid);
37+
void setVersion(uint8_t version);
38+
void setVolt(uint16_t volt);
39+
void setTemp(float temp);
40+
void setCount(uint32_t advCount);
41+
void setTime(uint32_t tmil);
3742

3843
private:
39-
uint16_t beaconUUID;
40-
struct {
41-
uint8_t frameType;
42-
uint8_t version;
43-
uint16_t volt;
44-
uint16_t temp;
45-
uint32_t advCount;
46-
uint32_t tmil;
47-
} __attribute__((packed)) m_eddystoneData;
44+
uint16_t beaconUUID;
45+
struct {
46+
uint8_t frameType;
47+
uint8_t version;
48+
uint16_t volt;
49+
uint16_t temp;
50+
uint32_t advCount;
51+
uint32_t tmil;
52+
} __attribute__((packed)) m_eddystoneData;
4853

4954
}; // BLEEddystoneTLM
5055

‎libraries/BLE/src/BLEEddystoneURL.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class BLEEddystoneURL {
3535
struct {
3636
uint8_t frameType;
3737
int8_t advertisedTxPower;
38-
uint8_t url[16];
38+
uint8_t url[18]; // 18 bytes: 1 byte for URL scheme + up to 17 bytes of URL
3939
} __attribute__((packed)) m_eddystoneData;
4040

4141
}; // BLEEddystoneURL

‎libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
#include "BluetoothSerial.h"
88

9+
//#define USE_PIN // Uncomment this to use PIN during pairing. The pin is specified on the line below
10+
const char *pin = "1234"; // Change this to more secure PIN.
11+
12+
String device_name = "ESP32-BT-Slave";
13+
914
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
1015
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
1116
#endif
@@ -18,8 +23,13 @@ BluetoothSerial SerialBT;
1823

1924
void setup() {
2025
Serial.begin(115200);
21-
SerialBT.begin("ESP32test"); //Bluetooth device name
22-
Serial.println("The device started, now you can pair it with bluetooth!");
26+
SerialBT.begin(device_name); //Bluetooth device name
27+
Serial.printf("The device with name \"%s\" is started.\nNow you can pair it with Bluetooth!\n", device_name.c_str());
28+
//Serial.printf("The device with name \"%s\" and MAC address %s is started.\nNow you can pair it with Bluetooth!\n", device_name.c_str(), SerialBT.getMacString()); // Use this after the MAC method is implemented
29+
#ifdef USE_PIN
30+
SerialBT.setPin(pin);
31+
Serial.println("Using PIN");
32+
#endif
2333
}
2434

2535
void loop() {

‎libraries/BluetoothSerial/examples/SerialToSerialBTM/SerialToSerialBTM.ino

Lines changed: 56 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,81 @@
1-
//This example code is in the Public Domain (or CC0 licensed, at your option.)
2-
//By Victor Tchistiak - 2019
1+
// This example code is in the Public Domain (or CC0 licensed, at your option.)
2+
// By Victor Tchistiak - 2019
33
//
4-
//This example demostrates master mode bluetooth connection and pin
5-
//it creates a bridge between Serial and Classical Bluetooth (SPP)
6-
//this is an extention of the SerialToSerialBT example by Evandro Copercini - 2018
4+
// This example demonstrates master mode Bluetooth connection to a slave BT device using PIN (password)
5+
// defined either by String "slaveName" by default "OBDII" or by MAC address
76
//
7+
// This example creates a bridge between Serial and Classical Bluetooth (SPP)
8+
// This is an extension of the SerialToSerialBT example by Evandro Copercini - 2018
9+
//
10+
// DO NOT try to connect to phone or laptop - they are master
11+
// devices, same as the ESP using this code - it will NOT work!
12+
//
13+
// You can try to flash a second ESP32 with the example SerialToSerialBT - it should
14+
// automatically pair with ESP32 running this code
815

916
#include "BluetoothSerial.h"
1017

18+
#define USE_NAME // Comment this to use MAC address instead of a slaveName
19+
const char *pin = "1234"; // Change this to reflect the pin expected by the real slave BT device
20+
1121
#if !defined(CONFIG_BT_SPP_ENABLED)
1222
#error Serial Bluetooth not available or not enabled. It is only available for the ESP32 chip.
1323
#endif
1424

1525
BluetoothSerial SerialBT;
1626

17-
String MACadd = "AA:BB:CC:11:22:33";
18-
uint8_t address[6] = {0xAA, 0xBB, 0xCC, 0x11, 0x22, 0x33};
19-
//uint8_t address[6] = {0x00, 0x1D, 0xA5, 0x02, 0xC3, 0x22};
20-
String name = "OBDII";
21-
const char *pin = "1234"; //<- standard pin would be provided by default
22-
bool connected;
27+
#ifdef USE_NAME
28+
String slaveName = "ESP32-BT-Slave"; // Change this to reflect the real name of your slave BT device
29+
#else
30+
String MACadd = "AA:BB:CC:11:22:33"; // This only for printing
31+
uint8_t address[6] = {0xAA, 0xBB, 0xCC, 0x11, 0x22, 0x33}; // Change this to reflect real MAC address of your slave BT device
32+
#endif
33+
34+
String myName = "ESP32-BT-Master";
2335

2436
void setup() {
37+
bool connected;
2538
Serial.begin(115200);
26-
//SerialBT.setPin(pin);
27-
SerialBT.begin("ESP32test", true);
28-
//SerialBT.setPin(pin);
29-
Serial.println("The device started in master mode, make sure remote BT device is on!");
30-
31-
// connect(address) is fast (upto 10 secs max), connect(name) is slow (upto 30 secs max) as it needs
32-
// to resolve name to address first, but it allows to connect to different devices with the same name.
33-
// Set CoreDebugLevel to Info to view devices bluetooth address and device names
34-
connected = SerialBT.connect(name);
35-
//connected = SerialBT.connect(address);
36-
39+
40+
SerialBT.begin(myName, true);
41+
Serial.printf("The device \"%s\" started in master mode, make sure slave BT device is on!\n", myName.c_str());
42+
43+
#ifndef USE_NAME
44+
SerialBT.setPin(pin);
45+
Serial.println("Using PIN");
46+
#endif
47+
48+
// connect(address) is fast (up to 10 secs max), connect(slaveName) is slow (up to 30 secs max) as it needs
49+
// to resolve slaveName to address first, but it allows to connect to different devices with the same name.
50+
// Set CoreDebugLevel to Info to view devices Bluetooth address and device names
51+
#ifdef USE_NAME
52+
connected = SerialBT.connect(slaveName);
53+
Serial.printf("Connecting to slave BT device named \"%s\"\n", slaveName.c_str());
54+
#else
55+
connected = SerialBT.connect(address);
56+
Serial.print("Connecting to slave BT device with MAC "); Serial.println(MACadd);
57+
#endif
58+
3759
if(connected) {
38-
Serial.println("Connected Succesfully!");
60+
Serial.println("Connected Successfully!");
3961
} else {
4062
while(!SerialBT.connected(10000)) {
41-
Serial.println("Failed to connect. Make sure remote device is available and in range, then restart app.");
63+
Serial.println("Failed to connect. Make sure remote device is available and in range, then restart app.");
4264
}
4365
}
44-
// disconnect() may take upto 10 secs max
66+
// Disconnect() may take up to 10 secs max
4567
if (SerialBT.disconnect()) {
46-
Serial.println("Disconnected Succesfully!");
68+
Serial.println("Disconnected Successfully!");
4769
}
48-
// this would reconnect to the name(will use address, if resolved) or address used with connect(name/address).
70+
// This would reconnect to the slaveName(will use address, if resolved) or address used with connect(slaveName/address).
4971
SerialBT.connect();
72+
if(connected) {
73+
Serial.println("Reconnected Successfully!");
74+
} else {
75+
while(!SerialBT.connected(10000)) {
76+
Serial.println("Failed to reconnect. Make sure remote device is available and in range, then restart app.");
77+
}
78+
}
5079
}
5180

5281
void loop() {

‎libraries/ESP32/examples/GPIO/FunctionalInterrupt/FunctionalInterrupt.ino

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,28 @@
77
class Button
88
{
99
public:
10-
Button(uint8_t reqPin) : PIN(reqPin){
11-
pinMode(PIN, INPUT_PULLUP);
12-
attachInterrupt(PIN, std::bind(&Button::isr,this), FALLING);
13-
};
14-
~Button() {
15-
detachInterrupt(PIN);
16-
}
17-
18-
void ARDUINO_ISR_ATTR isr() {
19-
numberKeyPresses += 1;
20-
pressed = true;
21-
}
22-
23-
void checkPressed() {
24-
if (pressed) {
25-
Serial.printf("Button on pin %u has been pressed %u times\n", PIN, numberKeyPresses);
26-
pressed = false;
27-
}
28-
}
10+
Button(uint8_t reqPin) : PIN(reqPin){
11+
pinMode(PIN, INPUT_PULLUP);
12+
attachInterrupt(PIN, std::bind(&Button::isr,this), FALLING);
13+
};
14+
~Button() {
15+
detachInterrupt(PIN);
16+
}
17+
18+
void ARDUINO_ISR_ATTR isr() {
19+
numberKeyPresses += 1;
20+
pressed = true;
21+
}
22+
23+
void checkPressed() {
24+
if (pressed) {
25+
Serial.printf("Button on pin %u has been pressed %u times\n", PIN, numberKeyPresses);
26+
pressed = false;
27+
}
28+
}
2929

3030
private:
31-
const uint8_t PIN;
31+
const uint8_t PIN;
3232
volatile uint32_t numberKeyPresses;
3333
volatile bool pressed;
3434
};
@@ -42,6 +42,6 @@ void setup() {
4242
}
4343

4444
void loop() {
45-
button1.checkPressed();
46-
button2.checkPressed();
45+
button1.checkPressed();
46+
button2.checkPressed();
4747
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#include <Arduino.h>
2+
3+
#define BUTTON1 16
4+
#define BUTTON2 17
5+
6+
struct Button {
7+
uint8_t PIN;
8+
volatile uint32_t numberKeyPresses;
9+
volatile int pressed;
10+
};
11+
12+
void isr(void* param) {
13+
struct Button *button = (struct Button*) param;
14+
button->numberKeyPresses += 1;
15+
button->pressed = 1;
16+
}
17+
18+
void checkPressed(struct Button* button) {
19+
if(button->pressed) {
20+
Serial.printf("Button on pin %u has been pressed %u times\n", button->PIN, button->numberKeyPresses);
21+
button->pressed = 0;
22+
}
23+
}
24+
25+
struct Button button1 = {BUTTON1, 0, 0};
26+
struct Button button2 = {BUTTON2, 0, 0};
27+
28+
void setup() {
29+
Serial.begin(115200);
30+
pinMode(button1.PIN, INPUT_PULLUP);
31+
pinMode(button2.PIN, INPUT_PULLUP);
32+
attachInterruptArg(button1.PIN, isr, (void*)&button1, FALLING);
33+
attachInterruptArg(button2.PIN, isr, (void*)&button2, FALLING);
34+
}
35+
36+
void loop() {
37+
checkPressed(&button1);
38+
checkPressed(&button2);
39+
}

‎libraries/WebServer/examples/MultiHomedServers/MultiHomedServers.ino

Lines changed: 22 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -3,62 +3,17 @@
33
#include <WebServer.h>
44
#include <ESPmDNS.h>
55

6-
/*
7-
* MultiHomedServers
8-
*
9-
* MultiHomedServers tests support for multi-homed servers, i.e. a distinct web servers on each IP interface.
10-
* It only tests the case n=2 because on a basic ESP32 device, we only have two IP interfaces, namely
11-
* the WiFi station interfaces and the WiFi soft AP interface.
12-
*
13-
* For this to work, the WebServer and the WiFiServer classes must correctly handle the case where an
14-
* IP address is passed to their relevant constructor. It also requires WebServer to work with multiple,
15-
* simultaneous instances.
16-
*
17-
* Testing the WebServer and the WiFiServer constructors was the primary purpose of this script.
18-
* The part of WebServer used by this sketch does seem to work with multiple, simultaneous instances.
19-
* However there is much functionality in WebServer that is not tested here. It may all be well, but
20-
* that is not proven here.
21-
*
22-
* This sketch starts the mDNS server, as did HelloServer, and it resolves esp32.local on both interfaces,
23-
* but was not otherwise tested.
24-
*
25-
* This script also tests that a server not bound to a specific IP address still works.
26-
*
27-
* We create three, simultaneous web servers, one specific to each interface and one that listens on both:
28-
*
29-
* name IP Address Port
30-
* ---- ---------- ----
31-
* server0 INADDR_ANY 8080
32-
* server1 station address 8081
33-
* server2 soft AP address 8081
34-
*
35-
* The expected responses to a brower's requests are as follows:
36-
*
37-
* 1. when client connected to the same WLAN as the station:
38-
* Request URL Response
39-
* ----------- --------
40-
* http://stationaddress:8080 "hello from server0"
41-
* http://stationaddress:8081 "hello from server1"
42-
*
43-
* 2. when client is connected to the soft AP:
44-
*
45-
* Request URL Response
46-
* ----------- --------
47-
* http://softAPaddress:8080 "hello from server0"
48-
* http://softAPaddress:8081 "hello from server2"
49-
*
50-
* 3. Repeat 1 and 2 above with esp32.local in place of stationaddress and softAPaddress, respectively.
51-
*
52-
* MultiHomedServers was originally based on HelloServer.
53-
*/
54-
55-
const char* ssid = "........";
56-
const char* password = "........";
6+
const char* ssid = "WiFi_SSID";
7+
const char* password = "WiFi_Password";
578
const char *apssid = "ESP32";
589

5910
WebServer *server0, *server1, *server2;
6011

12+
#ifdef LED_BUILTIN
13+
const int led = LED_BUILTIN;
14+
#else
6115
const int led = 13;
16+
#endif
6217

6318
void handleRoot(WebServer *server, const char *content) {
6419
digitalWrite(led, 1);
@@ -67,15 +22,15 @@ void handleRoot(WebServer *server, const char *content) {
6722
}
6823

6924
void handleRoot0() {
70-
handleRoot(server0, "hello from server0");
25+
handleRoot(server0, "Hello from server0 who listens on both WLAN and own Soft AP");
7126
}
7227

7328
void handleRoot1() {
74-
handleRoot(server1, "hello from server1");
29+
handleRoot(server1, "Hello from server1 who listens only on WLAN");
7530
}
7631

7732
void handleRoot2() {
78-
handleRoot(server2, "hello from server2");
33+
handleRoot(server2, "Hello from server2 who listens only on own Soft AP");
7934
}
8035

8136
void handleNotFound(WebServer *server) {
@@ -111,19 +66,22 @@ void setup(void) {
11166
pinMode(led, OUTPUT);
11267
digitalWrite(led, 0);
11368
Serial.begin(115200);
69+
while(!Serial){ delay(100); }
70+
Serial.println("Multi-homed Servers example starting");
71+
delay(1000);
11472
WiFi.mode(WIFI_STA);
11573
WiFi.begin(ssid, password);
116-
Serial.println("");
74+
Serial.print("Connecting ");
11775

11876
// Wait for connection
11977
while (WiFi.status() != WL_CONNECTED) {
12078
delay(500);
12179
Serial.print(".");
12280
}
12381
Serial.println("");
124-
Serial.print("Connected to ");
125-
Serial.println(ssid);
126-
Serial.print("IP address: ");
82+
Serial.print("Connected to \"");
83+
Serial.print(ssid);
84+
Serial.print("\", IP address: \"");
12785
Serial.println(WiFi.localIP());
12886
if (!WiFi.softAP(apssid)) {
12987
Serial.println("failed to start softAP");
@@ -134,9 +92,9 @@ void setup(void) {
13492
delay(100);
13593
}
13694
}
137-
Serial.print("Soft AP: ");
95+
Serial.print("Soft AP SSID: \"");
13896
Serial.print(apssid);
139-
Serial.print(" IP address: ");
97+
Serial.print("\", IP address: ");
14098
Serial.println(WiFi.softAPIP());
14199

142100
if (MDNS.begin("esp32")) {
@@ -161,6 +119,10 @@ void setup(void) {
161119
Serial.println("HTTP server1 started");
162120
server2->begin();
163121
Serial.println("HTTP server2 started");
122+
123+
Serial.printf("SSID: %s\n\thttp://", ssid); Serial.print(WiFi.localIP()); Serial.print(":8080\n\thttp://"); Serial.print(WiFi.localIP()); Serial.println(":8081");
124+
Serial.printf("SSID: %s\n\thttp://", apssid); Serial.print(WiFi.softAPIP()); Serial.print(":8080\n\thttp://"); Serial.print(WiFi.softAPIP()); Serial.println(":8081");
125+
Serial.printf("Any of the above SSIDs\n\thttp://esp32.local:8080\n\thttp://esp32.local:8081\n");
164126
}
165127

166128
void loop(void) {
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Multi Homed Servers
2+
3+
This example tests support for multi-homed servers, i.e. a distinct web servers on distinct IP interface.
4+
5+
It only tests the case n=2 because on a basic ESP32 device, we only have two IP interfaces, namely the WiFi station interfaces and the WiFi soft AP interface.
6+
For this to work, the WebServer and the WiFiServer classes must correctly handle the case where an IP address is passed to their relevant constructor.
7+
It also requires WebServer to work with multiple, simultaneous instances.
8+
9+
Testing the WebServer and the WiFiServer constructors was the primary purpose of this script.
10+
The part of WebServer used by this sketch does seem to work with multiple, simultaneous instances.
11+
However there is much functionality in WebServer that is not tested here. It may all be well, but that is not proven here.
12+
13+
This sketch starts the mDNS server, as did HelloServer, and it resolves esp32.local on both interfaces, but was not otherwise tested.
14+
This script also tests that a server not bound to a specific IP address still works.
15+
16+
We create three, simultaneous web servers, one specific to each interface and one that listens on both:
17+
18+
| name | IP Address | Port |
19+
| ---- | ---------- | ---- |
20+
| server0 | INADDR_ANY | 8080 |
21+
| server1 | station address | 8081 |
22+
| server2 | soft AP address | 8081 |
23+
24+
The expected responses to a browser's requests are as follows:
25+
26+
#### 1. The Client connected to the same WLAN as the station:
27+
28+
| Request URL | Response |
29+
| ----------- | -------- |
30+
| [http://stationaddress:8080](http://stationaddress:8080) | Hello from server0 who listens on both WLAN and own Soft AP |
31+
| [http://stationaddress:8081](http://stationaddress:8081) | Hello from server1 who listens only on WLAN |
32+
33+
#### 2. The Client is connected to the soft AP:
34+
35+
| Request URL | Response |
36+
| ----------- | -------- |
37+
| [http://softAPaddress:8080](http://softAPaddress:8080) | Hello from server0 who listens on both WLAN and own Soft AP |
38+
| [http://softAPaddress:8081](http://softAPaddress:8081) | Hello from server2 who listens only on own Soft AP |
39+
40+
#### 3. The Client is connect to either WLAN or SoftAP:
41+
42+
| Request URL | Response |
43+
| ----------- | -------- |
44+
| [http://esp32.local:8080](http://esp32.local:8080) | Hello from server0 who listens on both WLAN and own Soft AP |
45+
| [http://esp32.local:8081](http://esp32.local:8081) | Hello from server1 who listens only on WLAN |
46+
47+
MultiHomedServers was originally based on HelloServer.
48+
49+
# Supported Targets
50+
51+
Currently, this example supports the following targets.
52+
53+
| Supported Targets | ESP32 | ESP32-S2 | ESP32-C3 | ESP32-S3 |
54+
| ----------------- | ----- | -------- | -------- | -------- |
55+
56+
## How to Use Example
57+
58+
Change the SSID and password in the example to your WiFi and flash the example.
59+
Open a serial terminal and the example will write the exact addresses with used IP addresses you can use to test the servers.
60+
61+
* How to install the Arduino IDE: [Install Arduino IDE](https://github.com/espressif/arduino-esp32/tree/master/docs/arduino-ide).
62+
63+
#### Using Arduino IDE
64+
65+
To get more information about the Espressif boards see [Espressif Development Kits](https://www.espressif.com/en/products/devkits).
66+
67+
* Before Compile/Verify, select the correct board: `Tools -> Board`.
68+
* Select the COM port: `Tools -> Port: xxx` where the `xxx` is the detected COM port.
69+
70+
#### Using Platform IO
71+
72+
* Select the COM port: `Devices` or set the `upload_port` option on the `platformio.ini` file.
73+
74+
## Example Log Output
75+
76+
```
77+
Multi-homed Servers example starting
78+
Connecting ...
79+
Connected to "WiFi_SSID", IP address: "192.168.42.24
80+
Soft AP SSID: "ESP32", IP address: 192.168.4.1
81+
MDNS responder started
82+
SSID: WiFi_SSID
83+
http://192.168.42.24:8080
84+
http://192.168.42.24:8081
85+
SSID: ESP32
86+
http://192.168.4.1:8080
87+
http://192.168.4.1:8081
88+
Any of the above SSIDs
89+
http://esp32.local:8080
90+
http://esp32.local:8081
91+
HTTP server0 started
92+
HTTP server1 started
93+
HTTP server2 started
94+
```
95+
96+
## Known issues
97+
98+
`http://esp32.local` Does not work on some Android phones
99+
100+
## Troubleshooting
101+
102+
***Important: Make sure you are using a good quality USB cable and that you have a reliable power source***
103+
104+
## Contribute
105+
106+
To know how to contribute to this project, see [How to contribute.](https://github.com/espressif/arduino-esp32/blob/master/CONTRIBUTING.rst)
107+
108+
If you have any **feedback** or **issue** to report on this example/library, please open an issue or fix it by creating a new PR. Contributions are more than welcome!
109+
110+
Before creating a new issue, be sure to try Troubleshooting and check if the same issue was already created by someone else.
111+
112+
## Resources
113+
114+
* Official ESP32 Forum: [Link](https://esp32.com)
115+
* Arduino-ESP32 Official Repository: [espressif/arduino-esp32](https://github.com/espressif/arduino-esp32)
116+
* ESP32 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf)
117+
* ESP32-S2 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf)
118+
* ESP32-C3 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf)
119+
* Official ESP-IDF documentation: [ESP-IDF](https://idf.espressif.com)

‎libraries/WiFi/src/WiFiUdp.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
License along with this library; if not, write to the Free Software
1717
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
19+
1920
#include "WiFiUdp.h"
21+
#include <new> //std::nothrow
2022
#include <lwip/sockets.h>
2123
#include <lwip/netdb.h>
2224
#include <errno.h>
@@ -207,12 +209,12 @@ int WiFiUDP::parsePacket(){
207209
return 0;
208210
struct sockaddr_in si_other;
209211
int slen = sizeof(si_other) , len;
210-
char * buf = new char[1460];
211-
if(!buf){
212+
char *buf = (char *)malloc(1460);
213+
if(!buf) {
212214
return 0;
213215
}
214216
if ((len = recvfrom(udp_server, buf, 1460, MSG_DONTWAIT, (struct sockaddr *) &si_other, (socklen_t *)&slen)) == -1){
215-
delete[] buf;
217+
free(buf);
216218
if(errno == EWOULDBLOCK){
217219
return 0;
218220
}
@@ -222,10 +224,10 @@ int WiFiUDP::parsePacket(){
222224
remote_ip = IPAddress(si_other.sin_addr.s_addr);
223225
remote_port = ntohs(si_other.sin_port);
224226
if (len > 0) {
225-
rx_buffer = new cbuf(len);
227+
rx_buffer = new(std::nothrow) cbuf(len);
226228
rx_buffer->write(buf, len);
227229
}
228-
delete[] buf;
230+
free(buf);
229231
return len;
230232
}
231233

‎libraries/WiFiClientSecure/README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,28 @@ For example, this is used with AWS IoT Custom Authorizers where an MQTT client m
106106
const char *aws_protos[] = {"mqtt", NULL};
107107
...
108108
wiFiClient.setAlpnProtocols(aws_protos);
109-
```
109+
```
110+
111+
Examples
112+
--------
113+
#### WiFiClientInsecure
114+
Demonstrates usage of insecure connection using `WiFiClientSecure::setInsecure()`
115+
#### WiFiClientPSK
116+
Wifi secure connection example for ESP32 using a pre-shared key (PSK)
117+
This is useful with MQTT servers instead of using a self-signed cert, tested with mosquitto.
118+
Running on TLS 1.2 using mbedTLS
119+
#### WiFiClientSecure
120+
Wifi secure connection example for ESP32
121+
Running on TLS 1.2 using mbedTLS
122+
#### WiFiClientSecureEnterprise
123+
This example demonstrates a secure connection to a WiFi network using WPA/WPA2 Enterprise (for example eduroam),
124+
and establishing a secure HTTPS connection with an external server (for example arduino.php5.sk) using the defined anonymous identity, user identity, and password.
125+
126+
.. note::
127+
This example is outdated and might not work. For more examples see [https://github.com/martinius96/ESP32-eduroam](https://github.com/martinius96/ESP32-eduroam)
128+
129+
#### WiFiClientShowPeerCredentials
130+
Example of a establishing a secure connection and then showing the fingerprint of the certificate.
131+
This can be useful in an IoT setting to know for sure that you are connecting to the right server.
132+
Especially in situations where you cannot hardcode a trusted root certificate for long
133+
periods of time (as they tend to get replaced more often than the lifecycle of IoT hardware).

‎libraries/WiFiClientSecure/examples/WiFiClientSecureEnterprise/WiFiClientSecureEnterprise.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
/*|Supported methods: PEAP + MsCHAPv2, EAP-TTLS + MsCHAPv2 |*/
88
/*|-----------------------------------------------------------|*/
99

10+
// This example demonstrates a secure connection to a WiFi network using WPA/WPA2 Enterprise (for example eduroam),
11+
// and establishing a secure HTTPS connection with an external server (for example arduino.php5.sk) using the defined anonymous identity, user identity, and password.
12+
13+
// Note: this example is outdated and may not work!
14+
// For more examples see https://github.com/martinius96/ESP32-eduroam
15+
1016
#include <WiFi.h>
1117
#include <WiFiClientSecure.h>
1218
#include "esp_wpa2.h"

0 commit comments

Comments
 (0)
Please sign in to comment.