Added defines for lighting output object present-value special values. (#1137)
This commit is contained in:
@@ -873,38 +873,47 @@ bool Lighting_Output_Present_Value_Set(
|
||||
the corresponding lighting command and is subject to the same
|
||||
restrictions. The special value itself is not written to the
|
||||
priority array. */
|
||||
if (is_float_equal(value, -1.0)) {
|
||||
if (is_float_equal(value, BACNET_LIGHTING_SPECIAL_VALUE_WARN)) {
|
||||
/* Provides the same functionality as the
|
||||
WARN lighting command. */
|
||||
Lighting_Command_Warn(pObject, priority);
|
||||
status = true;
|
||||
} else if (is_float_equal(value, -2.0)) {
|
||||
} else if (is_float_equal(
|
||||
value,
|
||||
BACNET_LIGHTING_SPECIAL_VALUE_WARN_RELINQUISH)) {
|
||||
/* Provides the same functionality as the
|
||||
WARN_RELINQUISH lighting command. */
|
||||
Lighting_Command_Warn_Relinquish(pObject, priority);
|
||||
status = true;
|
||||
} else if (is_float_equal(value, -3.0)) {
|
||||
} else if (is_float_equal(
|
||||
value, BACNET_LIGHTING_SPECIAL_VALUE_WARN_OFF)) {
|
||||
/* Provides the same functionality as the
|
||||
WARN_OFF lighting command. */
|
||||
Lighting_Command_Warn_Off(pObject, priority);
|
||||
status = true;
|
||||
#if (BACNET_PROTOCOL_REVISION >= 28)
|
||||
} else if (is_float_equal(value, -4.0)) {
|
||||
} else if (is_float_equal(
|
||||
value, BACNET_LIGHTING_SPECIAL_VALUE_RESTORE_ON)) {
|
||||
/* Provides the same functionality as the
|
||||
RESTORE_ON lighting command. */
|
||||
Lighting_Command_Restore_On(pObject, priority);
|
||||
status = true;
|
||||
} else if (is_float_equal(value, -5.0)) {
|
||||
} else if (is_float_equal(
|
||||
value, BACNET_LIGHTING_SPECIAL_VALUE_DEFAULT_ON)) {
|
||||
/* Provides the same functionality as the
|
||||
DEFAULT_ON lighting command. */
|
||||
Lighting_Command_Default_On(pObject, priority);
|
||||
status = true;
|
||||
} else if (is_float_equal(value, -6.0)) {
|
||||
} else if (is_float_equal(
|
||||
value,
|
||||
BACNET_LIGHTING_SPECIAL_VALUE_TOGGLE_RESTORE)) {
|
||||
/* Provides the same functionality as the
|
||||
TOGGLE_RESTORE lighting command. */
|
||||
Lighting_Command_Toggle_Restore(pObject, priority);
|
||||
status = true;
|
||||
} else if (is_float_equal(value, -7.0)) {
|
||||
} else if (is_float_equal(
|
||||
value,
|
||||
BACNET_LIGHTING_SPECIAL_VALUE_TOGGLE_DEFAULT)) {
|
||||
/* Provides the same functionality as the
|
||||
TOGGLE_DEFAULT lighting command. */
|
||||
Lighting_Command_Toggle_Default(pObject, priority);
|
||||
|
||||
@@ -40,6 +40,28 @@ typedef struct BACnetLightingCommand {
|
||||
uint8_t priority;
|
||||
} BACNET_LIGHTING_COMMAND;
|
||||
|
||||
/* The Lighting Output object Present_Value supports special values.
|
||||
Some special values (e.g., 0.0, 1.0, 100.0) are within the normal
|
||||
operating range (0.0–100.0%) but have specific semantic meanings
|
||||
such as ON, OFF, and MIN. Other special values (negative values) are
|
||||
outside of the normal range of values and trigger specific lighting
|
||||
commands to provide functionality from objects and devices that are
|
||||
unable to write the complex datatypes used in the Lighting Command
|
||||
property (e.g., the BACnet Schedule object type).
|
||||
Writing a special value has the same effect as writing the
|
||||
corresponding lighting command and is subject to the same restrictions.*/
|
||||
/* Table 12-65. Special Values of the Present_Value Property */
|
||||
#define BACNET_LIGHTING_SPECIAL_VALUE_ON 100.0f
|
||||
#define BACNET_LIGHTING_SPECIAL_VALUE_MIN 1.0f
|
||||
#define BACNET_LIGHTING_SPECIAL_VALUE_OFF 0.0f
|
||||
#define BACNET_LIGHTING_SPECIAL_VALUE_WARN -1.0f
|
||||
#define BACNET_LIGHTING_SPECIAL_VALUE_WARN_RELINQUISH -2.0f
|
||||
#define BACNET_LIGHTING_SPECIAL_VALUE_WARN_OFF -3.0f
|
||||
#define BACNET_LIGHTING_SPECIAL_VALUE_RESTORE_ON -4.0f
|
||||
#define BACNET_LIGHTING_SPECIAL_VALUE_DEFAULT_ON -5.0f
|
||||
#define BACNET_LIGHTING_SPECIAL_VALUE_TOGGLE_RESTORE -6.0f
|
||||
#define BACNET_LIGHTING_SPECIAL_VALUE_TOGGLE_DEFAULT -7.0f
|
||||
|
||||
/**
|
||||
* BACnetxyColor::= SEQUENCE {
|
||||
* x-coordinate REAL, --(0.0 to 1.0)
|
||||
|
||||
Reference in New Issue
Block a user