Strip tabs and trailing white spaces, and fix end of files (#748)
* format: Strip trailing whitespaces
We want to get rid of trailing whitespaces completly as they make just git
noice. Much better to start using automated tools to get rid of them once and
not getting them back again. This way git history will be cleaner and review
easier.
Commit was generated with:
pre-commit run --all-files trailing-whitespace
* format: Files should have exactly one new line end of them
It is good practice that every file has one new line. It is not now days so
mandatory but it also is not nice if file has lot of newlines end of it. We will
use pre-commit which takes automatically care about this so let's fix all.
Commit was generated with:
pre-commit run --all-files end-of-file-fixer
* format: Convert tabs to spaces
Project mostly use spaces over tabs. When mixing tabs and spaces this usually
makes formatting issues and also when changing those in commits it will make lot
of git noise. We will force spaces most of the time and use pre-commit to fix.
Commit was generated with:
pre-commit run --all-files remove-tabs
---------
Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
This commit is contained in:
@@ -49,7 +49,7 @@ int alarm_ack_encode_apdu(
|
||||
* event-state-acknowledged [0] BACnetEventState,
|
||||
* timestamp [1] BACnetTimeStamp
|
||||
* }
|
||||
*
|
||||
*
|
||||
* @param apdu application data buffer, or NULL for length
|
||||
* @param data Pointer to the service data used for encoding values
|
||||
* @return number of bytes encoded
|
||||
@@ -102,7 +102,7 @@ int alarm_ack_encode_service_request(uint8_t *apdu, BACNET_ALARM_ACK_DATA *data)
|
||||
* @return number of bytes encoded, or zero if unable to encode or too large
|
||||
*/
|
||||
size_t bacnet_acknowledge_alarm_info_request_encode(
|
||||
uint8_t *apdu,
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
BACNET_ALARM_ACK_DATA *data)
|
||||
{
|
||||
|
||||
@@ -51,7 +51,7 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
size_t bacnet_acknowledge_alarm_info_request_encode(
|
||||
uint8_t *apdu,
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
BACNET_ALARM_ACK_DATA *data);
|
||||
|
||||
|
||||
+4
-4
@@ -52,12 +52,12 @@ extern "C" {
|
||||
BACNET_ATOMIC_READ_FILE_DATA * data);
|
||||
BACNET_STACK_EXPORT
|
||||
int arf_service_encode_apdu(
|
||||
uint8_t *apdu,
|
||||
uint8_t *apdu,
|
||||
BACNET_ATOMIC_READ_FILE_DATA *data);
|
||||
BACNET_STACK_EXPORT
|
||||
size_t atomicreadfile_service_request_encode(
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
BACNET_ATOMIC_READ_FILE_DATA *data);
|
||||
|
||||
/* decode the service request only */
|
||||
@@ -84,7 +84,7 @@ extern "C" {
|
||||
BACNET_ATOMIC_READ_FILE_DATA * data);
|
||||
BACNET_STACK_EXPORT
|
||||
int arf_ack_service_encode_apdu(
|
||||
uint8_t *apdu,
|
||||
uint8_t *apdu,
|
||||
BACNET_ATOMIC_READ_FILE_DATA *data);
|
||||
|
||||
/* decode the service request only */
|
||||
|
||||
@@ -48,4 +48,3 @@ extern "C" {
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
|
||||
+4
-4
@@ -41,12 +41,12 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int awf_service_encode_apdu(
|
||||
uint8_t *apdu,
|
||||
uint8_t *apdu,
|
||||
BACNET_ATOMIC_WRITE_FILE_DATA *data);
|
||||
BACNET_STACK_EXPORT
|
||||
int atomicwritefile_service_request_encode(
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
BACNET_ATOMIC_WRITE_FILE_DATA *data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
@@ -69,7 +69,7 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int awf_ack_service_encode_apdu(
|
||||
uint8_t *apdu,
|
||||
uint8_t *apdu,
|
||||
BACNET_ATOMIC_WRITE_FILE_DATA *data);
|
||||
BACNET_STACK_EXPORT
|
||||
int awf_ack_encode_apdu(
|
||||
|
||||
+1
-1
@@ -3254,7 +3254,7 @@ int bacapp_snprintf_value(
|
||||
case BACNET_APPLICATION_TAG_SCALE:
|
||||
if (value->type.Scale.float_scale) {
|
||||
ret_val = bacapp_snprintf(
|
||||
str, str_len, "%f",
|
||||
str, str_len, "%f",
|
||||
(double)value->type.Scale.type.real_scale);
|
||||
} else {
|
||||
ret_val = bacapp_snprintf(
|
||||
|
||||
+7
-7
@@ -306,7 +306,7 @@ extern "C" {
|
||||
int max_apdu_len,
|
||||
BACNET_APPLICATION_DATA_VALUE * value,
|
||||
BACNET_PROPERTY_ID prop);
|
||||
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int bacapp_decode_application_tag_value(
|
||||
uint8_t *apdu,
|
||||
@@ -336,7 +336,7 @@ extern "C" {
|
||||
uint8_t * apdu,
|
||||
unsigned max_apdu_len,
|
||||
BACNET_PROPERTY_ID property);
|
||||
|
||||
|
||||
BACNET_STACK_DEPRECATED("Use bacnet_application_data_length() instead")
|
||||
BACNET_STACK_EXPORT
|
||||
int bacapp_decode_data_len(
|
||||
@@ -359,14 +359,14 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int bacapp_snprintf(
|
||||
char *buffer,
|
||||
size_t count,
|
||||
char *buffer,
|
||||
size_t count,
|
||||
const char *format, ...);
|
||||
BACNET_STACK_EXPORT
|
||||
int bacapp_snprintf_shift(
|
||||
int len,
|
||||
char **buf,
|
||||
size_t *buf_size);
|
||||
int len,
|
||||
char **buf,
|
||||
size_t *buf_size);
|
||||
BACNET_STACK_EXPORT
|
||||
int bacapp_snprintf_value(
|
||||
char *str,
|
||||
|
||||
@@ -757,7 +757,7 @@ int bacnet_tag_number_and_value_decode(
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Determine the data length from the application tag number
|
||||
* @brief Determine the data length from the application tag number
|
||||
* @param tag_number application tag number to be evaluated.
|
||||
* @param len_value_type Length of the data in bytes.
|
||||
* @return datalength for the given tag, or INT_MAX if out of range.
|
||||
@@ -801,7 +801,7 @@ int bacnet_application_data_length(
|
||||
* @param apdu Pointer to the APDU buffer
|
||||
* @param apdu_size Bytes valid in the buffer
|
||||
* @param property ID of the property to get the length for.
|
||||
* @return length of data between an opening tag and a closing tag 0..N,
|
||||
* @return length of data between an opening tag and a closing tag 0..N,
|
||||
* or BACNET_STATUS_ERROR.
|
||||
*/
|
||||
int bacnet_enclosed_data_length(
|
||||
@@ -862,7 +862,7 @@ int bacnet_enclosed_data_length(
|
||||
return BACNET_STATUS_ERROR;
|
||||
}
|
||||
/* application tagged data */
|
||||
len += bacnet_application_data_length(tag.number,
|
||||
len += bacnet_application_data_length(tag.number,
|
||||
tag.len_value_type);
|
||||
total_len_enable = true;
|
||||
}
|
||||
@@ -946,7 +946,7 @@ bool decode_is_context_tag_with_length(
|
||||
* @return true on a match, false otherwise.
|
||||
*/
|
||||
bool bacnet_is_context_tag_number(
|
||||
uint8_t *apdu, uint32_t apdu_size, uint8_t tag_number, int *tag_length,
|
||||
uint8_t *apdu, uint32_t apdu_size, uint8_t tag_number, int *tag_length,
|
||||
uint32_t *len_value_type)
|
||||
{
|
||||
bool match = false;
|
||||
@@ -2751,7 +2751,7 @@ int bacnet_unsigned_context_decode(uint8_t *apdu,
|
||||
|
||||
/**
|
||||
* @brief Encode an application tagged BACnet Unsigned value
|
||||
* From clause 20.2.4 Encoding of an Unsigned Integer Value
|
||||
* From clause 20.2.4 Encoding of an Unsigned Integer Value
|
||||
* and 20.2.1 General Rules for Encoding BACnet Tags
|
||||
*
|
||||
* @param apdu - buffer to hold the data to be encoded, or NULL for length
|
||||
|
||||
@@ -133,17 +133,17 @@ int bacnet_device_object_reference_context_decode(uint8_t *apdu,
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacnet_device_object_property_reference_same(
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *value1,
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *value1,
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *value2);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacnet_device_object_reference_same(
|
||||
BACNET_DEVICE_OBJECT_REFERENCE *value1,
|
||||
BACNET_DEVICE_OBJECT_REFERENCE *value1,
|
||||
BACNET_DEVICE_OBJECT_REFERENCE *value2);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacnet_object_property_reference_same(
|
||||
BACNET_OBJECT_PROPERTY_REFERENCE *value1,
|
||||
BACNET_OBJECT_PROPERTY_REFERENCE *value1,
|
||||
BACNET_OBJECT_PROPERTY_REFERENCE *value2);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
/**
|
||||
* @brief Encodes BACnet Error class and code values into a PDU
|
||||
* From clause 21. FORMAL DESCRIPTION OF APPLICATION PROTOCOL DATA UNITS
|
||||
*
|
||||
*
|
||||
* Error ::= SEQUENCE {
|
||||
* -- NOTE: The valid combinations of error-class and error-code
|
||||
* -- NOTE: The valid combinations of error-class and error-code
|
||||
* -- are defined in Clause 18.
|
||||
* error-class ENUMERATED,
|
||||
* error-code ENUMERATED
|
||||
* }
|
||||
*
|
||||
*
|
||||
* @param apdu - buffer for the data to be encoded, or NULL for length
|
||||
* @param invoke_id - invokeID to be encoded
|
||||
* @param service - BACnet service to be encoded
|
||||
@@ -41,7 +41,7 @@ int bacerror_encode_apdu(uint8_t *apdu,
|
||||
/* length of the specific element of the PDU */
|
||||
int len = 0;
|
||||
/* total length of the apdu, return value */
|
||||
int apdu_len = 0;
|
||||
int apdu_len = 0;
|
||||
|
||||
if (apdu) {
|
||||
apdu[0] = PDU_TYPE_ERROR;
|
||||
@@ -69,9 +69,9 @@ int bacerror_encode_apdu(uint8_t *apdu,
|
||||
/**
|
||||
* @brief Decodes from bytes a BACnet Error service APDU
|
||||
* From clause 21. FORMAL DESCRIPTION OF APPLICATION PROTOCOL DATA UNITS
|
||||
*
|
||||
*
|
||||
* Error ::= SEQUENCE {
|
||||
* -- NOTE: The valid combinations of error-class and error-code
|
||||
* -- NOTE: The valid combinations of error-class and error-code
|
||||
* -- are defined in Clause 18.
|
||||
* error-class ENUMERATED,
|
||||
* error-code ENUMERATED
|
||||
|
||||
@@ -89,8 +89,8 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int bacapp_property_state_decode(
|
||||
uint8_t *apdu,
|
||||
uint32_t apdu_size,
|
||||
uint8_t *apdu,
|
||||
uint32_t apdu_size,
|
||||
BACNET_PROPERTY_STATE *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
+9
-9
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief BACnet bitstring, octectstring, and characterstring encode
|
||||
* @brief BACnet bitstring, octectstring, and characterstring encode
|
||||
* and decode functions
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date 2004
|
||||
@@ -393,18 +393,18 @@ bool characterstring_init(BACNET_CHARACTER_STRING *char_string,
|
||||
|
||||
/**
|
||||
* @brief Return the length of a string, within a maximum length
|
||||
* @note The strnlen function is non-standard and not available in
|
||||
* @note The strnlen function is non-standard and not available in
|
||||
* all libc implementations. This function is a workaround for that.
|
||||
* @details The strnlen function computes the smaller of the number
|
||||
* of characters in the array pointed to by s, not including any
|
||||
* terminating null character, or the value of the maxlen argument.
|
||||
* The strnlen function examines no more than maxlen bytes of the
|
||||
* @details The strnlen function computes the smaller of the number
|
||||
* of characters in the array pointed to by s, not including any
|
||||
* terminating null character, or the value of the maxlen argument.
|
||||
* The strnlen function examines no more than maxlen bytes of the
|
||||
* array pointed to by s.
|
||||
* @param s - string to check
|
||||
* @param maxlen - maximum length to check
|
||||
* @return The strnlen function returns the number of bytes that
|
||||
* precede the first null character in the array pointed to by s,
|
||||
* if s contains a null character within the first maxlen characters;
|
||||
* @return The strnlen function returns the number of bytes that
|
||||
* precede the first null character in the array pointed to by s,
|
||||
* if s contains a null character within the first maxlen characters;
|
||||
* otherwise, it returns maxlen.
|
||||
*/
|
||||
size_t characterstring_strnlen(const char *str, size_t maxlen)
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief BACnet bitstring, octectstring, and characterstring encode
|
||||
* @brief BACnet bitstring, octectstring, and characterstring encode
|
||||
* and decode functions
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date 2012
|
||||
@@ -101,7 +101,7 @@ extern "C" {
|
||||
const char *value);
|
||||
BACNET_STACK_EXPORT
|
||||
size_t characterstring_strnlen(
|
||||
const char *str,
|
||||
const char *str,
|
||||
size_t maxlen);
|
||||
BACNET_STACK_EXPORT
|
||||
bool characterstring_init_ansi_safe(
|
||||
|
||||
+10
-10
@@ -140,11 +140,11 @@ INDTEXT_DATA bacnet_application_tag_names[] = { { BACNET_APPLICATION_TAG_NULL,
|
||||
{ BACNET_APPLICATION_TAG_HOST_N_PORT, "BACnetHostNPort" },
|
||||
{ BACNET_APPLICATION_TAG_XY_COLOR, "BACnetxyColor" },
|
||||
{ BACNET_APPLICATION_TAG_COLOR_COMMAND, "BACnetColorCommand" },
|
||||
{ BACNET_APPLICATION_TAG_BDT_ENTRY, "BACnetBDTEntry" },
|
||||
{ BACNET_APPLICATION_TAG_FDT_ENTRY, "BACnetFDTEntry" },
|
||||
{ BACNET_APPLICATION_TAG_BDT_ENTRY, "BACnetBDTEntry" },
|
||||
{ BACNET_APPLICATION_TAG_FDT_ENTRY, "BACnetFDTEntry" },
|
||||
{ BACNET_APPLICATION_TAG_ACTION_COMMAND, "BACnetActionCommand" },
|
||||
{ BACNET_APPLICATION_TAG_SCALE, "BACnetScale" },
|
||||
{ BACNET_APPLICATION_TAG_SHED_LEVEL, "BACnetShedLevel" },
|
||||
{ BACNET_APPLICATION_TAG_SCALE, "BACnetScale" },
|
||||
{ BACNET_APPLICATION_TAG_SHED_LEVEL, "BACnetShedLevel" },
|
||||
{ 0, NULL } };
|
||||
|
||||
const char *bactext_application_tag_name(unsigned index)
|
||||
@@ -1889,9 +1889,9 @@ bool bactext_lighting_operation_strtol(const char *search_name, unsigned *found_
|
||||
}
|
||||
|
||||
INDTEXT_DATA bacnet_binary_lighting_pv_names[] = {
|
||||
{ BINARY_LIGHTING_PV_OFF, "off" },
|
||||
{ BINARY_LIGHTING_PV_OFF, "off" },
|
||||
{ BINARY_LIGHTING_PV_ON, "on" },
|
||||
{ BINARY_LIGHTING_PV_WARN, "warn" },
|
||||
{ BINARY_LIGHTING_PV_WARN, "warn" },
|
||||
{ BINARY_LIGHTING_PV_WARN_OFF, "warn-off" },
|
||||
{ BINARY_LIGHTING_PV_WARN_RELINQUISH, "warn-relinquish" },
|
||||
{ BINARY_LIGHTING_PV_STOP, "stop" },
|
||||
@@ -1910,7 +1910,7 @@ const char *bactext_binary_lighting_pv_name(unsigned index)
|
||||
}
|
||||
}
|
||||
|
||||
bool bactext_binary_lighting_pv_names_strtol(const char *search_name,
|
||||
bool bactext_binary_lighting_pv_names_strtol(const char *search_name,
|
||||
unsigned *found_index)
|
||||
{
|
||||
return bactext_strtol_index(
|
||||
@@ -1946,8 +1946,8 @@ const char *bactext_device_communications_name(unsigned index)
|
||||
INDTEXT_DATA bacnet_shed_state_names[] = {
|
||||
{ BACNET_SHED_INACTIVE, "shed-inactive" },
|
||||
{ BACNET_SHED_REQUEST_PENDING, "shed-request-pending" },
|
||||
{ BACNET_SHED_COMPLIANT, "shed-compliant" },
|
||||
{ BACNET_SHED_NON_COMPLIANT, "shed-non-compliant" },
|
||||
{ BACNET_SHED_COMPLIANT, "shed-compliant" },
|
||||
{ BACNET_SHED_NON_COMPLIANT, "shed-non-compliant" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
@@ -1960,7 +1960,7 @@ const char *bactext_shed_state_name(unsigned index)
|
||||
INDTEXT_DATA bacnet_shed_level_type_names[] = {
|
||||
{ BACNET_SHED_TYPE_PERCENT, "percent" },
|
||||
{ BACNET_SHED_TYPE_LEVEL, "level" },
|
||||
{ BACNET_SHED_TYPE_AMOUNT, "amount" },
|
||||
{ BACNET_SHED_TYPE_AMOUNT, "amount" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
|
||||
+13
-13
@@ -34,9 +34,9 @@ extern "C" {
|
||||
const char *bactext_application_tag_name(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bactext_application_tag_index(
|
||||
const char *search_name,
|
||||
unsigned *found_index);
|
||||
bool bactext_application_tag_index(
|
||||
const char *search_name,
|
||||
unsigned *found_index);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_object_type_name(
|
||||
unsigned index);
|
||||
@@ -139,9 +139,9 @@ extern "C" {
|
||||
const char *bactext_segmentation_name(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bactext_segmentation_index(
|
||||
const char *search_name,
|
||||
unsigned *found_index);
|
||||
bool bactext_segmentation_index(
|
||||
const char *search_name,
|
||||
unsigned *found_index);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_node_type_name(
|
||||
unsigned index);
|
||||
@@ -169,7 +169,7 @@ extern "C" {
|
||||
unsigned index);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_life_safety_state_name(
|
||||
const char *bactext_life_safety_state_name(
|
||||
unsigned index);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
@@ -182,7 +182,7 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool bactext_lighting_operation_strtol(
|
||||
const char *search_name,
|
||||
const char *search_name,
|
||||
unsigned *found_index);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
@@ -191,16 +191,16 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool bactext_binary_lighting_pv_names_strtol(
|
||||
const char *search_name,
|
||||
const char *search_name,
|
||||
unsigned *found_index);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_lighting_in_progress(
|
||||
unsigned index);
|
||||
const char *bactext_lighting_in_progress(
|
||||
unsigned index);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_lighting_transition(
|
||||
unsigned index);
|
||||
const char *bactext_lighting_transition(
|
||||
unsigned index);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_color_operation_name(
|
||||
|
||||
@@ -124,10 +124,10 @@ int npdu_send_what_is_network_number(BACNET_ADDRESS *dst)
|
||||
* If src->net and src->len are 0, there is no
|
||||
* routing source information.
|
||||
* @param npdu_data [in] Contains a filled-out structure with information
|
||||
* decoded from the NCPI and other NPDU
|
||||
* decoded from the NCPI and other NPDU
|
||||
* bytes.
|
||||
* @param npdu [in] Buffer containing the rest of the NPDU, following the
|
||||
* bytes that have already been decoded.
|
||||
* bytes that have already been decoded.
|
||||
* @param npdu_len [in] The length of the remaining NPDU message in npdu[].
|
||||
*/
|
||||
static void network_control_handler(
|
||||
|
||||
@@ -42,10 +42,10 @@
|
||||
* @param DNET_list [in] List of our reachable downstream BACnet Network
|
||||
* numbers. Normally just one valid entry; terminated with a -1 value.
|
||||
* @param npdu_data [in] Contains a filled-out structure with information
|
||||
* decoded from the NCPI and other NPDU
|
||||
* decoded from the NCPI and other NPDU
|
||||
* bytes.
|
||||
* @param npdu [in] Buffer containing the rest of the NPDU, following the
|
||||
* bytes that have already been decoded.
|
||||
* bytes that have already been decoded.
|
||||
* @param npdu_len [in] The length of the remaining NPDU message in npdu[].
|
||||
*/
|
||||
static void network_control_handler(BACNET_ADDRESS *src,
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
* The contents of iArgs are are, per message type:
|
||||
* - NETWORK_MESSAGE_WHO_IS_ROUTER_TO_NETWORK: Single int for DNET requested
|
||||
* - NETWORK_MESSAGE_I_AM_ROUTER_TO_NETWORK: Array of DNET(s) to send,
|
||||
* terminated with -1
|
||||
* terminated with -1
|
||||
* - NETWORK_MESSAGE_REJECT_MESSAGE_TO_NETWORK: array of 2 ints,
|
||||
* first is reason, second is DNET of interest
|
||||
* - NETWORK_MESSAGE_ROUTER_BUSY_TO_NETWORK: same as I-Am-Router msg
|
||||
|
||||
@@ -80,7 +80,7 @@ extern "C" {
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_UNSIGNED_INTEGER Accumulator_Present_Value(uint32_t object_instance);
|
||||
BACNET_UNSIGNED_INTEGER Accumulator_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
@@ -112,6 +112,3 @@ extern "C" {
|
||||
Accumulator_Name, Accumulator_Read_Property, Accumulator_Write_Property, \
|
||||
Accumulator_Property_Lists, NULL, NULL
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ int Access_Credential_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
break;
|
||||
case PROP_AUTHENTICATION_FACTORS:
|
||||
apdu_len = bacnet_array_encode(rpdata->object_instance,
|
||||
rpdata->array_index,
|
||||
rpdata->array_index,
|
||||
Access_Credential_Authentication_Factor_Array_Encode,
|
||||
ac_descr[object_index].auth_factors_count, apdu, apdu_size);
|
||||
if (apdu_len == BACNET_STATUS_ABORT) {
|
||||
@@ -276,7 +276,7 @@ int Access_Credential_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
break;
|
||||
case PROP_ASSIGNED_ACCESS_RIGHTS:
|
||||
apdu_len = bacnet_array_encode(rpdata->object_instance,
|
||||
rpdata->array_index,
|
||||
rpdata->array_index,
|
||||
Access_Credential_Assigned_Access_Rights_Array_Encode,
|
||||
ac_descr[object_index].assigned_access_rights_count, apdu, apdu_size);
|
||||
if (apdu_len == BACNET_STATUS_ABORT) {
|
||||
|
||||
@@ -260,7 +260,7 @@ bool Access_Door_Object_Name(
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_ACCESS_DOORS) {
|
||||
snprintf(text, sizeof(text), "ACCESS DOOR %lu",
|
||||
snprintf(text, sizeof(text), "ACCESS DOOR %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, text);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ bool Access_Point_Object_Name(
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_ACCESS_POINTS) {
|
||||
snprintf(text, sizeof(text), "ACCESS POINT %lu",
|
||||
snprintf(text, sizeof(text), "ACCESS POINT %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, text);
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ bool Access_Rights_Object_Name(
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_ACCESS_RIGHTSS) {
|
||||
snprintf(text, sizeof(text), "ACCESS RIGHTS %lu",
|
||||
snprintf(text, sizeof(text), "ACCESS RIGHTS %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, text);
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ bool Access_User_Object_Name(
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_ACCESS_USERS) {
|
||||
snprintf(text, sizeof(text), "ACCESS USER %lu",
|
||||
snprintf(text, sizeof(text), "ACCESS USER %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, text);
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ bool Access_Zone_Object_Name(
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_ACCESS_ZONES) {
|
||||
snprintf(text, sizeof(text), "ACCESS ZONE %lu",
|
||||
snprintf(text, sizeof(text), "ACCESS ZONE %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, text);
|
||||
}
|
||||
|
||||
@@ -38,18 +38,18 @@ static const int Properties_Required[] = {
|
||||
PROP_OUT_OF_SERVICE, PROP_UNITS, -1
|
||||
};
|
||||
|
||||
static const int Properties_Optional[] = {
|
||||
static const int Properties_Optional[] = {
|
||||
PROP_DESCRIPTION, PROP_RELIABILITY, PROP_COV_INCREMENT,
|
||||
#if defined(INTRINSIC_REPORTING)
|
||||
PROP_TIME_DELAY, PROP_NOTIFICATION_CLASS, PROP_HIGH_LIMIT,
|
||||
PROP_LOW_LIMIT, PROP_DEADBAND, PROP_LIMIT_ENABLE, PROP_EVENT_ENABLE,
|
||||
PROP_ACKED_TRANSITIONS, PROP_NOTIFY_TYPE, PROP_EVENT_TIME_STAMPS,
|
||||
#endif
|
||||
-1
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Properties_Proprietary[] = {
|
||||
-1
|
||||
static const int Properties_Proprietary[] = {
|
||||
-1
|
||||
};
|
||||
/* clang-format on */
|
||||
|
||||
|
||||
@@ -317,7 +317,7 @@ bool Analog_Output_Present_Value_Set(
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if ((priority >= 1) && (priority <= BACNET_MAX_PRIORITY) &&
|
||||
(value >= pObject->Min_Pres_Value) &&
|
||||
(value >= pObject->Min_Pres_Value) &&
|
||||
(value <= pObject->Max_Pres_Value)) {
|
||||
pObject->Relinquished[priority - 1] = false;
|
||||
pObject->Priority_Array[priority - 1] = value;
|
||||
@@ -891,7 +891,7 @@ bool Analog_Output_Encode_Value_List(
|
||||
status = cov_value_list_encode_real(value_list, pObject->Prior_Value,
|
||||
in_alarm, fault, overridden, pObject->Out_Of_Service);
|
||||
}
|
||||
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,18 +41,18 @@ static const int Analog_Value_Properties_Required[] = {
|
||||
PROP_OUT_OF_SERVICE, PROP_UNITS, -1
|
||||
};
|
||||
|
||||
static const int Analog_Value_Properties_Optional[] = {
|
||||
static const int Analog_Value_Properties_Optional[] = {
|
||||
PROP_DESCRIPTION, PROP_RELIABILITY, PROP_COV_INCREMENT,
|
||||
#if defined(INTRINSIC_REPORTING)
|
||||
PROP_TIME_DELAY, PROP_NOTIFICATION_CLASS, PROP_HIGH_LIMIT,
|
||||
PROP_LOW_LIMIT, PROP_DEADBAND, PROP_LIMIT_ENABLE, PROP_EVENT_ENABLE,
|
||||
PROP_LOW_LIMIT, PROP_DEADBAND, PROP_LIMIT_ENABLE, PROP_EVENT_ENABLE,
|
||||
PROP_ACKED_TRANSITIONS, PROP_NOTIFY_TYPE, PROP_EVENT_TIME_STAMPS,
|
||||
#endif
|
||||
-1
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Analog_Value_Properties_Proprietary[] = {
|
||||
-1
|
||||
static const int Analog_Value_Properties_Proprietary[] = {
|
||||
-1
|
||||
};
|
||||
/* clang-format on */
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ static const int Properties_Required[] = {
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Properties_Optional[] = {
|
||||
static const int Properties_Optional[] = {
|
||||
PROP_RELIABILITY,
|
||||
PROP_DESCRIPTION,
|
||||
PROP_ACTIVE_TEXT,
|
||||
@@ -98,7 +98,7 @@ static const int Properties_Optional[] = {
|
||||
PROP_EVENT_TIME_STAMPS,
|
||||
PROP_EVENT_DETECTION_ENABLE,
|
||||
#endif
|
||||
-1
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Properties_Proprietary[] = { -1 };
|
||||
|
||||
@@ -668,7 +668,7 @@ bool BitString_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
break;
|
||||
default:
|
||||
if (property_lists_member(
|
||||
Properties_Required, Properties_Optional,
|
||||
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;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date 2005
|
||||
* @brief A basic BACnet Binary Output object implementation.
|
||||
* The Binary Lighting Output object is a commandable object, and the
|
||||
* present-value property uses a priority array and an enumerated 2-state
|
||||
* The Binary Lighting Output object is a commandable object, and the
|
||||
* present-value property uses a priority array and an enumerated 2-state
|
||||
* data type.
|
||||
* @copyright SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
@@ -72,13 +72,13 @@ static binary_value_write_present_value_callback
|
||||
/* clang-format off */
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Binary_Value_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
-1
|
||||
};
|
||||
|
||||
@@ -101,7 +101,7 @@ static const int Binary_Value_Properties_Optional[] = {
|
||||
};
|
||||
|
||||
static const int Binary_Value_Properties_Proprietary[] = {
|
||||
-1
|
||||
-1
|
||||
};
|
||||
/* clang-format on */
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @file
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date 2013
|
||||
* @brief The Channel object is a command object without a priority array,
|
||||
* @brief The Channel object is a command object without a priority array,
|
||||
* and the present-value property proxies an ANY data type (sort of)
|
||||
* @copyright SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @file
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date 2013
|
||||
* @brief The Channel object is a command object without a priority array,
|
||||
* @brief The Channel object is a command object without a priority array,
|
||||
* and the present-value property proxies an ANY data type (sort of)
|
||||
* @copyright SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
@@ -702,7 +702,7 @@ bool Color_Object_Name(
|
||||
|
||||
/**
|
||||
* For a given object instance-number, sets the object-name
|
||||
*
|
||||
*
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @param new_name - holds the object-name to be set
|
||||
*
|
||||
@@ -815,11 +815,11 @@ static void Color_Fade_To_Color_Handler(
|
||||
x3 = (float)pObject->Color_Command.transit.fade_time;
|
||||
y1 = old_value.x_coordinate;
|
||||
y3 = pObject->Color_Command.target.color.x_coordinate;
|
||||
pObject->Tracking_Value.x_coordinate = linear_interpolate(x1, x2,
|
||||
pObject->Tracking_Value.x_coordinate = linear_interpolate(x1, x2,
|
||||
x3, y1, y3);
|
||||
y1 = old_value.y_coordinate;
|
||||
y3 = pObject->Color_Command.target.color.y_coordinate;
|
||||
pObject->Tracking_Value.y_coordinate = linear_interpolate(x1, x2,
|
||||
pObject->Tracking_Value.y_coordinate = linear_interpolate(x1, x2,
|
||||
x3, y1, y3);
|
||||
pObject->Color_Command.transit.fade_time -= milliseconds;
|
||||
pObject->In_Progress =
|
||||
|
||||
@@ -35,14 +35,14 @@ static COMMAND_DESCR Command_Descr[MAX_COMMANDS];
|
||||
|
||||
/* clang-format off */
|
||||
/* These arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Command_Properties_Required[] = {
|
||||
static const int Command_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_IN_PROCESS,
|
||||
PROP_ALL_WRITES_SUCCESSFUL,
|
||||
PROP_ACTION,
|
||||
PROP_ALL_WRITES_SUCCESSFUL,
|
||||
PROP_ACTION,
|
||||
-1 };
|
||||
|
||||
static const int Command_Properties_Optional[] = { -1 };
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @file
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date 2005
|
||||
* @brief API for handling all BACnet objects belonging to a BACnet device,
|
||||
* @brief API for handling all BACnet objects belonging to a BACnet device,
|
||||
* as well as Device-specific properties.
|
||||
* @copyright SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
@@ -227,13 +227,13 @@ bool Routed_Device_Address_Lookup(int idx, uint8_t dlen, uint8_t *dadr)
|
||||
* functions.
|
||||
*
|
||||
* @param dest [in] The BACNET_ADDRESS of the message's destination.
|
||||
* If the Length of the mac_adress[] field is 0, then this is a
|
||||
* If the Length of the mac_adress[] field is 0, then this is a
|
||||
* MAC broadcast. Otherwise, size is determined by the DLL type (eg, 6 for BIP
|
||||
* and 2 for MSTP).
|
||||
* @param DNET_list [in] List of our reachable downstream BACnet Network
|
||||
* numbers. Normally just one valid entry; terminated with a -1 value.
|
||||
* @param cursor [in,out] The concept of the cursor is that it is a starting
|
||||
* "hint" for the search; on return, it is updated to provide
|
||||
* "hint" for the search; on return, it is updated to provide
|
||||
* the cursor value to use with a subsequent GetNext call, or it equals -1 if
|
||||
* there are no further matches. Set it to 0 on entry to access the main,
|
||||
* gateway Device entry, or to start looping through the routed devices.
|
||||
@@ -241,7 +241,7 @@ bool Routed_Device_Address_Lookup(int idx, uint8_t dlen, uint8_t *dadr)
|
||||
* calling function should not alter or interpret it.
|
||||
*
|
||||
* @return True if the MAC addresses match (or if BACNET_BROADCAST_NETWORK and
|
||||
* the dest->len is 0, meaning MAC bcast, so it's an automatic
|
||||
* the dest->len is 0, meaning MAC bcast, so it's an automatic
|
||||
* match). Else False if no match or invalid idx is given; the cursor will be
|
||||
* returned as -1 in these cases.
|
||||
*/
|
||||
@@ -307,12 +307,12 @@ bool Routed_Device_GetNext(BACNET_ADDRESS *dest, int *DNET_list, int *cursor)
|
||||
* or local or else broadcast.
|
||||
*
|
||||
* @param dest_net [in] The BACnet network number of a message's destination.
|
||||
* Success if it is our virtual network number, or 0 (local for
|
||||
* Success if it is our virtual network number, or 0 (local for
|
||||
* the gateway, or 0xFFFF for a broadcast network number.
|
||||
* @param DNET_list [in] List of our reachable downstream BACnet Network
|
||||
* numbers. Normally just one valid entry; terminated with a -1 value.
|
||||
* @return True if matches our virtual network, or is for the local network
|
||||
* Device (the gateway), or is BACNET_BROADCAST_NETWORK,
|
||||
* Device (the gateway), or is BACNET_BROADCAST_NETWORK,
|
||||
* which is an automatic match. Else False if not a reachable network.
|
||||
*/
|
||||
bool Routed_Device_Is_Valid_Network(uint16_t dest_net, int *DNET_list)
|
||||
|
||||
@@ -506,9 +506,9 @@ bool Integer_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
break;
|
||||
default:
|
||||
if (property_lists_member(
|
||||
Integer_Value_Properties_Required,
|
||||
Integer_Value_Properties_Required,
|
||||
Integer_Value_Properties_Optional,
|
||||
Integer_Value_Properties_Proprietary,
|
||||
Integer_Value_Properties_Proprietary,
|
||||
wp_data->object_property)) {
|
||||
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||
wp_data->error_code = ERROR_CODE_WRITE_ACCESS_DENIED;
|
||||
@@ -708,4 +708,3 @@ void Integer_Value_Init(void)
|
||||
Object_List = Keylist_Create();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,14 +115,14 @@ static const int Load_Control_Properties_Required[] = {
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Load_Control_Properties_Optional[] = {
|
||||
static const int Load_Control_Properties_Optional[] = {
|
||||
PROP_DESCRIPTION,
|
||||
PROP_FULL_DUTY_BASELINE,
|
||||
-1
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Load_Control_Properties_Proprietary[] = {
|
||||
-1
|
||||
static const int Load_Control_Properties_Proprietary[] = {
|
||||
-1
|
||||
};
|
||||
/* clang-format on */
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ extern "C" {
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t object_instance,
|
||||
BACNET_LIFE_SAFETY_STATE present_value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
@@ -61,21 +61,21 @@ extern "C" {
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Silenced_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t object_instance,
|
||||
BACNET_SILENCED_STATE value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_LIFE_SAFETY_MODE Life_Safety_Point_Mode(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Mode_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t object_instance,
|
||||
BACNET_LIFE_SAFETY_MODE value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_LIFE_SAFETY_OPERATION Life_Safety_Point_Operation_Expected(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Operation_Expected_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t object_instance,
|
||||
BACNET_LIFE_SAFETY_OPERATION value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
@@ -1078,9 +1078,9 @@ bool Multistate_Output_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
break;
|
||||
default:
|
||||
if (property_lists_member(
|
||||
Properties_Required,
|
||||
Properties_Optional,
|
||||
Properties_Proprietary,
|
||||
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;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @file
|
||||
* @author Krzysztof Malorny <malornykrzysztof@gmail.com>
|
||||
* @author Ed Hague <edward@bac-test.com>
|
||||
* @date 2011, 2018
|
||||
* @date 2011, 2018
|
||||
* @brief A basic BACnet Notification Class object
|
||||
* @copyright SPDX-License-Identifier: MIT
|
||||
*/
|
||||
@@ -135,7 +135,7 @@ bool Notification_Class_Object_Name(
|
||||
|
||||
index = Notification_Class_Instance_To_Index(object_instance);
|
||||
if (index < MAX_NOTIFICATION_CLASSES) {
|
||||
snprintf(text, sizeof(text), "NOTIFICATION CLASS %lu",
|
||||
snprintf(text, sizeof(text), "NOTIFICATION CLASS %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, text);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file
|
||||
* @author Krzysztof Malorny <malornykrzysztof@gmail.com>
|
||||
* @date 2011
|
||||
* @date 2011
|
||||
* @brief API for a basic BACnet Notification Class object
|
||||
* @copyright SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
@@ -123,7 +123,7 @@ extern "C" {
|
||||
bool Network_Port_MSTP_MAC_Address_Set(
|
||||
uint32_t object_instance,
|
||||
uint8_t value);
|
||||
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Network_Port_MSTP_Max_Master(
|
||||
uint32_t object_instance);
|
||||
@@ -195,7 +195,7 @@ extern "C" {
|
||||
uint32_t object_instance,
|
||||
uint8_t a, uint8_t b, uint8_t c, uint8_t d);
|
||||
|
||||
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_DHCP_Enable(
|
||||
uint32_t object_instance);
|
||||
|
||||
@@ -45,7 +45,7 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool objects_device_delete(int index);
|
||||
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
OBJECT_DEVICE_T *objects_device_new(uint32_t device_instance);
|
||||
|
||||
@@ -54,10 +54,10 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
OBJECT_DEVICE_T *objects_device_data(int index);
|
||||
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int objects_device_count(void);
|
||||
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t objects_device_id(int index);
|
||||
|
||||
@@ -69,4 +69,3 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ static int Schedule_Weekly_Schedule_Encode(
|
||||
return BACNET_STATUS_ERROR;
|
||||
}
|
||||
pObject = Schedule_Object(object_instance);
|
||||
if (!pObject) {
|
||||
if (!pObject) {
|
||||
return BACNET_STATUS_ERROR;
|
||||
}
|
||||
day = array_index;
|
||||
@@ -275,10 +275,10 @@ static int Schedule_Exception_Schedule_Encode(
|
||||
return BACNET_STATUS_ERROR;
|
||||
}
|
||||
pObject = Schedule_Object(object_instance);
|
||||
if (!pObject) {
|
||||
if (!pObject) {
|
||||
return BACNET_STATUS_ERROR;
|
||||
}
|
||||
apdu_len = bacnet_special_event_encode(apdu,
|
||||
apdu_len = bacnet_special_event_encode(apdu,
|
||||
&pObject->Exception_Schedule[array_index]);
|
||||
|
||||
return apdu_len;
|
||||
@@ -346,7 +346,7 @@ int Schedule_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
case PROP_EXCEPTION_SCHEDULE:
|
||||
apdu_len = bacnet_array_encode(
|
||||
rpdata->object_instance, rpdata->array_index,
|
||||
Schedule_Exception_Schedule_Encode,
|
||||
Schedule_Exception_Schedule_Encode,
|
||||
BACNET_EXCEPTION_SCHEDULE_SIZE, apdu, apdu_max);
|
||||
if (apdu_len == BACNET_STATUS_ABORT) {
|
||||
rpdata->error_code =
|
||||
@@ -439,7 +439,7 @@ bool Schedule_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
break;
|
||||
default:
|
||||
if (property_lists_member(
|
||||
Schedule_Properties_Required, Schedule_Properties_Optional,
|
||||
Schedule_Properties_Required, Schedule_Properties_Optional,
|
||||
Schedule_Properties_Proprietary, wp_data->object_property)) {
|
||||
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||
wp_data->error_code = ERROR_CODE_WRITE_ACCESS_DENIED;
|
||||
|
||||
@@ -60,9 +60,9 @@ static const int Time_Value_Properties_Proprietary[] = { -1 };
|
||||
|
||||
/* standard properties that are arrays for this object,
|
||||
but not necessary supported in this object */
|
||||
static const int BACnetARRAY_Properties[] = {
|
||||
PROP_PRIORITY_ARRAY, PROP_EVENT_TIME_STAMPS, PROP_EVENT_MESSAGE_TEXTS,
|
||||
PROP_EVENT_MESSAGE_TEXTS_CONFIG, PROP_VALUE_SOURCE_ARRAY,
|
||||
static const int BACnetARRAY_Properties[] = {
|
||||
PROP_PRIORITY_ARRAY, PROP_EVENT_TIME_STAMPS, PROP_EVENT_MESSAGE_TEXTS,
|
||||
PROP_EVENT_MESSAGE_TEXTS_CONFIG, PROP_VALUE_SOURCE_ARRAY,
|
||||
PROP_COMMAND_TIME_ARRAY, PROP_TAGS, -1 };
|
||||
|
||||
/**
|
||||
|
||||
@@ -234,7 +234,7 @@ bool Trend_Log_Object_Name(
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_TREND_LOGS) {
|
||||
snprintf(text, sizeof(text), "Trend Log %lu",
|
||||
snprintf(text, sizeof(text), "Trend Log %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, text);
|
||||
}
|
||||
@@ -664,7 +664,7 @@ bool Trend_Log_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
|
||||
case PROP_LOG_DEVICE_OBJECT_PROPERTY:
|
||||
len = bacnet_device_object_property_reference_decode(
|
||||
wp_data->application_data,wp_data->application_data_len,
|
||||
wp_data->application_data,wp_data->application_data_len,
|
||||
&TempSource);
|
||||
if (len <= 0) {
|
||||
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||
@@ -1478,7 +1478,7 @@ int TL_encode_entry(uint8_t *apdu, int iLog, int iEntry)
|
||||
case TL_TYPE_ANY:
|
||||
/* Should never happen as we don't support this at the moment */
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ void handler_alarm_ack(uint8_t *service_request,
|
||||
data.ackSource.value, (unsigned long)data.ackProcessIdentifier);
|
||||
#endif
|
||||
|
||||
/* BACnet Testing Observed Incident oi00105
|
||||
/* BACnet Testing Observed Incident oi00105
|
||||
ACK of a non-existent object returned the incorrect error code
|
||||
Revealed by BACnet Test Client v1.8.16 (
|
||||
www.bac-test.com/bacnet-test-client-download ) BC 135.1: 9.1.3.3-A Any
|
||||
|
||||
@@ -139,9 +139,9 @@ void handler_read_property_ack(uint8_t *service_request,
|
||||
* @param apdu [in] The received apdu data.
|
||||
* @param apdu_len [in] Total length of the apdu.
|
||||
* @param read_access_data [out] Pointer to the head of the linked list
|
||||
* where the RP data is to be stored.
|
||||
* where the RP data is to be stored.
|
||||
* @return Number of decoded bytes (could be less than apdu_len),
|
||||
* or -1 on decoding error.
|
||||
* or -1 on decoding error.
|
||||
*/
|
||||
int rp_ack_fully_decode_service_request(
|
||||
uint8_t *apdu, int apdu_len, BACNET_READ_ACCESS_DATA *read_access_data)
|
||||
|
||||
@@ -39,7 +39,7 @@ static uint8_t Temp_Buf[MAX_APDU] = { 0 };
|
||||
/**
|
||||
* @brief Fetches the lists of properties (array of BACNET_PROPERTY_ID's) for
|
||||
* this object type and the special properties ALL or REQUIRED or OPTIONAL.
|
||||
* @param pPropertyList reference for the list of ALL, REQUIRED, and OPTIONAL
|
||||
* @param pPropertyList reference for the list of ALL, REQUIRED, and OPTIONAL
|
||||
* properties.
|
||||
* @param special_property The special property ALL, REQUIRED, or OPTIONAL
|
||||
* to fetch.
|
||||
@@ -82,7 +82,7 @@ static BACNET_PROPERTY_ID RPM_Object_Property(
|
||||
|
||||
/**
|
||||
* @brief Fetches the number of properties (array of BACNET_PROPERTY_ID's) for
|
||||
* this object type belonging to the special properties ALL or REQUIRED or
|
||||
* this object type belonging to the special properties ALL or REQUIRED or
|
||||
* OPTIONAL.
|
||||
* @param pPropertyList reference for the list of ALL, REQUIRED, and OPTIONAL
|
||||
* properties.
|
||||
@@ -108,7 +108,7 @@ static unsigned RPM_Object_Property_Count(
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Encode the RPM property returning the length of the encoding,
|
||||
* or 0 if there is no room to fit the encoding.
|
||||
* @param apdu [out] The buffer to encode the property into.
|
||||
@@ -516,7 +516,7 @@ void handler_read_property_multiple(uint8_t *service_request,
|
||||
bytes_sent = datalink_send_pdu(
|
||||
src, &npdu_data, &Handler_Transmit_Buffer[0], pdu_len);
|
||||
if (bytes_sent <= 0) {
|
||||
debug_fprintf(stderr, "RPM: Failed to send PDU (errno=%d)!\n",
|
||||
debug_fprintf(stderr, "RPM: Failed to send PDU (errno=%d)!\n",
|
||||
errno);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
* @param apdu [in] The received apdu data.
|
||||
* @param apdu_len [in] Total length of the apdu.
|
||||
* @param read_access_data [out] Pointer to the head of the linked list
|
||||
* where the RPM data is to be stored.
|
||||
* where the RPM data is to be stored.
|
||||
* @return The number of bytes decoded, or -1 on error
|
||||
*/
|
||||
int rpm_ack_decode_service_request(
|
||||
|
||||
@@ -97,7 +97,7 @@ void handler_who_is_unicast(
|
||||
* @param service_len [in] Length of the service_request message.
|
||||
* @param src [in] The BACNET_ADDRESS of the message's source.
|
||||
* @param is_unicast [in] True if should send unicast response(s)
|
||||
* back to the src, else False if should broadcast
|
||||
* back to the src, else False if should broadcast
|
||||
* response(s).
|
||||
*/
|
||||
static void check_who_is_for_routing(uint8_t *service_request,
|
||||
|
||||
@@ -388,4 +388,3 @@ bool tsm_invoke_id_failed(uint8_t invokeID)
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* FIXME: modify basic service handlers to use TSM rather than this buffer! */
|
||||
BACNET_STACK_EXPORT extern
|
||||
BACNET_STACK_EXPORT extern
|
||||
uint8_t Handler_Transmit_Buffer[MAX_PDU];
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
+118
-118
@@ -73,27 +73,27 @@ Create a device instance configuration
|
||||
Example Device configuration:
|
||||
|
||||
config dev '0'
|
||||
option description 'Openwrt Router'
|
||||
option modelname 'Openwrt Router'
|
||||
option location 'Europe'
|
||||
option app_ver '12.09'
|
||||
option name 'openwrt-router-bip'
|
||||
option id '4711'
|
||||
option port '47808'
|
||||
option net '0'
|
||||
option iface 'lan'
|
||||
option bacdl 'bip'
|
||||
option description 'Openwrt Router'
|
||||
option modelname 'Openwrt Router'
|
||||
option location 'Europe'
|
||||
option app_ver '12.09'
|
||||
option name 'openwrt-router-bip'
|
||||
option id '4711'
|
||||
option port '47808'
|
||||
option net '0'
|
||||
option iface 'lan'
|
||||
option bacdl 'bip'
|
||||
|
||||
config dev '1'
|
||||
option description 'Openwrt Router'
|
||||
option modelname 'Openwrt Router'
|
||||
option location 'Europe'
|
||||
option app_ver '12.09'
|
||||
option name 'openwrt-router-ethernet'
|
||||
option id '4712'
|
||||
option net '0'
|
||||
option iface 'lan'
|
||||
option bacdl 'ethernet'
|
||||
option description 'Openwrt Router'
|
||||
option modelname 'Openwrt Router'
|
||||
option location 'Europe'
|
||||
option app_ver '12.09'
|
||||
option name 'openwrt-router-ethernet'
|
||||
option id '4712'
|
||||
option net '0'
|
||||
option iface 'lan'
|
||||
option bacdl 'ethernet'
|
||||
|
||||
Create a Notification Class configuration:
|
||||
|
||||
@@ -102,23 +102,23 @@ Create a Notification Class configuration:
|
||||
Example Notification Class configuration:
|
||||
|
||||
config nc 'default'
|
||||
option description 'Notification Class default'
|
||||
option name 'Notification Class'
|
||||
option group 'ZF'
|
||||
option description 'Notification Class default'
|
||||
option name 'Notification Class'
|
||||
option group 'ZF'
|
||||
|
||||
config nc '0'
|
||||
option description 'Network Monitoring'
|
||||
option name 'Komunikationfehler'
|
||||
option group 'ZF'
|
||||
list recipient '65535'
|
||||
list recipient '1,104.13.8.92:47808'
|
||||
option description 'Network Monitoring'
|
||||
option name 'Komunikationfehler'
|
||||
option group 'ZF'
|
||||
list recipient '65535'
|
||||
list recipient '1,104.13.8.92:47808'
|
||||
|
||||
config nc '1'
|
||||
option description 'Modbus Sensor Fehler'
|
||||
option name 'Sensor Fehler'
|
||||
option group 'ZF'
|
||||
list recipient '65535'
|
||||
list recipient '1,104.13.8.92:47808'
|
||||
option description 'Modbus Sensor Fehler'
|
||||
option name 'Sensor Fehler'
|
||||
option group 'ZF'
|
||||
list recipient '65535'
|
||||
list recipient '1,104.13.8.92:47808'
|
||||
|
||||
Create a Trendlog configuration:
|
||||
touch /etc/config/bacnet_tl
|
||||
@@ -126,18 +126,18 @@ Create a Trendlog configuration:
|
||||
Example Trendlog configuration:
|
||||
|
||||
config tl 'default'
|
||||
option description 'Analog Value'
|
||||
option nc '1'
|
||||
option interval '300'
|
||||
option device_type 8
|
||||
option object_type 2
|
||||
option description 'Analog Value'
|
||||
option nc '1'
|
||||
option interval '300'
|
||||
option device_type 8
|
||||
option object_type 2
|
||||
|
||||
config tl '0'
|
||||
option object_instance '0'
|
||||
option interval '10'
|
||||
option object_instance '0'
|
||||
option interval '10'
|
||||
|
||||
config tl '1'
|
||||
option object_instance '1'
|
||||
option object_instance '1'
|
||||
|
||||
Create a Analog Value configuration:
|
||||
|
||||
@@ -146,42 +146,42 @@ Create a Analog Value configuration:
|
||||
Example Analog Value configuration:
|
||||
|
||||
config av 'default'
|
||||
option si_unit '98'
|
||||
option description 'Analog Value'
|
||||
option nc '1'
|
||||
option event '7'
|
||||
option limit '3'
|
||||
option high_limit '40'
|
||||
option low_limit '0'
|
||||
option dead_limit '0'
|
||||
option cov_increment '0.1'
|
||||
option value '23.8'
|
||||
option si_unit '98'
|
||||
option description 'Analog Value'
|
||||
option nc '1'
|
||||
option event '7'
|
||||
option limit '3'
|
||||
option high_limit '40'
|
||||
option low_limit '0'
|
||||
option dead_limit '0'
|
||||
option cov_increment '0.1'
|
||||
option value '23.8'
|
||||
|
||||
config av '0'
|
||||
option pgroup 'ZF_EZR08'
|
||||
option name 'R801_RT'
|
||||
option description 'Raumtemperatur'
|
||||
option addr '1'
|
||||
option tagname 'modbus-s1'
|
||||
option si_unit '62'
|
||||
option dead_limit '0.5'
|
||||
option cov_increment '0.2'
|
||||
option resolution 'doublefloat'
|
||||
option value '0.000000'
|
||||
option Out_Of_Service '0'
|
||||
option value_time '1384274334'
|
||||
option pgroup 'ZF_EZR08'
|
||||
option name 'R801_RT'
|
||||
option description 'Raumtemperatur'
|
||||
option addr '1'
|
||||
option tagname 'modbus-s1'
|
||||
option si_unit '62'
|
||||
option dead_limit '0.5'
|
||||
option cov_increment '0.2'
|
||||
option resolution 'doublefloat'
|
||||
option value '0.000000'
|
||||
option Out_Of_Service '0'
|
||||
option value_time '1384274334'
|
||||
|
||||
config av '1'
|
||||
option pgroup 'ZF_EZR08'
|
||||
option name 'R802_RT'
|
||||
option description 'Raumtemperatur'
|
||||
option tagname 'modbus-s1'
|
||||
option si_unit '62'
|
||||
option resolution 'doublefloat'
|
||||
option addr '3'
|
||||
option value '0.000000'
|
||||
option Out_Of_Service '0'
|
||||
option value_time '1384274334'
|
||||
option pgroup 'ZF_EZR08'
|
||||
option name 'R802_RT'
|
||||
option description 'Raumtemperatur'
|
||||
option tagname 'modbus-s1'
|
||||
option si_unit '62'
|
||||
option resolution 'doublefloat'
|
||||
option addr '3'
|
||||
option value '0.000000'
|
||||
option Out_Of_Service '0'
|
||||
option value_time '1384274334'
|
||||
|
||||
Create a Multistate Value configuration
|
||||
|
||||
@@ -190,26 +190,26 @@ Create a Multistate Value configuration
|
||||
Example Analog Value configuration:
|
||||
|
||||
config mv 'default'
|
||||
list state 'up'
|
||||
list state 'down'
|
||||
list state 'unreachable'
|
||||
list state 'flaping'
|
||||
list alarmstate 'down'
|
||||
list alarmstate 'unreachable'
|
||||
list alarmstate 'flaping'
|
||||
option description 'Multi State Value'
|
||||
option nc '1'
|
||||
option event '7'
|
||||
list state 'up'
|
||||
list state 'down'
|
||||
list state 'unreachable'
|
||||
list state 'flaping'
|
||||
list alarmstate 'down'
|
||||
list alarmstate 'unreachable'
|
||||
list alarmstate 'flaping'
|
||||
option description 'Multi State Value'
|
||||
option nc '1'
|
||||
option event '7'
|
||||
|
||||
config mv '0'
|
||||
option name 'TR_EZR00_SV01'
|
||||
option value '1'
|
||||
option description '192.168.100.29'
|
||||
option name 'TR_EZR00_SV01'
|
||||
option value '1'
|
||||
option description '192.168.100.29'
|
||||
|
||||
config mv '1'
|
||||
option name 'TR_EZR01_SV01'
|
||||
option value '1'
|
||||
option description '192.168.100.30'
|
||||
option name 'TR_EZR01_SV01'
|
||||
option value '1'
|
||||
option description '192.168.100.30'
|
||||
|
||||
Create a Binary Value configuration:
|
||||
|
||||
@@ -218,40 +218,40 @@ Create a Binary Value configuration:
|
||||
Example Analog Value configuration:
|
||||
|
||||
config bv 'default'
|
||||
option description 'Binary Value'
|
||||
option inactive 'AUS'
|
||||
option active 'EIN'
|
||||
option nc '1'
|
||||
option event '7'
|
||||
option time_delay '3'
|
||||
option description 'Binary Value'
|
||||
option inactive 'AUS'
|
||||
option active 'EIN'
|
||||
option nc '1'
|
||||
option event '7'
|
||||
option time_delay '3'
|
||||
|
||||
config bv '0'
|
||||
option name 'BV_00'
|
||||
option alarm_value '0'
|
||||
option tagname 'modbus-s1'
|
||||
option addr '5'
|
||||
option bit '0'
|
||||
option resolution 'dword'
|
||||
option active 'Ein'
|
||||
option inactive 'Aus'
|
||||
option description 'Datenwort 2 Bit 0'
|
||||
option value '0'
|
||||
option Out_Of_Service '0'
|
||||
option value_time '1384274334'
|
||||
option name 'BV_00'
|
||||
option alarm_value '0'
|
||||
option tagname 'modbus-s1'
|
||||
option addr '5'
|
||||
option bit '0'
|
||||
option resolution 'dword'
|
||||
option active 'Ein'
|
||||
option inactive 'Aus'
|
||||
option description 'Datenwort 2 Bit 0'
|
||||
option value '0'
|
||||
option Out_Of_Service '0'
|
||||
option value_time '1384274334'
|
||||
|
||||
config bv '1'
|
||||
option name 'BV_01'
|
||||
option alarm_value '0'
|
||||
option tagname 'modbus-s1'
|
||||
option addr '5'
|
||||
option bit '1'
|
||||
option resolution 'dword'
|
||||
option active 'Ein'
|
||||
option inactive 'Aus'
|
||||
option description 'Datenwort 2 Bit 1'
|
||||
option Out_Of_Service '0'
|
||||
option value '0'
|
||||
option value_time '1384274334'
|
||||
option name 'BV_01'
|
||||
option alarm_value '0'
|
||||
option tagname 'modbus-s1'
|
||||
option addr '5'
|
||||
option bit '1'
|
||||
option resolution 'dword'
|
||||
option active 'Ein'
|
||||
option inactive 'Aus'
|
||||
option description 'Datenwort 2 Bit 1'
|
||||
option Out_Of_Service '0'
|
||||
option value '0'
|
||||
option value_time '1384274334'
|
||||
|
||||
## Run
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2008 John Crispin <blogic@openwrt.org>
|
||||
*
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2008 John Crispin <blogic@openwrt.org>
|
||||
* Copyright (C) 2008 John Crispin <blogic@openwrt.org>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
@@ -75,4 +75,3 @@ bool bacnet_calendar_entry_same(
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
|
||||
+2
-2
@@ -164,8 +164,8 @@ int ucov_notify_encode_apdu(
|
||||
|
||||
if (apdu && (apdu_size > 2)) {
|
||||
apdu[0] = PDU_TYPE_UNCONFIRMED_SERVICE_REQUEST;
|
||||
apdu[1] = SERVICE_UNCONFIRMED_COV_NOTIFICATION;
|
||||
}
|
||||
apdu[1] = SERVICE_UNCONFIRMED_COV_NOTIFICATION;
|
||||
}
|
||||
len = 2;
|
||||
apdu_len += len;
|
||||
if (apdu) {
|
||||
|
||||
+6
-6
@@ -108,18 +108,18 @@ int cov_subscribe_property_encode_apdu(uint8_t *apdu,
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int cov_subscribe_decode_service_request(
|
||||
uint8_t *apdu,
|
||||
unsigned apdu_len,
|
||||
uint8_t *apdu,
|
||||
unsigned apdu_len,
|
||||
BACNET_SUBSCRIBE_COV_DATA *data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int cov_subscribe_apdu_encode(uint8_t *apdu,
|
||||
int cov_subscribe_apdu_encode(uint8_t *apdu,
|
||||
BACNET_SUBSCRIBE_COV_DATA *data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
size_t cov_subscribe_service_request_encode(
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
BACNET_SUBSCRIBE_COV_DATA *data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
@@ -134,7 +134,7 @@ void cov_property_value_list_link(
|
||||
size_t count);
|
||||
BACNET_STACK_EXPORT
|
||||
void cov_data_value_list_link(
|
||||
BACNET_COV_DATA *data,
|
||||
BACNET_COV_DATA *data,
|
||||
BACNET_PROPERTY_VALUE *value_list,
|
||||
size_t count);
|
||||
|
||||
|
||||
@@ -87,4 +87,3 @@ int create_object_error_ack_encode(
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* @brief BACnetDailySchedule complex data type encode and decode
|
||||
* @author Ondřej Hruška <ondra@ondrovo.com>
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date February 2024
|
||||
* @date February 2024
|
||||
* @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
|
||||
*/
|
||||
#include <stdint.h>
|
||||
@@ -33,7 +33,7 @@ int bacnet_dailyschedule_context_decode(uint8_t *apdu,
|
||||
return BACNET_STATUS_ERROR;
|
||||
}
|
||||
len = bacnet_time_values_context_decode(apdu, apdu_size,
|
||||
tag_number, &day->Time_Values[0], ARRAY_SIZE(day->Time_Values),
|
||||
tag_number, &day->Time_Values[0], ARRAY_SIZE(day->Time_Values),
|
||||
&tv_count);
|
||||
if (len < 0) {
|
||||
return BACNET_STATUS_ERROR;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @file
|
||||
* @brief BACnet Security Wrapper module from Clause 24 of the BACnet Standard.
|
||||
* @author Nikola Jelic <nikola.jelic@euroicc.com>
|
||||
* @date 2015
|
||||
* @date 2015
|
||||
* @copyright SPDX-License-Identifier: MIT
|
||||
*/
|
||||
#include <stdbool.h>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @file
|
||||
* @brief BACnet Security Wrapper module from Clause 24 of the BACnet Standard.
|
||||
* @author Nikola Jelic <nikola.jelic@euroicc.com>
|
||||
* @date 2015
|
||||
* @date 2015
|
||||
* @copyright SPDX-License-Identifier: MIT
|
||||
*/
|
||||
#ifndef BACNET_SECURITY_H
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* @author Steve Karg
|
||||
* @date 2015
|
||||
* @copyright SPDX-License-Identifier: MIT
|
||||
* @details Implementation of the Network Layer using BACnet/IPv6 as the transport,
|
||||
* @details Implementation of the Network Layer using BACnet/IPv6 as the transport,
|
||||
* as described in ASHRAE 135 Annex J.
|
||||
* The functions described here fulfill the roles defined generically at the
|
||||
* DataLink level by serving as the implementation of the function templates.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @file
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date February 2023
|
||||
* @brief Implementation of the Network Layer using BACnet MS/TP transport
|
||||
* @brief Implementation of the Network Layer using BACnet MS/TP transport
|
||||
* @copyright SPDX-License-Identifier: MIT
|
||||
* @defgroup DLMSTP BACnet MS/TP DataLink Network Layer
|
||||
* @ingroup DataLink
|
||||
@@ -670,7 +670,7 @@ void dlmstp_set_baud_rate(uint32_t baud)
|
||||
/* Tframe_abort=60 bit times, not to exceed 100 milliseconds.*/
|
||||
if (MSTP_Port->Tframe_abort <= 7) {
|
||||
/* within baud range, so auto-calculate range based on baud */
|
||||
MSTP_Port->Tframe_abort = 1+((60*1000UL)/baud);
|
||||
MSTP_Port->Tframe_abort = 1+((60*1000UL)/baud);
|
||||
}
|
||||
/* Tturnaround=40 bit times */
|
||||
MSTP_Port->Tturnaround_timeout = 1 + ((Tturnaround * 1000) / baud);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief API for the Network Layer using BACnet MS/TP as the transport
|
||||
* @brief API for the Network Layer using BACnet MS/TP as the transport
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date 2004
|
||||
* @copyright SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @file
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date 2004
|
||||
* @brief Implementation of the Network Layer using BACnet Ethernet transport
|
||||
* @brief Implementation of the Network Layer using BACnet Ethernet transport
|
||||
* @copyright SPDX-License-Identifier: MIT
|
||||
* @defgroup DL_ETHERNET BACnet Ethernet DataLink Network Layer
|
||||
* @ingroup DataLink
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief Implementation of the finite state machines
|
||||
* @brief Implementation of the finite state machines
|
||||
* and BACnet Master-Slave Twisted Pair (MS/TP) functions
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date 2003
|
||||
* @details This clause describes a Master-Slave/Token-Passing (MS/TP)
|
||||
* @details This clause describes a Master-Slave/Token-Passing (MS/TP)
|
||||
* data link protocol, which provides the same services to the network layer
|
||||
* as ISO 8802-2 Logical Link Control. It uses services provided by the
|
||||
* EIA-485 physical layer. Relevant clauses of EIA-485 are deemed to be
|
||||
@@ -14,7 +14,7 @@
|
||||
* and no parity.
|
||||
* (b) An EIA-485 transceiver whose driver may be disabled.
|
||||
* (c) A timer with a resolution of five milliseconds or less
|
||||
*
|
||||
*
|
||||
* @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
|
||||
* @defgroup DLMSTP BACnet MS/TP DataLink Network Layer
|
||||
* @ingroup DataLink
|
||||
|
||||
+20
-20
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief API for the BACnet MS/TP finite state machines and their data
|
||||
* @brief API for the BACnet MS/TP finite state machines and their data
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date 2004
|
||||
* @copyright SPDX-License-Identifier: MIT
|
||||
@@ -76,7 +76,7 @@ struct mstp_port_struct_t {
|
||||
uint8_t HeaderCRC;
|
||||
/* Used to store the actual CRC from the header. */
|
||||
uint8_t HeaderCRCActual;
|
||||
/* Used as an index by the Receive State Machine,
|
||||
/* Used as an index by the Receive State Machine,
|
||||
up to a maximum value of InputBufferSize. */
|
||||
uint32_t Index;
|
||||
/* An array of octets, used to store octets as they are received.
|
||||
@@ -87,9 +87,9 @@ struct mstp_port_struct_t {
|
||||
hold contiguous memory. */
|
||||
uint8_t *InputBuffer;
|
||||
uint16_t InputBufferSize;
|
||||
/* "Next Station," the MAC address of the node to which
|
||||
/* "Next Station," the MAC address of the node to which
|
||||
This Station passes */
|
||||
/* the token. If the Next_Station is unknown, Next_Station
|
||||
/* the token. If the Next_Station is unknown, Next_Station
|
||||
shall be equal to */
|
||||
/* This_Station. */
|
||||
uint8_t Next_Station;
|
||||
@@ -99,10 +99,10 @@ struct mstp_port_struct_t {
|
||||
/* A counter of transmission retries used for Token and Poll For Master
|
||||
transmission. */
|
||||
unsigned RetryCount;
|
||||
/* A timer with nominal 5 millisecond resolution used to measure
|
||||
and generate silence on the medium between octets. It is
|
||||
incremented by a timer process and is cleared by the Receive
|
||||
State Machine when activity is detected and by the SendFrame
|
||||
/* A timer with nominal 5 millisecond resolution used to measure
|
||||
and generate silence on the medium between octets. It is
|
||||
incremented by a timer process and is cleared by the Receive
|
||||
State Machine when activity is detected and by the SendFrame
|
||||
procedure as each octet is transmitted. */
|
||||
/* Since the timer resolution is limited and the timer is not necessarily
|
||||
synchronized to other machine events, a timer value of N will actually
|
||||
@@ -122,9 +122,9 @@ struct mstp_port_struct_t {
|
||||
/* Used to store the Source Address of a received frame. */
|
||||
uint8_t SourceAddress;
|
||||
|
||||
/* The number of tokens received by this node. When this counter
|
||||
/* The number of tokens received by this node. When this counter
|
||||
reaches the value Npoll, the node polls the address range between
|
||||
TS and NS for additional master nodes. TokenCount is set to zero
|
||||
TS and NS for additional master nodes. TokenCount is set to zero
|
||||
at the end of the polling process. */
|
||||
unsigned TokenCount;
|
||||
|
||||
@@ -186,8 +186,8 @@ struct mstp_port_struct_t {
|
||||
Tframe_abort = 1 + ((60*1000UL)/RS485_Baud); */
|
||||
uint8_t Tframe_abort;
|
||||
|
||||
/* The maximum time a node may wait after reception of a frame that
|
||||
expects a reply before sending the first octet of a reply or
|
||||
/* The maximum time a node may wait after reception of a frame that
|
||||
expects a reply before sending the first octet of a reply or
|
||||
Reply Postponed frame: 250 milliseconds. */
|
||||
uint8_t Treply_delay;
|
||||
|
||||
@@ -197,15 +197,15 @@ struct mstp_port_struct_t {
|
||||
larger values for this timeout, not to exceed 300 milliseconds.) */
|
||||
uint16_t Treply_timeout;
|
||||
|
||||
/* The minimum time without a DataAvailable or ReceiveError event
|
||||
that a node must wait for a remote node to begin using a token
|
||||
or replying to a Poll For Master frame: 20 milliseconds.
|
||||
(Implementations may use larger values for this timeout,
|
||||
/* The minimum time without a DataAvailable or ReceiveError event
|
||||
that a node must wait for a remote node to begin using a token
|
||||
or replying to a Poll For Master frame: 20 milliseconds.
|
||||
(Implementations may use larger values for this timeout,
|
||||
not to exceed 35 milliseconds.) */
|
||||
uint8_t Tusage_timeout;
|
||||
|
||||
/* The minimum time after the end of the stop bit of the final
|
||||
octet of a received frame before a node may enable its
|
||||
/* The minimum time after the end of the stop bit of the final
|
||||
octet of a received frame before a node may enable its
|
||||
EIA-485 driver: 40 bit times.
|
||||
40 bits is 4 octets including a start and stop bit with each octet.
|
||||
turnaround_time_milliseconds = (Tturnaround*1000UL)/RS485_Baud; */
|
||||
@@ -233,7 +233,7 @@ BACNET_STACK_EXPORT
|
||||
bool MSTP_Line_Active(struct mstp_port_struct_t *mstp_port);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t MSTP_Create_Frame(uint8_t *buffer,
|
||||
uint16_t MSTP_Create_Frame(uint8_t *buffer,
|
||||
uint16_t buffer_len,
|
||||
uint8_t frame_type,
|
||||
uint8_t destination,
|
||||
@@ -243,7 +243,7 @@ uint16_t MSTP_Create_Frame(uint8_t *buffer,
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void MSTP_Create_And_Send_Frame(
|
||||
struct mstp_port_struct_t *mstp_port,
|
||||
struct mstp_port_struct_t *mstp_port,
|
||||
uint8_t frame_type,
|
||||
uint8_t destination,
|
||||
uint8_t source,
|
||||
|
||||
@@ -49,12 +49,12 @@
|
||||
/* frame specific data */
|
||||
#define MSTP_PREAMBLE_X55 (0x55)
|
||||
/* The length of the data portion of a Test_Request, Test_Response,
|
||||
BACnet Data Expecting Reply, or BACnet Data Not Expecting Reply frame
|
||||
may range from 0 to 501 octets.
|
||||
The length of the data portion of a proprietary frame shall
|
||||
BACnet Data Expecting Reply, or BACnet Data Not Expecting Reply frame
|
||||
may range from 0 to 501 octets.
|
||||
The length of the data portion of a proprietary frame shall
|
||||
be in the range of 2 to 501 octets.*/
|
||||
#define MSTP_FRAME_NPDU_MAX 501
|
||||
/* COBS-encoded frames data parameter length is between
|
||||
/* COBS-encoded frames data parameter length is between
|
||||
502 and 1497 octets, inclusive */
|
||||
#define MSTP_EXTENDED_FRAME_NPDU_MAX 1497
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @file
|
||||
* @brief Enumerations to text for BACnet Master-Slave Twisted Pair (MS/TP)
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date 2007
|
||||
* @date 2007
|
||||
* @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
|
||||
* @defgroup DLMSTP BACnet MS/TP DataLink Network Layer
|
||||
* @ingroup DataLink
|
||||
@@ -64,14 +64,14 @@ const char *mstptext_frame_type(unsigned index)
|
||||
FRAME_TYPE_PROPRIETARY_MIN, "UNKNOWN", "PROPRIETARY");
|
||||
}
|
||||
|
||||
static INDTEXT_DATA mstp_zero_config_state_text[] = {
|
||||
static INDTEXT_DATA mstp_zero_config_state_text[] = {
|
||||
{ MSTP_ZERO_CONFIG_STATE_INIT, "INIT" },
|
||||
{ MSTP_ZERO_CONFIG_STATE_IDLE, "IDLE" },
|
||||
{ MSTP_ZERO_CONFIG_STATE_LURK, "LURK" },
|
||||
{ MSTP_ZERO_CONFIG_STATE_CLAIM, "CLAIM" },
|
||||
{ MSTP_ZERO_CONFIG_STATE_CONFIRM, "CONFIRM" },
|
||||
{ MSTP_ZERO_CONFIG_STATE_USE, "USE" },
|
||||
{ 0, NULL }
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
const char *mstptext_zero_config_state(unsigned index)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief API for the BACnet MS/TP defines to text functions
|
||||
* @brief API for the BACnet MS/TP defines to text functions
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date 2007
|
||||
* @copyright SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief BACnetDate, BACnetTime, BACnetDateTime, BACnetDateRange complex data
|
||||
* @brief BACnetDate, BACnetTime, BACnetDateTime, BACnetDateRange complex data
|
||||
* type encode and decode functions
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @author Greg Shue <greg.shue@outlook.com>
|
||||
@@ -1179,7 +1179,7 @@ int bacapp_decode_context_datetime(
|
||||
* @param value2 - complex data value 2 structure
|
||||
* @return true if the two complex data values are the same
|
||||
*/
|
||||
bool bacnet_daterange_same(BACNET_DATE_RANGE *value1,
|
||||
bool bacnet_daterange_same(BACNET_DATE_RANGE *value1,
|
||||
BACNET_DATE_RANGE *value2)
|
||||
{
|
||||
bool status = false;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief API for BACnetDate, BACnetTime, BACnetDateTime, BACnetDateRange
|
||||
* @brief API for BACnetDate, BACnetTime, BACnetDateTime, BACnetDateRange
|
||||
* complex data type encode and decode
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @author Greg Shue <greg.shue@outlook.com>
|
||||
@@ -282,13 +282,13 @@ int bacapp_decode_context_datetime(uint8_t *apdu,
|
||||
BACNET_DATE_TIME *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacnet_daterange_same(BACNET_DATE_RANGE *value1,
|
||||
bool bacnet_daterange_same(BACNET_DATE_RANGE *value1,
|
||||
BACNET_DATE_RANGE *value2);
|
||||
BACNET_STACK_EXPORT
|
||||
int bacnet_daterange_encode(uint8_t *apdu, BACNET_DATE_RANGE *value);
|
||||
BACNET_STACK_EXPORT
|
||||
int bacnet_daterange_decode(uint8_t *apdu,
|
||||
uint32_t apdu_size,
|
||||
int bacnet_daterange_decode(uint8_t *apdu,
|
||||
uint32_t apdu_size,
|
||||
BACNET_DATE_RANGE *value);
|
||||
BACNET_STACK_EXPORT
|
||||
int bacnet_daterange_context_encode(
|
||||
|
||||
+2
-2
@@ -62,9 +62,9 @@ extern "C" {
|
||||
int dcc_encode_apdu(
|
||||
uint8_t * apdu,
|
||||
uint8_t invoke_id,
|
||||
uint16_t timeDuration,
|
||||
uint16_t timeDuration,
|
||||
BACNET_COMMUNICATION_ENABLE_DISABLE enable_disable,
|
||||
BACNET_CHARACTER_STRING * password);
|
||||
BACNET_CHARACTER_STRING * password);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int dcc_decode_service_request(
|
||||
|
||||
@@ -57,4 +57,3 @@ int delete_object_decode_service_request(
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+2
-2
@@ -215,8 +215,8 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
size_t event_notification_service_request_encode(
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
BACNET_EVENT_NOTIFICATION_DATA *data);
|
||||
|
||||
/***************************************************
|
||||
|
||||
@@ -43,7 +43,7 @@ int getevent_apdu_encode(uint8_t *apdu,
|
||||
* @return number of bytes encoded, or zero if unable to encode or too large
|
||||
*/
|
||||
size_t getevent_service_request_encode(
|
||||
uint8_t *apdu, size_t apdu_size,
|
||||
uint8_t *apdu, size_t apdu_size,
|
||||
BACNET_OBJECT_ID *data)
|
||||
{
|
||||
size_t apdu_len = 0; /* total length of the apdu, return value */
|
||||
|
||||
@@ -54,7 +54,7 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
size_t getevent_service_request_encode(
|
||||
uint8_t *apdu, size_t apdu_size,
|
||||
uint8_t *apdu, size_t apdu_size,
|
||||
BACNET_OBJECT_ID *data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
@@ -707,7 +707,7 @@ bool bacnet_bdt_entry_from_ascii(BACNET_BDT_ENTRY *value, const char *argv)
|
||||
if (name && isalnum(name[0])) {
|
||||
value->bbmd_address.host_ip_address = false;
|
||||
value->bbmd_address.host_name = true;
|
||||
characterstring_init(&value->bbmd_address.host.name,
|
||||
characterstring_init(&value->bbmd_address.host.name,
|
||||
CHARACTER_ANSI_X34,
|
||||
name, name_len);
|
||||
} else {
|
||||
@@ -775,7 +775,7 @@ int bacnet_bdt_entry_to_ascii(
|
||||
(int)characterstring_length(&value->bbmd_address.host.name),
|
||||
characterstring_value(&value->bbmd_address.host.name),
|
||||
value->bbmd_address.port);
|
||||
}
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
@@ -1065,7 +1065,7 @@ bool bacnet_fdt_entry_from_ascii(BACNET_FDT_ENTRY *value, const char *argv)
|
||||
"%02x%02x:%02x%02x:%02x%02x:%02x%02x:"
|
||||
"%02x%02x:%02x%02x:%02x%02x:%02x%02x:%5u,%5u,%5u",
|
||||
&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6], &a[7], &a[8],
|
||||
&a[9], &a[10], &a[11], &a[12], &a[13], &a[14], &a[15], &p, &ttl,
|
||||
&a[9], &a[10], &a[11], &a[12], &a[13], &a[14], &a[15], &p, &ttl,
|
||||
&rttl);
|
||||
if ((count == 16) || (count == 17) || (count == 18) || (count == 19)) {
|
||||
uint8_t address[18];
|
||||
|
||||
+10
-10
@@ -41,7 +41,7 @@ typedef struct BACnetHostNPort {
|
||||
/**
|
||||
* BACnetBDTEntry ::= SEQUENCE {
|
||||
* bbmd-address [0] BACnetHostNPort,
|
||||
* broadcast-mask [1] OCTET STRING OPTIONAL
|
||||
* broadcast-mask [1] OCTET STRING OPTIONAL
|
||||
* -- shall be present if BACnet/IP, and absent for BACnet/IPv6
|
||||
* }
|
||||
*/
|
||||
@@ -52,11 +52,11 @@ typedef struct BACnetBDTEntry {
|
||||
|
||||
/**
|
||||
* BACnetFDTEntry ::= SEQUENCE {
|
||||
* bacnetip-address [0] OCTET STRING,
|
||||
* bacnetip-address [0] OCTET STRING,
|
||||
* -- the 6-octet B/IP or 18-octet B/IPv6 address of the registrant
|
||||
* time-to-live [1] Unsigned16,
|
||||
* time-to-live [1] Unsigned16,
|
||||
* -- time to live in seconds at the time of registration
|
||||
* remaining-time-to-live [2] Unsigned16
|
||||
* remaining-time-to-live [2] Unsigned16
|
||||
* -- remaining time to live in seconds, incl. grace period
|
||||
* }
|
||||
*/
|
||||
@@ -72,7 +72,7 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int host_n_port_address_encode(
|
||||
uint8_t *apdu,
|
||||
uint8_t *apdu,
|
||||
BACNET_HOST_N_PORT *address);
|
||||
BACNET_STACK_EXPORT
|
||||
int host_n_port_encode(
|
||||
@@ -109,7 +109,7 @@ extern "C" {
|
||||
BACNET_HOST_N_PORT * src);
|
||||
BACNET_STACK_EXPORT
|
||||
bool host_n_port_from_ascii(
|
||||
BACNET_HOST_N_PORT *value,
|
||||
BACNET_HOST_N_PORT *value,
|
||||
const char *argv);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
@@ -142,11 +142,11 @@ extern "C" {
|
||||
BACNET_BDT_ENTRY * src);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacnet_bdt_entry_from_ascii(
|
||||
BACNET_BDT_ENTRY *value,
|
||||
BACNET_BDT_ENTRY *value,
|
||||
const char *argv);
|
||||
BACNET_STACK_EXPORT
|
||||
int bacnet_bdt_entry_to_ascii(
|
||||
char *str, size_t str_size,
|
||||
char *str, size_t str_size,
|
||||
BACNET_BDT_ENTRY *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
@@ -179,11 +179,11 @@ extern "C" {
|
||||
BACNET_FDT_ENTRY * src);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacnet_fdt_entry_from_ascii(
|
||||
BACNET_FDT_ENTRY *value,
|
||||
BACNET_FDT_ENTRY *value,
|
||||
const char *argv);
|
||||
BACNET_STACK_EXPORT
|
||||
int bacnet_fdt_entry_to_ascii(
|
||||
char *str, size_t str_size,
|
||||
char *str, size_t str_size,
|
||||
BACNET_FDT_ENTRY *value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -97,7 +97,7 @@ bool indtext_by_istring(
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Search a list of strings to find a matching string,
|
||||
* @brief Search a list of strings to find a matching string,
|
||||
* or return a default index
|
||||
* @param data_list - list of strings and indices
|
||||
* @param search_name - string to search for
|
||||
|
||||
@@ -110,15 +110,15 @@ extern "C" {
|
||||
bool lighting_command_same(
|
||||
BACNET_LIGHTING_COMMAND * dst,
|
||||
BACNET_LIGHTING_COMMAND * src);
|
||||
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool lighting_command_from_ascii(
|
||||
BACNET_LIGHTING_COMMAND *value,
|
||||
BACNET_LIGHTING_COMMAND *value,
|
||||
const char *argv);
|
||||
BACNET_STACK_EXPORT
|
||||
int lighting_command_to_ascii(
|
||||
const BACNET_LIGHTING_COMMAND *value,
|
||||
char *buf,
|
||||
const BACNET_LIGHTING_COMMAND *value,
|
||||
char *buf,
|
||||
size_t buf_size);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
@@ -80,4 +80,3 @@ int list_element_error_ack_decode(
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+3
-3
@@ -36,13 +36,13 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int life_safety_operation_encode(
|
||||
uint8_t *apdu,
|
||||
uint8_t *apdu,
|
||||
BACNET_LSO_DATA *data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
size_t life_safety_operation_request_encode(
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
BACNET_LSO_DATA *data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
+6
-6
@@ -79,7 +79,7 @@ ABORT.indication Yes Yes Yes No
|
||||
* The Network Layer Protocol Control Information byte is described
|
||||
* in section 6.2.2 of the BACnet standard.
|
||||
* @param npdu [out] Buffer which will hold the encoded NPDU header bytes.
|
||||
* The size isn't given, but it must be at least 2 bytes for the simplest
|
||||
* The size isn't given, but it must be at least 2 bytes for the simplest
|
||||
* case, and should always be at least 24 bytes to accommodate the maximal
|
||||
* case (all fields loaded). If the buffer is NULL, the number of bytes
|
||||
* the buffer would have held is returned.
|
||||
@@ -244,7 +244,7 @@ int npdu_encode_pdu(uint8_t *npdu,
|
||||
* @param pdu_size Number of bytes in the buffer to hold the encoded data.
|
||||
* If the size is zero, the number of bytes the buffer would have held
|
||||
* is returned.
|
||||
* The size isn't given, but it must be at least 2 bytes for the simplest
|
||||
* The size isn't given, but it must be at least 2 bytes for the simplest
|
||||
* case, and should always be at least 24 bytes to accommodate the maximal
|
||||
* case (all fields loaded). Can be NULL to determine length of buffer.
|
||||
* @param dest [in] The routing destination information if the message must
|
||||
@@ -314,7 +314,7 @@ is expected for the service being issued.
|
||||
* @see npdu_encode_npdu_network if you need to set a network layer msg.
|
||||
*
|
||||
* @param npdu_data [out] Returns a filled-out structure with information
|
||||
* provided by the other arguments and
|
||||
* provided by the other arguments and
|
||||
* good defaults.
|
||||
* @param data_expecting_reply [in] True if message should have a reply.
|
||||
* @param priority [in] One of the 4 priorities defined in section 6.2.2,
|
||||
@@ -343,7 +343,7 @@ void npdu_encode_npdu_data(BACNET_NPDU_DATA *npdu_data,
|
||||
* APDU instead of a Network Layer Message.
|
||||
*
|
||||
* @param npdu_data [out] Returns a filled-out structure with information
|
||||
* provided by the other arguments and
|
||||
* provided by the other arguments and
|
||||
* good defaults.
|
||||
* @param network_message_type [in] The type of Network Layer Message.
|
||||
* @param data_expecting_reply [in] True if message should have a reply.
|
||||
@@ -414,10 +414,10 @@ int npdu_decode(uint8_t *npdu,
|
||||
* This src describes the original source of the message when
|
||||
* it had to be routed to reach this BACnet Device.
|
||||
* @param npdu_data [out] Returns a filled-out structure with information
|
||||
* decoded from the NCPI and other NPDU
|
||||
* decoded from the NCPI and other NPDU
|
||||
* bytes.
|
||||
* @return On success, returns the number of bytes which were decoded from the
|
||||
* NPDU section; if this is a network layer message, there may
|
||||
* NPDU section; if this is a network layer message, there may
|
||||
* be more bytes left in the NPDU; if not a network msg, the APDU follows. If 0
|
||||
* or negative, there were problems with the data or arguments.
|
||||
*/
|
||||
|
||||
+4
-4
@@ -19,14 +19,14 @@
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This structure defines the NPCI (header part) of the NPDU.
|
||||
* This structure defines the NPCI (header part) of the NPDU.
|
||||
* See Figures 5-2 and 7-1 of the BACnet standard for clarity
|
||||
*
|
||||
*
|
||||
* NPDU = NPCI + NSDU
|
||||
* "Network-layer Protocol Data Unit" =
|
||||
* "Network Protocol Control Information" +
|
||||
* "Network Service Data Unit"
|
||||
* (APDU for application messages,
|
||||
* "Network Service Data Unit"
|
||||
* (APDU for application messages,
|
||||
* "Network Message" for network layer messages)
|
||||
*/
|
||||
typedef struct bacnet_npdu_data_t {
|
||||
|
||||
+14
-14
@@ -401,9 +401,9 @@ static const int Color_Temperature_Properties_Required[] = {
|
||||
PROP_DEFAULT_RAMP_RATE, PROP_DEFAULT_STEP_INCREMENT, -1
|
||||
};
|
||||
|
||||
static const int Color_Temperature_Properties_Optional[] = {
|
||||
PROP_DESCRIPTION, PROP_MIN_PRES_VALUE, PROP_MAX_PRES_VALUE,
|
||||
PROP_TRANSITION, PROP_VALUE_SOURCE, PROP_AUDIT_LEVEL,
|
||||
static const int Color_Temperature_Properties_Optional[] = {
|
||||
PROP_DESCRIPTION, PROP_MIN_PRES_VALUE, PROP_MAX_PRES_VALUE,
|
||||
PROP_TRANSITION, PROP_VALUE_SOURCE, PROP_AUDIT_LEVEL,
|
||||
PROP_AUDITABLE_OPERATIONS, PROP_TAGS, PROP_PROFILE_LOCATION,
|
||||
PROP_PROFILE_NAME, -1 };
|
||||
|
||||
@@ -1594,16 +1594,16 @@ unsigned property_list_special_count(
|
||||
#endif
|
||||
|
||||
#if BACNET_PROPERTY_ARRAY_LISTS
|
||||
/* standard properties that are arrays
|
||||
/* standard properties that are arrays
|
||||
but not necessary supported in every object */
|
||||
|
||||
/* clang-format off */
|
||||
static const int Properties_BACnetARRAY[] = {
|
||||
PROP_AUTHENTICATION_FACTORS, PROP_ASSIGNED_ACCESS_RIGHTS,
|
||||
PROP_PRIORITY_ARRAY, PROP_VALUE_SOURCE_ARRAY, PROP_COMMAND_TIME_ARRAY,
|
||||
PROP_ALARM_VALUES, PROP_FAULT_VALUES,
|
||||
PROP_EVENT_TIME_STAMPS, PROP_EVENT_MESSAGE_TEXTS,
|
||||
PROP_EVENT_MESSAGE_TEXTS_CONFIG,
|
||||
static const int Properties_BACnetARRAY[] = {
|
||||
PROP_AUTHENTICATION_FACTORS, PROP_ASSIGNED_ACCESS_RIGHTS,
|
||||
PROP_PRIORITY_ARRAY, PROP_VALUE_SOURCE_ARRAY, PROP_COMMAND_TIME_ARRAY,
|
||||
PROP_ALARM_VALUES, PROP_FAULT_VALUES,
|
||||
PROP_EVENT_TIME_STAMPS, PROP_EVENT_MESSAGE_TEXTS,
|
||||
PROP_EVENT_MESSAGE_TEXTS_CONFIG,
|
||||
PROP_SUPPORTED_FORMATS, PROP_SUPPORTED_FORMAT_CLASSES,
|
||||
PROP_SUBORDINATE_LIST, PROP_SUBORDINATE_ANNOTATIONS, PROP_SUBORDINATE_TAGS,
|
||||
PROP_SUBORDINATE_NODE_TYPES, PROP_SUBORDINATE_RELATIONSHIPS,
|
||||
@@ -1614,7 +1614,7 @@ static const int Properties_BACnetARRAY[] = {
|
||||
PROP_LINK_SPEEDS, PROP_IP_DNS_SERVER, PROP_IPV6_DNS_SERVER,
|
||||
PROP_FLOOR_TEXT, PROP_CAR_DOOR_TEXT, PROP_ASSIGNED_LANDING_CALLS,
|
||||
PROP_MAKING_CAR_CALL, PROP_REGISTERED_CAR_CALL, PROP_CAR_DOOR_STATUS,
|
||||
PROP_CAR_DOOR_COMMAND, PROP_LANDING_DOOR_STATUS,
|
||||
PROP_CAR_DOOR_COMMAND, PROP_LANDING_DOOR_STATUS,
|
||||
PROP_STAGES, PROP_STAGE_NAMES, PROP_TARGET_REFERENCES,
|
||||
PROP_MONITORED_OBJECTS, PROP_TAGS, -1
|
||||
};
|
||||
@@ -1713,7 +1713,7 @@ bool property_list_writable_member(
|
||||
case OBJECT_PULSE_CONVERTER:
|
||||
if (object_property == PROP_ADJUST_VALUE) {
|
||||
writable = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case OBJECT_EVENT_LOG:
|
||||
case OBJECT_TRENDLOG:
|
||||
@@ -1764,13 +1764,13 @@ bool property_list_writable_member(
|
||||
(object_property == PROP_CHANNEL_NUMBER) ||
|
||||
(object_property == PROP_CONTROL_GROUPS)) {
|
||||
writable = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case OBJECT_LIGHTING_OUTPUT:
|
||||
if ((object_property == PROP_PRESENT_VALUE) ||
|
||||
(object_property == PROP_LIGHTING_COMMAND)) {
|
||||
writable = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case OBJECT_AUDIT_LOG:
|
||||
if (object_property == PROP_ENABLE) {
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
size_t reinitialize_device_request_encode(
|
||||
uint8_t *apdu, size_t apdu_size,
|
||||
uint8_t *apdu, size_t apdu_size,
|
||||
BACNET_REINITIALIZED_STATE state,
|
||||
BACNET_CHARACTER_STRING *password);
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ extern "C" {
|
||||
/** Function template for ReadRange information retrieval function.
|
||||
* A function template; @see device.c for assignment to object types.
|
||||
* @ingroup ObjHelpers
|
||||
* @param pRequest [in] Info on the request.
|
||||
* @param pRequest [in] Info on the request.
|
||||
* @param pInfo [out] Where to write the response to.
|
||||
* @return True on success, False on error or failure.
|
||||
*/
|
||||
@@ -126,12 +126,12 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int read_range_encode(
|
||||
uint8_t *apdu,
|
||||
uint8_t *apdu,
|
||||
BACNET_READ_RANGE_DATA *data);
|
||||
BACNET_STACK_EXPORT
|
||||
size_t read_range_request_encode(
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
BACNET_READ_RANGE_DATA *data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief BACnet ReadProperty-Request and ReadProperty-ACK encode and decode
|
||||
* @brief BACnet ReadProperty-Request and ReadProperty-ACK encode and decode
|
||||
* helper functions
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date 2005
|
||||
@@ -407,7 +407,7 @@ int rp_ack_encode_apdu(
|
||||
* @param apdu_size [in] The total length of the apdu.
|
||||
* @param rpdata [out] The structure holding the partially decoded result.
|
||||
* @return Number of decoded bytes (could be less than apdu_len),
|
||||
* or -1 on decoding error.
|
||||
* or -1 on decoding error.
|
||||
*/
|
||||
int rp_ack_decode_service_request(uint8_t *apdu,
|
||||
int apdu_size,
|
||||
@@ -470,7 +470,7 @@ int rp_ack_decode_service_request(uint8_t *apdu,
|
||||
return BACNET_STATUS_ERROR;
|
||||
}
|
||||
/* determine the length of the data blob */
|
||||
data_len = bacnet_enclosed_data_length(&apdu[apdu_len],
|
||||
data_len = bacnet_enclosed_data_length(&apdu[apdu_len],
|
||||
apdu_size - apdu_len);
|
||||
if (data_len == BACNET_STATUS_ERROR) {
|
||||
return BACNET_STATUS_ERROR;
|
||||
|
||||
+6
-6
@@ -55,24 +55,24 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int read_property_request_encode(
|
||||
uint8_t *apdu,
|
||||
uint8_t *apdu,
|
||||
BACNET_READ_PROPERTY_DATA *data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
size_t read_property_request_service_encode(
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
BACNET_READ_PROPERTY_DATA *data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int read_property_ack_encode(
|
||||
uint8_t *apdu,
|
||||
uint8_t *apdu,
|
||||
BACNET_READ_PROPERTY_DATA *data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
size_t read_property_ack_service_encode(
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
BACNET_READ_PROPERTY_DATA *data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
+1
-1
@@ -562,7 +562,7 @@ int rpm_ack_decode_object_end(uint8_t *apdu, unsigned apdu_size)
|
||||
if (bacnet_is_closing_tag_number(apdu, apdu_size, 1, &len)) {
|
||||
apdu_len += len;
|
||||
} else {
|
||||
return BACNET_STATUS_ERROR;
|
||||
return BACNET_STATUS_ERROR;
|
||||
}
|
||||
|
||||
return apdu_len;
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief BACnet ReadPropertyMultiple -Request and -Ack encode and decode
|
||||
* @brief BACnet ReadPropertyMultiple -Request and -Ack encode and decode
|
||||
* API header file
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date 2005
|
||||
@@ -96,11 +96,11 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
int read_property_multiple_request_encode(
|
||||
uint8_t *apdu,
|
||||
BACNET_READ_ACCESS_DATA *data);
|
||||
BACNET_READ_ACCESS_DATA *data);
|
||||
BACNET_STACK_EXPORT
|
||||
size_t read_property_multiple_request_service_encode(
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
BACNET_READ_ACCESS_DATA *data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
@@ -441,7 +441,7 @@ bool bacapp_timestamp_init_ascii(BACNET_TIMESTAMP *timestamp, const char *ascii)
|
||||
* @param ts - pointer to the timestamp
|
||||
* @return number of characters printed
|
||||
*/
|
||||
int bacapp_timestamp_to_ascii(char *str, size_t str_size,
|
||||
int bacapp_timestamp_to_ascii(char *str, size_t str_size,
|
||||
BACNET_TIMESTAMP *timestamp)
|
||||
{
|
||||
int str_len = 0;
|
||||
@@ -461,7 +461,7 @@ int bacapp_timestamp_to_ascii(char *str, size_t str_size,
|
||||
break;
|
||||
case TIME_STAMP_SEQUENCE:
|
||||
/* 65535 */
|
||||
str_len = snprintf(str, str_size, "%u",
|
||||
str_len = snprintf(str, str_size, "%u",
|
||||
(unsigned)timestamp->value.sequenceNum);
|
||||
break;
|
||||
case TIME_STAMP_DATETIME:
|
||||
|
||||
@@ -57,7 +57,7 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacapp_timestamp_same(
|
||||
BACNET_TIMESTAMP *value1,
|
||||
BACNET_TIMESTAMP *value1,
|
||||
BACNET_TIMESTAMP *value2);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
@@ -100,8 +100,8 @@ extern "C" {
|
||||
const char *ascii);
|
||||
BACNET_STACK_EXPORT
|
||||
int bacapp_timestamp_to_ascii(
|
||||
char *str,
|
||||
size_t str_size,
|
||||
char *str,
|
||||
size_t str_size,
|
||||
BACNET_TIMESTAMP *timestamp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
+3
-3
@@ -55,12 +55,12 @@ extern "C" {
|
||||
/* encode service */
|
||||
BACNET_STACK_EXPORT
|
||||
size_t writeproperty_apdu_encode(
|
||||
uint8_t *apdu,
|
||||
uint8_t *apdu,
|
||||
BACNET_WRITE_PROPERTY_DATA *data);
|
||||
BACNET_STACK_EXPORT
|
||||
size_t writeproperty_service_request_encode(
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
BACNET_WRITE_PROPERTY_DATA *data);
|
||||
BACNET_STACK_EXPORT
|
||||
int wp_encode_apdu(
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user