Enhance DALI DT1 support: add new operations and extend DT1 status structure with additional fields
Signed-off-by: Tony <tonylu@tony-cloud.com>
This commit is contained in:
@@ -88,6 +88,35 @@ enum class BridgeOperation {
|
||||
resetAndAllocateShortAddresses = 48,
|
||||
stopAddressAllocation = 49,
|
||||
batch = 50,
|
||||
dt1Rest = 51,
|
||||
dt1Inhibit = 52,
|
||||
dt1RelightResetInhibit = 53,
|
||||
dt1StartIdentification = 54,
|
||||
dt1ResetFunctionTestDoneFlag = 55,
|
||||
dt1ResetDurationTestDoneFlag = 56,
|
||||
dt1ResetLampTime = 57,
|
||||
dt1StoreEmergencyLevel = 58,
|
||||
dt1StoreTestDelayTime = 59,
|
||||
dt1StoreFunctionTestInterval = 60,
|
||||
dt1StoreDurationTestInterval = 61,
|
||||
dt1StoreTestExecutionTimeout = 62,
|
||||
dt1StoreProlongTime = 63,
|
||||
dt1PerformDtrSelectedFunction = 64,
|
||||
dt1GetBatteryCharge = 65,
|
||||
dt1GetFunctionTestDelayTime = 66,
|
||||
dt1GetDurationTestDelayTime = 67,
|
||||
dt1GetFunctionTestInterval = 68,
|
||||
dt1GetDurationTestInterval = 69,
|
||||
dt1GetTestExecutionTimeout = 70,
|
||||
dt1GetProlongTime = 71,
|
||||
dt1GetDurationTestResult = 72,
|
||||
dt1GetLampEmergencyTime = 73,
|
||||
dt1GetLampTotalOperationTime = 74,
|
||||
dt1GetEmergencyMinLevel = 75,
|
||||
dt1GetEmergencyMaxLevel = 76,
|
||||
dt1GetRatedDuration = 77,
|
||||
dt1GetExtendedVersion = 78,
|
||||
dt1GetEmergencyDeviceType = 79,
|
||||
};
|
||||
|
||||
enum class BridgeValueEncoding {
|
||||
|
||||
@@ -11,6 +11,23 @@ struct DT1TestStatusDetailed {
|
||||
std::optional<int> emergencyMode;
|
||||
std::optional<int> feature;
|
||||
std::optional<int> deviceStatus;
|
||||
std::optional<int> batteryChargeLevel;
|
||||
std::optional<int> functionTestDelayTime;
|
||||
std::optional<int> durationTestDelayTime;
|
||||
std::optional<int> functionTestIntervalDays;
|
||||
std::optional<int> durationTestIntervalWeeks;
|
||||
std::optional<int> testExecutionTimeoutDays;
|
||||
std::optional<int> prolongTimeHalfMinutes;
|
||||
std::optional<int> durationTestResultMinutes;
|
||||
std::optional<int> lampEmergencyTimeHours;
|
||||
std::optional<int> lampTotalOperationTimeHours;
|
||||
std::optional<int> emergencyLevel;
|
||||
std::optional<int> emergencyMinLevel;
|
||||
std::optional<int> emergencyMaxLevel;
|
||||
std::optional<int> ratedDurationMinutes;
|
||||
std::optional<int> extendedVersion;
|
||||
std::optional<int> physicalMinLevel;
|
||||
std::optional<int> emergencyDeviceTypeCode;
|
||||
bool testInProgress = false;
|
||||
bool lampFailure = false;
|
||||
bool batteryFailure = false;
|
||||
@@ -41,6 +58,14 @@ struct DT1TestStatusDetailed {
|
||||
bool supportsAdjustableEmergencyLevel = false;
|
||||
};
|
||||
|
||||
enum class DaliDT1EmergencyDeviceType {
|
||||
unknown = 0,
|
||||
typeA = 1,
|
||||
typeB = 2,
|
||||
typeC = 3,
|
||||
typeD = 4,
|
||||
};
|
||||
|
||||
class DaliDT1DeviceStatus {
|
||||
public:
|
||||
explicit DaliDT1DeviceStatus(int raw) : raw_(raw & 0xFF) {}
|
||||
@@ -132,6 +157,9 @@ class DaliDT1Features {
|
||||
bool hardwiredInhibitSupported() const { return bit(0x20); }
|
||||
bool physicalSelectionSupported() const { return bit(0x40); }
|
||||
bool relightInRestModeSupported() const { return bit(0x80); }
|
||||
DaliDT1EmergencyDeviceType emergencyDeviceType(
|
||||
const std::optional<int>& physicalMinLevel = std::nullopt) const;
|
||||
int emergencyDeviceTypeCode(const std::optional<int>& physicalMinLevel = std::nullopt) const;
|
||||
|
||||
private:
|
||||
int raw_ = 0;
|
||||
@@ -187,8 +215,10 @@ class DaliDT1 {
|
||||
|
||||
std::optional<int> getBatteryChargeLevel(int a);
|
||||
std::optional<int> getTestTiming(int a, int selector);
|
||||
std::optional<int> getFunctionTestDelayTime(int a);
|
||||
std::optional<int> getFunctionTestDelayHighByte(int a);
|
||||
std::optional<int> getFunctionTestDelayLowByte(int a);
|
||||
std::optional<int> getDurationTestDelayTime(int a);
|
||||
std::optional<int> getDurationTestDelayHighByte(int a);
|
||||
std::optional<int> getDurationTestDelayLowByte(int a);
|
||||
std::optional<int> getEmergencyLevel(int a);
|
||||
@@ -223,5 +253,6 @@ class DaliDT1 {
|
||||
bool sendWithDTR(int a, int code, int value);
|
||||
std::optional<int> query(int a, int code);
|
||||
std::optional<int> queryTiming(int a, int selector);
|
||||
std::optional<int> queryTimingWordFromHighSelector(int a, int selector);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user