Feature - added create/delete/COV services for analog, binary, and multistate objects (#612)

* Added Create/Delete object services to Analog Input, Analog Value, Binary Input, Binary Value, Multistate Input, Multistate Value object examples, and updated their units tests.
This commit is contained in:
Steve Karg
2024-04-03 13:27:03 -05:00
committed by GitHub
parent 8a0a01c0fa
commit 76d3680b5e
47 changed files with 4450 additions and 2919 deletions
+17 -26
View File
@@ -79,7 +79,7 @@ static binary_output_write_present_value_callback
Binary_Output_Write_Present_Value_Callback;
/* These three arrays are used by the ReadPropertyMultiple handler */
static const int Binary_Output_Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
static const int Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_PRESENT_VALUE, PROP_STATUS_FLAGS,
PROP_EVENT_STATE, PROP_OUT_OF_SERVICE, PROP_POLARITY, PROP_PRIORITY_ARRAY,
PROP_RELINQUISH_DEFAULT,
@@ -88,10 +88,10 @@ static const int Binary_Output_Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
#endif
-1 };
static const int Binary_Output_Properties_Optional[] = { PROP_RELIABILITY,
static const int Properties_Optional[] = { PROP_RELIABILITY,
PROP_DESCRIPTION, PROP_ACTIVE_TEXT, PROP_INACTIVE_TEXT, -1 };
static const int Binary_Output_Properties_Proprietary[] = { -1 };
static const int Properties_Proprietary[] = { -1 };
/**
* Returns the list of required, optional, and proprietary properties.
@@ -108,13 +108,13 @@ void Binary_Output_Property_Lists(
const int **pRequired, const int **pOptional, const int **pProprietary)
{
if (pRequired) {
*pRequired = Binary_Output_Properties_Required;
*pRequired = Properties_Required;
}
if (pOptional) {
*pOptional = Binary_Output_Properties_Optional;
*pOptional = Properties_Optional;
}
if (pProprietary) {
*pProprietary = Binary_Output_Properties_Proprietary;
*pProprietary = Properties_Proprietary;
}
return;
@@ -340,7 +340,7 @@ bool Binary_Output_Present_Value_Relinquish(
* @brief For a given object instance-number, writes the present-value to the
* remote node
* @param object_instance - object-instance number of the object
* @param value - floating point analog value
* @param value - present-value
* @param priority - priority-array index value 1..16
* @param error_class - the BACnet error class
* @param error_code - BACnet Error code
@@ -911,11 +911,12 @@ bool Binary_Output_Encode_Value_List(
bool status = false;
struct object_data *pObject;
const bool in_alarm = false;
const bool fault = false;
bool fault = false;
const bool overridden = false;
pObject = Keylist_Data(Object_List, object_instance);
if (pObject) {
fault = Binary_Output_Object_Fault(pObject);
status =
cov_value_list_encode_enumerated(value_list, pObject->Present_Value,
in_alarm, fault, overridden, pObject->Out_Of_Service);
@@ -1117,25 +1118,15 @@ bool Binary_Output_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
wp_data->object_instance, value.type.Boolean);
}
break;
case PROP_OBJECT_IDENTIFIER:
case PROP_OBJECT_TYPE:
case PROP_OBJECT_NAME:
case PROP_STATUS_FLAGS:
case PROP_EVENT_STATE:
case PROP_DESCRIPTION:
case PROP_POLARITY:
case PROP_RELIABILITY:
case PROP_ACTIVE_TEXT:
case PROP_INACTIVE_TEXT:
#if (BACNET_PROTOCOL_REVISION >= 17)
case PROP_CURRENT_COMMAND_PRIORITY:
#endif
wp_data->error_class = ERROR_CLASS_PROPERTY;
wp_data->error_code = ERROR_CODE_WRITE_ACCESS_DENIED;
break;
default:
wp_data->error_class = ERROR_CLASS_PROPERTY;
wp_data->error_code = ERROR_CODE_UNKNOWN_PROPERTY;
if (property_lists_member(Properties_Required, Properties_Optional,
Properties_Proprietary, wp_data->object_property)) {
wp_data->error_class = ERROR_CLASS_PROPERTY;
wp_data->error_code = ERROR_CODE_WRITE_ACCESS_DENIED;
} else {
wp_data->error_class = ERROR_CLASS_PROPERTY;
wp_data->error_code = ERROR_CODE_UNKNOWN_PROPERTY;
}
break;
}
/* not using len at this time */