From 6aa69cdcd8720d835e922323cdcf79147c9b3154 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 16 May 2022 08:30:59 +0200 Subject: refactor(minion): create http OK response constant --- minion/src/gymnasiearbete.cpp | 3 ++- minion/src/http/response_status.hpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 minion/src/http/response_status.hpp diff --git a/minion/src/gymnasiearbete.cpp b/minion/src/gymnasiearbete.cpp index b31cf81..a1f6d51 100644 --- a/minion/src/gymnasiearbete.cpp +++ b/minion/src/gymnasiearbete.cpp @@ -1,4 +1,5 @@ #include "http/request.hpp" +#include "http/response_status.hpp" #include "secrets.hpp" #include "wifi_module.hpp" @@ -101,7 +102,7 @@ void loop() Serial.print("\nData: "); Serial.println(request.data()); - wifi_module.send_response(connection, 200U, "hello there!"); + wifi_module.send_response(connection, HTTP_RESPONSE_STATUS_OK, "hello there!"); wifi_module.close_connection(connection); diff --git a/minion/src/http/response_status.hpp b/minion/src/http/response_status.hpp new file mode 100644 index 0000000..577eedd --- /dev/null +++ b/minion/src/http/response_status.hpp @@ -0,0 +1,3 @@ +#pragma once + +constexpr auto HTTP_RESPONSE_STATUS_OK = 200U; -- cgit v1.2.3-18-g5258