ENTS-tock
Environmental NeTworked Sensor firmware on Tock OS
Loading...
Searching...
No Matches
ModuleWiFi Class Reference

WiFi module for the esp32. More...

#include <module_handler/include/modules/wifi.hpp>

Inheritance diagram for ModuleWiFi:
ModuleHandler::Module

Public Member Functions

 ModuleWiFi (void)
 
 ~ModuleWiFi (void)
 
void OnReceive (const Esp32Command &cmd)
 
size_t OnRequest (uint8_t *buffer)
 
- Public Member Functions inherited from ModuleHandler::Module
 Module (void)
 Construct a new Module object.
 
 ~Module (void)
 Destroy the Module object.
 
int State (void)
 Get the current state of the module.
 
int Type ()
 Get the message type associated with the module.
 
void Reset (void)
 Resets the module to default state.
 

Additional Inherited Members

- Protected Attributes inherited from ModuleHandler::Module
int state = 0
 
int type = 0
 

Detailed Description

WiFi module for the esp32.

The WiFi module support CONNECT and POST commands through OnReceive. The CONNECT command connects to a WiFi network and returns the timestamp from the server for time syncronization purposes. The POST requires sends a HTTP POST to the configured hub URL and returns the data from the HTTP response.

Definition at line 37 of file wifi.hpp.

Constructor & Destructor Documentation

◆ ModuleWiFi()

ModuleWiFi::ModuleWiFi ( void  )

Definition at line 7 of file wifi.cpp.

References ModuleHandler::Module::type.

◆ ~ModuleWiFi()

ModuleWiFi::~ModuleWiFi ( void  )

Definition at line 15 of file wifi.cpp.

Member Function Documentation

◆ OnReceive()

void ModuleWiFi::OnReceive ( const Esp32Command &  cmd)
virtual
See also
ModuleHandler::Module.OnReceive

Implements ModuleHandler::Module.

Definition at line 20 of file wifi.cpp.

References Connect(), and Disconnect().

◆ OnRequest()

size_t ModuleWiFi::OnRequest ( uint8_t *  buffer)
virtual
See also
ModuleHandler::Module.OnRequest

Implements ModuleHandler::Module.

Definition at line 94 of file wifi.cpp.

References buffer.


The documentation for this class was generated from the following files: