-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Labels
Area: Lib BuilderDepends on Lib BuilderDepends on Lib BuilderChip: ESP32-C3Issue is related to support of ESP32-C3 ChipIssue is related to support of ESP32-C3 ChipStatus: SolvedThe issue has been resolved and requires no further action.The issue has been resolved and requires no further action.
Milestone
Description
Board
ESP32-C3
Device Description
ESP32-C3
Hardware Configuration
no
Version
v2.0.2
IDE Name
Arduino IDE
Operating System
Ubuntu 20.04
Flash frequency
80Mhz
PSRAM enabled
no
Upload speed
115200
Description
Compiling ESP32 BLE Arduino library by nkolban requires the C++ Exceptions compiler option to be enabled.
Sketch
/*
Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleServer.cpp
Ported to Arduino ESP32 by Evandro Copercini
updates by chegewara
*/
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
// See the following for generating UUIDs:
// https://www.uuidgenerator.net/
#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8"
void setup() {
Serial.begin(115200);
Serial.println("Starting BLE work!");
BLEDevice::init("Long name works now");
BLEServer *pServer = BLEDevice::createServer();
BLEService *pService = pServer->createService(SERVICE_UUID);
BLECharacteristic *pCharacteristic = pService->createCharacteristic(
CHARACTERISTIC_UUID,
BLECharacteristic::PROPERTY_READ |
BLECharacteristic::PROPERTY_WRITE
);
pCharacteristic->setValue("Hello World says Neil");
pService->start();
// BLEAdvertising *pAdvertising = pServer->getAdvertising(); // this still is working for backward compatibility
BLEAdvertising *pAdvertising = BLEDevice::getAdvertising();
pAdvertising->addServiceUUID(SERVICE_UUID);
pAdvertising->setScanResponse(true);
pAdvertising->setMinPreferred(0x06); // functions that help with iPhone connections issue
pAdvertising->setMinPreferred(0x12);
BLEDevice::startAdvertising();
Serial.println("Characteristic defined! Now you can read it in your phone!");
}
void loop() {
// put your main code here, to run repeatedly:
delay(2000);
}
Debug Message
#error "C++ exception handling must be enabled within make menuconfig. See Compiler Options > Enable C++ Exceptions."
Other Steps to Reproduce
Enabling option in the sdkconfig file does not solve the problem
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.
Metadata
Metadata
Assignees
Labels
Area: Lib BuilderDepends on Lib BuilderDepends on Lib BuilderChip: ESP32-C3Issue is related to support of ESP32-C3 ChipIssue is related to support of ESP32-C3 ChipStatus: SolvedThe issue has been resolved and requires no further action.The issue has been resolved and requires no further action.
Type
Projects
Status
Done