Skip to content
Branch: master
Find file History
Latest commit e7e2653 May 1, 2019
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
BLEXML Common code style Oct 14, 2018
DesignNotes Changes for #337 Jan 1, 2018
tests Fix missing return Feb 8, 2019
.gitignore Sync update 2017-09-10 Sep 10, 2017
AWS.cpp Sync Aug 6, 2018
AWS.h Sync Aug 6, 2018
Apa102.cpp Common code style Oct 14, 2018
Apa102.h Work on #134 Oct 22, 2017
ArduinoBLE.md Fix image link Nov 25, 2017
Arduino_ESP32_BLE.library.properties Fixes for #121 Oct 15, 2017
BLE2902.cpp Common code style Oct 14, 2018
BLE2902.h Sync commit - 2017-07-09 Jul 29, 2017
BLE2904.cpp Common code style Oct 14, 2018
BLE2904.h Added reference to assigned numbers for units #314 Dec 25, 2017
BLEAddress.cpp Common code style Oct 14, 2018
BLEAddress.h Sync commit - 2017-07-09 Jul 29, 2017
BLEAdvertisedDevice.cpp Bugfixes Jan 22, 2019
BLEAdvertisedDevice.h Bugfix: write long characteristic value Jan 30, 2019
BLEAdvertising.cpp Bugfixes Jan 22, 2019
BLEAdvertising.h Few more fixes, arduino compatibility tested Nov 19, 2018
BLEBeacon.cpp Bugfixes Jan 22, 2019
BLEBeacon.h Common code style Oct 14, 2018
BLECharacteristic.cpp Fix #803 Feb 8, 2019
BLECharacteristic.h Bugfix: write long characteristic value Jan 30, 2019
BLECharacteristicMap.cpp Fix line mangling on merge Oct 15, 2018
BLEClient.cpp Bugfix: write long characteristic value Jan 30, 2019
BLEClient.h Bugfix: write long characteristic value Jan 30, 2019
BLEDescriptor.cpp Bugfixes Jan 22, 2019
BLEDescriptor.h Few more fixes, arduino compatibility tested Nov 19, 2018
BLEDescriptorMap.cpp Few more fixes, arduino compatibility tested Nov 19, 2018
BLEDevice.cpp Bugfix: write long characteristic value Jan 30, 2019
BLEDevice.h Bugfix: write long characteristic value Jan 30, 2019
BLEEddystoneTLM.cpp Common code style Oct 14, 2018
BLEEddystoneTLM.h Common code style Oct 14, 2018
BLEEddystoneURL.cpp Common code style Oct 14, 2018
BLEEddystoneURL.h Common code style Oct 14, 2018
BLEExceptions.cpp Updates for #228 Nov 28, 2017
BLEExceptions.h Common code style Oct 14, 2018
BLEHIDDevice.cpp Notify after setBatteryLevel Feb 12, 2019
BLEHIDDevice.h Common code style Oct 14, 2018
BLERemoteCharacteristic.cpp Bugfix: write long characteristic value Jan 30, 2019
BLERemoteCharacteristic.h Bugfix: write long characteristic value Jan 30, 2019
BLERemoteDescriptor.cpp Bugfixes Jan 22, 2019
BLERemoteDescriptor.h Updates for #228 Nov 28, 2017
BLERemoteService.cpp Bugfixes Jan 22, 2019
BLERemoteService.h Fix issues in last commit Nov 17, 2018
BLEScan.cpp Bugfixes Jan 22, 2019
BLEScan.h Add missing BLEScan.h Nov 27, 2018
BLESecurity.cpp Add static pin feature Jan 30, 2019
BLESecurity.h Add static pin feature Jan 30, 2019
BLEServer.cpp Bugfix: write long characteristic value Jan 30, 2019
BLEServer.h Bugfix: write long characteristic value Jan 30, 2019
BLEService.cpp Bugfixes Jan 22, 2019
BLEService.h Changes, bugfixes, new features. Nov 14, 2018
BLEServiceMap.cpp Fix issues in last commit Nov 17, 2018
BLEUUID.cpp Bugfixes Jan 22, 2019
BLEUUID.h Fix issue #618 Nov 14, 2018
BLEUtils.cpp fixed bugs Jan 17, 2019
BLEUtils.h Common code style Oct 14, 2018
BLEValue.cpp Bugfixes Jan 22, 2019
BLEValue.h Common code style Oct 14, 2018
CMakeLists.txt Fix for greedy file(GLOB) Dec 25, 2018
CPPNVS.cpp Common code style Oct 14, 2018
CPPNVS.h Common code style Oct 14, 2018
Console.cpp Common code style Oct 14, 2018
Console.h Common code style Oct 14, 2018
Doxyfile Fixes for esp idf commit 79f206be47c3f608615c1de8c491107e6c9194bb and… Nov 1, 2017
FATFS_VFS.cpp Sync update 2017-09-10 Sep 10, 2017
FATFS_VFS.h Sync update 2017-09-10 Sep 10, 2017
FTPCallbacks.cpp Common code style Oct 14, 2018
FTPServer.cpp Common code style Oct 14, 2018
FTPServer.h Common code style Oct 14, 2018
File.cpp Change local includes from brackets to quotes Oct 18, 2018
File.h Common code style Oct 14, 2018
FileSystem.cpp Common code style Oct 14, 2018
FileSystem.h Sync 2017-09-18 Sep 19, 2017
FreeRTOS.cpp Update FreeRTOS.cpp May 1, 2019
FreeRTOS.h Merge branch 'master' into code-cleanup Oct 15, 2018
FreeRTOSTimer.cpp Common code style Oct 14, 2018
FreeRTOSTimer.h Common code style Oct 14, 2018
GPIO.cpp Merge branch 'master' into code-cleanup Oct 15, 2018
GPIO.h Common code style Oct 14, 2018
GeneralUtils.cpp Bugfixes Jan 22, 2019
GeneralUtils.h Common code style Oct 14, 2018
HIDKeyboardTypes.h Common code style Oct 14, 2018
HIDTypes.h Common code style Oct 14, 2018
HttpParser.cpp Common code style Oct 14, 2018
HttpParser.h Common code style Oct 14, 2018
HttpRequest.cpp Common code style Oct 14, 2018
HttpRequest.h Common code style Oct 14, 2018
HttpResponse.cpp Fix HttpResponse line mangling Oct 15, 2018
HttpResponse.h Fix HttpResponse line mangling Oct 15, 2018
HttpServer.cpp Common code style Oct 14, 2018
HttpServer.h Common code style Oct 14, 2018
I2C.cpp Merge branch 'master' into code-cleanup Oct 15, 2018
I2C.h Merge branch 'master' into code-cleanup Oct 15, 2018
I2S.cpp Common code style Oct 14, 2018
I2S.h Sync commit - 2017-07-09 Jul 29, 2017
IFTTT.cpp Common code style Oct 14, 2018
IFTTT.h sync May 22, 2017
JSON.cpp Common code style Oct 14, 2018
JSON.h Common code style Oct 14, 2018
Kconfig sync May 22, 2017
MAX7219.cpp Common code style Oct 14, 2018
MAX7219.h Common code style Oct 14, 2018
MFRC522.cpp Add slave select and release when reading / writting registers Nov 11, 2018
MFRC522.h Common code style Oct 14, 2018
MFRC522Debug.h Common code style Oct 14, 2018
MMU.cpp uint8_t < 256 is always true Dec 7, 2018
MMU.h Sync Aug 6, 2018
MPU6050.cpp Common code style Oct 14, 2018
MPU6050.h Common code style Oct 14, 2018
MRFC522Debug.cpp Common code style Oct 14, 2018
Makefile.arduino Common code style Oct 14, 2018
Memory.cpp Merge branch 'master' into code-cleanup Oct 15, 2018
Memory.h Common code style Oct 14, 2018
NeoPixelWiFiEventHandler.cpp Sanitize Neopixel logging Oct 14, 2018
NeoPixelWiFiEventHandler.h Common code style Oct 14, 2018
OV7670.cpp Common code style Oct 14, 2018
OV7670.h Common code style Oct 14, 2018
PCF8574.cpp init should not set I2C addr to 0 Dec 21, 2018
PCF8574.h Merge branch 'master' into code-cleanup Oct 15, 2018
PCF8575.cpp Merge branch 'master' into code-cleanup Oct 15, 2018
PCF8575.h Merge branch 'master' into code-cleanup Oct 15, 2018
PWM.cpp Merge branch 'master' into code-cleanup Oct 15, 2018
PWM.h Common code style Oct 14, 2018
PubSubClient.cpp Merge branch 'master' into code-cleanup Oct 15, 2018
PubSubClient.h Merge branch 'master' into code-cleanup Oct 15, 2018
README.md Updated docs for CONFIG_BTC_STACK_SIZE Aug 13, 2017
RESTClient.cpp Common code style Oct 14, 2018
RESTClient.h Common code style Oct 14, 2018
RMT.cpp Common code style Oct 14, 2018
RMT.h Common code style Oct 14, 2018
SOC.cpp Common code style Oct 14, 2018
SOC.h sync May 22, 2017
SPI.cpp Common code style Oct 14, 2018
SPI.h Common code style Oct 14, 2018
SSLUtils.cpp Common code style Oct 14, 2018
SSLUtils.h Fixes for #65 Sep 17, 2017
SmartLED.cpp Common code style Oct 14, 2018
SmartLED.h Common code style Oct 14, 2018
SockServ.cpp Change local includes from brackets to quotes Oct 18, 2018
SockServ.h Common code style Oct 14, 2018
Socket.cpp Common code style Oct 14, 2018
Socket.h Common code style Oct 14, 2018
System.cpp Fix line mangling on merge Oct 15, 2018
System.h Common code style Oct 14, 2018
TFTP.cpp Change local includes from brackets to quotes Oct 18, 2018
TFTP.h Common code style Oct 14, 2018
Task.cpp Common code style Oct 14, 2018
Task.h Common code style Oct 14, 2018
U8G2.cpp sync May 22, 2017
U8G2.h Common code style Oct 14, 2018
WS2812.cpp fix an infinite loop in WS2812.cpp Oct 18, 2018
WS2812.h Common code style Oct 14, 2018
WebServer.cpp Common code style Oct 14, 2018
WebServer.h Common code style Oct 14, 2018
WebSocket.cpp Merge branch 'master' into code-cleanup Oct 15, 2018
WebSocket.h Common code style Oct 14, 2018
WebSocketFileTransfer.cpp Common code style Oct 14, 2018
WebSocketFileTransfer.h Common code style Oct 14, 2018
WiFi.cpp Common code style Oct 14, 2018
WiFi.h Common code style Oct 14, 2018
WiFiEventHandler.cpp Common code style Oct 14, 2018
WiFiEventHandler.h Common code style Oct 14, 2018
component.mk Fixes for #108 Oct 5, 2017
library.properties Addition of C++ Http Server Sep 12, 2017
mainpage.dox Common code style Oct 14, 2018

