Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
608 B

  1. /*
  2. API MODULE
  3. Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
  4. */
  5. #pragma once
  6. #include "web.h"
  7. #include <functional>
  8. // TODO: need these prototypes for .ino
  9. using api_get_callback_f = std::function<void(char * buffer, size_t size)>;
  10. using api_put_callback_f = std::function<void(const char * payload)> ;
  11. #if API_SUPPORT
  12. #include <ESPAsyncTCP.h>
  13. #include <ESPAsyncWebServer.h>
  14. #include <ArduinoJson.h>
  15. #include <vector>
  16. #if WEB_SUPPORT
  17. void apiRegister(const char * key, api_get_callback_f getFn, api_put_callback_f putFn = nullptr);
  18. #endif
  19. #endif // API_SUPPORT == 1