Updated proto with request->response features

This commit is contained in:
Niklas Jensen
2026-01-03 12:35:02 +01:00
committed by nikguin04
parent 719e6be8a7
commit 28bb35d104
9 changed files with 7113 additions and 6422 deletions
+19
View File
@@ -29,6 +29,25 @@ void printFeatureConfiguration() {
ESP_LOGI("Features", "==========================================================");
}
void features_request(socket_message_FeaturesDataRequest& fd_req, socket_message_FeaturesDataResponse& fd_res) {
fd_res.camera = USE_CAMERA ? true : false;
fd_res.imu = (USE_MPU6050 || USE_BNO055) ? true : false;
fd_res.mag = (USE_HMC5883 || USE_BNO055) ? true : false;
fd_res.bmp = USE_BMP180 ? true : false;
//fd_res.sonar = USE_USS ? true : false;
fd_res.sonar = fd_req.sonar_test; // Temporarily set to a variable for testing
fd_res.servo = USE_PCA9685 ? true : false;
fd_res.ws2812 = USE_WS2812 ? true : false;
fd_res.mdns = USE_MDNS ? true : false;
fd_res.embed_www = EMBED_WEBAPP ? true : false;
strcpy(fd_res.firmware_version, APP_VERSION);
strcpy(fd_res.firmware_name, APP_NAME);
strcpy(fd_res.firmware_built_target, BUILD_TARGET);
strcpy(fd_res.variant, KINEMATICS_VARIANT_STR);
}
void features(JsonObject &root) {
root["camera"] = USE_CAMERA ? true : false;
root["imu"] = (USE_MPU6050 || USE_BNO055) ? true : false;