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.
33 lines
1.1 KiB
Markdown
33 lines
1.1 KiB
Markdown
# 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
|
|
|
|
```bash
|
|
cd /Users/tonylu/StudioProjects/dalimaster/dali_cpp
|
|
. ./scripts/export_esp_idf.sh
|
|
```
|
|
|
|
## Build
|
|
|
|
```bash
|
|
cd /Users/tonylu/StudioProjects/dalimaster/dali_cpp/examples/esp32s3_bridge
|
|
idf.py set-target esp32s3
|
|
idf.py build
|
|
```
|
|
|
|
## What It Shows
|
|
|
|
- `DaliBridgeEngine` resolving model bindings.
|
|
- `BridgeProvisioningStore` loading and saving model/config state in NVS.
|
|
- `DaliModbusBridge` mapping Modbus TCP holding-register writes to DALI operations.
|
|
- `DaliBacnetBridge` mapping 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 `1502` by default.
|
|
- Holding register `0` maps to bridge register `40001`.
|
|
- The default config is stored to NVS on first boot and reused on later boots. |