ENTS-tock
Environmental NeTworked Sensor firmware on Tock OS
Loading...
Searching...
No Matches
wifi_userconfig.hpp
Go to the documentation of this file.
1#ifndef LIB_USER_CONFIG_INCLUDE_WIFI_USERCONFIG_HPP
2#define LIB_USER_CONFIG_INCLUDE_WIFI_USERCONFIG_HPP
3
4#include <ArduinoLog.h>
5#include <libents/proto/controller.pb.h>
6
7#include "configuration.hpp"
8#include "template_module.hpp"
9
10namespace ModuleHandler {
11
12class ModuleUserConfig : public Module {
13 public:
15 virtual ~ModuleUserConfig() = default;
16
17 // Implement required Module interface
18 void OnReceive(const Esp32Command& cmd) override;
19 size_t OnRequest(uint8_t* buffer) override;
20
21 private:
23 uint8_t buffer[Esp32Command_size];
25 size_t buffer_len = 0;
26
32 bool has_config_ = false;
33
43 void updateWebConfig(const UserConfiguration* pb_config);
44
51 void requestConfig(const UserConfigCommand& cmd);
52
58 void responseConfig(const UserConfigCommand& cmd);
59
63 void start();
64};
65
66} // namespace ModuleHandler
67
68#endif // LIB_USER_CONFIG_INCLUDE_WIFI_USERCONFIG_HPP
void OnReceive(const Esp32Command &cmd) override
Arduino I2C onRecieve.
virtual ~ModuleUserConfig()=default
size_t OnRequest(uint8_t *buffer) override
Arduino I2C onRequest.
Class prototype for modules.
Power module for the esp32.