Class interfacing Arduino to the EmlaLock API.
More...
#include <EmlaLockApi.h>
|
| EmlaLockApi (bool offlineMode) |
| Construct a new EmlaLock Api Object. Use the singleton EmlaLock or getInstance() instead of creating new objects. More...
|
|
void | threadFunction () |
| The thread functions which is communicating asynchronously with the Emlalock API. More...
|
|
bool | requestUrl (String &url) |
| Loads the requested url and parses the json result. More...
|
|
|
const String | host = "api.emlalock.com" |
| The base address to the API. More...
|
|
StaticJsonDocument< 10000 > | jsonDocument |
| JSON parser. More...
|
|
std::mutex | mtx |
| Mutex used to ensure thread safety of the API. More...
|
|
std::condition_variable | condVar |
| Condition variable to which can be triggered to immediately request the status of the EmlaLock Session. More...
|
|
bool | triggered |
| Helper variable to detect spurious wakeups of thread. More...
|
|
bool | offlineMode |
| If true the thread requesting data from emlalock won't be started. More...
|
|
Class interfacing Arduino to the EmlaLock API.
- See also
- https://www.emlalock.com/apidoc/
◆ EmlaLockApi()
emlalock::EmlaLockApi::EmlaLockApi |
( |
bool |
offlineMode | ) |
|
|
inlineprotected |
Construct a new EmlaLock Api Object. Use the singleton EmlaLock or getInstance() instead of creating new objects.
- Parameters
-
offlineMode | if true the thread requesting data from emlalock won't be started. |
◆ getSingleton()
static EmlaLockApi & emlalock::EmlaLockApi::getSingleton |
( |
bool |
offlineMode = false | ) |
|
|
inlinestatic |
Get the singleton instance of the API handler.
- Parameters
-
offlineMode | if true the thread requesting data from emlalock won't be started. |
◆ requestUrl()
bool emlalock::EmlaLockApi::requestUrl |
( |
String & |
url | ) |
|
|
inlineprotected |
Loads the requested url and parses the json result.
- Parameters
-
- Returns
- true if no error occurred.
◆ threadFunction()
void emlalock::EmlaLockApi::threadFunction |
( |
| ) |
|
|
inlineprotected |
The thread functions which is communicating asynchronously with the Emlalock API.
◆ triggerRefresh()
void emlalock::EmlaLockApi::triggerRefresh |
( |
| ) |
|
|
inline |
Triggers the client to reload the current state from the EmlaLock server.
◆ condVar
std::condition_variable emlalock::EmlaLockApi::condVar |
|
protected |
Condition variable to which can be triggered to immediately request the status of the EmlaLock Session.
◆ host
const String emlalock::EmlaLockApi::host = "api.emlalock.com" |
|
protected |
The base address to the API.
◆ jsonDocument
StaticJsonDocument<10000> emlalock::EmlaLockApi::jsonDocument |
|
protected |
◆ mtx
std::mutex emlalock::EmlaLockApi::mtx |
|
protected |
Mutex used to ensure thread safety of the API.
◆ offlineMode
bool emlalock::EmlaLockApi::offlineMode |
|
protected |
If true the thread requesting data from emlalock won't be started.
◆ triggered
bool emlalock::EmlaLockApi::triggered |
|
protected |
Helper variable to detect spurious wakeups of thread.
The documentation for this class was generated from the following file: