feat(gateway): add extended function property handlers and diagnostics support for OpenKNX
Signed-off-by: Tony <tonylu@tony-cloud.com>
This commit is contained in:
@@ -29,6 +29,11 @@ class EtsDeviceRuntime {
|
||||
using FunctionPropertyHandler = std::function<bool(uint8_t object_index, uint8_t property_id,
|
||||
const uint8_t* data, size_t len,
|
||||
std::vector<uint8_t>* response)>;
|
||||
using FunctionPropertyExtHandler = std::function<bool(uint16_t object_type,
|
||||
uint8_t object_instance,
|
||||
uint8_t property_id,
|
||||
const uint8_t* data, size_t len,
|
||||
std::vector<uint8_t>* response)>;
|
||||
|
||||
EtsDeviceRuntime(std::string nvs_namespace,
|
||||
uint16_t fallback_individual_address,
|
||||
@@ -52,6 +57,8 @@ class EtsDeviceRuntime {
|
||||
|
||||
void setFunctionPropertyHandlers(FunctionPropertyHandler command_handler,
|
||||
FunctionPropertyHandler state_handler);
|
||||
void setFunctionPropertyExtHandlers(FunctionPropertyExtHandler command_handler,
|
||||
FunctionPropertyExtHandler state_handler);
|
||||
void setGroupWriteHandler(GroupWriteHandler handler);
|
||||
void setGroupObjectWriteHandler(GroupObjectWriteHandler handler);
|
||||
void setBusFrameSender(CemiFrameSender sender);
|
||||
@@ -79,10 +86,29 @@ class EtsDeviceRuntime {
|
||||
static bool HandleFunctionPropertyState(uint8_t object_index, uint8_t property_id,
|
||||
uint8_t length, uint8_t* data,
|
||||
uint8_t* result_data, uint8_t& result_length);
|
||||
static bool HandleFunctionPropertyExtCommand(uint16_t object_type,
|
||||
uint8_t object_instance,
|
||||
uint8_t property_id,
|
||||
uint8_t length, uint8_t* data,
|
||||
uint8_t* result_data,
|
||||
uint8_t& result_length);
|
||||
static bool HandleFunctionPropertyExtState(uint16_t object_type,
|
||||
uint8_t object_instance,
|
||||
uint8_t property_id,
|
||||
uint8_t length, uint8_t* data,
|
||||
uint8_t* result_data,
|
||||
uint8_t& result_length);
|
||||
static uint16_t DefaultTunnelClientAddress(uint16_t individual_address);
|
||||
static bool DispatchFunctionProperty(FunctionPropertyHandler* handler, uint8_t object_index,
|
||||
uint8_t property_id, uint8_t length, uint8_t* data,
|
||||
uint8_t* result_data, uint8_t& result_length);
|
||||
static bool DispatchFunctionPropertyExt(FunctionPropertyExtHandler* handler,
|
||||
uint16_t object_type,
|
||||
uint8_t object_instance,
|
||||
uint8_t property_id,
|
||||
uint8_t length, uint8_t* data,
|
||||
uint8_t* result_data,
|
||||
uint8_t& result_length);
|
||||
void installGroupObjectCallbacks();
|
||||
bool shouldConsumeTunnelFrame(CemiFrame& frame) const;
|
||||
bool shouldConsumeBusFrame(CemiFrame& frame) const;
|
||||
@@ -97,6 +123,8 @@ class EtsDeviceRuntime {
|
||||
GroupObjectWriteHandler group_object_write_handler_;
|
||||
FunctionPropertyHandler command_handler_;
|
||||
FunctionPropertyHandler state_handler_;
|
||||
FunctionPropertyExtHandler command_ext_handler_;
|
||||
FunctionPropertyExtHandler state_ext_handler_;
|
||||
bool suppress_group_object_write_callback_{false};
|
||||
uint16_t group_object_callback_count_{0};
|
||||
};
|
||||
|
||||
@@ -236,6 +236,17 @@ class GatewayKnxTpIpRouter {
|
||||
bool publishDaliStatus(const GatewayKnxDaliTarget& target, uint8_t actual_level);
|
||||
|
||||
private:
|
||||
bool handleFunctionPropertyExtCommand(uint16_t object_type,
|
||||
uint8_t object_instance,
|
||||
uint8_t property_id,
|
||||
const uint8_t* data, size_t len,
|
||||
std::vector<uint8_t>* response);
|
||||
bool handleFunctionPropertyExtState(uint16_t object_type,
|
||||
uint8_t object_instance,
|
||||
uint8_t property_id,
|
||||
const uint8_t* data, size_t len,
|
||||
std::vector<uint8_t>* response);
|
||||
|
||||
static constexpr size_t kMaxTunnelClients = 16;
|
||||
static constexpr size_t kMaxTcpClients = 4;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user