mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-13 03:37:05 +01:00
- general conversion from .ino modules into a separate .cpp files - clean-up internal headers, place libraries into .h. guard .cpp with _SUPPORT flags - fix some instances of shared variables instead of public methods - tweak build system to still build a single source file via os environment variable ESPURNA_BUILD_SINGLE_SOURCE
29 lines
545 B
C++
29 lines
545 B
C++
/*
|
|
|
|
API MODULE
|
|
|
|
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "espurna.h"
|
|
#include "web.h"
|
|
|
|
#include <functional>
|
|
|
|
#if WEB_SUPPORT && API_SUPPORT
|
|
|
|
#include <ESPAsyncTCP.h>
|
|
#include <ArduinoJson.h>
|
|
|
|
using api_get_callback_f = std::function<void(char * buffer, size_t size)>;
|
|
using api_put_callback_f = std::function<void(const char * payload)> ;
|
|
|
|
void apiRegister(const char * key, api_get_callback_f getFn, api_put_callback_f putFn = nullptr);
|
|
|
|
void apiSetup();
|
|
|
|
#endif // API_SUPPORT == 1
|