diff options
author | HampusM <hampus@hampusmat.com> | 2022-05-08 23:04:16 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-05-08 23:05:36 +0200 |
commit | eddaed4e597ce2bc7fa179ce6a15b90951579c6e (patch) | |
tree | 0e696aaab4cb24f58582efce1982cce47832cb4f /minion/src/wifi_module.hpp | |
parent | 2809f92eeb8b727e20167fe82e4cb9c3627d4870 (diff) |
feat(minion): implement respond to HTTP requests
Diffstat (limited to 'minion/src/wifi_module.hpp')
-rw-r--r-- | minion/src/wifi_module.hpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/minion/src/wifi_module.hpp b/minion/src/wifi_module.hpp index 5a4148c..3621229 100644 --- a/minion/src/wifi_module.hpp +++ b/minion/src/wifi_module.hpp @@ -6,6 +6,8 @@ constexpr auto MAX_NETWORK_MODULE_RESPONSE_LENGTH = 128U; +constexpr auto ASCII_TO_CHAR = 48U; + enum WifiMode { Station = 1, @@ -66,6 +68,21 @@ public: */ const char *get_local_ip(char *local_ip_out) noexcept; + bool has_incoming_request() noexcept; + + /** + * Reads a incoming HTTP request. + * + * @param raw_request_out Raw request output buffer. + * + * @returns The connection ID. + */ + size_t read_incoming_request(char *raw_request_out) noexcept; + + bool close_connection(size_t connection_id) noexcept; + + bool send(size_t connection_id, const char *data); + private: SoftwareSerial _serial; |