LSH-Core
A robust C++ framework for Arduino-based home automation nodes
Loading...
Searching...
No Matches
config.hpp File Reference

Defines build-time configurable parameters for serial communication. More...

#include <ArduinoJson.h>
#include <etl/bit.h>
#include <stdint.h>
#include "internal/user_config_bridge.hpp"
Include dependency graph for config.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  constants
 namespace for constants.
 
namespace  constants::espComConfigs
 namespace for build configurable ESP communication constants.
 

Variables

constexpr uint16_t constants::espComConfigs::RECEIVED_DOC_MIN_SIZE = etl::bit_ceil(JSON_ARRAY_SIZE(CONFIG_MAX_ACTUATORS) + JSON_OBJECT_SIZE(2) + 4U)
 Calculated minimum size for the JSON document received from the bridge.
 
constexpr uint16_t constants::espComConfigs::RECEIVED_DOC_SIZE = RECEIVED_DOC_MIN_SIZE <= 48U ? 48U : RECEIVED_DOC_MIN_SIZE
 Final allocated size for the received JSON document, ensuring a minimum of 48 bytes.
 
constexpr uint16_t constants::espComConfigs::RAW_INPUT_BUFFER_MIN_SIZE = etl::bit_ceil(22U)
 Defines the size of the temporary on-stack buffer for reading raw serial messages.
 
constexpr uint16_t constants::espComConfigs::RAW_INPUT_BUFFER_VARIABLE_CMD_SIZE
 Calculated size for the longest variable-length command ({"p":12,"s":[0,1,0,1,0,...]})
 
constexpr uint16_t constants::espComConfigs::RAW_INPUT_BUFFER_SIZE = RAW_INPUT_BUFFER_VARIABLE_CMD_SIZE <= RAW_INPUT_BUFFER_MIN_SIZE ? RAW_INPUT_BUFFER_MIN_SIZE : RAW_INPUT_BUFFER_VARIABLE_CMD_SIZE
 Final allocated size for the raw serial input buffer.
 
constexpr uint16_t constants::espComConfigs::SENT_DOC_DETAILS_SIZE = JSON_ARRAY_SIZE(CONFIG_MAX_ACTUATORS) + JSON_ARRAY_SIZE(CONFIG_MAX_CLICKABLES) + JSON_OBJECT_SIZE(4)
 Calculated size for the JSON document sent with device details.
 
constexpr uint16_t constants::espComConfigs::SENT_DOC_STATE_SIZE = JSON_ARRAY_SIZE(CONFIG_MAX_ACTUATORS) + JSON_OBJECT_SIZE(2)
 Calculated size for the JSON document sent with actuator states.
 
constexpr uint16_t constants::espComConfigs::SENT_DOC_NETWORK_CLICK_SIZE = JSON_OBJECT_SIZE(4)
 Calculated size for the JSON document sent for network clicks.
 
constexpr uint16_t constants::espComConfigs::SENT_DOC_MAX_SIZE = SENT_DOC_DETAILS_SIZE
 The maximum possible size for any JSON document sent by the device.
 

Detailed Description

Defines build-time configurable parameters for serial communication.

Author
Jacopo Labardi (labodj)

Copyright 2025 Jacopo Labardi

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.