Removes PsychicHttp dependency

This commit is contained in:
Rune Harlyk
2026-01-22 22:20:13 +01:00
committed by Rune Harlyk
parent 0b8e060063
commit 64199ac1a3
22 changed files with 256 additions and 413 deletions
+7 -13
View File
@@ -1,28 +1,24 @@
#include <features.h>
#include <communication/native_server.h>
namespace feature_service {
// New function to print all feature flags to log
void printFeatureConfiguration() {
ESP_LOGI("Features", "====================== FEATURE FLAGS ======================");
ESP_LOGI("Features", "Firmware version: %s, name: %s, target: %s", APP_VERSION, APP_NAME, BUILD_TARGET);
// Core features
ESP_LOGI("Features", "USE_CAMERA: %s", USE_CAMERA ? "enabled" : "disabled");
ESP_LOGI("Features", "USE_MOTION: %s", USE_MOTION ? "enabled" : "disabled");
// Sensors
ESP_LOGI("Features", "USE_BNO055: %s", USE_BNO055 ? "enabled" : "disabled");
ESP_LOGI("Features", "USE_MPU6050: %s", USE_MPU6050 ? "enabled" : "disabled");
ESP_LOGI("Features", "USE_HMC5883: %s", USE_HMC5883 ? "enabled" : "disabled");
ESP_LOGI("Features", "USE_BMP180: %s", USE_BMP180 ? "enabled" : "disabled");
ESP_LOGI("Features", "USE_USS: %s", USE_USS ? "enabled" : "disabled");
// Peripherals
ESP_LOGI("Features", "USE_PCA9685: %s", USE_PCA9685 ? "enabled" : "disabled");
ESP_LOGI("Features", "USE_WS2812: %s", USE_WS2812 ? "enabled" : "disabled");
// Web services
ESP_LOGI("Features", "USE_MDNS: %s", USE_MDNS ? "enabled" : "disabled");
ESP_LOGI("Features", "EMBED_WEBAPP: %s", EMBED_WEBAPP ? "enabled" : "disabled");
ESP_LOGI("Features", "KINEMATICS_VARIANT: %s", KINEMATICS_VARIANT_STR);
@@ -45,9 +41,7 @@ void features_request(const socket_message_FeaturesDataRequest& fd_req, socket_m
fd_res.variant = const_cast<char*>(KINEMATICS_VARIANT_STR);
}
void features(JsonObject &root) {
void features(JsonObject& root) {
root["camera"] = USE_CAMERA ? true : false;
root["imu"] = (USE_MPU6050 || USE_BNO055) ? true : false;
root["mag"] = (USE_HMC5883 || USE_BNO055) ? true : false;
@@ -63,11 +57,11 @@ void features(JsonObject &root) {
root["variant"] = KINEMATICS_VARIANT_STR;
}
esp_err_t getFeatures(PsychicRequest *request) {
PsychicJsonResponse response = PsychicJsonResponse(request, false);
JsonObject root = response.getRoot();
esp_err_t getFeatures(httpd_req_t* request) {
JsonDocument doc;
JsonObject root = doc.to<JsonObject>();
features(root);
return response.send();
return NativeServer::sendJson(request, 200, doc);
}
} // namespace feature_service
} // namespace feature_service