README.md

CPP Utils

This directory contains a wealth of C++ classes that have been found useful when working in C++ in conjunction with the ESP-IDF. The classes have been documented using doxygen so one can run a doxygen processor over them to create the user guides and programming references.

Compiling the C++ classes

The C++ classes found here exist as an ESP-IDF component. To build the classes and then use them in your project perform the following steps:

  1. Create an ESP-IDF project.
  2. Create a directory called components in the root of your ESP-IDF project.
  3. Copy this directory (cpp_utils) into your new components directory. The result will be <project>/components/cpp_utils/<files>.
  4. In your ESP-IDF project build as normal.

The C++ classes will be compiled and available to be used in your own code.

Adding a main function

When working with C++, your calling function should also be written in C++. Consider replacing your main.c with the following main.cpp file:

extern "C" {
   void app_main();
}

void app_main() {
   // Your code goes here
}

The way to read the above is that we are defining a global function called app_main but we are saying that its external linkage (i.e. how it is found and called) is using the C language convention. However, since the source file is main.cpp and hence compiled by the C++ compiler, you can utilize C++ classes and language features within and, since it has C linkage, it will satisfy the ESP-IDF environment as the entry point into your own code.

BLE Functions

The Bluetooth BLE functions are only compiled if Bluetooth is enabled in make menuconfig. This is primarily because the ESP-IDF build system has chosen to only compile the underlying BLE functions if Bluetooth is enabled.

Building the Documentation

The code is commented using the Doxygen tags. As such we can run Doxygen to generate the data. I use doxywizard using the Doxyfile located in this directory.

Building the Arduino libraries

Some of the classes in this package also have applicability in an Arduino environment. A Makefile called Makefile.arduino is provided to build the libraries. For example:

$ make -f Makefile.arduino

The results of this will be ZIP files found in the Arduino directory relative to this one. Targets include:

You can’t perform that action at this time.