/esp32-snippets

Sample ESP32 snippets and code fragments

Primary LanguageCApache License 2.0Apache-2.0

ESP32 Snippets

The main reason that I forked this library is because the API design of the original repository does not allow the programmers to implement the app that BLE server and BLE client coexist and run simultaneously.

As one of the projects that I am participating in requires both BLE client and server on same board, thus, I decided to fork the esp32 library, and add new codes that allow me to do this.

To make the ESP32 to have BLE server mode and BLE client mode, we should be able to kill the BLE server if requried. However, due to API design, it was impossible to kill the server, thus, I implemented a method called "removeServer" in the BLEDevice.cpp file to make it possible.

Changes

1) Make BLE Advertising stop when it is required

Due to this issue, removed the 496th line from the original BLEAdvertising.cpp file.

2) Add new static method to kill BLE server properly

Add removeServer() method to BLEDevice class, so that the programmer could deinitialise the BLE server(kill the BLE server).

3) Creates a bunch of fixes for GCC warnings and errors

View commits for more information.