Added Write_Enabled flag API into multi-state-input and multi-state-value basic objects. (#903)
This commit is contained in:
@@ -875,6 +875,52 @@ void Multistate_Input_Write_Present_Value_Callback_Set(
|
||||
Multistate_Input_Write_Present_Value_Callback = cb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Determines a object write-enabled flag state
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return write-enabled status flag
|
||||
*/
|
||||
bool Multistate_Input_Write_Enabled(uint32_t object_instance)
|
||||
{
|
||||
bool value = false;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Multistate_Input_Object(object_instance);
|
||||
if (pObject) {
|
||||
value = pObject->Write_Enabled;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, sets the write-enabled flag
|
||||
* @param object_instance - object-instance number of the object
|
||||
*/
|
||||
void Multistate_Input_Write_Enable(uint32_t object_instance)
|
||||
{
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Multistate_Input_Object(object_instance);
|
||||
if (pObject) {
|
||||
pObject->Write_Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, clears the write-enabled flag
|
||||
* @param object_instance - object-instance number of the object
|
||||
*/
|
||||
void Multistate_Input_Write_Disable(uint32_t object_instance)
|
||||
{
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Multistate_Input_Object(object_instance);
|
||||
if (pObject) {
|
||||
pObject->Write_Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Creates a new object and adds it to the object list
|
||||
* @param object_instance - object-instance number of the object
|
||||
@@ -905,6 +951,7 @@ uint32_t Multistate_Input_Create(uint32_t object_instance)
|
||||
pObject->Reliability = RELIABILITY_NO_FAULT_DETECTED;
|
||||
pObject->Change_Of_Value = false;
|
||||
pObject->Present_Value = 1;
|
||||
pObject->Write_Enabled = false;
|
||||
/* add to list */
|
||||
index = Keylist_Data_Add(Object_List, object_instance, pObject);
|
||||
if (index < 0) {
|
||||
|
||||
@@ -70,6 +70,13 @@ BACNET_STACK_EXPORT
|
||||
void Multistate_Input_Write_Present_Value_Callback_Set(
|
||||
multistate_input_write_present_value_callback cb);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Write_Enabled(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Input_Write_Enable(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Input_Write_Disable(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
@@ -879,6 +879,52 @@ void Multistate_Value_Write_Present_Value_Callback_Set(
|
||||
Multistate_Value_Write_Present_Value_Callback = cb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Determines a object write-enabled flag state
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return write-enabled status flag
|
||||
*/
|
||||
bool Multistate_Value_Write_Enabled(uint32_t object_instance)
|
||||
{
|
||||
bool value = false;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Multistate_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
value = pObject->Write_Enabled;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, sets the write-enabled flag
|
||||
* @param object_instance - object-instance number of the object
|
||||
*/
|
||||
void Multistate_Value_Write_Enable(uint32_t object_instance)
|
||||
{
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Multistate_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
pObject->Write_Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, clears the write-enabled flag
|
||||
* @param object_instance - object-instance number of the object
|
||||
*/
|
||||
void Multistate_Value_Write_Disable(uint32_t object_instance)
|
||||
{
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Multistate_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
pObject->Write_Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Creates a new object and adds it to the object list
|
||||
* @param object_instance - object-instance number of the object
|
||||
|
||||
@@ -69,6 +69,13 @@ BACNET_STACK_EXPORT
|
||||
void Multistate_Value_Write_Present_Value_Callback_Set(
|
||||
multistate_value_write_present_value_callback cb);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Write_Enabled(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Value_Write_Enable(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Value_Write_Disable(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
Reference in New Issue
Block a user