feat: Add DALI raw frame handling and USB setup bridge
- Introduced DaliRawFrame structure to encapsulate raw frame data. - Enhanced DaliDomainService to manage raw frame sinks and processing. - Implemented raw frame task for asynchronous handling of incoming DALI frames. - Integrated raw frame handling in GatewayBleBridge and GatewayNetworkService. - Added GatewayUsbSetupBridge to facilitate USB Serial/JTAG communication with DALI. - Configured ESP-NOW for wireless communication and setup management. - Updated GatewayRuntime to support clearing wireless credentials on boot button long press. - Enhanced CMakeLists to include new components and dependencies. Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -177,6 +177,7 @@ esp_err_t GatewayBleBridge::start() {
|
||||
[this](const std::vector<uint8_t>& frame) { handleGatewayNotification(frame); });
|
||||
controller_.addBleStateSink([this](bool enabled) { setEnabled(enabled); });
|
||||
controller_.addGatewayNameSink([this](uint8_t) { refreshDeviceName(); });
|
||||
dali_domain_.addRawFrameSink([this](const DaliRawFrame& frame) { handleDaliRawFrame(frame); });
|
||||
|
||||
const esp_err_t err = initNimble();
|
||||
if (err != ESP_OK) {
|
||||
@@ -372,6 +373,13 @@ void GatewayBleBridge::handleGatewayNotification(const std::vector<uint8_t>& fra
|
||||
last_notify_at_us_ = now;
|
||||
}
|
||||
|
||||
void GatewayBleBridge::handleDaliRawFrame(const DaliRawFrame& frame) {
|
||||
if (!enabled_ || conn_handle_ == kInvalidConnectionHandle || frame.data.empty()) {
|
||||
return;
|
||||
}
|
||||
notifyCharacteristic(frame.channel_index, frame.data);
|
||||
}
|
||||
|
||||
void GatewayBleBridge::handleRawWrite(size_t channel_index, const std::vector<uint8_t>& payload) {
|
||||
const auto channels = dali_domain_.channelInfo();
|
||||
const auto channel_it = std::find_if(channels.begin(), channels.end(),
|
||||
|
||||
Reference in New Issue
Block a user