-remove hack for 0 terminating string in groupobjects

-fix logging on linux
-add parameters to python bindings
This commit is contained in:
Thomas Kunze
2024-09-12 00:14:25 +02:00
parent b687cd24d9
commit d1bdc6ef51
17 changed files with 77 additions and 54 deletions

View File

@@ -91,13 +91,13 @@ void setup()
goMin.dataPointType(DPT_Value_Temp);
goMax.dataPointType(DPT_Value_Temp);
Serial.print("Timeout: ");
Serial.print("Startverzögerung s: ");
Serial.println(knx.paramByte(0));
Serial.print("Zykl. senden: ");
Serial.print("Aenderung senden (*0.1K): ");
Serial.println(knx.paramByte(1));
Serial.print("Min/Max senden: ");
Serial.print("Zykl. senden min: ");
Serial.println(knx.paramByte(2));
Serial.print("Aenderung senden: ");
Serial.print("Min/Max senden: ");
Serial.println(knx.paramByte(3));
Serial.print("Abgleich: ");
Serial.println(knx.paramByte(4));

View File

@@ -99,7 +99,8 @@ void setup()
srand((unsigned int)time(NULL));
Logger::logLevel("App", Logger::Info);
Logger::logLevel("ApplicationLayer", Logger::Info);
Logger::logLevel("TableObject", Logger::Info);
Logger::logLevel("Memory", Logger::Info);
knx.readMemory();
if (knx.individualAddress() == 0xFFFF)
@@ -115,11 +116,11 @@ void setup()
GO_MAX.dataPointType(Dpt(9, 1));
GO_MAX.valueNoSend(-273.0);
GO_RESET.dataPointType(Dpt(1, 15));
LOGGER.info("Timeout: %d", knx.paramWord(0));
LOGGER.info("Zykl. senden: %d", knx.paramByte(2));
LOGGER.info("Startverzögerung s: %d", knx.paramByte(0));
LOGGER.info("Aenderung senden (*0.1K): %d", knx.paramByte(1));
LOGGER.info("Zykl. senden min: %d", knx.paramByte(2));
LOGGER.info("Min/Max senden: %d", knx.paramByte(3));
LOGGER.info("Aenderung senden: %d", knx.paramByte(4));
LOGGER.info("Abgleich %d", knx.paramByte(5));
LOGGER.info("Abgleich %d", knx.paramInt(4));
}
else
LOGGER.info("not configured");

View File

@@ -14,11 +14,11 @@ namespace py = pybind11;
#include <vector>
#include <algorithm>
#include "knx/bits.h"
#include "knx/platform/linux_platform.h"
#include "knx/ip/bau57B0.h"
#include "knx/interface_object/group_object_table_object.h"
#include "knx/util/logger.h"
#include <knx/bits.h>
#include <knx/platform/linux_platform.h>
#include <knx/ip/bau57B0.h>
#include <knx/interface_object/group_object_table_object.h>
#include <knx/util/logger.h>
#define LOGGER Logger::logger("knxmodule")
@@ -56,6 +56,8 @@ static void init()
Logger::logLevel("ApplicationLayer", Logger::Info);
Logger::logLevel("BauSystemBDevice", Logger::Info);
Logger::logLevel("GroupObject", Logger::Info);
Logger::logLevel("TableObject", Logger::Info);
Logger::logLevel("Memory", Logger::Info);
/*
// copy args so we control the livetime of the char*
@@ -186,6 +188,14 @@ PYBIND11_MODULE(knx, m)
{
GroupObject::classCallback(handler);
});
m.def("Parameters", []()
{
uint8_t* data = bau->parameters().data();
if (data == nullptr)
return py::bytes();
return py::bytes((const char*)data, bau->parameters().dataSize());
});
py::class_<GroupObject>(m, "GroupObject", py::dynamic_attr())
.def(py::init())