https://github.com/zauberzeug/esp32-ble-command
BLE module for lizard
https://github.com/zauberzeug/esp32-ble-command
Last synced: 10 months ago
JSON representation
BLE module for lizard
- Host: GitHub
- URL: https://github.com/zauberzeug/esp32-ble-command
- Owner: zauberzeug
- License: mit
- Created: 2022-01-19T17:59:19.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-16T13:39:04.000Z (over 1 year ago)
- Last Synced: 2025-01-14T15:48:53.745Z (12 months ago)
- Language: C++
- Size: 26.4 KB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# esp32-ble-command
Receive unformatted text commands via a single BLE service / characteristic pair.
# Example usage
```C++
#include
#include
#include
#include
extern "C" {
auto app_main() -> void;
}
auto app_main() -> void {
/* Initialize NVS — it is used to store PHY calibration data */
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
ESP_ERROR_CHECK(ret);
ZZ::BleCommand::init("MyDeviceName", [](const std::string_view &com) {
std::printf("Command: [%.*s]\n", com.length(), com.data());
});
}
```
## License
MIT