21afc6b942
- Added `bridge.cpp` to handle DALI bridge operations including model management, command execution, and response formatting. - Introduced `bridge_model.cpp` for defining bridge models, value transformations, and JSON serialization/deserialization. - Created `bridge_provisioning.cpp` for managing bridge configuration storage and retrieval using NVS on ESP platform. - Enhanced `gateway_cloud.cpp` to integrate DALI bridge requests and responses with cloud communication. - Introduced `modbus_bridge.cpp` to handle Modbus-specific operations and register management. - Implemented utility functions for converting between DaliValue and cJSON formats. - Added error handling and metadata management in bridge responses.
1.1 KiB
1.1 KiB
ESP32-S3 Bridge Example
This ESP-IDF example wires dali_cpp into a standalone application and demonstrates how to register strongly typed Modbus and BACnet bridge models.
Environment
cd /Users/tonylu/StudioProjects/dalimaster/dali_cpp
. ./scripts/export_esp_idf.sh
Build
cd /Users/tonylu/StudioProjects/dalimaster/dali_cpp/examples/esp32s3_bridge
idf.py set-target esp32s3
idf.py build
What It Shows
DaliBridgeEngineresolving model bindings.BridgeProvisioningStoreloading and saving model/config state in NVS.DaliModbusBridgemapping Modbus TCP holding-register writes to DALI operations.DaliBacnetBridgemapping BACnet property writes to DALI brightness percentage updates.- A simple Modbus TCP listener supporting write-single-register (
0x06) and write-multiple-registers (0x10). - Placeholder DALI gateway callbacks where you can connect your UART transport.
Modbus Mapping Notes
- The example listens on port
1502by default. - Holding register
0maps to bridge register40001. - The default config is stored to NVS on first boot and reused on later boots.