c5a079e779
- Added DaliGatewayCache class for managing DALI device states, including address states, presence, and group statuses. - Implemented methods for configuring cache, enabling/disabling features, and setting status update callbacks. - Introduced state encoding/decoding for persistence and added support for CSV parsing. - Created mutation handling for runtime status updates, group masks, scene levels, and settings. - Developed reconciliation logic to handle incoming frames and classify mutations. - Added tests to validate cache functionality, persistence, and DALI protocol handling. Signed-off-by: Tony <tonylu@tony-cloud.com>
68 lines
1.5 KiB
C++
68 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include "base.hpp"
|
|
#include "bridge.hpp"
|
|
#include "bridge_model.hpp"
|
|
#include "bridge_provisioning.hpp"
|
|
#include "bus_monitor.hpp"
|
|
#include "comm.hpp"
|
|
#include "dali_comm.hpp"
|
|
#include "decode.hpp"
|
|
#include "device.hpp"
|
|
#include "dt1.hpp"
|
|
#include "dt4.hpp"
|
|
#include "dt5.hpp"
|
|
#include "dt6.hpp"
|
|
#include "dt8.hpp"
|
|
#include "addr.hpp"
|
|
#include "dali_gateway.hpp"
|
|
#include "gateway_cloud.hpp"
|
|
#include "gateway_provisioning.hpp"
|
|
#include "color.hpp"
|
|
#include "errors.hpp"
|
|
#include "log.hpp"
|
|
#include "query_scheduler.hpp"
|
|
#include "sequence.hpp"
|
|
#include "sequence_store.hpp"
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
// Convenience umbrella header for the complete ESP-IDF DALI component.
|
|
// Platform-neutral gateway adapters can include dali_gateway.hpp directly.
|
|
|
|
class Dali {
|
|
public:
|
|
static Dali& instance(DaliComm& comm) {
|
|
if (!instance_) {
|
|
instance_ = std::unique_ptr<Dali>(new Dali(comm));
|
|
}
|
|
return *instance_;
|
|
}
|
|
|
|
static void resetInstance() { instance_.reset(); }
|
|
|
|
static constexpr int broadcast = 127;
|
|
|
|
std::string name = "dali1";
|
|
int gw = 0;
|
|
DaliBase base;
|
|
DaliDecode decode;
|
|
DaliDT1 dt1;
|
|
DaliDT4 dt4;
|
|
DaliDT5 dt5;
|
|
DaliDT6 dt6;
|
|
DaliDT8 dt8;
|
|
DaliAddr addr;
|
|
|
|
explicit Dali(DaliComm& comm, int g = 0, const std::string& n = "dali1")
|
|
: name(n), gw(g), base(comm), decode(), dt1(base), dt4(base), dt5(base), dt6(base),
|
|
dt8(base), addr(base) {}
|
|
|
|
void open() {}
|
|
void close() {}
|
|
|
|
private:
|
|
inline static std::unique_ptr<Dali> instance_ = nullptr;
|
|
};
|