Easy-to-use Arduino library for interfacing an ESP 32 with Bluetooth LE mobile device notifications.
Go to file
2020-01-27 14:54:10 +11:00
examples/ble_connection Updated README with info on setting partition size, and changed the example to remove references to the Hackwatch platform. 2020-01-27 14:54:10 +11:00
src Improved documentation. 2019-12-28 11:06:19 +11:00
.gitignore Initial commit 2019-12-11 16:55:25 +01:00
library.properties Removed one hack from the old BLE32 libraries so the library builds on a pure ESP32 Espressif Arduino library. 2019-12-13 16:55:28 +01:00
LICENSE Initial commit 2019-12-11 16:55:25 +01:00
README.md Updated README with info on setting partition size, and changed the example to remove references to the Hackwatch platform. 2020-01-27 14:54:10 +11:00

ESP32NotificationsLib

Easy-to-use Arduino library for interfacing an ESP 32 with Bluetooth LE mobile device notifications.

This library is designed to follow the standard Arduino library style, and be as easy to use and clear as possible for non-programmers (i.e. no lambda functions, threads, new C++ language features, etc.)

Note that this is a work in progress and is incomplete (but should work).

Features

* Easily start re-advertising the ESP 32 device if BLE connection is lost.
* Apple ANCS notification support, with advanced message details.

Installation

Put the unzipped library code into your ~/arduino/libraries/ folder, under a ESP32NotificationsLib subfolder:

Or use git:

cd ~/arduino/libraries/
git clone git@github.com:Smartphone-Companions/ESP32NotificationsLib.git

Then you should see the examples and be able to include the library in your projects with:

 #include "esp32notifications.h"

Usage

This works like a standard Arduino library. Here's a minimal example:

// Create an interface to the BLE notification library at the top of your sketch
BLENotifications notifications;

// Start looking for a device connection
notifications.begin("BLEConnection device name");

// Setup a callback for when a notification arrives
void onNotificationArrived(const Notification * notification) {
    Serial.println(notification->title.c_str());
}

// Register the callback to be informed when a notification arrives
notifications.setConnectionStateChangedCallback(onBLEStateChanged);
notifications.setNotificationCallback(onNotificationArrived);

Note that the Espressif BLE libraries are very large, so you may need to increase your partition scheme to "Large" in the Arduino IDE.

See the ble_connection example for a more fully-featured example.

History / Acknowledgements

Based on the work of CarWatch, Hackwatch, and S-March. This project was created to hide the complicated BLE notification internals behind a standard, easy-to-use Arduino library.

To see a real-world project, https://github.com/jhud/hackwatch uses this library.