feat(gateway): enhance OpenKNX integration with new DIB construction methods and improve BLE configuration
Signed-off-by: Tony <tonylu@tony-cloud.com>
This commit is contained in:
@@ -28,6 +28,7 @@ class ActiveFunctionPropertyRuntimeScope {
|
||||
};
|
||||
|
||||
constexpr uint16_t kInvalidIndividualAddress = 0xffff;
|
||||
constexpr uint16_t kKnxUnconfiguredBroadcastAddress = 0xffff; // KNX broadcast IA for unconfigured devices
|
||||
constexpr uint16_t kReg1DaliManufacturerId = 0x00a4;
|
||||
constexpr uint8_t kReg1DaliApplicationNumber = 0x01;
|
||||
constexpr uint8_t kReg1DaliApplicationVersion = 0x05;
|
||||
@@ -125,6 +126,10 @@ void EtsDeviceRuntime::setProgrammingMode(bool enabled) {
|
||||
|
||||
void EtsDeviceRuntime::toggleProgrammingMode() { setProgrammingMode(!programmingMode()); }
|
||||
|
||||
DeviceObject& EtsDeviceRuntime::deviceObject() { return device_.deviceObject(); }
|
||||
|
||||
Platform& EtsDeviceRuntime::platform() { return platform_; }
|
||||
|
||||
EtsMemorySnapshot EtsDeviceRuntime::snapshot() const {
|
||||
EtsMemorySnapshot out;
|
||||
auto& device = const_cast<Bau07B0&>(device_);
|
||||
@@ -318,19 +323,26 @@ bool EtsDeviceRuntime::shouldConsumeTunnelFrame(CemiFrame& frame) const {
|
||||
case M_FuncPropCommand_req:
|
||||
case M_FuncPropStateRead_req:
|
||||
return true;
|
||||
case L_data_req:
|
||||
if (!const_cast<Bau07B0&>(device_).configured() || programmingMode()) {
|
||||
return true;
|
||||
case L_data_req: {
|
||||
// In commissioning / programming mode ETS may address the device via its
|
||||
// individual address, the cEMI-client tunnel address (device+1), or the
|
||||
// unconfigured broadcast address 0xFFFF. Consume only those; let all
|
||||
// other individual-addressed frames (bus-scan, DeviceDescriptorRead, …)
|
||||
// pass through to the physical TP-UART so real KNX devices on the bus
|
||||
// can reply.
|
||||
const uint16_t dest = frame.destinationAddress();
|
||||
const uint16_t own_address = individualAddress();
|
||||
const uint16_t client_address = tunnelClientAddress();
|
||||
const bool commissioning = !const_cast<Bau07B0&>(device_).configured() || programmingMode();
|
||||
|
||||
if (frame.addressType() == IndividualAddress) {
|
||||
if (dest == own_address || dest == client_address ||
|
||||
(commissioning && dest == kKnxUnconfiguredBroadcastAddress)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (frame.addressType() == IndividualAddress &&
|
||||
frame.destinationAddress() == individualAddress()) {
|
||||
return true;
|
||||
}
|
||||
#ifdef USE_DATASECURE
|
||||
return frame.addressType() == GroupAddress && frame.apdu().type() == SecureService;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user