mirror of
https://github.com/Smartphone-Companions/ESP32-ANCS-Notifications.git
synced 2025-01-22 11:28:29 +00:00
Stubbed API which compiles.
This commit is contained in:
parent
bccb3ea28a
commit
8194511b31
32
src/esp32notifications.cpp
Normal file
32
src/esp32notifications.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
#include "esp32notifications.h"
|
||||
|
||||
BLENotifications::BLENotifications() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool BLENotifications::begin(const char * name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void BLENotifications::setConnectionStateChangedCallback(ble_notifications_state_changed_t) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
void BLENotifications::setNotificationCallback(ble_notification_arrived_t) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
void BLENotifications::actionPositive() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
void BLENotifications::actionNegative() {
|
||||
|
||||
}
|
||||
|
||||
|
46
src/esp32notifications.h
Normal file
46
src/esp32notifications.h
Normal file
@ -0,0 +1,46 @@
|
||||
#ifndef ESP32NOTIFICATIONS_H_
|
||||
#define ESP32NOTIFICATIONS_H_
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
class BLENotifications {
|
||||
public:
|
||||
/**
|
||||
* State of the BLE connection.
|
||||
*/
|
||||
enum State {
|
||||
StateConnected,
|
||||
StateDisconnected
|
||||
};
|
||||
|
||||
/**
|
||||
* Callback for a state change of the BLE connection.
|
||||
* Use this to modify the UI to notify the user if a connection is available.
|
||||
*/
|
||||
typedef void (*ble_notifications_state_changed_t)(State state);
|
||||
|
||||
/**
|
||||
* Callback for when a notification arrives.
|
||||
*/
|
||||
typedef void (*ble_notification_arrived_t)();
|
||||
|
||||
|
||||
public:
|
||||
BLENotifications();
|
||||
|
||||
/**
|
||||
* Setup the device to receive BLE notifications.
|
||||
* @param name the device name, as it will appear in a BLE scan.
|
||||
*/
|
||||
bool begin(const char * name);
|
||||
|
||||
void setConnectionStateChangedCallback(ble_notifications_state_changed_t);
|
||||
void setNotificationCallback(ble_notification_arrived_t);
|
||||
|
||||
void actionPositive();
|
||||
void actionNegative();
|
||||
|
||||
int getNumPending() const { return 0; }
|
||||
};
|
||||
|
||||
#endif // ESP32NOTIFICATIONS_H_
|
Loading…
Reference in New Issue
Block a user