This commit is contained in:
2025-06-08 16:55:50 +01:00
parent b457a39997
commit 03de00b93f
249 changed files with 93 additions and 19015 deletions

View File

@@ -0,0 +1,52 @@
#include "orno_modbus.h"
#include <stdbool.h>
#include "esp_log.h"
static const char *TAG = "orno_modbus";
static bool meter_state = false;
static bool meter_test = false;
static bool model_enabled = false;
esp_err_t orno_modbus_init(void)
{
ESP_LOGI(TAG, "Initializing ORNO Modbus driver");
return ESP_OK;
}
esp_err_t orno_modbus_read_current(orno_meter_type_t type, float *current)
{
if (!current) {
return ESP_ERR_INVALID_ARG;
}
// Stub implementation - replace with real Modbus queries
*current = 0.0f;
ESP_LOGD(TAG, "Read current type %d -> %f", type, *current);
return ESP_OK;
}
void orno_modbus_set_meter_test(bool state)
{
meter_test = state;
}
void orno_modbus_set_model(bool enabled)
{
model_enabled = enabled;
}
bool orno_modbus_get_meter_state(void)
{
return meter_state;
}
void orno_modbus_start(void)
{
ESP_LOGI(TAG, "Starting ORNO Modbus driver");
meter_state = true;
}
void orno_modbus_stop(void)
{
ESP_LOGI(TAG, "Stopping ORNO Modbus driver");
meter_state = false;
}