Added defines for lighting output object present-value special values. (#1137)
This commit is contained in:
@@ -28,6 +28,7 @@ The git repositories are hosted at the following sites:
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
* Added defines for lighting output object present-value special values. (#1137)
|
||||||
* Added get copy API to timer object for state-change-value (#1134)
|
* Added get copy API to timer object for state-change-value (#1134)
|
||||||
* Added Audit Log and Time Value objects to basic device and builds. (#1128)
|
* Added Audit Log and Time Value objects to basic device and builds. (#1128)
|
||||||
* Added ListElement service callback for storing data. (#1128)
|
* Added ListElement service callback for storing data. (#1128)
|
||||||
|
|||||||
@@ -873,38 +873,47 @@ bool Lighting_Output_Present_Value_Set(
|
|||||||
the corresponding lighting command and is subject to the same
|
the corresponding lighting command and is subject to the same
|
||||||
restrictions. The special value itself is not written to the
|
restrictions. The special value itself is not written to the
|
||||||
priority array. */
|
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
|
/* Provides the same functionality as the
|
||||||
WARN lighting command. */
|
WARN lighting command. */
|
||||||
Lighting_Command_Warn(pObject, priority);
|
Lighting_Command_Warn(pObject, priority);
|
||||||
status = true;
|
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
|
/* Provides the same functionality as the
|
||||||
WARN_RELINQUISH lighting command. */
|
WARN_RELINQUISH lighting command. */
|
||||||
Lighting_Command_Warn_Relinquish(pObject, priority);
|
Lighting_Command_Warn_Relinquish(pObject, priority);
|
||||||
status = true;
|
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
|
/* Provides the same functionality as the
|
||||||
WARN_OFF lighting command. */
|
WARN_OFF lighting command. */
|
||||||
Lighting_Command_Warn_Off(pObject, priority);
|
Lighting_Command_Warn_Off(pObject, priority);
|
||||||
status = true;
|
status = true;
|
||||||
#if (BACNET_PROTOCOL_REVISION >= 28)
|
#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
|
/* Provides the same functionality as the
|
||||||
RESTORE_ON lighting command. */
|
RESTORE_ON lighting command. */
|
||||||
Lighting_Command_Restore_On(pObject, priority);
|
Lighting_Command_Restore_On(pObject, priority);
|
||||||
status = true;
|
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
|
/* Provides the same functionality as the
|
||||||
DEFAULT_ON lighting command. */
|
DEFAULT_ON lighting command. */
|
||||||
Lighting_Command_Default_On(pObject, priority);
|
Lighting_Command_Default_On(pObject, priority);
|
||||||
status = true;
|
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
|
/* Provides the same functionality as the
|
||||||
TOGGLE_RESTORE lighting command. */
|
TOGGLE_RESTORE lighting command. */
|
||||||
Lighting_Command_Toggle_Restore(pObject, priority);
|
Lighting_Command_Toggle_Restore(pObject, priority);
|
||||||
status = true;
|
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
|
/* Provides the same functionality as the
|
||||||
TOGGLE_DEFAULT lighting command. */
|
TOGGLE_DEFAULT lighting command. */
|
||||||
Lighting_Command_Toggle_Default(pObject, priority);
|
Lighting_Command_Toggle_Default(pObject, priority);
|
||||||
|
|||||||
@@ -40,6 +40,28 @@ typedef struct BACnetLightingCommand {
|
|||||||
uint8_t priority;
|
uint8_t priority;
|
||||||
} BACNET_LIGHTING_COMMAND;
|
} 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 {
|
* BACnetxyColor::= SEQUENCE {
|
||||||
* x-coordinate REAL, --(0.0 to 1.0)
|
* x-coordinate REAL, --(0.0 to 1.0)
|
||||||
|
|||||||
Reference in New Issue
Block a user