Run clang-format and enable CI check for it (#755)
* pre-commit: Update and enable clang-format check There is newer version from clang-format so use that. We do not yet want 18 as that is little bit too new. * Format some thing by hand which clang-format "breaks" Clang-format will format some things little bit off in some cases. Format some things by hand so we get cleaner end result. * Run clang-format with ``` pre-commit run --all-files clang-format ``` We have already in previously checked places where clang-format does not make good format and ignored those (hopefully most of the things). --------- Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
This commit is contained in:
@@ -27,9 +27,16 @@ static struct object_data Object_List[MAX_ACCUMULATORS];
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
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_SCALE, PROP_UNITS,
|
||||
PROP_MAX_PRES_VALUE, -1 };
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
PROP_SCALE,
|
||||
PROP_UNITS,
|
||||
PROP_MAX_PRES_VALUE,
|
||||
-1 };
|
||||
|
||||
static const int Properties_Optional[] = { PROP_DESCRIPTION, -1 };
|
||||
|
||||
@@ -138,8 +145,9 @@ bool Accumulator_Object_Name(
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_ACCUMULATORS) {
|
||||
snprintf(text, sizeof(text),
|
||||
"ACCUMULATOR-%lu", (unsigned long)object_instance);
|
||||
snprintf(
|
||||
text, sizeof(text), "ACCUMULATOR-%lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, text);
|
||||
}
|
||||
|
||||
@@ -314,7 +322,8 @@ int Accumulator_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
break;
|
||||
case PROP_SCALE:
|
||||
/* context tagged choice: [0]=REAL, [1]=INTEGER */
|
||||
apdu_len = encode_context_signed(&apdu[apdu_len], 1,
|
||||
apdu_len = encode_context_signed(
|
||||
&apdu[apdu_len], 1,
|
||||
Accumulator_Scale_Integer(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_MAX_PRES_VALUE:
|
||||
|
||||
@@ -20,95 +20,71 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
BACNET_STACK_EXPORT
|
||||
void Accumulator_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void Accumulator_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Accumulator_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Accumulator_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Accumulator_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Accumulator_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Accumulator_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Accumulator_Instance_To_Index(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Accumulator_Name(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
char *Accumulator_Name(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Name_Set(uint32_t object_instance, char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Accumulator_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Description_Set(
|
||||
uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
char *Accumulator_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Description_Set(uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Units_Set(uint32_t instance, uint16_t units);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Accumulator_Units(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Units_Set(
|
||||
uint32_t instance,
|
||||
uint16_t units);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Accumulator_Units(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
int Accumulator_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Accumulator_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_UNSIGNED_INTEGER Accumulator_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Present_Value_Set(
|
||||
uint32_t object_instance, BACNET_UNSIGNED_INTEGER value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_UNSIGNED_INTEGER Accumulator_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_UNSIGNED_INTEGER value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_UNSIGNED_INTEGER Accumulator_Max_Pres_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Max_Pres_Value_Set(
|
||||
uint32_t object_instance, BACNET_UNSIGNED_INTEGER value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_UNSIGNED_INTEGER Accumulator_Max_Pres_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Max_Pres_Value_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_UNSIGNED_INTEGER value);
|
||||
BACNET_STACK_EXPORT
|
||||
int32_t Accumulator_Scale_Integer(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Scale_Integer_Set(uint32_t object_instance, int32_t);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int32_t Accumulator_Scale_Integer(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Scale_Integer_Set(uint32_t object_instance, int32_t);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Accumulator_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Accumulator_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#define ACCUMULATOR_OBJ_FUNCTIONS \
|
||||
OBJECT_ACCUMULATOR, Accumulator_Init, Accumulator_Count, \
|
||||
Accumulator_Index_To_Instance, Accumulator_Valid_Instance, \
|
||||
Accumulator_Name, Accumulator_Read_Property, Accumulator_Write_Property, \
|
||||
Accumulator_Property_Lists, NULL, NULL
|
||||
#define ACCUMULATOR_OBJ_FUNCTIONS \
|
||||
OBJECT_ACCUMULATOR, Accumulator_Init, Accumulator_Count, \
|
||||
Accumulator_Index_To_Instance, Accumulator_Valid_Instance, \
|
||||
Accumulator_Name, Accumulator_Read_Property, \
|
||||
Accumulator_Write_Property, Accumulator_Property_Lists, NULL, NULL
|
||||
#endif
|
||||
|
||||
@@ -24,11 +24,19 @@ static ACCESS_CREDENTIAL_DESCR ac_descr[MAX_ACCESS_CREDENTIALS];
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_GLOBAL_IDENTIFIER,
|
||||
PROP_STATUS_FLAGS, PROP_RELIABILITY, PROP_CREDENTIAL_STATUS,
|
||||
PROP_REASON_FOR_DISABLE, PROP_AUTHENTICATION_FACTORS, PROP_ACTIVATION_TIME,
|
||||
PROP_EXPIRATION_TIME, PROP_CREDENTIAL_DISABLE, PROP_ASSIGNED_ACCESS_RIGHTS,
|
||||
-1 };
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_GLOBAL_IDENTIFIER,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_RELIABILITY,
|
||||
PROP_CREDENTIAL_STATUS,
|
||||
PROP_REASON_FOR_DISABLE,
|
||||
PROP_AUTHENTICATION_FACTORS,
|
||||
PROP_ACTIVATION_TIME,
|
||||
PROP_EXPIRATION_TIME,
|
||||
PROP_CREDENTIAL_DISABLE,
|
||||
PROP_ASSIGNED_ACCESS_RIGHTS,
|
||||
-1 };
|
||||
|
||||
static const int Properties_Optional[] = { -1 };
|
||||
|
||||
@@ -123,7 +131,8 @@ bool Access_Credential_Object_Name(
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_ACCESS_CREDENTIALS) {
|
||||
snprintf(text, sizeof(text), "ACCESS CREDENTIAL %lu",
|
||||
snprintf(
|
||||
text, sizeof(text), "ACCESS CREDENTIAL %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, text);
|
||||
}
|
||||
@@ -250,8 +259,8 @@ 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,
|
||||
apdu_len = bacnet_array_encode(
|
||||
rpdata->object_instance, 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) {
|
||||
@@ -275,10 +284,11 @@ int Access_Credential_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
&apdu[0], ac_descr[object_index].credential_disable);
|
||||
break;
|
||||
case PROP_ASSIGNED_ACCESS_RIGHTS:
|
||||
apdu_len = bacnet_array_encode(rpdata->object_instance,
|
||||
rpdata->array_index,
|
||||
apdu_len = bacnet_array_encode(
|
||||
rpdata->object_instance, rpdata->array_index,
|
||||
Access_Credential_Assigned_Access_Rights_Array_Encode,
|
||||
ac_descr[object_index].assigned_access_rights_count, apdu, apdu_size);
|
||||
ac_descr[object_index].assigned_access_rights_count, apdu,
|
||||
apdu_size);
|
||||
if (apdu_len == BACNET_STATUS_ABORT) {
|
||||
rpdata->error_code =
|
||||
ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED;
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "bacnet/rp.h"
|
||||
#include "bacnet/wp.h"
|
||||
|
||||
|
||||
#ifndef MAX_ACCESS_CREDENTIALS
|
||||
#define MAX_ACCESS_CREDENTIALS 4
|
||||
#endif
|
||||
@@ -42,73 +41,56 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct {
|
||||
uint32_t global_identifier;
|
||||
BACNET_RELIABILITY reliability;
|
||||
bool credential_status;
|
||||
uint32_t reasons_count;
|
||||
BACNET_ACCESS_CREDENTIAL_DISABLE_REASON
|
||||
reason_for_disable[MAX_REASONS_FOR_DISABLE];
|
||||
uint32_t auth_factors_count;
|
||||
BACNET_CREDENTIAL_AUTHENTICATION_FACTOR
|
||||
auth_factors[MAX_AUTHENTICATION_FACTORS];
|
||||
BACNET_DATE_TIME activation_time, expiration_time;
|
||||
BACNET_ACCESS_CREDENTIAL_DISABLE credential_disable;
|
||||
uint32_t assigned_access_rights_count;
|
||||
BACNET_ASSIGNED_ACCESS_RIGHTS
|
||||
assigned_access_rights[MAX_ASSIGNED_ACCESS_RIGHTS];
|
||||
} ACCESS_CREDENTIAL_DESCR;
|
||||
typedef struct {
|
||||
uint32_t global_identifier;
|
||||
BACNET_RELIABILITY reliability;
|
||||
bool credential_status;
|
||||
uint32_t reasons_count;
|
||||
BACNET_ACCESS_CREDENTIAL_DISABLE_REASON
|
||||
reason_for_disable[MAX_REASONS_FOR_DISABLE];
|
||||
uint32_t auth_factors_count;
|
||||
BACNET_CREDENTIAL_AUTHENTICATION_FACTOR
|
||||
auth_factors[MAX_AUTHENTICATION_FACTORS];
|
||||
BACNET_DATE_TIME activation_time, expiration_time;
|
||||
BACNET_ACCESS_CREDENTIAL_DISABLE credential_disable;
|
||||
uint32_t assigned_access_rights_count;
|
||||
BACNET_ASSIGNED_ACCESS_RIGHTS
|
||||
assigned_access_rights[MAX_ASSIGNED_ACCESS_RIGHTS];
|
||||
} ACCESS_CREDENTIAL_DESCR;
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Credential_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Credential_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_Credential_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Credential_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_Credential_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Credential_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Credential_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Credential_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_Credential_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Credential_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_Credential_Instance_To_Index(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Credential_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Credential_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Credential_Name_Set(uint32_t object_instance, char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Credential_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Credential_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
int Access_Credential_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Credential_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Access_Credential_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Credential_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Credential_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Credential_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Credential_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Credential_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Credential_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Credential_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Credential_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Credential_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -23,14 +23,25 @@ static ACCESS_DOOR_DESCR ad_descr[MAX_ACCESS_DOORS];
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_PRESENT_VALUE, PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE, PROP_RELIABILITY, PROP_OUT_OF_SERVICE,
|
||||
PROP_PRIORITY_ARRAY, PROP_RELINQUISH_DEFAULT, PROP_DOOR_PULSE_TIME,
|
||||
PROP_DOOR_EXTENDED_PULSE_TIME, PROP_DOOR_OPEN_TOO_LONG_TIME, -1 };
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE,
|
||||
PROP_RELIABILITY,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
PROP_PRIORITY_ARRAY,
|
||||
PROP_RELINQUISH_DEFAULT,
|
||||
PROP_DOOR_PULSE_TIME,
|
||||
PROP_DOOR_EXTENDED_PULSE_TIME,
|
||||
PROP_DOOR_OPEN_TOO_LONG_TIME,
|
||||
-1 };
|
||||
|
||||
static const int Properties_Optional[] = { PROP_DOOR_STATUS, PROP_LOCK_STATUS,
|
||||
PROP_SECURED_STATUS, PROP_DOOR_UNLOCK_DELAY_TIME, PROP_DOOR_ALARM_STATE,
|
||||
-1 };
|
||||
static const int Properties_Optional[] = {
|
||||
PROP_DOOR_STATUS, PROP_LOCK_STATUS,
|
||||
PROP_SECURED_STATUS, PROP_DOOR_UNLOCK_DELAY_TIME,
|
||||
PROP_DOOR_ALARM_STATE, -1
|
||||
};
|
||||
|
||||
static const int Properties_Proprietary[] = { -1 };
|
||||
|
||||
@@ -260,7 +271,8 @@ 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);
|
||||
}
|
||||
@@ -349,9 +361,10 @@ int Access_Door_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu_len = encode_application_boolean(&apdu[0], state);
|
||||
break;
|
||||
case PROP_PRIORITY_ARRAY:
|
||||
apdu_len = bacnet_array_encode(rpdata->object_instance,
|
||||
rpdata->array_index, Access_Door_Priority_Array_Encode,
|
||||
BACNET_MAX_PRIORITY, apdu, apdu_size);
|
||||
apdu_len = bacnet_array_encode(
|
||||
rpdata->object_instance, rpdata->array_index,
|
||||
Access_Door_Priority_Array_Encode, BACNET_MAX_PRIORITY, apdu,
|
||||
apdu_size);
|
||||
if (apdu_len == BACNET_STATUS_ABORT) {
|
||||
rpdata->error_code =
|
||||
ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED;
|
||||
@@ -361,7 +374,8 @@ int Access_Door_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
}
|
||||
break;
|
||||
case PROP_RELINQUISH_DEFAULT:
|
||||
apdu_len = encode_application_enumerated(&apdu[0],
|
||||
apdu_len = encode_application_enumerated(
|
||||
&apdu[0],
|
||||
Access_Door_Relinquish_Default(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_DOOR_STATUS:
|
||||
@@ -447,7 +461,8 @@ bool Access_Door_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
/* Command priority 6 is reserved for use by Minimum On/Off
|
||||
algorithm and may not be used for other purposes in any
|
||||
object. */
|
||||
status = Access_Door_Present_Value_Set(wp_data->object_instance,
|
||||
status = Access_Door_Present_Value_Set(
|
||||
wp_data->object_instance,
|
||||
(BACNET_DOOR_VALUE)value.type.Enumerated,
|
||||
wp_data->priority);
|
||||
if (wp_data->priority == 6) {
|
||||
|
||||
@@ -17,131 +17,96 @@
|
||||
#include "bacnet/rp.h"
|
||||
#include "bacnet/wp.h"
|
||||
|
||||
|
||||
#ifndef MAX_ACCESS_DOORS
|
||||
#define MAX_ACCESS_DOORS 4
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct {
|
||||
bool value_active[BACNET_MAX_PRIORITY];
|
||||
BACNET_DOOR_VALUE priority_array[BACNET_MAX_PRIORITY];
|
||||
BACNET_DOOR_VALUE relinquish_default;
|
||||
BACNET_EVENT_STATE event_state;
|
||||
BACNET_RELIABILITY reliability;
|
||||
bool out_of_service;
|
||||
BACNET_DOOR_STATUS door_status;
|
||||
BACNET_LOCK_STATUS lock_status;
|
||||
BACNET_DOOR_SECURED_STATUS secured_status;
|
||||
uint32_t door_pulse_time, door_extended_pulse_time,
|
||||
door_unlock_delay_time, door_open_too_long_time;
|
||||
BACNET_DOOR_ALARM_STATE door_alarm_state;
|
||||
} ACCESS_DOOR_DESCR;
|
||||
typedef struct {
|
||||
bool value_active[BACNET_MAX_PRIORITY];
|
||||
BACNET_DOOR_VALUE priority_array[BACNET_MAX_PRIORITY];
|
||||
BACNET_DOOR_VALUE relinquish_default;
|
||||
BACNET_EVENT_STATE event_state;
|
||||
BACNET_RELIABILITY reliability;
|
||||
bool out_of_service;
|
||||
BACNET_DOOR_STATUS door_status;
|
||||
BACNET_LOCK_STATUS lock_status;
|
||||
BACNET_DOOR_SECURED_STATUS secured_status;
|
||||
uint32_t door_pulse_time, door_extended_pulse_time, door_unlock_delay_time,
|
||||
door_open_too_long_time;
|
||||
BACNET_DOOR_ALARM_STATE door_alarm_state;
|
||||
} ACCESS_DOOR_DESCR;
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Door_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_Door_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Door_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_Door_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Door_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_Door_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Door_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_Door_Instance_To_Index(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_DOOR_VALUE Access_Door_Present_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_Door_Present_Value_Priority(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_DOOR_VALUE value,
|
||||
unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Present_Value_Relinquish(
|
||||
uint32_t object_instance,
|
||||
unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_DOOR_VALUE Access_Door_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_Door_Present_Value_Priority(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Present_Value_Set(
|
||||
uint32_t object_instance, BACNET_DOOR_VALUE value, unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Present_Value_Relinquish(
|
||||
uint32_t object_instance, unsigned priority);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_DOOR_VALUE Access_Door_Relinquish_Default(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Relinquish_Default_Set(
|
||||
uint32_t object_instance,
|
||||
float value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_DOOR_VALUE Access_Door_Relinquish_Default(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Relinquish_Default_Set(uint32_t object_instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Change_Of_Value(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Door_Change_Of_Value_Clear(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Encode_Value_List(
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Door_Change_Of_Value_Clear(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Encode_Value_List(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Name_Set(uint32_t object_instance, char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Access_Door_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Description_Set(
|
||||
uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
char *Access_Door_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Description_Set(uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Out_Of_Service(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Door_Out_Of_Service_Set(
|
||||
uint32_t instance,
|
||||
bool oos_flag);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Door_Out_Of_Service_Set(uint32_t instance, bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Access_Door_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Access_Door_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Door_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Door_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Door_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Door_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Door_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Door_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -22,13 +22,26 @@ static bool Access_Point_Initialized = false;
|
||||
static ACCESS_POINT_DESCR ap_descr[MAX_ACCESS_POINTS];
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_STATUS_FLAGS, PROP_EVENT_STATE,
|
||||
PROP_RELIABILITY, PROP_OUT_OF_SERVICE, PROP_AUTHENTICATION_STATUS,
|
||||
PROP_ACTIVE_AUTHENTICATION_POLICY, PROP_NUMBER_OF_AUTHENTICATION_POLICIES,
|
||||
PROP_AUTHORIZATION_MODE, PROP_ACCESS_EVENT, PROP_ACCESS_EVENT_TAG,
|
||||
PROP_ACCESS_EVENT_TIME, PROP_ACCESS_EVENT_CREDENTIAL, PROP_ACCESS_DOORS,
|
||||
PROP_PRIORITY_FOR_WRITING, -1 };
|
||||
static const int Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE,
|
||||
PROP_RELIABILITY,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
PROP_AUTHENTICATION_STATUS,
|
||||
PROP_ACTIVE_AUTHENTICATION_POLICY,
|
||||
PROP_NUMBER_OF_AUTHENTICATION_POLICIES,
|
||||
PROP_AUTHORIZATION_MODE,
|
||||
PROP_ACCESS_EVENT,
|
||||
PROP_ACCESS_EVENT_TAG,
|
||||
PROP_ACCESS_EVENT_TIME,
|
||||
PROP_ACCESS_EVENT_CREDENTIAL,
|
||||
PROP_ACCESS_DOORS,
|
||||
PROP_PRIORITY_FOR_WRITING,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Properties_Optional[] = { -1 };
|
||||
|
||||
@@ -126,7 +139,8 @@ 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);
|
||||
}
|
||||
@@ -219,7 +233,8 @@ int Access_Point_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
&apdu[0], ap_descr[object_index].active_authentication_policy);
|
||||
break;
|
||||
case PROP_NUMBER_OF_AUTHENTICATION_POLICIES:
|
||||
apdu_len = encode_application_unsigned(&apdu[0],
|
||||
apdu_len = encode_application_unsigned(
|
||||
&apdu[0],
|
||||
ap_descr[object_index].number_of_authentication_policies);
|
||||
break;
|
||||
case PROP_AUTHORIZATION_MODE:
|
||||
@@ -261,7 +276,8 @@ int Access_Point_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
}
|
||||
} else {
|
||||
if (rpdata->array_index <= ap_descr[object_index].num_doors) {
|
||||
apdu_len = bacapp_encode_device_obj_ref(&apdu[0],
|
||||
apdu_len = bacapp_encode_device_obj_ref(
|
||||
&apdu[0],
|
||||
&ap_descr[object_index]
|
||||
.access_doors[rpdata->array_index - 1]);
|
||||
} else {
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "bacnet/rp.h"
|
||||
#include "bacnet/wp.h"
|
||||
|
||||
|
||||
#ifndef MAX_ACCESS_POINTS
|
||||
#define MAX_ACCESS_POINTS 4
|
||||
#endif
|
||||
@@ -32,81 +31,59 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct {
|
||||
BACNET_EVENT_STATE event_state;
|
||||
BACNET_RELIABILITY reliability;
|
||||
bool out_of_service;
|
||||
BACNET_AUTHENTICATION_STATUS authentication_status;
|
||||
uint32_t active_authentication_policy,
|
||||
number_of_authentication_policies;
|
||||
BACNET_AUTHORIZATION_MODE authorization_mode;
|
||||
BACNET_ACCESS_EVENT access_event;
|
||||
uint32_t access_event_tag;
|
||||
BACNET_TIMESTAMP access_event_time;
|
||||
BACNET_DEVICE_OBJECT_REFERENCE access_event_credential;
|
||||
uint32_t num_doors; /* helper value, not a property */
|
||||
BACNET_DEVICE_OBJECT_REFERENCE access_doors[MAX_ACCESS_DOORS_COUNT];
|
||||
uint8_t priority_for_writing;
|
||||
} ACCESS_POINT_DESCR;
|
||||
typedef struct {
|
||||
BACNET_EVENT_STATE event_state;
|
||||
BACNET_RELIABILITY reliability;
|
||||
bool out_of_service;
|
||||
BACNET_AUTHENTICATION_STATUS authentication_status;
|
||||
uint32_t active_authentication_policy, number_of_authentication_policies;
|
||||
BACNET_AUTHORIZATION_MODE authorization_mode;
|
||||
BACNET_ACCESS_EVENT access_event;
|
||||
uint32_t access_event_tag;
|
||||
BACNET_TIMESTAMP access_event_time;
|
||||
BACNET_DEVICE_OBJECT_REFERENCE access_event_credential;
|
||||
uint32_t num_doors; /* helper value, not a property */
|
||||
BACNET_DEVICE_OBJECT_REFERENCE access_doors[MAX_ACCESS_DOORS_COUNT];
|
||||
uint8_t priority_for_writing;
|
||||
} ACCESS_POINT_DESCR;
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Point_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Point_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
unsigned Access_Point_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Point_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_Point_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Point_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Point_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Point_Valid_Instance(uint32_t object_instance);
|
||||
unsigned Access_Point_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Point_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_Point_Instance_To_Index(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Point_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Point_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Point_Name_Set(uint32_t object_instance, char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Point_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Point_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Point_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Point_Out_Of_Service_Set(uint32_t instance, bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Access_Point_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Point_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Point_Out_Of_Service(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Point_Out_Of_Service_Set(
|
||||
uint32_t instance,
|
||||
bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Access_Point_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Point_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Point_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Point_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Point_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Point_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Point_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Point_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Point_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Point_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -24,9 +24,15 @@ static ACCESS_RIGHTS_DESCR ar_descr[MAX_ACCESS_RIGHTSS];
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_GLOBAL_IDENTIFIER,
|
||||
PROP_STATUS_FLAGS, PROP_RELIABILITY, PROP_ENABLE,
|
||||
PROP_NEGATIVE_ACCESS_RULES, PROP_POSITIVE_ACCESS_RULES, -1 };
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_GLOBAL_IDENTIFIER,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_RELIABILITY,
|
||||
PROP_ENABLE,
|
||||
PROP_NEGATIVE_ACCESS_RULES,
|
||||
PROP_POSITIVE_ACCESS_RULES,
|
||||
-1 };
|
||||
|
||||
static const int Properties_Optional[] = { -1 };
|
||||
|
||||
@@ -118,7 +124,8 @@ 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);
|
||||
}
|
||||
@@ -179,13 +186,15 @@ int Access_Rights_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
break;
|
||||
case PROP_NEGATIVE_ACCESS_RULES:
|
||||
if (rpdata->array_index == 0) {
|
||||
apdu_len = encode_application_unsigned(&apdu[0],
|
||||
apdu_len = encode_application_unsigned(
|
||||
&apdu[0],
|
||||
ar_descr[object_index].negative_access_rules_count);
|
||||
} else if (rpdata->array_index == BACNET_ARRAY_ALL) {
|
||||
for (i = 0;
|
||||
i < ar_descr[object_index].negative_access_rules_count;
|
||||
i++) {
|
||||
len = bacapp_encode_access_rule(&apdu[0],
|
||||
len = bacapp_encode_access_rule(
|
||||
&apdu[0],
|
||||
&ar_descr[object_index].negative_access_rules[i]);
|
||||
if (apdu_len + len < MAX_APDU) {
|
||||
apdu_len += len;
|
||||
@@ -199,7 +208,8 @@ int Access_Rights_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
} else {
|
||||
if (rpdata->array_index <=
|
||||
ar_descr[object_index].negative_access_rules_count) {
|
||||
apdu_len = bacapp_encode_access_rule(&apdu[0],
|
||||
apdu_len = bacapp_encode_access_rule(
|
||||
&apdu[0],
|
||||
&ar_descr[object_index]
|
||||
.negative_access_rules[rpdata->array_index - 1]);
|
||||
} else {
|
||||
@@ -211,13 +221,15 @@ int Access_Rights_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
break;
|
||||
case PROP_POSITIVE_ACCESS_RULES:
|
||||
if (rpdata->array_index == 0) {
|
||||
apdu_len = encode_application_unsigned(&apdu[0],
|
||||
apdu_len = encode_application_unsigned(
|
||||
&apdu[0],
|
||||
ar_descr[object_index].positive_access_rules_count);
|
||||
} else if (rpdata->array_index == BACNET_ARRAY_ALL) {
|
||||
for (i = 0;
|
||||
i < ar_descr[object_index].positive_access_rules_count;
|
||||
i++) {
|
||||
len = bacapp_encode_access_rule(&apdu[0],
|
||||
len = bacapp_encode_access_rule(
|
||||
&apdu[0],
|
||||
&ar_descr[object_index].positive_access_rules[i]);
|
||||
if (apdu_len + len < MAX_APDU) {
|
||||
apdu_len += len;
|
||||
@@ -231,7 +243,8 @@ int Access_Rights_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
} else {
|
||||
if (rpdata->array_index <=
|
||||
ar_descr[object_index].positive_access_rules_count) {
|
||||
apdu_len = bacapp_encode_access_rule(&apdu[0],
|
||||
apdu_len = bacapp_encode_access_rule(
|
||||
&apdu[0],
|
||||
&ar_descr[object_index]
|
||||
.positive_access_rules[rpdata->array_index - 1]);
|
||||
} else {
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "bacnet/rp.h"
|
||||
#include "bacnet/wp.h"
|
||||
|
||||
|
||||
#ifndef MAX_ACCESS_RIGHTSS
|
||||
#define MAX_ACCESS_RIGHTSS 4
|
||||
#endif
|
||||
@@ -36,65 +35,49 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct {
|
||||
uint32_t global_identifier;
|
||||
BACNET_RELIABILITY reliability;
|
||||
bool enable;
|
||||
uint32_t negative_access_rules_count, positive_access_rules_count;
|
||||
BACNET_ACCESS_RULE
|
||||
negative_access_rules[MAX_NEGATIVE_ACCESS_RIGHTS_RULES];
|
||||
BACNET_ACCESS_RULE
|
||||
positive_access_rules[MAX_POSITIVE_ACCESS_RIGHTS_RULES];
|
||||
} ACCESS_RIGHTS_DESCR;
|
||||
typedef struct {
|
||||
uint32_t global_identifier;
|
||||
BACNET_RELIABILITY reliability;
|
||||
bool enable;
|
||||
uint32_t negative_access_rules_count, positive_access_rules_count;
|
||||
BACNET_ACCESS_RULE
|
||||
negative_access_rules[MAX_NEGATIVE_ACCESS_RIGHTS_RULES];
|
||||
BACNET_ACCESS_RULE
|
||||
positive_access_rules[MAX_POSITIVE_ACCESS_RIGHTS_RULES];
|
||||
} ACCESS_RIGHTS_DESCR;
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Rights_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Rights_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
unsigned Access_Rights_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Rights_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_Rights_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Rights_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Rights_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Rights_Valid_Instance(uint32_t object_instance);
|
||||
unsigned Access_Rights_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Rights_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_Rights_Instance_To_Index(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Rights_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Rights_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Rights_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Rights_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Rights_Name_Set(uint32_t object_instance, char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Access_Rights_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Rights_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Access_Rights_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Rights_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Rights_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Rights_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Rights_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Rights_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Rights_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Rights_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Rights_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Rights_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -22,9 +22,11 @@ static bool Access_User_Initialized = false;
|
||||
static ACCESS_USER_DESCR au_descr[MAX_ACCESS_USERS];
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_GLOBAL_IDENTIFIER,
|
||||
PROP_STATUS_FLAGS, PROP_RELIABILITY, PROP_USER_TYPE, PROP_CREDENTIALS, -1 };
|
||||
static const int Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER, PROP_OBJECT_NAME, PROP_OBJECT_TYPE,
|
||||
PROP_GLOBAL_IDENTIFIER, PROP_STATUS_FLAGS, PROP_RELIABILITY,
|
||||
PROP_USER_TYPE, PROP_CREDENTIALS, -1
|
||||
};
|
||||
|
||||
static const int Properties_Optional[] = { -1 };
|
||||
|
||||
@@ -115,7 +117,8 @@ 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);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "bacnet/rp.h"
|
||||
#include "bacnet/wp.h"
|
||||
|
||||
|
||||
#ifndef MAX_ACCESS_USERS
|
||||
#define MAX_ACCESS_USERS 4
|
||||
#endif
|
||||
@@ -31,63 +30,47 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct {
|
||||
uint32_t global_identifier;
|
||||
BACNET_RELIABILITY reliability;
|
||||
BACNET_ACCESS_USER_TYPE user_type;
|
||||
uint32_t credentials_count;
|
||||
BACNET_DEVICE_OBJECT_REFERENCE
|
||||
credentials[MAX_ACCESS_USER_CREDENTIALS_COUNT];
|
||||
} ACCESS_USER_DESCR;
|
||||
typedef struct {
|
||||
uint32_t global_identifier;
|
||||
BACNET_RELIABILITY reliability;
|
||||
BACNET_ACCESS_USER_TYPE user_type;
|
||||
uint32_t credentials_count;
|
||||
BACNET_DEVICE_OBJECT_REFERENCE
|
||||
credentials[MAX_ACCESS_USER_CREDENTIALS_COUNT];
|
||||
} ACCESS_USER_DESCR;
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_User_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_User_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
unsigned Access_User_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_User_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_User_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_User_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_User_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_User_Valid_Instance(uint32_t object_instance);
|
||||
unsigned Access_User_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_User_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_User_Instance_To_Index(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_User_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_User_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_User_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_User_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_User_Name_Set(uint32_t object_instance, char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Access_User_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_User_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Access_User_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_User_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_User_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_User_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_User_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_User_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_User_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_User_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_User_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_User_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -23,10 +23,12 @@ static bool Access_Zone_Initialized = false;
|
||||
static ACCESS_ZONE_DESCR az_descr[MAX_ACCESS_ZONES];
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_GLOBAL_IDENTIFIER,
|
||||
PROP_OCCUPANCY_STATE, PROP_STATUS_FLAGS, PROP_EVENT_STATE, PROP_RELIABILITY,
|
||||
PROP_OUT_OF_SERVICE, PROP_ENTRY_POINTS, PROP_EXIT_POINTS, -1 };
|
||||
static const int Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER, PROP_OBJECT_NAME, PROP_OBJECT_TYPE,
|
||||
PROP_GLOBAL_IDENTIFIER, PROP_OCCUPANCY_STATE, PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE, PROP_RELIABILITY, PROP_OUT_OF_SERVICE,
|
||||
PROP_ENTRY_POINTS, PROP_EXIT_POINTS, -1
|
||||
};
|
||||
|
||||
static const int Properties_Optional[] = { -1 };
|
||||
|
||||
@@ -120,7 +122,8 @@ 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);
|
||||
}
|
||||
|
||||
@@ -34,75 +34,56 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct {
|
||||
uint32_t global_identifier;
|
||||
BACNET_ACCESS_ZONE_OCCUPANCY_STATE occupancy_state;
|
||||
BACNET_EVENT_STATE event_state;
|
||||
BACNET_RELIABILITY reliability;
|
||||
bool out_of_service;
|
||||
uint32_t entry_points_count, exit_points_count;
|
||||
BACNET_DEVICE_OBJECT_REFERENCE
|
||||
entry_points[MAX_ACCESS_ZONE_ENTRY_POINTS];
|
||||
BACNET_DEVICE_OBJECT_REFERENCE
|
||||
exit_points[MAX_ACCESS_ZONE_EXIT_POINTS];
|
||||
} ACCESS_ZONE_DESCR;
|
||||
typedef struct {
|
||||
uint32_t global_identifier;
|
||||
BACNET_ACCESS_ZONE_OCCUPANCY_STATE occupancy_state;
|
||||
BACNET_EVENT_STATE event_state;
|
||||
BACNET_RELIABILITY reliability;
|
||||
bool out_of_service;
|
||||
uint32_t entry_points_count, exit_points_count;
|
||||
BACNET_DEVICE_OBJECT_REFERENCE
|
||||
entry_points[MAX_ACCESS_ZONE_ENTRY_POINTS];
|
||||
BACNET_DEVICE_OBJECT_REFERENCE
|
||||
exit_points[MAX_ACCESS_ZONE_EXIT_POINTS];
|
||||
} ACCESS_ZONE_DESCR;
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Zone_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Zone_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
unsigned Access_Zone_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Zone_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_Zone_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Zone_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Zone_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Zone_Valid_Instance(uint32_t object_instance);
|
||||
unsigned Access_Zone_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Zone_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Access_Zone_Instance_To_Index(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Zone_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Zone_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Zone_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Zone_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Zone_Name_Set(uint32_t object_instance, char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Zone_Out_Of_Service(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Zone_Out_Of_Service_Set(
|
||||
uint32_t instance,
|
||||
bool oos_flag);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Zone_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Zone_Out_Of_Service_Set(uint32_t instance, bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Access_Zone_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Zone_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Access_Zone_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Zone_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Zone_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Zone_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Zone_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Zone_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Access_Zone_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Zone_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Zone_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Access_Zone_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1044,10 +1044,11 @@ void Analog_Input_Intrinsic_Reporting(uint32_t object_instance)
|
||||
EVENT_HIGH_LIMIT_ENABLE) &&
|
||||
((CurrentAI->Event_Enable & EVENT_ENABLE_TO_OFFNORMAL) ==
|
||||
EVENT_ENABLE_TO_OFFNORMAL)) {
|
||||
if (!CurrentAI->Remaining_Time_Delay)
|
||||
if (!CurrentAI->Remaining_Time_Delay) {
|
||||
CurrentAI->Event_State = EVENT_STATE_HIGH_LIMIT;
|
||||
else
|
||||
} else {
|
||||
CurrentAI->Remaining_Time_Delay--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* A TO-OFFNORMAL event is generated under these conditions:
|
||||
@@ -1062,10 +1063,11 @@ void Analog_Input_Intrinsic_Reporting(uint32_t object_instance)
|
||||
EVENT_LOW_LIMIT_ENABLE) &&
|
||||
((CurrentAI->Event_Enable & EVENT_ENABLE_TO_OFFNORMAL) ==
|
||||
EVENT_ENABLE_TO_OFFNORMAL)) {
|
||||
if (!CurrentAI->Remaining_Time_Delay)
|
||||
if (!CurrentAI->Remaining_Time_Delay) {
|
||||
CurrentAI->Event_State = EVENT_STATE_LOW_LIMIT;
|
||||
else
|
||||
} else {
|
||||
CurrentAI->Remaining_Time_Delay--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* value of the object is still in the same event state */
|
||||
@@ -1091,10 +1093,12 @@ void Analog_Input_Intrinsic_Reporting(uint32_t object_instance)
|
||||
* indicate a transition to the NORMAL event state. */
|
||||
(!(CurrentAI->Limit_Enable & EVENT_HIGH_LIMIT_ENABLE))) {
|
||||
if ((!CurrentAI->Remaining_Time_Delay) ||
|
||||
(!(CurrentAI->Limit_Enable & EVENT_HIGH_LIMIT_ENABLE)))
|
||||
(!(CurrentAI->Limit_Enable &
|
||||
EVENT_HIGH_LIMIT_ENABLE))) {
|
||||
CurrentAI->Event_State = EVENT_STATE_NORMAL;
|
||||
else
|
||||
} else {
|
||||
CurrentAI->Remaining_Time_Delay--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* value of the object is still in the same event state */
|
||||
@@ -1121,10 +1125,11 @@ void Analog_Input_Intrinsic_Reporting(uint32_t object_instance)
|
||||
* indicate a transition to the NORMAL event state. */
|
||||
(!(CurrentAI->Limit_Enable & EVENT_LOW_LIMIT_ENABLE))) {
|
||||
if ((!CurrentAI->Remaining_Time_Delay) ||
|
||||
(!(CurrentAI->Limit_Enable & EVENT_LOW_LIMIT_ENABLE)))
|
||||
(!(CurrentAI->Limit_Enable & EVENT_LOW_LIMIT_ENABLE))) {
|
||||
CurrentAI->Event_State = EVENT_STATE_NORMAL;
|
||||
else
|
||||
} else {
|
||||
CurrentAI->Remaining_Time_Delay--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* value of the object is still in the same event state */
|
||||
@@ -1239,8 +1244,9 @@ void Analog_Input_Intrinsic_Reporting(uint32_t object_instance)
|
||||
/* Notify Type */
|
||||
/* filled before */
|
||||
/* From State */
|
||||
if (event_data.notifyType != NOTIFY_ACK_NOTIFICATION)
|
||||
if (event_data.notifyType != NOTIFY_ACK_NOTIFICATION) {
|
||||
event_data.fromState = FromState;
|
||||
}
|
||||
/* To State */
|
||||
event_data.toState = CurrentAI->Event_State;
|
||||
/* Event Values */
|
||||
@@ -1395,8 +1401,9 @@ int Analog_Input_Event_Information(
|
||||
pObject->Notification_Class, getevent_data->eventPriorities);
|
||||
|
||||
return 1; /* active event */
|
||||
} else
|
||||
} else {
|
||||
return 0; /* no active event at this index */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+86
-127
@@ -24,7 +24,7 @@
|
||||
#endif
|
||||
|
||||
typedef struct analog_input_descr {
|
||||
unsigned Event_State:3;
|
||||
unsigned Event_State : 3;
|
||||
float Present_Value;
|
||||
BACNET_RELIABILITY Reliability;
|
||||
bool Out_Of_Service;
|
||||
@@ -32,17 +32,17 @@ typedef struct analog_input_descr {
|
||||
float Prior_Value;
|
||||
float COV_Increment;
|
||||
bool Changed;
|
||||
const char* Object_Name;
|
||||
const char* Description;
|
||||
const char *Object_Name;
|
||||
const char *Description;
|
||||
#if defined(INTRINSIC_REPORTING)
|
||||
uint32_t Time_Delay;
|
||||
uint32_t Notification_Class;
|
||||
float High_Limit;
|
||||
float Low_Limit;
|
||||
float Deadband;
|
||||
unsigned Limit_Enable:2;
|
||||
unsigned Event_Enable:3;
|
||||
unsigned Notify_Type:1;
|
||||
unsigned Limit_Enable : 2;
|
||||
unsigned Event_Enable : 3;
|
||||
unsigned Notify_Type : 1;
|
||||
ACKED_INFO Acked_Transitions[MAX_BACNET_EVENT_TRANSITION];
|
||||
BACNET_DATE_TIME Event_Time_Stamps[MAX_BACNET_EVENT_TRANSITION];
|
||||
/* time to generate event notification */
|
||||
@@ -56,144 +56,103 @@ typedef struct analog_input_descr {
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Input_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Input_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Input_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Analog_Input_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Input_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Input_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Analog_Input_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Input_Instance_To_Index(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Name_Set(
|
||||
uint32_t object_instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char * Analog_Input_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Analog_Input_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Analog_Input_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Description_Set(
|
||||
uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Analog_Input_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Description_Set(uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Analog_Input_Reliability(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Reliability_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_RELIABILITY value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Analog_Input_Reliability(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Reliability_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Units_Set(
|
||||
uint32_t instance,
|
||||
uint16_t units);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Analog_Input_Units(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Units_Set(uint32_t instance, uint16_t units);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Analog_Input_Units(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Input_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Input_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Analog_Input_Present_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Input_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
float value);
|
||||
BACNET_STACK_EXPORT
|
||||
float Analog_Input_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Input_Present_Value_Set(uint32_t object_instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Out_Of_Service(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Input_Out_Of_Service_Set(
|
||||
uint32_t object_instance,
|
||||
bool oos_flag);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Out_Of_Service(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Input_Out_Of_Service_Set(uint32_t object_instance, bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Input_Event_State(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Event_State_Set(uint32_t object_instance, unsigned state);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Input_Event_State(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Event_State_Set(uint32_t object_instance, unsigned state);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Change_Of_Value(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Input_Change_Of_Value_Clear(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Encode_Value_List(
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
float Analog_Input_COV_Increment(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Input_COV_Increment_Set(
|
||||
uint32_t instance,
|
||||
float value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Input_Change_Of_Value_Clear(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Encode_Value_List(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
float Analog_Input_COV_Increment(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Input_COV_Increment_Set(uint32_t instance, float value);
|
||||
|
||||
/* note: header of Intrinsic_Reporting function is required
|
||||
even when INTRINSIC_REPORTING is not defined */
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Input_Intrinsic_Reporting(
|
||||
uint32_t object_instance);
|
||||
/* note: header of Intrinsic_Reporting function is required
|
||||
even when INTRINSIC_REPORTING is not defined */
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Input_Intrinsic_Reporting(uint32_t object_instance);
|
||||
|
||||
#if defined(INTRINSIC_REPORTING)
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Input_Event_Information(
|
||||
unsigned index,
|
||||
BACNET_GET_EVENT_INFORMATION_DATA * getevent_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Input_Event_Information(
|
||||
unsigned index, BACNET_GET_EVENT_INFORMATION_DATA *getevent_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Input_Alarm_Ack(
|
||||
BACNET_ALARM_ACK_DATA * alarmack_data,
|
||||
BACNET_ERROR_CODE * error_code);
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Input_Alarm_Ack(
|
||||
BACNET_ALARM_ACK_DATA *alarmack_data, BACNET_ERROR_CODE *error_code);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Input_Alarm_Summary(
|
||||
unsigned index,
|
||||
BACNET_GET_ALARM_SUMMARY_DATA * getalarm_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Input_Alarm_Summary(
|
||||
unsigned index, BACNET_GET_ALARM_SUMMARY_DATA *getalarm_data);
|
||||
#endif
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Analog_Input_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Input_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Input_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Analog_Input_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Input_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Input_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -57,18 +57,27 @@ static analog_output_write_present_value_callback
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
|
||||
static const int Analog_Output_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_UNITS, PROP_PRIORITY_ARRAY,
|
||||
static const int Analog_Output_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_UNITS,
|
||||
PROP_PRIORITY_ARRAY,
|
||||
PROP_RELINQUISH_DEFAULT,
|
||||
#if (BACNET_PROTOCOL_REVISION >= 17)
|
||||
PROP_CURRENT_COMMAND_PRIORITY,
|
||||
#endif
|
||||
-1 };
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Analog_Output_Properties_Optional[] = { PROP_RELIABILITY,
|
||||
PROP_DESCRIPTION, PROP_COV_INCREMENT, PROP_MIN_PRES_VALUE,
|
||||
PROP_MAX_PRES_VALUE, -1 };
|
||||
static const int Analog_Output_Properties_Optional[] = {
|
||||
PROP_RELIABILITY, PROP_DESCRIPTION, PROP_COV_INCREMENT,
|
||||
PROP_MIN_PRES_VALUE, PROP_MAX_PRES_VALUE, -1
|
||||
};
|
||||
|
||||
static const int Analog_Output_Properties_Proprietary[] = { -1 };
|
||||
|
||||
@@ -278,8 +287,8 @@ bool Analog_Output_Relinquish_Default_Set(uint32_t object_instance, float value)
|
||||
* @param pObject - specific object with valid data
|
||||
* @param value - floating point analog value
|
||||
*/
|
||||
static void Analog_Output_Present_Value_COV_Detect(
|
||||
struct object_data *pObject, float value)
|
||||
static void
|
||||
Analog_Output_Present_Value_COV_Detect(struct object_data *pObject, float value)
|
||||
{
|
||||
float prior_value = 0.0;
|
||||
float cov_increment = 0.0;
|
||||
@@ -366,7 +375,8 @@ bool Analog_Output_Present_Value_Relinquish(
|
||||
* @param error_code - BACnet Error code
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Analog_Output_Present_Value_Write(uint32_t object_instance,
|
||||
static bool Analog_Output_Present_Value_Write(
|
||||
uint32_t object_instance,
|
||||
float value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
@@ -380,7 +390,8 @@ static bool Analog_Output_Present_Value_Write(uint32_t object_instance,
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if ((priority >= 1) && (priority <= BACNET_MAX_PRIORITY) &&
|
||||
(value >= pObject->Min_Pres_Value) && (value <= pObject->Max_Pres_Value)) {
|
||||
(value >= pObject->Min_Pres_Value) &&
|
||||
(value <= pObject->Max_Pres_Value)) {
|
||||
if (priority != 6) {
|
||||
old_value = Analog_Output_Present_Value(object_instance);
|
||||
Analog_Output_Present_Value_Set(
|
||||
@@ -491,7 +502,8 @@ bool Analog_Output_Object_Name(
|
||||
status =
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(name_text, sizeof(name_text), "ANALOG OUTPUT %lu",
|
||||
snprintf(
|
||||
name_text, sizeof(name_text), "ANALOG OUTPUT %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, name_text);
|
||||
}
|
||||
@@ -907,8 +919,9 @@ bool Analog_Output_Encode_Value_List(
|
||||
if (pObject->Reliability != RELIABILITY_NO_FAULT_DETECTED) {
|
||||
fault = true;
|
||||
}
|
||||
status = cov_value_list_encode_real(value_list, pObject->Prior_Value,
|
||||
in_alarm, fault, overridden, pObject->Out_Of_Service);
|
||||
status = cov_value_list_encode_real(
|
||||
value_list, pObject->Prior_Value, in_alarm, fault, overridden,
|
||||
pObject->Out_Of_Service);
|
||||
}
|
||||
|
||||
return status;
|
||||
@@ -1028,9 +1041,10 @@ int Analog_Output_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu_len = encode_application_enumerated(&apdu[0], units);
|
||||
break;
|
||||
case PROP_PRIORITY_ARRAY:
|
||||
apdu_len = bacnet_array_encode(rpdata->object_instance,
|
||||
rpdata->array_index, Analog_Output_Priority_Array_Encode,
|
||||
BACNET_MAX_PRIORITY, apdu, apdu_size);
|
||||
apdu_len = bacnet_array_encode(
|
||||
rpdata->object_instance, rpdata->array_index,
|
||||
Analog_Output_Priority_Array_Encode, BACNET_MAX_PRIORITY, apdu,
|
||||
apdu_size);
|
||||
if (apdu_len == BACNET_STATUS_ABORT) {
|
||||
rpdata->error_code =
|
||||
ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED;
|
||||
@@ -1045,7 +1059,8 @@ int Analog_Output_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu_len = encode_application_real(&apdu[0], real_value);
|
||||
break;
|
||||
case PROP_DESCRIPTION:
|
||||
characterstring_init_ansi(&char_string,
|
||||
characterstring_init_ansi(
|
||||
&char_string,
|
||||
Analog_Output_Description(rpdata->object_instance));
|
||||
apdu_len =
|
||||
encode_application_character_string(&apdu[0], &char_string);
|
||||
@@ -1118,10 +1133,10 @@ bool Analog_Output_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_REAL);
|
||||
if (status) {
|
||||
status =
|
||||
Analog_Output_Present_Value_Write(wp_data->object_instance,
|
||||
value.type.Real, wp_data->priority,
|
||||
&wp_data->error_class, &wp_data->error_code);
|
||||
status = Analog_Output_Present_Value_Write(
|
||||
wp_data->object_instance, value.type.Real,
|
||||
wp_data->priority, &wp_data->error_class,
|
||||
&wp_data->error_code);
|
||||
} else {
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_NULL);
|
||||
|
||||
+91
-138
@@ -13,7 +13,7 @@
|
||||
#define BACNET_BASIC_OBJECT_ANALOG_OUTPUT_H
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "bacnet/bacdef.h" /* Must be before all other bacnet *.h files */
|
||||
#include "bacnet/bacdef.h" /* Must be before all other bacnet *.h files */
|
||||
#include "bacnet/bacerror.h"
|
||||
#include "bacnet/rp.h"
|
||||
#include "bacnet/wp.h"
|
||||
@@ -31,155 +31,108 @@ typedef void (*analog_output_write_present_value_callback)(
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Output_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Output_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Analog_Output_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Output_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Output_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Output_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Analog_Output_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Output_Instance_To_Index(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Analog_Output_Present_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
float value,
|
||||
unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Present_Value_Relinquish(
|
||||
uint32_t object_instance,
|
||||
unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Output_Present_Value_Priority(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Output_Write_Present_Value_Callback_Set(
|
||||
analog_output_write_present_value_callback cb);
|
||||
BACNET_STACK_EXPORT
|
||||
float Analog_Output_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Present_Value_Set(
|
||||
uint32_t object_instance, float value, unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Present_Value_Relinquish(
|
||||
uint32_t object_instance, unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Output_Present_Value_Priority(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Output_Write_Present_Value_Callback_Set(
|
||||
analog_output_write_present_value_callback cb);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Analog_Output_Relinquish_Default(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Relinquish_Default_Set(
|
||||
uint32_t object_instance,
|
||||
float value);
|
||||
BACNET_STACK_EXPORT
|
||||
float Analog_Output_Relinquish_Default(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Relinquish_Default_Set(
|
||||
uint32_t object_instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Change_Of_Value(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Output_Change_Of_Value_Clear(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Encode_Value_List(
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
float Analog_Output_COV_Increment(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Output_COV_Increment_Set(
|
||||
uint32_t instance,
|
||||
float value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Output_Change_Of_Value_Clear(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Encode_Value_List(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
float Analog_Output_COV_Increment(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Output_COV_Increment_Set(uint32_t instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Name_Set(
|
||||
uint32_t object_instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char * Analog_Output_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Analog_Output_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Analog_Output_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Description_Set(
|
||||
uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Analog_Output_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Description_Set(uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Units_Set(
|
||||
uint32_t instance,
|
||||
uint16_t units);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Analog_Output_Units(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Units_Set(uint32_t instance, uint16_t units);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Analog_Output_Units(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Out_Of_Service(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Output_Out_Of_Service_Set(
|
||||
uint32_t instance,
|
||||
bool oos_flag);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Output_Out_Of_Service_Set(uint32_t instance, bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Overridden(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Output_Overridden_Set(
|
||||
uint32_t instance,
|
||||
bool oos_flag);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Overridden(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Output_Overridden_Set(uint32_t instance, bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Analog_Output_Reliability(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Reliability_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Analog_Output_Reliability(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Reliability_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Analog_Output_Min_Pres_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Min_Pres_Value_Set(
|
||||
uint32_t object_instance, float value);
|
||||
BACNET_STACK_EXPORT
|
||||
float Analog_Output_Max_Pres_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Max_Pres_Value_Set(
|
||||
uint32_t object_instance, float value);
|
||||
BACNET_STACK_EXPORT
|
||||
float Analog_Output_Min_Pres_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Min_Pres_Value_Set(uint32_t object_instance, float value);
|
||||
BACNET_STACK_EXPORT
|
||||
float Analog_Output_Max_Pres_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Max_Pres_Value_Set(uint32_t object_instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Output_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Output_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Analog_Output_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Output_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Output_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Analog_Output_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Output_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Output_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1082,10 +1082,11 @@ void Analog_Value_Intrinsic_Reporting(uint32_t object_instance)
|
||||
EVENT_HIGH_LIMIT_ENABLE) &&
|
||||
((CurrentAV->Event_Enable & EVENT_ENABLE_TO_OFFNORMAL) ==
|
||||
EVENT_ENABLE_TO_OFFNORMAL)) {
|
||||
if (!CurrentAV->Remaining_Time_Delay)
|
||||
if (!CurrentAV->Remaining_Time_Delay) {
|
||||
CurrentAV->Event_State = EVENT_STATE_HIGH_LIMIT;
|
||||
else
|
||||
} else {
|
||||
CurrentAV->Remaining_Time_Delay--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1101,10 +1102,11 @@ void Analog_Value_Intrinsic_Reporting(uint32_t object_instance)
|
||||
EVENT_LOW_LIMIT_ENABLE) &&
|
||||
((CurrentAV->Event_Enable & EVENT_ENABLE_TO_OFFNORMAL) ==
|
||||
EVENT_ENABLE_TO_OFFNORMAL)) {
|
||||
if (!CurrentAV->Remaining_Time_Delay)
|
||||
if (!CurrentAV->Remaining_Time_Delay) {
|
||||
CurrentAV->Event_State = EVENT_STATE_LOW_LIMIT;
|
||||
else
|
||||
} else {
|
||||
CurrentAV->Remaining_Time_Delay--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* value of the object is still in the same event state */
|
||||
@@ -1131,10 +1133,12 @@ void Analog_Value_Intrinsic_Reporting(uint32_t object_instance)
|
||||
* indicate a transition to the NORMAL event state. */
|
||||
(!(CurrentAV->Limit_Enable & EVENT_HIGH_LIMIT_ENABLE))) {
|
||||
if ((!CurrentAV->Remaining_Time_Delay) ||
|
||||
(!(CurrentAV->Limit_Enable & EVENT_HIGH_LIMIT_ENABLE)))
|
||||
(!(CurrentAV->Limit_Enable &
|
||||
EVENT_HIGH_LIMIT_ENABLE))) {
|
||||
CurrentAV->Event_State = EVENT_STATE_NORMAL;
|
||||
else
|
||||
} else {
|
||||
CurrentAV->Remaining_Time_Delay--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* value of the object is still in the same event state */
|
||||
@@ -1162,10 +1166,11 @@ void Analog_Value_Intrinsic_Reporting(uint32_t object_instance)
|
||||
* indicate a transition to the NORMAL event state. */
|
||||
(!(CurrentAV->Limit_Enable & EVENT_LOW_LIMIT_ENABLE))) {
|
||||
if ((!CurrentAV->Remaining_Time_Delay) ||
|
||||
(!(CurrentAV->Limit_Enable & EVENT_LOW_LIMIT_ENABLE)))
|
||||
(!(CurrentAV->Limit_Enable & EVENT_LOW_LIMIT_ENABLE))) {
|
||||
CurrentAV->Event_State = EVENT_STATE_NORMAL;
|
||||
else
|
||||
} else {
|
||||
CurrentAV->Remaining_Time_Delay--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* value of the object is still in the same event state */
|
||||
@@ -1288,8 +1293,9 @@ void Analog_Value_Intrinsic_Reporting(uint32_t object_instance)
|
||||
/* filled before */
|
||||
|
||||
/* From State */
|
||||
if (event_data.notifyType != NOTIFY_ACK_NOTIFICATION)
|
||||
if (event_data.notifyType != NOTIFY_ACK_NOTIFICATION) {
|
||||
event_data.fromState = FromState;
|
||||
}
|
||||
|
||||
/* To State */
|
||||
event_data.toState = CurrentAV->Event_State;
|
||||
@@ -1447,8 +1453,9 @@ int Analog_Value_Event_Information(
|
||||
pObject->Notification_Class, getevent_data->eventPriorities);
|
||||
|
||||
return 1; /* active event */
|
||||
} else
|
||||
} else {
|
||||
return 0; /* no active event at this index */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1601,10 +1608,12 @@ int Analog_Value_Alarm_Summary(
|
||||
pObject->Acked_Transitions[TRANSITION_TO_NORMAL].bIsAcked);
|
||||
|
||||
return 1; /* active alarm */
|
||||
} else
|
||||
} else {
|
||||
return 0; /* no active alarm at this index */
|
||||
} else
|
||||
}
|
||||
} else {
|
||||
return -1; /* end of list */
|
||||
}
|
||||
}
|
||||
#endif /* defined(INTRINSIC_REPORTING) */
|
||||
|
||||
|
||||
+86
-129
@@ -26,15 +26,15 @@
|
||||
#endif
|
||||
|
||||
typedef struct analog_value_descr {
|
||||
unsigned Event_State:3;
|
||||
unsigned Event_State : 3;
|
||||
bool Out_Of_Service;
|
||||
uint16_t Units;
|
||||
float Present_Value;
|
||||
float Prior_Value;
|
||||
float COV_Increment;
|
||||
bool Changed;
|
||||
const char* Object_Name;
|
||||
const char* Description;
|
||||
const char *Object_Name;
|
||||
const char *Description;
|
||||
BACNET_RELIABILITY Reliability;
|
||||
#if defined(INTRINSIC_REPORTING)
|
||||
uint32_t Time_Delay;
|
||||
@@ -42,9 +42,9 @@ typedef struct analog_value_descr {
|
||||
float High_Limit;
|
||||
float Low_Limit;
|
||||
float Deadband;
|
||||
unsigned Limit_Enable:2;
|
||||
unsigned Event_Enable:3;
|
||||
unsigned Notify_Type:1;
|
||||
unsigned Limit_Enable : 2;
|
||||
unsigned Event_Enable : 3;
|
||||
unsigned Notify_Type : 1;
|
||||
ACKED_INFO Acked_Transitions[MAX_BACNET_EVENT_TRANSITION];
|
||||
BACNET_DATE_TIME Event_Time_Stamps[MAX_BACNET_EVENT_TRANSITION];
|
||||
/* time to generate event notification */
|
||||
@@ -57,146 +57,103 @@ typedef struct analog_value_descr {
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Value_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Value_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Analog_Value_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Value_Instance_To_Index(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Value_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Value_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Analog_Value_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Value_Instance_To_Index(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Name_Set(
|
||||
uint32_t object_instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Analog_Value_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Analog_Value_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Value_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
float value,
|
||||
uint8_t priority);
|
||||
BACNET_STACK_EXPORT
|
||||
float Analog_Value_Present_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Present_Value_Set(
|
||||
uint32_t object_instance, float value, uint8_t priority);
|
||||
BACNET_STACK_EXPORT
|
||||
float Analog_Value_Present_Value(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Value_Event_State(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Event_State_Set(
|
||||
uint32_t object_instance,
|
||||
unsigned state);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Analog_Value_Event_State(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Event_State_Set(uint32_t object_instance, unsigned state);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Change_Of_Value(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Value_Change_Of_Value_Clear(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Encode_Value_List(
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
float Analog_Value_COV_Increment(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Value_COV_Increment_Set(
|
||||
uint32_t instance,
|
||||
float value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Value_Change_Of_Value_Clear(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Encode_Value_List(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
float Analog_Value_COV_Increment(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Value_COV_Increment_Set(uint32_t instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Analog_Value_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Description_Set(
|
||||
uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Analog_Value_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Description_Set(uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Analog_Value_Reliability(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Reliability_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_RELIABILITY value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Analog_Value_Reliability(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Reliability_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Analog_Value_Units(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Units_Set(
|
||||
uint32_t instance,
|
||||
uint16_t unit);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Analog_Value_Units(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Units_Set(uint32_t instance, uint16_t unit);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Out_Of_Service(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Value_Out_Of_Service_Set(
|
||||
uint32_t instance,
|
||||
bool oos_flag);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Value_Out_Of_Service_Set(uint32_t instance, bool oos_flag);
|
||||
|
||||
/* note: header of Intrinsic_Reporting function is required
|
||||
even when INTRINSIC_REPORTING is not defined */
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Value_Intrinsic_Reporting(
|
||||
uint32_t object_instance);
|
||||
/* note: header of Intrinsic_Reporting function is required
|
||||
even when INTRINSIC_REPORTING is not defined */
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Value_Intrinsic_Reporting(uint32_t object_instance);
|
||||
|
||||
#if defined(INTRINSIC_REPORTING)
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Value_Event_Information(
|
||||
unsigned index,
|
||||
BACNET_GET_EVENT_INFORMATION_DATA * getevent_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Value_Event_Information(
|
||||
unsigned index, BACNET_GET_EVENT_INFORMATION_DATA *getevent_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Value_Alarm_Ack(
|
||||
BACNET_ALARM_ACK_DATA * alarmack_data,
|
||||
BACNET_ERROR_CODE * error_code);
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Value_Alarm_Ack(
|
||||
BACNET_ALARM_ACK_DATA *alarmack_data, BACNET_ERROR_CODE *error_code);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Value_Alarm_Summary(
|
||||
unsigned index,
|
||||
BACNET_GET_ALARM_SUMMARY_DATA * getalarm_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Analog_Value_Alarm_Summary(
|
||||
unsigned index, BACNET_GET_ALARM_SUMMARY_DATA *getalarm_data);
|
||||
#endif
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Analog_Value_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Value_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Value_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Analog_Value_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Value_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Analog_Value_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ struct object_data {
|
||||
char *Pathname;
|
||||
BACNET_DATE_TIME Modification_Date;
|
||||
char *File_Type;
|
||||
bool File_Access_Stream:1;
|
||||
bool File_Access_Stream : 1;
|
||||
bool Read_Only : 1;
|
||||
bool Archive : 1;
|
||||
};
|
||||
@@ -47,9 +47,15 @@ static OS_Keylist Object_List;
|
||||
static const BACNET_OBJECT_TYPE Object_Type = OBJECT_FILE;
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int bacfile_Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_FILE_TYPE, PROP_FILE_SIZE,
|
||||
PROP_MODIFICATION_DATE, PROP_ARCHIVE, PROP_READ_ONLY,
|
||||
PROP_FILE_ACCESS_METHOD, -1 };
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_FILE_TYPE,
|
||||
PROP_FILE_SIZE,
|
||||
PROP_MODIFICATION_DATE,
|
||||
PROP_ARCHIVE,
|
||||
PROP_READ_ONLY,
|
||||
PROP_FILE_ACCESS_METHOD,
|
||||
-1 };
|
||||
|
||||
static const int bacfile_Properties_Optional[] = { PROP_DESCRIPTION, -1 };
|
||||
|
||||
@@ -86,7 +92,8 @@ void BACfile_Property_Lists(
|
||||
* @param s - string to duplicate
|
||||
* @return a pointer to a new string on success, or a null pointer
|
||||
*/
|
||||
static char *bacfile_strdup(const char *s) {
|
||||
static char *bacfile_strdup(const char *s)
|
||||
{
|
||||
size_t size = strlen(s) + 1;
|
||||
char *p = malloc(size);
|
||||
if (p != NULL) {
|
||||
@@ -137,8 +144,7 @@ void bacfile_pathname_set(uint32_t object_instance, const char *pathname)
|
||||
* @return object-instance number of the object,
|
||||
* or #BACNET_MAX_INSTANCE if not found
|
||||
*/
|
||||
uint32_t bacfile_pathname_instance(
|
||||
const char *pathname)
|
||||
uint32_t bacfile_pathname_instance(const char *pathname)
|
||||
{
|
||||
struct object_data *pObject;
|
||||
int count = 0;
|
||||
@@ -179,11 +185,10 @@ bool bacfile_object_name(
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if (pObject->Object_Name) {
|
||||
status = characterstring_init_ansi(object_name,
|
||||
pObject->Object_Name);
|
||||
status =
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(name_text, sizeof(name_text), "FILE %u",
|
||||
object_instance);
|
||||
snprintf(name_text, sizeof(name_text), "FILE %u", object_instance);
|
||||
status = characterstring_init_ansi(object_name, name_text);
|
||||
}
|
||||
}
|
||||
@@ -232,7 +237,6 @@ const char *bacfile_name_ansi(uint32_t object_instance)
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Determines if a given object instance is valid
|
||||
* @param object_instance - object-instance number of the object
|
||||
@@ -300,8 +304,8 @@ static long fsize(FILE *pFile)
|
||||
* @param buffer_size - in bytes
|
||||
* @return file size in bytes
|
||||
*/
|
||||
uint32_t bacfile_read(uint32_t object_instance, uint8_t *buffer,
|
||||
uint32_t buffer_size)
|
||||
uint32_t
|
||||
bacfile_read(uint32_t object_instance, uint8_t *buffer, uint32_t buffer_size)
|
||||
{
|
||||
const char *pFilename = NULL;
|
||||
FILE *pFile = NULL;
|
||||
@@ -331,8 +335,8 @@ uint32_t bacfile_read(uint32_t object_instance, uint8_t *buffer,
|
||||
* @param buffer_size - in bytes
|
||||
* @return file size in bytes
|
||||
*/
|
||||
uint32_t bacfile_write(uint32_t object_instance, const uint8_t *buffer,
|
||||
uint32_t buffer_size)
|
||||
uint32_t bacfile_write(
|
||||
uint32_t object_instance, const uint8_t *buffer, uint32_t buffer_size)
|
||||
{
|
||||
const char *pFilename = NULL;
|
||||
FILE *pFile = NULL;
|
||||
@@ -387,8 +391,7 @@ BACNET_UNSIGNED_INTEGER bacfile_file_size(uint32_t object_instance)
|
||||
* @return true if file size is writable
|
||||
*/
|
||||
bool bacfile_file_size_set(
|
||||
uint32_t object_instance,
|
||||
BACNET_UNSIGNED_INTEGER file_size)
|
||||
uint32_t object_instance, BACNET_UNSIGNED_INTEGER file_size)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -404,17 +407,15 @@ bool bacfile_file_size_set(
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Determines the file size property value
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return value of the file size property
|
||||
*/
|
||||
const char * bacfile_file_type(
|
||||
uint32_t object_instance)
|
||||
const char *bacfile_file_type(uint32_t object_instance)
|
||||
{
|
||||
struct object_data *pObject;
|
||||
const char * mime_type = "application/octet-stream";
|
||||
const char *mime_type = "application/octet-stream";
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
@@ -431,9 +432,7 @@ const char * bacfile_file_type(
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @param mime_type - value of the file type property
|
||||
*/
|
||||
void bacfile_file_type_set(
|
||||
uint32_t object_instance,
|
||||
const char *mime_type)
|
||||
void bacfile_file_type_set(uint32_t object_instance, const char *mime_type)
|
||||
{
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -461,8 +460,7 @@ void bacfile_file_type_set(
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return true if the property is true
|
||||
*/
|
||||
bool bacfile_archive(
|
||||
uint32_t object_instance)
|
||||
bool bacfile_archive(uint32_t object_instance)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -486,8 +484,7 @@ bool bacfile_archive(
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return true if the property is true
|
||||
*/
|
||||
bool bacfile_archive_set(
|
||||
uint32_t object_instance, bool archive)
|
||||
bool bacfile_archive_set(uint32_t object_instance, bool archive)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -506,8 +503,7 @@ bool bacfile_archive_set(
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return true if the property is true
|
||||
*/
|
||||
bool bacfile_read_only(
|
||||
uint32_t object_instance)
|
||||
bool bacfile_read_only(uint32_t object_instance)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -526,9 +522,7 @@ bool bacfile_read_only(
|
||||
* @param archive - value of the file archive property
|
||||
* @return true if the file exists and read-only is writeable
|
||||
*/
|
||||
bool bacfile_read_only_set(
|
||||
uint32_t object_instance,
|
||||
bool read_only)
|
||||
bool bacfile_read_only_set(uint32_t object_instance, bool read_only)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -547,8 +541,8 @@ bool bacfile_read_only_set(
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @param bdatetime
|
||||
*/
|
||||
static void bacfile_modification_date(
|
||||
uint32_t object_instance, BACNET_DATE_TIME *bdatetime)
|
||||
static void
|
||||
bacfile_modification_date(uint32_t object_instance, BACNET_DATE_TIME *bdatetime)
|
||||
{
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -563,8 +557,7 @@ static void bacfile_modification_date(
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return true if the property is true
|
||||
*/
|
||||
bool bacfile_file_access_stream(
|
||||
uint32_t object_instance)
|
||||
bool bacfile_file_access_stream(uint32_t object_instance)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -583,9 +576,7 @@ bool bacfile_file_access_stream(
|
||||
* @param access - value of the property
|
||||
* @return true if the file exists and property is writeable
|
||||
*/
|
||||
bool bacfile_file_access_stream_set(
|
||||
uint32_t object_instance,
|
||||
bool access)
|
||||
bool bacfile_file_access_stream_set(uint32_t object_instance, bool access)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -630,8 +621,7 @@ int bacfile_read_property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
encode_application_character_string(&apdu[0], &char_string);
|
||||
break;
|
||||
case PROP_OBJECT_TYPE:
|
||||
apdu_len =
|
||||
encode_application_enumerated(&apdu[0], Object_Type);
|
||||
apdu_len = encode_application_enumerated(&apdu[0], Object_Type);
|
||||
break;
|
||||
case PROP_DESCRIPTION:
|
||||
characterstring_init_ansi(
|
||||
@@ -640,8 +630,8 @@ int bacfile_read_property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
encode_application_character_string(&apdu[0], &char_string);
|
||||
break;
|
||||
case PROP_FILE_TYPE:
|
||||
characterstring_init_ansi(&char_string,
|
||||
bacfile_file_type(rpdata->object_instance));
|
||||
characterstring_init_ansi(
|
||||
&char_string, bacfile_file_type(rpdata->object_instance));
|
||||
apdu_len =
|
||||
encode_application_character_string(&apdu[0], &char_string);
|
||||
break;
|
||||
@@ -654,20 +644,20 @@ int bacfile_read_property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu_len = bacapp_encode_datetime(apdu, &bdatetime);
|
||||
break;
|
||||
case PROP_ARCHIVE:
|
||||
apdu_len = encode_application_boolean(&apdu[0],
|
||||
bacfile_archive(rpdata->object_instance));
|
||||
apdu_len = encode_application_boolean(
|
||||
&apdu[0], bacfile_archive(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_READ_ONLY:
|
||||
apdu_len = encode_application_boolean(&apdu[0],
|
||||
bacfile_read_only(rpdata->object_instance));
|
||||
apdu_len = encode_application_boolean(
|
||||
&apdu[0], bacfile_read_only(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_FILE_ACCESS_METHOD:
|
||||
if (bacfile_file_access_stream(rpdata->object_instance)) {
|
||||
apdu_len = encode_application_enumerated(
|
||||
&apdu[0], FILE_STREAM_ACCESS);
|
||||
apdu_len =
|
||||
encode_application_enumerated(&apdu[0], FILE_STREAM_ACCESS);
|
||||
} else {
|
||||
apdu_len = encode_application_enumerated(
|
||||
&apdu[0], FILE_RECORD_ACCESS);
|
||||
apdu_len =
|
||||
encode_application_enumerated(&apdu[0], FILE_RECORD_ACCESS);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -730,9 +720,8 @@ bool bacfile_write_property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_UNSIGNED_INT);
|
||||
if (status) {
|
||||
status =
|
||||
bacfile_file_size_set(wp_data->object_instance,
|
||||
value.type.Unsigned_Int);
|
||||
status = bacfile_file_size_set(
|
||||
wp_data->object_instance, value.type.Unsigned_Int);
|
||||
if (!status) {
|
||||
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||
wp_data->error_code = ERROR_CODE_WRITE_ACCESS_DENIED;
|
||||
@@ -786,9 +775,9 @@ uint32_t bacfile_instance_from_tsm(uint8_t invokeID)
|
||||
if (!npdu_data.network_layer_message &&
|
||||
npdu_data.data_expecting_reply &&
|
||||
((apdu[0] & 0xF0) == PDU_TYPE_CONFIRMED_SERVICE_REQUEST)) {
|
||||
len = apdu_decode_confirmed_service_request(&apdu[0], apdu_len,
|
||||
&service_data, &service_choice, &service_request,
|
||||
&service_request_len);
|
||||
len = apdu_decode_confirmed_service_request(
|
||||
&apdu[0], apdu_len, &service_data, &service_choice,
|
||||
&service_request, &service_request_len);
|
||||
if ((len > 0) &&
|
||||
(service_choice == SERVICE_CONFIRMED_ATOMIC_READ_FILE)) {
|
||||
len = arf_decode_service_request(
|
||||
@@ -819,7 +808,8 @@ bool bacfile_read_stream_data(BACNET_ATOMIC_READ_FILE_DATA *data)
|
||||
pFile = fopen(pFilename, "rb");
|
||||
if (pFile) {
|
||||
(void)fseek(pFile, data->type.stream.fileStartPosition, SEEK_SET);
|
||||
len = fread(octetstring_value(&data->fileData[0]), 1,
|
||||
len = fread(
|
||||
octetstring_value(&data->fileData[0]), 1,
|
||||
data->type.stream.requestedOctetCount, pFile);
|
||||
if (len < data->type.stream.requestedOctetCount) {
|
||||
data->endOfFile = true;
|
||||
@@ -866,7 +856,8 @@ bool bacfile_write_stream_data(BACNET_ATOMIC_WRITE_FILE_DATA *data)
|
||||
(void)fseek(
|
||||
pFile, data->type.stream.fileStartPosition, SEEK_SET);
|
||||
}
|
||||
if (fwrite(octetstring_value(&data->fileData[0]),
|
||||
if (fwrite(
|
||||
octetstring_value(&data->fileData[0]),
|
||||
octetstring_length(&data->fileData[0]), 1, pFile) != 1) {
|
||||
/* do something if it fails? */
|
||||
}
|
||||
@@ -913,7 +904,9 @@ bool bacfile_write_record_data(const BACNET_ATOMIC_WRITE_FILE_DATA *data)
|
||||
}
|
||||
}
|
||||
for (i = 0; i < data->type.record.returnedRecordCount; i++) {
|
||||
if (fwrite(octetstring_value((BACNET_OCTET_STRING*)&data->fileData[i]),
|
||||
if (fwrite(
|
||||
octetstring_value(
|
||||
(BACNET_OCTET_STRING *)&data->fileData[i]),
|
||||
octetstring_length(&data->fileData[i]), 1,
|
||||
pFile) != 1) {
|
||||
/* do something if it fails? */
|
||||
@@ -939,10 +932,13 @@ bool bacfile_read_ack_stream_data(
|
||||
pFile = fopen(pFilename, "rb+");
|
||||
if (pFile) {
|
||||
(void)fseek(pFile, data->type.stream.fileStartPosition, SEEK_SET);
|
||||
if (fwrite(octetstring_value((BACNET_OCTET_STRING*)&data->fileData[0]),
|
||||
if (fwrite(
|
||||
octetstring_value(
|
||||
(BACNET_OCTET_STRING *)&data->fileData[0]),
|
||||
octetstring_length(&data->fileData[0]), 1, pFile) != 1) {
|
||||
#if PRINT_ENABLED
|
||||
fprintf(stderr, "Failed to write to %s (%lu)!\n", pFilename,
|
||||
fprintf(
|
||||
stderr, "Failed to write to %s (%lu)!\n", pFilename,
|
||||
(unsigned long)instance);
|
||||
#endif
|
||||
}
|
||||
@@ -978,11 +974,14 @@ bool bacfile_read_ack_record_data(
|
||||
}
|
||||
}
|
||||
for (i = 0; i < data->type.record.RecordCount; i++) {
|
||||
if (fwrite(octetstring_value((BACNET_OCTET_STRING*)&data->fileData[i]),
|
||||
if (fwrite(
|
||||
octetstring_value(
|
||||
(BACNET_OCTET_STRING *)&data->fileData[i]),
|
||||
octetstring_length(&data->fileData[i]), 1,
|
||||
pFile) != 1) {
|
||||
#if PRINT_ENABLED
|
||||
fprintf(stderr, "Failed to write to %s (%lu)!\n", pFilename,
|
||||
fprintf(
|
||||
stderr, "Failed to write to %s (%lu)!\n", pFilename,
|
||||
(unsigned long)instance);
|
||||
#endif
|
||||
}
|
||||
@@ -994,7 +993,6 @@ bool bacfile_read_ack_record_data(
|
||||
return found;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Creates a File object
|
||||
* @param object_instance - object-instance number of the object
|
||||
@@ -1022,8 +1020,8 @@ uint32_t bacfile_create(uint32_t object_instance)
|
||||
pObject->Object_Name = NULL;
|
||||
pObject->Pathname = NULL;
|
||||
/* April Fool's Day */
|
||||
datetime_set_values(&pObject->Modification_Date,
|
||||
2006, 4, 1, 7, 0, 3, 1);
|
||||
datetime_set_values(
|
||||
&pObject->Modification_Date, 2006, 4, 1, 7, 0, 3, 1);
|
||||
pObject->Read_Only = false;
|
||||
pObject->Archive = false;
|
||||
pObject->File_Access_Stream = true;
|
||||
|
||||
@@ -24,152 +24,107 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void BACfile_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void BACfile_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_object_name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_object_name_set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char * bacfile_name_ansi(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_object_name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_object_name_set(uint32_t object_instance, char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bacfile_name_ansi(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_valid_instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t bacfile_count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t bacfile_index_to_instance(
|
||||
unsigned find_index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned bacfile_instance_to_index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_valid_instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t bacfile_count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t bacfile_index_to_instance(unsigned find_index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned bacfile_instance_to_index(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char * bacfile_file_type(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void bacfile_file_type_set(
|
||||
uint32_t object_instance,
|
||||
const char *mime_type);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bacfile_file_type(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void bacfile_file_type_set(uint32_t object_instance, const char *mime_type);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_archive(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_archive_set(
|
||||
uint32_t instance, bool status);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_archive(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_archive_set(uint32_t instance, bool status);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_read_only(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_read_only_set(
|
||||
uint32_t object_instance,
|
||||
bool read_only);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_read_only(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_read_only_set(uint32_t object_instance, bool read_only);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_file_access_stream(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_file_access_stream_set(
|
||||
uint32_t object_instance,
|
||||
bool access);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_file_access_stream(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_file_access_stream_set(uint32_t object_instance, bool access);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_UNSIGNED_INTEGER bacfile_file_size(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_file_size_set(
|
||||
uint32_t object_instance,
|
||||
BACNET_UNSIGNED_INTEGER file_size);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_UNSIGNED_INTEGER bacfile_file_size(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_file_size_set(
|
||||
uint32_t object_instance, BACNET_UNSIGNED_INTEGER file_size);
|
||||
|
||||
/* this is one way to match up the invoke ID with */
|
||||
/* the file ID from the AtomicReadFile request. */
|
||||
/* Another way would be to store the */
|
||||
/* invokeID and file instance in a list or table */
|
||||
/* when the request was sent */
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t bacfile_instance_from_tsm(
|
||||
uint8_t invokeID);
|
||||
/* this is one way to match up the invoke ID with */
|
||||
/* the file ID from the AtomicReadFile request. */
|
||||
/* Another way would be to store the */
|
||||
/* invokeID and file instance in a list or table */
|
||||
/* when the request was sent */
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t bacfile_instance_from_tsm(uint8_t invokeID);
|
||||
|
||||
/* handler ACK helper */
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_read_stream_data(
|
||||
BACNET_ATOMIC_READ_FILE_DATA * data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_read_ack_stream_data(
|
||||
uint32_t instance,
|
||||
const BACNET_ATOMIC_READ_FILE_DATA * data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_write_stream_data(
|
||||
BACNET_ATOMIC_WRITE_FILE_DATA * data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_read_record_data(
|
||||
BACNET_ATOMIC_READ_FILE_DATA * data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_read_ack_record_data(
|
||||
uint32_t instance,
|
||||
const BACNET_ATOMIC_READ_FILE_DATA * data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_write_record_data(
|
||||
const BACNET_ATOMIC_WRITE_FILE_DATA * data);
|
||||
/* handler ACK helper */
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_read_stream_data(BACNET_ATOMIC_READ_FILE_DATA *data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_read_ack_stream_data(
|
||||
uint32_t instance, const BACNET_ATOMIC_READ_FILE_DATA *data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_write_stream_data(BACNET_ATOMIC_WRITE_FILE_DATA *data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_read_record_data(BACNET_ATOMIC_READ_FILE_DATA *data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_read_ack_record_data(
|
||||
uint32_t instance, const BACNET_ATOMIC_READ_FILE_DATA *data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_write_record_data(const BACNET_ATOMIC_WRITE_FILE_DATA *data);
|
||||
|
||||
/* handling for read property service */
|
||||
BACNET_STACK_EXPORT
|
||||
int bacfile_read_property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
/* handling for read property service */
|
||||
BACNET_STACK_EXPORT
|
||||
int bacfile_read_property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
/* handling for write property service */
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_write_property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
/* handling for write property service */
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_write_property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bacfile_pathname(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void bacfile_pathname_set(
|
||||
uint32_t instance,
|
||||
const char *pathname);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t bacfile_pathname_instance(
|
||||
const char *pathname);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bacfile_pathname(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void bacfile_pathname_set(uint32_t instance, const char *pathname);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t bacfile_pathname_instance(const char *pathname);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t bacfile_read(
|
||||
uint32_t object_instance,
|
||||
uint8_t *buffer,
|
||||
uint32_t buffer_size);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t bacfile_write(
|
||||
uint32_t object_instance,
|
||||
const uint8_t *buffer,
|
||||
uint32_t buffer_size);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t bacfile_create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void bacfile_cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void bacfile_init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t
|
||||
bacfile_read(uint32_t object_instance, uint8_t *buffer, uint32_t buffer_size);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t bacfile_write(
|
||||
uint32_t object_instance, const uint8_t *buffer, uint32_t buffer_size);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t bacfile_create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void bacfile_cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void bacfile_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1573,8 +1573,9 @@ int Binary_Input_Event_Information(
|
||||
false) |
|
||||
(pObject->Acked_Transitions[TRANSITION_TO_NORMAL].bIsAcked ==
|
||||
false);
|
||||
} else
|
||||
} else {
|
||||
return -1; /* end of list */
|
||||
}
|
||||
|
||||
if ((IsActiveEvent) || (IsNotAckedTransitions)) {
|
||||
/* Object Identifier */
|
||||
@@ -1618,8 +1619,9 @@ int Binary_Input_Event_Information(
|
||||
pObject->Notification_Class, getevent_data->eventPriorities);
|
||||
|
||||
return 1; /* active event */
|
||||
} else
|
||||
} else {
|
||||
return 0; /* no active event at this index */
|
||||
}
|
||||
}
|
||||
|
||||
int Binary_Input_Alarm_Ack(
|
||||
@@ -1759,10 +1761,12 @@ int Binary_Input_Alarm_Summary(
|
||||
&getalarm_data->acknowledgedTransitions, TRANSITION_TO_NORMAL,
|
||||
pObject->Acked_Transitions[TRANSITION_TO_NORMAL].bIsAcked);
|
||||
return 1; /* active alarm */
|
||||
} else
|
||||
} else {
|
||||
return 0; /* no active alarm at this index */
|
||||
} else
|
||||
}
|
||||
} else {
|
||||
return -1; /* end of list */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1935,10 +1939,11 @@ void Binary_Input_Intrinsic_Reporting(uint32_t object_instance)
|
||||
if ((PresentVal == pObject->Alarm_Value) &&
|
||||
((pObject->Event_Enable & EVENT_ENABLE_TO_OFFNORMAL) ==
|
||||
EVENT_ENABLE_TO_OFFNORMAL)) {
|
||||
if (!pObject->Remaining_Time_Delay)
|
||||
if (!pObject->Remaining_Time_Delay) {
|
||||
pObject->Event_State = EVENT_STATE_OFFNORMAL;
|
||||
else
|
||||
} else {
|
||||
pObject->Remaining_Time_Delay--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1955,10 +1960,11 @@ void Binary_Input_Intrinsic_Reporting(uint32_t object_instance)
|
||||
if ((PresentVal != pObject->Alarm_Value) &&
|
||||
((pObject->Event_Enable & EVENT_ENABLE_TO_NORMAL) ==
|
||||
EVENT_ENABLE_TO_NORMAL)) {
|
||||
if (!pObject->Remaining_Time_Delay)
|
||||
if (!pObject->Remaining_Time_Delay) {
|
||||
pObject->Event_State = EVENT_STATE_NORMAL;
|
||||
else
|
||||
} else {
|
||||
pObject->Remaining_Time_Delay--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2070,8 +2076,9 @@ void Binary_Input_Intrinsic_Reporting(uint32_t object_instance)
|
||||
/* filled before */
|
||||
|
||||
/* From State */
|
||||
if (event_data.notifyType != NOTIFY_ACK_NOTIFICATION)
|
||||
if (event_data.notifyType != NOTIFY_ACK_NOTIFICATION) {
|
||||
event_data.fromState = FromState;
|
||||
}
|
||||
|
||||
/* To State */
|
||||
event_data.toState = pObject->Event_State;
|
||||
|
||||
+123
-178
@@ -32,221 +32,166 @@
|
||||
* @param value - binary preset-value of the write
|
||||
*/
|
||||
typedef void (*binary_input_write_present_value_callback)(
|
||||
uint32_t object_instance, BACNET_BINARY_PV old_value,
|
||||
uint32_t object_instance,
|
||||
BACNET_BINARY_PV old_value,
|
||||
BACNET_BINARY_PV value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Input_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Input_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Input_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Input_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Input_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Input_Instance_To_Index(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Name_Set(
|
||||
uint32_t object_instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Input_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Input_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_BINARY_PV Binary_Input_Present_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_BINARY_PV value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_BINARY_PV Binary_Input_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Present_Value_Set(
|
||||
uint32_t object_instance, BACNET_BINARY_PV value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Input_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Description_Set(
|
||||
uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Input_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Description_Set(uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Binary_Input_Reliability(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Reliability_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_RELIABILITY value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Binary_Input_Reliability(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Reliability_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Input_Inactive_Text(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Inactive_Text_Set(
|
||||
uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Input_Inactive_Text(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Inactive_Text_Set(uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Input_Active_Text(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Active_Text_Set(
|
||||
uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Input_Active_Text(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Active_Text_Set(uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_POLARITY Binary_Input_Polarity(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Polarity_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_POLARITY polarity);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_POLARITY Binary_Input_Polarity(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Polarity_Set(
|
||||
uint32_t object_instance, BACNET_POLARITY polarity);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Out_Of_Service(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Out_Of_Service_Set(
|
||||
uint32_t object_instance,
|
||||
bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Out_Of_Service(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Out_Of_Service_Set(uint32_t object_instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Input_Event_State(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Input_Event_State(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Encode_Value_List(
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Change_Of_Value(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Change_Of_Value_Clear(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Encode_Value_List(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Change_Of_Value_Clear(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Input_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Write_Present_Value_Callback_Set(
|
||||
binary_input_write_present_value_callback cb);
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Input_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Write_Present_Value_Callback_Set(
|
||||
binary_input_write_present_value_callback cb);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Write_Enabled(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Write_Enable(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Write_Disable(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Write_Enabled(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Write_Enable(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Write_Disable(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Input_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Input_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Init(void);
|
||||
|
||||
#if defined(INTRINSIC_REPORTING) && (BINARY_INPUT_INTRINSIC_REPORTING)
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Event_Detection_Enable(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Event_Detection_Enable_Set(
|
||||
uint32_t object_instance, bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Event_Detection_Enable(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Event_Detection_Enable_Set(
|
||||
uint32_t object_instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Input_Event_Information(
|
||||
unsigned index,
|
||||
BACNET_GET_EVENT_INFORMATION_DATA * getevent_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Input_Event_Information(
|
||||
unsigned index, BACNET_GET_EVENT_INFORMATION_DATA *getevent_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Input_Alarm_Ack(
|
||||
BACNET_ALARM_ACK_DATA * alarmack_data,
|
||||
BACNET_ERROR_CODE * error_code);
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Input_Alarm_Ack(
|
||||
BACNET_ALARM_ACK_DATA *alarmack_data, BACNET_ERROR_CODE *error_code);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Input_Alarm_Summary(
|
||||
unsigned index,
|
||||
BACNET_GET_ALARM_SUMMARY_DATA * getalarm_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Input_Alarm_Summary(
|
||||
unsigned index, BACNET_GET_ALARM_SUMMARY_DATA *getalarm_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Input_Time_Delay(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Input_Time_Delay(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Time_Delay_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t time_delay);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Time_Delay_Set(uint32_t object_instance, uint32_t time_delay);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Input_Notification_Class(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Input_Notification_Class(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Notification_Class_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t notification_class);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Notification_Class_Set(
|
||||
uint32_t object_instance, uint32_t notification_class);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_BINARY_PV Binary_Input_Alarm_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_BINARY_PV Binary_Input_Alarm_Value(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Alarm_Value_Set(
|
||||
uint32_t object_instance, BACNET_BINARY_PV value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Alarm_Value_Set(
|
||||
uint32_t object_instance, BACNET_BINARY_PV value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Input_Event_Enable(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Input_Event_Enable(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Event_Enable_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t event_enable);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Event_Enable_Set(
|
||||
uint32_t object_instance, uint32_t event_enable);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_NOTIFY_TYPE Binary_Input_Notify_Type(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_NOTIFY_TYPE Binary_Input_Notify_Type(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Notify_Type_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_NOTIFY_TYPE notify_type);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Notify_Type_Set(
|
||||
uint32_t object_instance, BACNET_NOTIFY_TYPE notify_type);
|
||||
#endif
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Intrinsic_Reporting(
|
||||
uint32_t object_instance);
|
||||
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Input_Intrinsic_Reporting(uint32_t object_instance);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -41,12 +41,14 @@ static bitstring_value_write_present_value_callback
|
||||
BitString_Value_Write_Present_Value_Callback;
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_PRESENT_VALUE, PROP_STATUS_FLAGS,
|
||||
-1 };
|
||||
static const int Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER, PROP_OBJECT_NAME, PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE, PROP_STATUS_FLAGS, -1
|
||||
};
|
||||
|
||||
static const int Properties_Optional[] = { PROP_RELIABILITY,
|
||||
PROP_OUT_OF_SERVICE, PROP_DESCRIPTION, -1 };
|
||||
PROP_OUT_OF_SERVICE,
|
||||
PROP_DESCRIPTION, -1 };
|
||||
|
||||
static const int Properties_Proprietary[] = { -1 };
|
||||
|
||||
@@ -265,8 +267,7 @@ bool BitString_Value_Out_Of_Service(uint32_t object_instance)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @param true/false
|
||||
*/
|
||||
void BitString_Value_Out_Of_Service_Set(
|
||||
uint32_t object_instance, bool value)
|
||||
void BitString_Value_Out_Of_Service_Set(uint32_t object_instance, bool value)
|
||||
{
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -286,8 +287,7 @@ void BitString_Value_Out_Of_Service_Set(
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return BACNET_RELIABILITY value
|
||||
*/
|
||||
BACNET_RELIABILITY BitString_Value_Reliablity(
|
||||
uint32_t object_instance)
|
||||
BACNET_RELIABILITY BitString_Value_Reliablity(uint32_t object_instance)
|
||||
{
|
||||
BACNET_RELIABILITY value = RELIABILITY_NO_FAULT_DETECTED;
|
||||
struct object_data *pObject;
|
||||
@@ -298,7 +298,6 @@ BACNET_RELIABILITY BitString_Value_Reliablity(
|
||||
}
|
||||
|
||||
return value;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -411,8 +410,8 @@ bool BitString_Value_Encode_Value_List(
|
||||
|
||||
pObject = BitString_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
status = cov_value_list_encode_bit_string(value_list,
|
||||
&pObject->Present_Value, in_alarm, fault, overridden,
|
||||
status = cov_value_list_encode_bit_string(
|
||||
value_list, &pObject->Present_Value, in_alarm, fault, overridden,
|
||||
pObject->Out_Of_Service);
|
||||
}
|
||||
|
||||
@@ -442,7 +441,8 @@ bool BitString_Value_Object_Name(
|
||||
status =
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(name_text, sizeof(name_text), "BITSTRING_VALUE-%u",
|
||||
snprintf(
|
||||
name_text, sizeof(name_text), "BITSTRING_VALUE-%u",
|
||||
object_instance);
|
||||
status = characterstring_init_ansi(object_name, name_text);
|
||||
}
|
||||
@@ -562,8 +562,8 @@ int BitString_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu = rpdata->application_data;
|
||||
switch (rpdata->object_property) {
|
||||
case PROP_OBJECT_IDENTIFIER:
|
||||
apdu_len = encode_application_object_id(&apdu[0],
|
||||
OBJECT_BITSTRING_VALUE, rpdata->object_instance);
|
||||
apdu_len = encode_application_object_id(
|
||||
&apdu[0], OBJECT_BITSTRING_VALUE, rpdata->object_instance);
|
||||
break;
|
||||
case PROP_OBJECT_NAME:
|
||||
if (BitString_Value_Object_Name(
|
||||
@@ -574,13 +574,13 @@ int BitString_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
break;
|
||||
case PROP_DESCRIPTION:
|
||||
characterstring_init_ansi(
|
||||
&char_string, BitString_Value_Description(
|
||||
rpdata->object_instance));
|
||||
&char_string,
|
||||
BitString_Value_Description(rpdata->object_instance));
|
||||
apdu_len = encode_application_character_string(apdu, &char_string);
|
||||
break;
|
||||
case PROP_OBJECT_TYPE:
|
||||
apdu_len = encode_application_enumerated(
|
||||
&apdu[0], OBJECT_BITSTRING_VALUE);
|
||||
apdu_len =
|
||||
encode_application_enumerated(&apdu[0], OBJECT_BITSTRING_VALUE);
|
||||
break;
|
||||
case PROP_PRESENT_VALUE:
|
||||
BitString_Value_Present_Value(rpdata->object_instance, &bit_string);
|
||||
@@ -602,9 +602,8 @@ int BitString_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu_len = encode_application_boolean(&apdu[0], state);
|
||||
break;
|
||||
case PROP_RELIABILITY:
|
||||
apdu_len =
|
||||
encode_application_enumerated(&apdu[0],
|
||||
BitString_Value_Reliablity(rpdata->object_instance));
|
||||
apdu_len = encode_application_enumerated(
|
||||
&apdu[0], BitString_Value_Reliablity(rpdata->object_instance));
|
||||
break;
|
||||
default:
|
||||
rpdata->error_class = ERROR_CLASS_PROPERTY;
|
||||
@@ -684,8 +683,8 @@ bool BitString_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
break;
|
||||
default:
|
||||
if (property_lists_member(
|
||||
Properties_Required, Properties_Optional,
|
||||
Properties_Proprietary, wp_data->object_property)) {
|
||||
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 {
|
||||
|
||||
@@ -33,113 +33,89 @@ typedef void (*bitstring_value_write_present_value_callback)(
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
BACNET_STACK_EXPORT
|
||||
void BitString_Value_Write_Present_Value_Callback_Set(
|
||||
bitstring_value_write_present_value_callback cb);
|
||||
BACNET_STACK_EXPORT
|
||||
void BitString_Value_Write_Present_Value_Callback_Set(
|
||||
bitstring_value_write_present_value_callback cb);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void BitString_Value_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void BitString_Value_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned BitString_Value_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t BitString_Value_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned BitString_Value_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned BitString_Value_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t BitString_Value_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned BitString_Value_Instance_To_Index(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int BitString_Value_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
int BitString_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
/* optional API */
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
/* optional API */
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Name_Set(
|
||||
uint32_t object_instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *BitString_Value_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *BitString_Value_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Present_Value(
|
||||
uint32_t object_instance,
|
||||
BACNET_BIT_STRING * value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
const BACNET_BIT_STRING * value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Present_Value(
|
||||
uint32_t object_instance, BACNET_BIT_STRING *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Present_Value_Set(
|
||||
uint32_t object_instance, const BACNET_BIT_STRING *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *BitString_Value_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Description_Set(
|
||||
uint32_t object_instance,
|
||||
const char *text_string);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *BitString_Value_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Description_Set(
|
||||
uint32_t object_instance, const char *text_string);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Out_Of_Service(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void BitString_Value_Out_Of_Service_Set(
|
||||
uint32_t object_instance, bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Out_Of_Service(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void BitString_Value_Out_Of_Service_Set(uint32_t object_instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY BitString_Value_Reliablity(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Reliablity_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY BitString_Value_Reliablity(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Reliablity_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Change_Of_Value(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void BitString_Value_Change_Of_Value_Clear(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Encode_Value_List(
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void BitString_Value_Change_Of_Value_Clear(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Encode_Value_List(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Write_Enabled(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void BitString_Value_Write_Enable(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void BitString_Value_Write_Disable(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Write_Enabled(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void BitString_Value_Write_Enable(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void BitString_Value_Write_Disable(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t BitString_Value_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void BitString_Value_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t BitString_Value_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void BitString_Value_Cleanup(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void BitString_Value_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void BitString_Value_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -61,10 +61,17 @@ static binary_lighting_output_blink_warn_callback
|
||||
/* These arrays are used by the ReadPropertyMultiple handler and
|
||||
property-list property (as of protocol-revision 14) */
|
||||
static const int Binary_Lighting_Output_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER, PROP_OBJECT_NAME, PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE, PROP_STATUS_FLAGS, PROP_OUT_OF_SERVICE,
|
||||
PROP_BLINK_WARN_ENABLE, PROP_EGRESS_TIME, PROP_EGRESS_ACTIVE,
|
||||
PROP_PRIORITY_ARRAY, PROP_RELINQUISH_DEFAULT,
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
PROP_BLINK_WARN_ENABLE,
|
||||
PROP_EGRESS_TIME,
|
||||
PROP_EGRESS_ACTIVE,
|
||||
PROP_PRIORITY_ARRAY,
|
||||
PROP_RELINQUISH_DEFAULT,
|
||||
#if (BACNET_PROTOCOL_REVISION >= 17)
|
||||
PROP_CURRENT_COMMAND_PRIORITY,
|
||||
#endif
|
||||
@@ -216,8 +223,8 @@ static BACNET_BINARY_LIGHTING_PV Priority_Array_Next_Value(
|
||||
*
|
||||
* @return present-value of the object
|
||||
*/
|
||||
BACNET_BINARY_LIGHTING_PV Binary_Lighting_Output_Present_Value(
|
||||
uint32_t object_instance)
|
||||
BACNET_BINARY_LIGHTING_PV
|
||||
Binary_Lighting_Output_Present_Value(uint32_t object_instance)
|
||||
{
|
||||
BACNET_BINARY_LIGHTING_PV value = BINARY_LIGHTING_PV_OFF;
|
||||
struct object_data *pObject;
|
||||
@@ -314,8 +321,8 @@ static unsigned Present_Value_Priority(const struct object_data *pObject)
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Present_Value_Relinquish(
|
||||
struct object_data *pObject, unsigned priority)
|
||||
static bool
|
||||
Present_Value_Relinquish(struct object_data *pObject, unsigned priority)
|
||||
{
|
||||
bool status = false;
|
||||
|
||||
@@ -340,7 +347,8 @@ static bool Present_Value_Relinquish(
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Present_Value_Set(struct object_data *pObject,
|
||||
static bool Present_Value_Set(
|
||||
struct object_data *pObject,
|
||||
BACNET_BINARY_LIGHTING_PV value,
|
||||
unsigned priority)
|
||||
{
|
||||
@@ -391,7 +399,8 @@ unsigned Binary_Lighting_Output_Present_Value_Priority(uint32_t object_instance)
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
bool Binary_Lighting_Output_Present_Value_Set(uint32_t object_instance,
|
||||
bool Binary_Lighting_Output_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_BINARY_LIGHTING_PV value,
|
||||
unsigned priority)
|
||||
{
|
||||
@@ -426,8 +435,9 @@ static void Present_Value_On_Off_Handler(uint32_t object_instance)
|
||||
if (pObject->Feedback_Value != pObject->Target_Value) {
|
||||
if ((!pObject->Out_Of_Service) &&
|
||||
(Binary_Lighting_Output_Write_Value_Callback)) {
|
||||
Binary_Lighting_Output_Write_Value_Callback(object_instance,
|
||||
pObject->Feedback_Value, pObject->Target_Value);
|
||||
Binary_Lighting_Output_Write_Value_Callback(
|
||||
object_instance, pObject->Feedback_Value,
|
||||
pObject->Target_Value);
|
||||
}
|
||||
pObject->Feedback_Value = pObject->Target_Value;
|
||||
}
|
||||
@@ -563,8 +573,7 @@ static void Present_Value_Warn_Handler(uint32_t object_instance)
|
||||
pObject->Target_Value = BINARY_LIGHTING_PV_ON;
|
||||
} else if (pObject->Target_Value == BINARY_LIGHTING_PV_WARN_OFF) {
|
||||
pObject->Target_Value = BINARY_LIGHTING_PV_OFF;
|
||||
} else if (pObject->Target_Value ==
|
||||
BINARY_LIGHTING_PV_WARN_RELINQUISH) {
|
||||
} else if (pObject->Target_Value == BINARY_LIGHTING_PV_WARN_RELINQUISH) {
|
||||
pObject->Target_Value = BINARY_LIGHTING_PV_OFF;
|
||||
}
|
||||
}
|
||||
@@ -629,7 +638,8 @@ void Binary_Lighting_Output_Timer(
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Binary_Lighting_Output_Present_Value_Write(uint32_t object_instance,
|
||||
static bool Binary_Lighting_Output_Present_Value_Write(
|
||||
uint32_t object_instance,
|
||||
BACNET_BINARY_LIGHTING_PV value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
@@ -656,7 +666,8 @@ static bool Binary_Lighting_Output_Present_Value_Write(uint32_t object_instance,
|
||||
Present_Value_On_Off_Handler(object_instance);
|
||||
}
|
||||
status = true;
|
||||
} else if ((value >= BINARY_LIGHTING_PV_PROPRIETARY_MIN) &&
|
||||
} else if (
|
||||
(value >= BINARY_LIGHTING_PV_PROPRIETARY_MIN) &&
|
||||
(value <= BINARY_LIGHTING_PV_PROPRIETARY_MAX)) {
|
||||
pObject->Target_Priority = priority;
|
||||
pObject->Target_Value = value;
|
||||
@@ -770,7 +781,8 @@ bool Binary_Lighting_Output_Object_Name(
|
||||
status =
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(name_text, sizeof(name_text), "BINARY-LIGHTING-OUTPUT-%u",
|
||||
snprintf(
|
||||
name_text, sizeof(name_text), "BINARY-LIGHTING-OUTPUT-%u",
|
||||
object_instance);
|
||||
status = characterstring_init_ansi(object_name, name_text);
|
||||
}
|
||||
@@ -876,7 +888,8 @@ bool Binary_Lighting_Output_Description_Set(
|
||||
*
|
||||
* @return true if lighting target value was set
|
||||
*/
|
||||
bool Binary_Lighting_Output_Lighting_Command_Set(uint32_t object_instance,
|
||||
bool Binary_Lighting_Output_Lighting_Command_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_BINARY_LIGHTING_PV value,
|
||||
unsigned priority)
|
||||
{
|
||||
@@ -898,8 +911,8 @@ bool Binary_Lighting_Output_Lighting_Command_Set(uint32_t object_instance,
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return lighting command target value
|
||||
*/
|
||||
BACNET_BINARY_LIGHTING_PV Binary_Lighting_Output_Lighting_Command_Target_Value(
|
||||
uint32_t object_instance)
|
||||
BACNET_BINARY_LIGHTING_PV
|
||||
Binary_Lighting_Output_Lighting_Command_Target_Value(uint32_t object_instance)
|
||||
{
|
||||
BACNET_BINARY_LIGHTING_PV value = BINARY_LIGHTING_PV_OFF;
|
||||
struct object_data *pObject;
|
||||
@@ -939,8 +952,8 @@ unsigned Binary_Lighting_Output_Lighting_Command_Target_Priority(
|
||||
*
|
||||
* @return the tracking-value of this object instance.
|
||||
*/
|
||||
BACNET_BINARY_LIGHTING_PV Binary_Lighting_Output_Feedback_Value(
|
||||
uint32_t object_instance)
|
||||
BACNET_BINARY_LIGHTING_PV
|
||||
Binary_Lighting_Output_Feedback_Value(uint32_t object_instance)
|
||||
{
|
||||
BACNET_BINARY_LIGHTING_PV value = BINARY_LIGHTING_PV_OFF;
|
||||
struct object_data *pObject;
|
||||
@@ -1142,8 +1155,8 @@ void Binary_Lighting_Output_Out_Of_Service_Set(
|
||||
*
|
||||
* @return relinquish-default property value
|
||||
*/
|
||||
BACNET_BINARY_LIGHTING_PV Binary_Lighting_Output_Relinquish_Default(
|
||||
uint32_t object_instance)
|
||||
BACNET_BINARY_LIGHTING_PV
|
||||
Binary_Lighting_Output_Relinquish_Default(uint32_t object_instance)
|
||||
{
|
||||
BACNET_BINARY_LIGHTING_PV value = BINARY_LIGHTING_PV_OFF;
|
||||
struct object_data *pObject;
|
||||
@@ -1310,8 +1323,8 @@ int Binary_Lighting_Output_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu_len = encode_application_boolean(&apdu[0], state);
|
||||
break;
|
||||
case PROP_PRIORITY_ARRAY:
|
||||
apdu_len = bacnet_array_encode(rpdata->object_instance,
|
||||
rpdata->array_index,
|
||||
apdu_len = bacnet_array_encode(
|
||||
rpdata->object_instance, rpdata->array_index,
|
||||
Binary_Lighting_Output_Priority_Array_Encode,
|
||||
BACNET_MAX_PRIORITY, apdu, apdu_size);
|
||||
if (apdu_len == BACNET_STATUS_ABORT) {
|
||||
@@ -1339,7 +1352,8 @@ int Binary_Lighting_Output_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
break;
|
||||
#endif
|
||||
case PROP_DESCRIPTION:
|
||||
characterstring_init_ansi(&char_string,
|
||||
characterstring_init_ansi(
|
||||
&char_string,
|
||||
Binary_Lighting_Output_Description(rpdata->object_instance));
|
||||
apdu_len =
|
||||
encode_application_character_string(&apdu[0], &char_string);
|
||||
|
||||
@@ -53,13 +53,14 @@ BACNET_STACK_EXPORT
|
||||
bool Binary_Lighting_Output_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_BINARY_LIGHTING_PV Binary_Lighting_Output_Present_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_BINARY_LIGHTING_PV
|
||||
Binary_Lighting_Output_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Lighting_Output_Present_Value_Priority(
|
||||
uint32_t object_instance);
|
||||
unsigned
|
||||
Binary_Lighting_Output_Present_Value_Priority(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Lighting_Output_Present_Value_Set(uint32_t object_instance,
|
||||
bool Binary_Lighting_Output_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_BINARY_LIGHTING_PV value,
|
||||
unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
@@ -67,15 +68,14 @@ bool Binary_Lighting_Output_Present_Value_Relinquish(
|
||||
uint32_t object_instance, unsigned priority);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_BINARY_LIGHTING_PV Binary_Lighting_Output_Relinquish_Default(
|
||||
uint32_t object_instance);
|
||||
BACNET_BINARY_LIGHTING_PV
|
||||
Binary_Lighting_Output_Relinquish_Default(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Lighting_Output_Relinquish_Default_Set(
|
||||
uint32_t object_instance, BACNET_BINARY_LIGHTING_PV value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Binary_Lighting_Output_Reliability(
|
||||
uint32_t object_instance);
|
||||
BACNET_RELIABILITY Binary_Lighting_Output_Reliability(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Lighting_Output_Reliability_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
@@ -102,18 +102,20 @@ void Binary_Lighting_Output_Out_Of_Service_Set(
|
||||
uint32_t instance, bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_BINARY_LIGHTING_PV Binary_Lighting_Output_Lighting_Command_Target_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_BINARY_LIGHTING_PV
|
||||
Binary_Lighting_Output_Lighting_Command_Target_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Lighting_Output_Lighting_Command_Target_Priority(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Lighting_Output_Lighting_Command_Set(
|
||||
uint32_t object_instance, BACNET_BINARY_LIGHTING_PV value, unsigned priority);
|
||||
uint32_t object_instance,
|
||||
BACNET_BINARY_LIGHTING_PV value,
|
||||
unsigned priority);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_BINARY_LIGHTING_PV Binary_Lighting_Output_Feedback_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_BINARY_LIGHTING_PV
|
||||
Binary_Lighting_Output_Feedback_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Lighting_Output_Feedback_Value_Set(
|
||||
uint32_t object_instance, BACNET_BINARY_LIGHTING_PV value);
|
||||
|
||||
@@ -57,16 +57,23 @@ static binary_output_write_present_value_callback
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
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,
|
||||
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,
|
||||
#if (BACNET_PROTOCOL_REVISION >= 17)
|
||||
PROP_CURRENT_COMMAND_PRIORITY,
|
||||
PROP_CURRENT_COMMAND_PRIORITY,
|
||||
#endif
|
||||
-1 };
|
||||
-1 };
|
||||
|
||||
static const int Properties_Optional[] = { PROP_RELIABILITY,
|
||||
PROP_DESCRIPTION, PROP_ACTIVE_TEXT, PROP_INACTIVE_TEXT, -1 };
|
||||
static const int Properties_Optional[] = { PROP_RELIABILITY, PROP_DESCRIPTION,
|
||||
PROP_ACTIVE_TEXT, PROP_INACTIVE_TEXT,
|
||||
-1 };
|
||||
|
||||
static const int Properties_Proprietary[] = { -1 };
|
||||
|
||||
@@ -162,8 +169,7 @@ unsigned Binary_Output_Instance_To_Index(uint32_t object_instance)
|
||||
* @param pObject - pointer to the object data
|
||||
* @return The present-value of the object
|
||||
*/
|
||||
static BACNET_BINARY_PV Object_Present_Value(
|
||||
struct object_data *pObject)
|
||||
static BACNET_BINARY_PV Object_Present_Value(struct object_data *pObject)
|
||||
{
|
||||
BACNET_BINARY_PV value = BINARY_INACTIVE;
|
||||
unsigned p = 0;
|
||||
@@ -352,7 +358,8 @@ bool Binary_Output_Present_Value_Relinquish(
|
||||
* @param error_code - BACnet Error code
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Binary_Output_Present_Value_Write(uint32_t object_instance,
|
||||
static bool Binary_Output_Present_Value_Write(
|
||||
uint32_t object_instance,
|
||||
BACNET_BINARY_PV value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
@@ -519,7 +526,8 @@ bool Binary_Output_Object_Name(
|
||||
status =
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(name_text, sizeof(name_text), "BINARY OUTPUT %lu",
|
||||
snprintf(
|
||||
name_text, sizeof(name_text), "BINARY OUTPUT %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, name_text);
|
||||
}
|
||||
@@ -942,14 +950,13 @@ bool Binary_Output_Encode_Value_List(
|
||||
const bool overridden = false;
|
||||
BACNET_BINARY_PV value;
|
||||
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
fault = Binary_Output_Object_Fault(pObject);
|
||||
value = Object_Present_Value(pObject);
|
||||
status =
|
||||
cov_value_list_encode_enumerated(value_list, value,
|
||||
in_alarm, fault, overridden, pObject->Out_Of_Service);
|
||||
status = cov_value_list_encode_enumerated(
|
||||
value_list, value, in_alarm, fault, overridden,
|
||||
pObject->Out_Of_Service);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
@@ -1028,9 +1035,10 @@ int Binary_Output_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu_len = encode_application_enumerated(&apdu[0], polarity);
|
||||
break;
|
||||
case PROP_PRIORITY_ARRAY:
|
||||
apdu_len = bacnet_array_encode(rpdata->object_instance,
|
||||
rpdata->array_index, Binary_Output_Priority_Array_Encode,
|
||||
BACNET_MAX_PRIORITY, apdu, apdu_size);
|
||||
apdu_len = bacnet_array_encode(
|
||||
rpdata->object_instance, rpdata->array_index,
|
||||
Binary_Output_Priority_Array_Encode, BACNET_MAX_PRIORITY, apdu,
|
||||
apdu_size);
|
||||
if (apdu_len == BACNET_STATUS_ABORT) {
|
||||
rpdata->error_code =
|
||||
ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED;
|
||||
@@ -1045,19 +1053,22 @@ int Binary_Output_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu_len = encode_application_enumerated(&apdu[0], present_value);
|
||||
break;
|
||||
case PROP_DESCRIPTION:
|
||||
characterstring_init_ansi(&char_string,
|
||||
characterstring_init_ansi(
|
||||
&char_string,
|
||||
Binary_Output_Description(rpdata->object_instance));
|
||||
apdu_len =
|
||||
encode_application_character_string(&apdu[0], &char_string);
|
||||
break;
|
||||
case PROP_ACTIVE_TEXT:
|
||||
characterstring_init_ansi(&char_string,
|
||||
characterstring_init_ansi(
|
||||
&char_string,
|
||||
Binary_Output_Active_Text(rpdata->object_instance));
|
||||
apdu_len =
|
||||
encode_application_character_string(&apdu[0], &char_string);
|
||||
break;
|
||||
case PROP_INACTIVE_TEXT:
|
||||
characterstring_init_ansi(&char_string,
|
||||
characterstring_init_ansi(
|
||||
&char_string,
|
||||
Binary_Output_Inactive_Text(rpdata->object_instance));
|
||||
apdu_len =
|
||||
encode_application_character_string(&apdu[0], &char_string);
|
||||
@@ -1126,10 +1137,10 @@ bool Binary_Output_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_ENUMERATED);
|
||||
if (status) {
|
||||
status =
|
||||
Binary_Output_Present_Value_Write(wp_data->object_instance,
|
||||
value.type.Enumerated, wp_data->priority,
|
||||
&wp_data->error_class, &wp_data->error_code);
|
||||
status = Binary_Output_Present_Value_Write(
|
||||
wp_data->object_instance, value.type.Enumerated,
|
||||
wp_data->priority, &wp_data->error_class,
|
||||
&wp_data->error_code);
|
||||
} else {
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_NULL);
|
||||
@@ -1149,7 +1160,8 @@ bool Binary_Output_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (property_lists_member(Properties_Required, Properties_Optional,
|
||||
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;
|
||||
|
||||
+86
-126
@@ -26,152 +26,112 @@
|
||||
* @param value - binary preset-value of the write
|
||||
*/
|
||||
typedef void (*binary_output_write_present_value_callback)(
|
||||
uint32_t object_instance, BACNET_BINARY_PV old_value,
|
||||
uint32_t object_instance,
|
||||
BACNET_BINARY_PV old_value,
|
||||
BACNET_BINARY_PV value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Output_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Output_Init(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Output_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Output_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Output_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Output_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Output_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Output_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Output_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Output_Instance_To_Index(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Name_Set(
|
||||
uint32_t object_instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Output_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Output_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Output_Inactive_Text(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Inactive_Text_Set(
|
||||
uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Output_Active_Text(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Active_Text_Set(
|
||||
uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Output_Inactive_Text(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Inactive_Text_Set(uint32_t instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Output_Active_Text(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Active_Text_Set(uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_BINARY_PV Binary_Output_Present_Value(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Present_Value_Set(
|
||||
uint32_t instance,
|
||||
BACNET_BINARY_PV binary_value,
|
||||
unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Present_Value_Relinquish(
|
||||
uint32_t instance,
|
||||
unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Output_Present_Value_Priority(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_BINARY_PV Binary_Output_Present_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Present_Value_Set(
|
||||
uint32_t instance, BACNET_BINARY_PV binary_value, unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Present_Value_Relinquish(
|
||||
uint32_t instance, unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Output_Present_Value_Priority(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Output_Write_Present_Value_Callback_Set(
|
||||
binary_output_write_present_value_callback cb);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Output_Write_Present_Value_Callback_Set(
|
||||
binary_output_write_present_value_callback cb);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Out_Of_Service(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Output_Out_Of_Service_Set(
|
||||
uint32_t object_instance,
|
||||
bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Output_Out_Of_Service_Set(uint32_t object_instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Output_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Description_Set(
|
||||
uint32_t object_instance,
|
||||
const char *text_string);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Output_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Description_Set(
|
||||
uint32_t object_instance, const char *text_string);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_POLARITY Binary_Output_Polarity(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Polarity_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_POLARITY polarity);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_POLARITY Binary_Output_Polarity(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Polarity_Set(
|
||||
uint32_t object_instance, BACNET_POLARITY polarity);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Reliability_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Binary_Output_Reliability(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Reliability_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Binary_Output_Reliability(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_BINARY_PV Binary_Output_Relinquish_Default(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Relinquish_Default_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_BINARY_PV value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_BINARY_PV Binary_Output_Relinquish_Default(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Relinquish_Default_Set(
|
||||
uint32_t object_instance, BACNET_BINARY_PV value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Encode_Value_List(
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Change_Of_Value(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Output_Change_Of_Value_Clear(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Encode_Value_List(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Output_Change_Of_Value_Clear(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Output_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Output_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Output_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Output_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Output_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Output_Cleanup(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1588,8 +1588,9 @@ int Binary_Value_Event_Information(
|
||||
false) |
|
||||
(pObject->Acked_Transitions[TRANSITION_TO_NORMAL].bIsAcked ==
|
||||
false);
|
||||
} else
|
||||
} else {
|
||||
return -1; /* end of list */
|
||||
}
|
||||
|
||||
if ((IsActiveEvent) || (IsNotAckedTransitions)) {
|
||||
/* Object Identifier */
|
||||
@@ -1633,8 +1634,9 @@ int Binary_Value_Event_Information(
|
||||
pObject->Notification_Class, getevent_data->eventPriorities);
|
||||
|
||||
return 1; /* active event */
|
||||
} else
|
||||
} else {
|
||||
return 0; /* no active event at this index */
|
||||
}
|
||||
}
|
||||
|
||||
int Binary_Value_Alarm_Ack(
|
||||
@@ -1774,10 +1776,12 @@ int Binary_Value_Alarm_Summary(
|
||||
&getalarm_data->acknowledgedTransitions, TRANSITION_TO_NORMAL,
|
||||
pObject->Acked_Transitions[TRANSITION_TO_NORMAL].bIsAcked);
|
||||
return 1; /* active alarm */
|
||||
} else
|
||||
} else {
|
||||
return 0; /* no active alarm at this index */
|
||||
} else
|
||||
}
|
||||
} else {
|
||||
return -1; /* end of list */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1958,10 +1962,11 @@ void Binary_Value_Intrinsic_Reporting(uint32_t object_instance)
|
||||
if ((PresentVal == pObject->Alarm_Value) &&
|
||||
((pObject->Event_Enable & EVENT_ENABLE_TO_OFFNORMAL) ==
|
||||
EVENT_ENABLE_TO_OFFNORMAL)) {
|
||||
if (!pObject->Remaining_Time_Delay)
|
||||
if (!pObject->Remaining_Time_Delay) {
|
||||
pObject->Event_State = EVENT_STATE_OFFNORMAL;
|
||||
else
|
||||
} else {
|
||||
pObject->Remaining_Time_Delay--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1978,10 +1983,11 @@ void Binary_Value_Intrinsic_Reporting(uint32_t object_instance)
|
||||
if ((PresentVal != pObject->Alarm_Value) &&
|
||||
((pObject->Event_Enable & EVENT_ENABLE_TO_NORMAL) ==
|
||||
EVENT_ENABLE_TO_NORMAL)) {
|
||||
if (!pObject->Remaining_Time_Delay)
|
||||
if (!pObject->Remaining_Time_Delay) {
|
||||
pObject->Event_State = EVENT_STATE_NORMAL;
|
||||
else
|
||||
} else {
|
||||
pObject->Remaining_Time_Delay--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2093,8 +2099,9 @@ void Binary_Value_Intrinsic_Reporting(uint32_t object_instance)
|
||||
/* filled before */
|
||||
|
||||
/* From State */
|
||||
if (event_data.notifyType != NOTIFY_ACK_NOTIFICATION)
|
||||
if (event_data.notifyType != NOTIFY_ACK_NOTIFICATION) {
|
||||
event_data.fromState = FromState;
|
||||
}
|
||||
|
||||
/* To State */
|
||||
event_data.toState = pObject->Event_State;
|
||||
|
||||
+123
-176
@@ -31,219 +31,166 @@
|
||||
* @param value - binary preset-value of the write
|
||||
*/
|
||||
typedef void (*binary_value_write_present_value_callback)(
|
||||
uint32_t object_instance, BACNET_BINARY_PV old_value,
|
||||
uint32_t object_instance,
|
||||
BACNET_BINARY_PV old_value,
|
||||
BACNET_BINARY_PV value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Init(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Value_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Value_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Value_Instance_To_Index(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Value_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Value_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Value_Instance_To_Index(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Name_Set(
|
||||
uint32_t object_instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Value_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Value_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Binary_Value_Reliability(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Reliability_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_RELIABILITY value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Binary_Value_Reliability(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Reliability_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Value_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Encode_Value_List(
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Change_Of_Value(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Change_Of_Value_Clear(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Encode_Value_List(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Change_Of_Value_Clear(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_BINARY_PV Binary_Value_Present_Value(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Present_Value_Set(
|
||||
uint32_t instance,
|
||||
BACNET_BINARY_PV value);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Write_Present_Value_Callback_Set(
|
||||
binary_value_write_present_value_callback cb);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_BINARY_PV Binary_Value_Present_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Present_Value_Set(uint32_t instance, BACNET_BINARY_PV value);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Write_Present_Value_Callback_Set(
|
||||
binary_value_write_present_value_callback cb);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Write_Enabled(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Write_Enable(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Write_Disable(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Write_Enabled(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Write_Enable(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Write_Disable(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Out_Of_Service(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Out_Of_Service_Set(
|
||||
uint32_t instance,
|
||||
bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Out_Of_Service_Set(uint32_t instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Value_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Description_Set(
|
||||
uint32_t object_instance,
|
||||
const char *text_string);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Value_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Description_Set(
|
||||
uint32_t object_instance, const char *text_string);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Value_Inactive_Text(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Inactive_Text_Set(
|
||||
uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Value_Active_Text(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Active_Text_Set(
|
||||
uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Value_Inactive_Text(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Inactive_Text_Set(uint32_t instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Value_Active_Text(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Active_Text_Set(uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_POLARITY Binary_Value_Polarity(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Polarity_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_POLARITY polarity);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Value_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_POLARITY Binary_Value_Polarity(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Polarity_Set(
|
||||
uint32_t object_instance, BACNET_POLARITY polarity);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Value_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Cleanup(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Value_Event_State(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Binary_Value_Event_State(uint32_t object_instance);
|
||||
|
||||
#if defined(INTRINSIC_REPORTING) && (BINARY_VALUE_INTRINSIC_REPORTING)
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Event_Detection_Enable(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Event_Detection_Enable_Set(
|
||||
uint32_t object_instance, bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Event_Detection_Enable(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Event_Detection_Enable_Set(
|
||||
uint32_t object_instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Value_Event_Information(
|
||||
unsigned index,
|
||||
BACNET_GET_EVENT_INFORMATION_DATA * getevent_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Value_Event_Information(
|
||||
unsigned index, BACNET_GET_EVENT_INFORMATION_DATA *getevent_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Value_Alarm_Ack(
|
||||
BACNET_ALARM_ACK_DATA * alarmack_data,
|
||||
BACNET_ERROR_CODE * error_code);
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Value_Alarm_Ack(
|
||||
BACNET_ALARM_ACK_DATA *alarmack_data, BACNET_ERROR_CODE *error_code);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Value_Alarm_Summary(
|
||||
unsigned index,
|
||||
BACNET_GET_ALARM_SUMMARY_DATA * getalarm_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Binary_Value_Alarm_Summary(
|
||||
unsigned index, BACNET_GET_ALARM_SUMMARY_DATA *getalarm_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Value_Time_Delay(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Value_Time_Delay(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Time_Delay_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t time_delay);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Time_Delay_Set(uint32_t object_instance, uint32_t time_delay);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Value_Notification_Class(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Value_Notification_Class(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Notification_Class_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t notification_class);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Notification_Class_Set(
|
||||
uint32_t object_instance, uint32_t notification_class);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_BINARY_PV Binary_Value_Alarm_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_BINARY_PV Binary_Value_Alarm_Value(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Alarm_Value_Set(
|
||||
uint32_t object_instance, BACNET_BINARY_PV value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Alarm_Value_Set(
|
||||
uint32_t object_instance, BACNET_BINARY_PV value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Value_Event_Enable(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Binary_Value_Event_Enable(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Event_Enable_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t event_enable);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Event_Enable_Set(
|
||||
uint32_t object_instance, uint32_t event_enable);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_NOTIFY_TYPE Binary_Value_Notify_Type(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_NOTIFY_TYPE Binary_Value_Notify_Type(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Notify_Type_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_NOTIFY_TYPE notify_type);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Notify_Type_Set(
|
||||
uint32_t object_instance, BACNET_NOTIFY_TYPE notify_type);
|
||||
#endif
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Intrinsic_Reporting(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Binary_Value_Intrinsic_Reporting(uint32_t object_instance);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -64,8 +64,8 @@ void Calendar_Write_Present_Value_Callback_Set(
|
||||
calendar_write_present_value_callback cb);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_CALENDAR_ENTRY *Calendar_Date_List_Get(
|
||||
uint32_t object_instance, uint8_t index);
|
||||
BACNET_CALENDAR_ENTRY *
|
||||
Calendar_Date_List_Get(uint32_t object_instance, uint8_t index);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Calendar_Date_List_Add(
|
||||
uint32_t object_instance, const BACNET_CALENDAR_ENTRY *value);
|
||||
|
||||
@@ -53,11 +53,20 @@ static write_property_function Write_Property_Internal_Callback;
|
||||
|
||||
/* These arrays are used by the ReadPropertyMultiple handler
|
||||
property-list property (as of protocol-revision 14) */
|
||||
static const int Channel_Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_PRESENT_VALUE, PROP_LAST_PRIORITY,
|
||||
PROP_WRITE_STATUS, PROP_STATUS_FLAGS, PROP_OUT_OF_SERVICE,
|
||||
PROP_LIST_OF_OBJECT_PROPERTY_REFERENCES, PROP_CHANNEL_NUMBER,
|
||||
PROP_CONTROL_GROUPS, -1 };
|
||||
static const int Channel_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_LAST_PRIORITY,
|
||||
PROP_WRITE_STATUS,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
PROP_LIST_OF_OBJECT_PROPERTY_REFERENCES,
|
||||
PROP_CHANNEL_NUMBER,
|
||||
PROP_CONTROL_GROUPS,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Channel_Properties_Optional[] = { -1 };
|
||||
|
||||
@@ -346,7 +355,8 @@ BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *Channel_Reference_List_Member_Element(
|
||||
*
|
||||
* @return pointer to member element or NULL if not found
|
||||
*/
|
||||
bool Channel_Reference_List_Member_Element_Set(uint32_t object_instance,
|
||||
bool Channel_Reference_List_Member_Element_Set(
|
||||
uint32_t object_instance,
|
||||
unsigned array_index,
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMemberSrc)
|
||||
{
|
||||
@@ -359,7 +369,8 @@ bool Channel_Reference_List_Member_Element_Set(uint32_t object_instance,
|
||||
array_index--;
|
||||
if (array_index < CHANNEL_MEMBERS_MAX) {
|
||||
pMember = &pObject->Members[array_index];
|
||||
memcpy(pMember, pMemberSrc,
|
||||
memcpy(
|
||||
pMember, pMemberSrc,
|
||||
sizeof(BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE));
|
||||
status = true;
|
||||
}
|
||||
@@ -377,7 +388,8 @@ bool Channel_Reference_List_Member_Element_Set(uint32_t object_instance,
|
||||
* @return array_index - 1-based array index value for added element, or
|
||||
* zero if not added
|
||||
*/
|
||||
unsigned Channel_Reference_List_Member_Element_Add(uint32_t object_instance,
|
||||
unsigned Channel_Reference_List_Member_Element_Add(
|
||||
uint32_t object_instance,
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMemberSrc)
|
||||
{
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMember = NULL;
|
||||
@@ -392,7 +404,8 @@ unsigned Channel_Reference_List_Member_Element_Add(uint32_t object_instance,
|
||||
if (!Channel_Reference_List_Member_Valid(pMember)) {
|
||||
/* first empty slot */
|
||||
array_index = 1 + m;
|
||||
memcpy(pMember, pMemberSrc,
|
||||
memcpy(
|
||||
pMember, pMemberSrc,
|
||||
sizeof(BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE));
|
||||
break;
|
||||
}
|
||||
@@ -410,8 +423,8 @@ unsigned Channel_Reference_List_Member_Element_Add(uint32_t object_instance,
|
||||
*
|
||||
* @return group number in the array, or 0 if invalid
|
||||
*/
|
||||
uint16_t Channel_Control_Groups_Element(
|
||||
uint32_t object_instance, int32_t array_index)
|
||||
uint16_t
|
||||
Channel_Control_Groups_Element(uint32_t object_instance, int32_t array_index)
|
||||
{
|
||||
uint16_t value = 0;
|
||||
const struct object_data *pObject;
|
||||
@@ -705,8 +718,8 @@ int Channel_Value_Encode(
|
||||
#endif
|
||||
#if defined(CHANNEL_OBJECT_ID)
|
||||
case BACNET_APPLICATION_TAG_OBJECT_ID:
|
||||
apdu_len = encode_application_object_id(apdu,
|
||||
(int)value->type.Object_Id.type,
|
||||
apdu_len = encode_application_object_id(
|
||||
apdu, (int)value->type.Object_Id.type,
|
||||
value->type.Object_Id.instance);
|
||||
break;
|
||||
#endif
|
||||
@@ -742,7 +755,8 @@ int Channel_Value_Encode(
|
||||
*
|
||||
* @return number of bytes in the APDU, or BACNET_STATUS_ERROR if error.
|
||||
*/
|
||||
static int Coerce_Data_Encode(uint8_t *apdu,
|
||||
static int Coerce_Data_Encode(
|
||||
uint8_t *apdu,
|
||||
const BACNET_APPLICATION_DATA_VALUE *value,
|
||||
BACNET_APPLICATION_TAG tag)
|
||||
{
|
||||
@@ -1058,7 +1072,8 @@ static int Coerce_Data_Encode(uint8_t *apdu,
|
||||
*
|
||||
* @return number of bytes in the APDU, or BACNET_STATUS_ERROR if error.
|
||||
*/
|
||||
int Channel_Coerce_Data_Encode(uint8_t *apdu,
|
||||
int Channel_Coerce_Data_Encode(
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
const BACNET_APPLICATION_DATA_VALUE *value,
|
||||
BACNET_APPLICATION_TAG tag)
|
||||
@@ -1084,43 +1099,46 @@ int Channel_Coerce_Data_Encode(uint8_t *apdu,
|
||||
* @return true if values are within range and present-value is sent.
|
||||
*/
|
||||
bool Channel_Write_Member_Value(
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data, const BACNET_APPLICATION_DATA_VALUE *value)
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data,
|
||||
const BACNET_APPLICATION_DATA_VALUE *value)
|
||||
{
|
||||
bool status = false;
|
||||
int apdu_len = 0;
|
||||
|
||||
if (wp_data && value) {
|
||||
if (((wp_data->object_type == OBJECT_ANALOG_INPUT) ||
|
||||
(wp_data->object_type == OBJECT_ANALOG_OUTPUT) ||
|
||||
(wp_data->object_type == OBJECT_ANALOG_VALUE)) &&
|
||||
(wp_data->object_type == OBJECT_ANALOG_OUTPUT) ||
|
||||
(wp_data->object_type == OBJECT_ANALOG_VALUE)) &&
|
||||
(wp_data->object_property == PROP_PRESENT_VALUE) &&
|
||||
(wp_data->array_index == BACNET_ARRAY_ALL)) {
|
||||
apdu_len = Channel_Coerce_Data_Encode(wp_data->application_data,
|
||||
wp_data->application_data_len, value,
|
||||
apdu_len = Channel_Coerce_Data_Encode(
|
||||
wp_data->application_data, wp_data->application_data_len, value,
|
||||
BACNET_APPLICATION_TAG_REAL);
|
||||
if (apdu_len != BACNET_STATUS_ERROR) {
|
||||
wp_data->application_data_len = apdu_len;
|
||||
status = true;
|
||||
}
|
||||
} else if (((wp_data->object_type == OBJECT_BINARY_INPUT) ||
|
||||
(wp_data->object_type == OBJECT_BINARY_OUTPUT) ||
|
||||
(wp_data->object_type == OBJECT_BINARY_VALUE)) &&
|
||||
} else if (
|
||||
((wp_data->object_type == OBJECT_BINARY_INPUT) ||
|
||||
(wp_data->object_type == OBJECT_BINARY_OUTPUT) ||
|
||||
(wp_data->object_type == OBJECT_BINARY_VALUE)) &&
|
||||
(wp_data->object_property == PROP_PRESENT_VALUE) &&
|
||||
(wp_data->array_index == BACNET_ARRAY_ALL)) {
|
||||
apdu_len = Channel_Coerce_Data_Encode(wp_data->application_data,
|
||||
wp_data->application_data_len, value,
|
||||
apdu_len = Channel_Coerce_Data_Encode(
|
||||
wp_data->application_data, wp_data->application_data_len, value,
|
||||
BACNET_APPLICATION_TAG_ENUMERATED);
|
||||
if (apdu_len != BACNET_STATUS_ERROR) {
|
||||
wp_data->application_data_len = apdu_len;
|
||||
status = true;
|
||||
}
|
||||
} else if (((wp_data->object_type == OBJECT_MULTI_STATE_INPUT) ||
|
||||
(wp_data->object_type == OBJECT_MULTI_STATE_OUTPUT) ||
|
||||
(wp_data->object_type == OBJECT_MULTI_STATE_VALUE)) &&
|
||||
} else if (
|
||||
((wp_data->object_type == OBJECT_MULTI_STATE_INPUT) ||
|
||||
(wp_data->object_type == OBJECT_MULTI_STATE_OUTPUT) ||
|
||||
(wp_data->object_type == OBJECT_MULTI_STATE_VALUE)) &&
|
||||
(wp_data->object_property == PROP_PRESENT_VALUE) &&
|
||||
(wp_data->array_index == BACNET_ARRAY_ALL)) {
|
||||
apdu_len = Channel_Coerce_Data_Encode(wp_data->application_data,
|
||||
wp_data->application_data_len, value,
|
||||
apdu_len = Channel_Coerce_Data_Encode(
|
||||
wp_data->application_data, wp_data->application_data_len, value,
|
||||
BACNET_APPLICATION_TAG_UNSIGNED_INT);
|
||||
if (apdu_len != BACNET_STATUS_ERROR) {
|
||||
wp_data->application_data_len = apdu_len;
|
||||
@@ -1129,18 +1147,19 @@ bool Channel_Write_Member_Value(
|
||||
} else if (wp_data->object_type == OBJECT_LIGHTING_OUTPUT) {
|
||||
if ((wp_data->object_property == PROP_PRESENT_VALUE) &&
|
||||
(wp_data->array_index == BACNET_ARRAY_ALL)) {
|
||||
apdu_len = Channel_Coerce_Data_Encode(wp_data->application_data,
|
||||
wp_data->application_data_len, value,
|
||||
BACNET_APPLICATION_TAG_REAL);
|
||||
apdu_len = Channel_Coerce_Data_Encode(
|
||||
wp_data->application_data, wp_data->application_data_len,
|
||||
value, BACNET_APPLICATION_TAG_REAL);
|
||||
if (apdu_len != BACNET_STATUS_ERROR) {
|
||||
wp_data->application_data_len = apdu_len;
|
||||
status = true;
|
||||
}
|
||||
} else if ((wp_data->object_property == PROP_LIGHTING_COMMAND) &&
|
||||
} else if (
|
||||
(wp_data->object_property == PROP_LIGHTING_COMMAND) &&
|
||||
(wp_data->array_index == BACNET_ARRAY_ALL)) {
|
||||
apdu_len = Channel_Coerce_Data_Encode(wp_data->application_data,
|
||||
wp_data->application_data_len, value,
|
||||
BACNET_APPLICATION_TAG_LIGHTING_COMMAND);
|
||||
apdu_len = Channel_Coerce_Data_Encode(
|
||||
wp_data->application_data, wp_data->application_data_len,
|
||||
value, BACNET_APPLICATION_TAG_LIGHTING_COMMAND);
|
||||
if (apdu_len != BACNET_STATUS_ERROR) {
|
||||
wp_data->application_data_len = apdu_len;
|
||||
status = true;
|
||||
@@ -1149,26 +1168,27 @@ bool Channel_Write_Member_Value(
|
||||
} else if (wp_data->object_type == OBJECT_COLOR) {
|
||||
if ((wp_data->object_property == PROP_PRESENT_VALUE) &&
|
||||
(wp_data->array_index == BACNET_ARRAY_ALL)) {
|
||||
apdu_len = Channel_Coerce_Data_Encode(wp_data->application_data,
|
||||
wp_data->application_data_len, value,
|
||||
BACNET_APPLICATION_TAG_XY_COLOR);
|
||||
apdu_len = Channel_Coerce_Data_Encode(
|
||||
wp_data->application_data, wp_data->application_data_len,
|
||||
value, BACNET_APPLICATION_TAG_XY_COLOR);
|
||||
if (apdu_len != BACNET_STATUS_ERROR) {
|
||||
wp_data->application_data_len = apdu_len;
|
||||
status = true;
|
||||
}
|
||||
} else if ((wp_data->object_property == PROP_COLOR_COMMAND) &&
|
||||
} else if (
|
||||
(wp_data->object_property == PROP_COLOR_COMMAND) &&
|
||||
(wp_data->array_index == BACNET_ARRAY_ALL)) {
|
||||
apdu_len = Channel_Coerce_Data_Encode(wp_data->application_data,
|
||||
wp_data->application_data_len, value,
|
||||
BACNET_APPLICATION_TAG_COLOR_COMMAND);
|
||||
apdu_len = Channel_Coerce_Data_Encode(
|
||||
wp_data->application_data, wp_data->application_data_len,
|
||||
value, BACNET_APPLICATION_TAG_COLOR_COMMAND);
|
||||
if (apdu_len != BACNET_STATUS_ERROR) {
|
||||
wp_data->application_data_len = apdu_len;
|
||||
status = true;
|
||||
}
|
||||
}
|
||||
} else if (wp_data->object_type == OBJECT_COLOR_TEMPERATURE) {
|
||||
apdu_len = Channel_Coerce_Data_Encode(wp_data->application_data,
|
||||
wp_data->application_data_len, value,
|
||||
apdu_len = Channel_Coerce_Data_Encode(
|
||||
wp_data->application_data, wp_data->application_data_len, value,
|
||||
BACNET_APPLICATION_TAG_UNSIGNED_INT);
|
||||
if (apdu_len != BACNET_STATUS_ERROR) {
|
||||
wp_data->application_data_len = apdu_len;
|
||||
@@ -1190,7 +1210,8 @@ bool Channel_Write_Member_Value(
|
||||
*
|
||||
* @return true if values are within range and present-value is sent.
|
||||
*/
|
||||
static bool Channel_Write_Members(struct object_data *pObject,
|
||||
static bool Channel_Write_Members(
|
||||
struct object_data *pObject,
|
||||
const BACNET_APPLICATION_DATA_VALUE *value,
|
||||
uint8_t priority)
|
||||
{
|
||||
@@ -1244,7 +1265,8 @@ static bool Channel_Write_Members(struct object_data *pObject,
|
||||
* @return true if values are within range and present-value is sent.
|
||||
*/
|
||||
bool Channel_Present_Value_Set(
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data, const BACNET_APPLICATION_DATA_VALUE *value)
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data,
|
||||
const BACNET_APPLICATION_DATA_VALUE *value)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -1299,7 +1321,8 @@ bool Channel_Object_Name(
|
||||
status =
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(name_text, sizeof(name_text), "CHANNEL-%lu",
|
||||
snprintf(
|
||||
name_text, sizeof(name_text), "CHANNEL-%lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, name_text);
|
||||
}
|
||||
@@ -1459,8 +1482,8 @@ int Channel_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
case PROP_LIST_OF_OBJECT_PROPERTY_REFERENCES:
|
||||
count =
|
||||
Channel_Reference_List_Member_Count(rpdata->object_instance);
|
||||
apdu_len = bacnet_array_encode(rpdata->object_instance,
|
||||
rpdata->array_index,
|
||||
apdu_len = bacnet_array_encode(
|
||||
rpdata->object_instance, rpdata->array_index,
|
||||
Channel_Reference_List_Member_Element_Encode, count, apdu,
|
||||
apdu_size);
|
||||
if (apdu_len == BACNET_STATUS_ABORT) {
|
||||
@@ -1476,9 +1499,10 @@ int Channel_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu_len = encode_application_unsigned(apdu, unsigned_value);
|
||||
break;
|
||||
case PROP_CONTROL_GROUPS:
|
||||
apdu_len = bacnet_array_encode(rpdata->object_instance,
|
||||
rpdata->array_index, Channel_Control_Groups_Element_Encode,
|
||||
CONTROL_GROUPS_MAX, apdu, apdu_size);
|
||||
apdu_len = bacnet_array_encode(
|
||||
rpdata->object_instance, rpdata->array_index,
|
||||
Channel_Control_Groups_Element_Encode, CONTROL_GROUPS_MAX, apdu,
|
||||
apdu_size);
|
||||
if (apdu_len == BACNET_STATUS_ABORT) {
|
||||
rpdata->error_code =
|
||||
ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED;
|
||||
@@ -1586,7 +1610,7 @@ bool Channel_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
do {
|
||||
if ((element_len > 0) &&
|
||||
(value.tag ==
|
||||
BACNET_APPLICATION_TAG_UNSIGNED_INT)) {
|
||||
BACNET_APPLICATION_TAG_UNSIGNED_INT)) {
|
||||
if ((wp_data->array_index <= CONTROL_GROUPS_MAX) &&
|
||||
(value.type.Unsigned_Int <= 65535)) {
|
||||
status = Channel_Control_Groups_Element_Set(
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
|
||||
/* BACNET_CHANNEL_VALUE decodes WriteProperty service requests
|
||||
Choose the datatypes that your application supports */
|
||||
#if !(defined(CHANNEL_NUMERIC) || defined(CHANNEL_NULL) || \
|
||||
#if !( \
|
||||
defined(CHANNEL_NUMERIC) || defined(CHANNEL_NULL) || \
|
||||
defined(CHANNEL_BOOLEAN) || defined(CHANNEL_UNSIGNED) || \
|
||||
defined(CHANNEL_SIGNED) || defined(CHANNEL_REAL) || \
|
||||
defined(CHANNEL_DOUBLE) || defined(CHANNEL_OCTET_STRING) || \
|
||||
@@ -132,7 +133,8 @@ BACNET_STACK_EXPORT
|
||||
BACNET_CHANNEL_VALUE *Channel_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Channel_Present_Value_Set(
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data, const BACNET_APPLICATION_DATA_VALUE *value);
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data,
|
||||
const BACNET_APPLICATION_DATA_VALUE *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Channel_Out_Of_Service(uint32_t object_instance);
|
||||
@@ -153,15 +155,17 @@ BACNET_STACK_EXPORT
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *Channel_Reference_List_Member_Element(
|
||||
uint32_t object_instance, unsigned element);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Channel_Reference_List_Member_Element_Set(uint32_t object_instance,
|
||||
bool Channel_Reference_List_Member_Element_Set(
|
||||
uint32_t object_instance,
|
||||
unsigned array_index,
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMemberSrc);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Channel_Reference_List_Member_Element_Add(uint32_t object_instance,
|
||||
unsigned Channel_Reference_List_Member_Element_Add(
|
||||
uint32_t object_instance,
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMemberSrc);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Channel_Control_Groups_Element(
|
||||
uint32_t object_instance, int32_t array_index);
|
||||
uint16_t
|
||||
Channel_Control_Groups_Element(uint32_t object_instance, int32_t array_index);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Channel_Control_Groups_Element_Set(
|
||||
uint32_t object_instance, int32_t array_index, uint16_t value);
|
||||
@@ -172,17 +176,18 @@ BACNET_STACK_EXPORT
|
||||
int Channel_Value_Encode(
|
||||
uint8_t *apdu, int apdu_max, const BACNET_CHANNEL_VALUE *value);
|
||||
BACNET_STACK_EXPORT
|
||||
int Channel_Coerce_Data_Encode(uint8_t *apdu,
|
||||
int Channel_Coerce_Data_Encode(
|
||||
uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
const BACNET_APPLICATION_DATA_VALUE *value,
|
||||
BACNET_APPLICATION_TAG tag);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Channel_Write_Member_Value(
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data, const BACNET_APPLICATION_DATA_VALUE *value);
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data,
|
||||
const BACNET_APPLICATION_DATA_VALUE *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Channel_Write_Property_Internal_Callback_Set(
|
||||
write_property_function cb);
|
||||
void Channel_Write_Property_Internal_Callback_Set(write_property_function cb);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Channel_Create(uint32_t object_instance);
|
||||
|
||||
@@ -84,39 +84,73 @@ static uint32_t Database_Revision = 0;
|
||||
|
||||
/* external prototypes */
|
||||
extern int Routed_Device_Read_Property_Local(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
extern bool Routed_Device_Write_Property_Local(
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
extern bool
|
||||
Routed_Device_Write_Property_Local(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
/* All included BACnet objects */
|
||||
static object_functions_t Object_Table[] = {
|
||||
{ OBJECT_DEVICE, NULL /* Init - don't init Device or it will recourse! */,
|
||||
Device_Count, Device_Index_To_Instance,
|
||||
Device_Valid_Object_Instance_Number, Device_Object_Name,
|
||||
Device_Read_Property_Local, NULL /* Write_Property */,
|
||||
Device_Property_Lists, NULL /* ReadRangeInfo */, NULL /* Iterator */,
|
||||
NULL /* Value_Lists */, NULL /* COV */, NULL /* COV Clear */,
|
||||
NULL /* Intrinsic Reporting */,
|
||||
NULL /* Add_List_Element */, NULL /* Remove_List_Element */,
|
||||
NULL /* Create */, NULL /* Delete */, NULL /* Timer */ },
|
||||
{ OBJECT_DEVICE,
|
||||
NULL /* Init - don't init Device or it will recourse! */,
|
||||
Device_Count,
|
||||
Device_Index_To_Instance,
|
||||
Device_Valid_Object_Instance_Number,
|
||||
Device_Object_Name,
|
||||
Device_Read_Property_Local,
|
||||
NULL /* Write_Property */,
|
||||
Device_Property_Lists,
|
||||
NULL /* ReadRangeInfo */,
|
||||
NULL /* Iterator */,
|
||||
NULL /* Value_Lists */,
|
||||
NULL /* COV */,
|
||||
NULL /* COV Clear */,
|
||||
NULL /* Intrinsic Reporting */,
|
||||
NULL /* Add_List_Element */,
|
||||
NULL /* Remove_List_Element */,
|
||||
NULL /* Create */,
|
||||
NULL /* Delete */,
|
||||
NULL /* Timer */ },
|
||||
#if (BACNET_PROTOCOL_REVISION >= 17)
|
||||
{ OBJECT_NETWORK_PORT, Network_Port_Init, Network_Port_Count,
|
||||
Network_Port_Index_To_Instance, Network_Port_Valid_Instance,
|
||||
Network_Port_Object_Name, Network_Port_Read_Property,
|
||||
Network_Port_Write_Property, Network_Port_Property_Lists,
|
||||
NULL /* ReadRangeInfo */, NULL /* Iterator */, NULL /* Value_Lists */,
|
||||
NULL /* COV */, NULL /* COV Clear */, NULL /* Intrinsic Reporting */,
|
||||
NULL /* Add_List_Element */, NULL /* Remove_List_Element */,
|
||||
NULL /* Create */, NULL /* Delete */, NULL /* Timer */ },
|
||||
{ OBJECT_NETWORK_PORT,
|
||||
Network_Port_Init,
|
||||
Network_Port_Count,
|
||||
Network_Port_Index_To_Instance,
|
||||
Network_Port_Valid_Instance,
|
||||
Network_Port_Object_Name,
|
||||
Network_Port_Read_Property,
|
||||
Network_Port_Write_Property,
|
||||
Network_Port_Property_Lists,
|
||||
NULL /* ReadRangeInfo */,
|
||||
NULL /* Iterator */,
|
||||
NULL /* Value_Lists */,
|
||||
NULL /* COV */,
|
||||
NULL /* COV Clear */,
|
||||
NULL /* Intrinsic Reporting */,
|
||||
NULL /* Add_List_Element */,
|
||||
NULL /* Remove_List_Element */,
|
||||
NULL /* Create */,
|
||||
NULL /* Delete */,
|
||||
NULL /* Timer */ },
|
||||
#endif
|
||||
{ MAX_BACNET_OBJECT_TYPE, NULL /* Init */, NULL /* Count */,
|
||||
NULL /* Index_To_Instance */, NULL /* Valid_Instance */,
|
||||
NULL /* Object_Name */, NULL /* Read_Property */,
|
||||
NULL /* Write_Property */, NULL /* Property_Lists */,
|
||||
NULL /* ReadRangeInfo */, NULL /* Iterator */, NULL /* Value_Lists */,
|
||||
NULL /* COV */, NULL /* COV Clear */,
|
||||
NULL /* Intrinsic Reporting */,
|
||||
NULL /* Add_List_Element */, NULL /* Remove_List_Element */,
|
||||
NULL /* Create */, NULL /* Delete */, NULL /* Timer */ },
|
||||
{ MAX_BACNET_OBJECT_TYPE,
|
||||
NULL /* Init */,
|
||||
NULL /* Count */,
|
||||
NULL /* Index_To_Instance */,
|
||||
NULL /* Valid_Instance */,
|
||||
NULL /* Object_Name */,
|
||||
NULL /* Read_Property */,
|
||||
NULL /* Write_Property */,
|
||||
NULL /* Property_Lists */,
|
||||
NULL /* ReadRangeInfo */,
|
||||
NULL /* Iterator */,
|
||||
NULL /* Value_Lists */,
|
||||
NULL /* COV */,
|
||||
NULL /* COV Clear */,
|
||||
NULL /* Intrinsic Reporting */,
|
||||
NULL /* Add_List_Element */,
|
||||
NULL /* Remove_List_Element */,
|
||||
NULL /* Create */,
|
||||
NULL /* Delete */,
|
||||
NULL /* Timer */ },
|
||||
};
|
||||
|
||||
/** Glue function to let the Device object, when called by a handler,
|
||||
@@ -127,8 +161,8 @@ static object_functions_t Object_Table[] = {
|
||||
* @return Pointer to the group of object helper functions that implement this
|
||||
* type of Object.
|
||||
*/
|
||||
static struct object_functions *Device_Objects_Find_Functions(
|
||||
BACNET_OBJECT_TYPE Object_Type)
|
||||
static struct object_functions *
|
||||
Device_Objects_Find_Functions(BACNET_OBJECT_TYPE Object_Type)
|
||||
{
|
||||
struct object_functions *pObject = NULL;
|
||||
|
||||
@@ -175,7 +209,8 @@ rr_info_function Device_Objects_RR_Info(BACNET_OBJECT_TYPE object_type)
|
||||
* list, separately, the Required, Optional, and Proprietary object
|
||||
* properties with their counts.
|
||||
*/
|
||||
void Device_Objects_Property_List(BACNET_OBJECT_TYPE object_type,
|
||||
void Device_Objects_Property_List(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance,
|
||||
struct special_property_list_t *pPropertyList)
|
||||
{
|
||||
@@ -193,8 +228,9 @@ void Device_Objects_Property_List(BACNET_OBJECT_TYPE object_type,
|
||||
|
||||
pObject = Device_Objects_Find_Functions(object_type);
|
||||
if ((pObject != NULL) && (pObject->Object_RPM_List != NULL)) {
|
||||
pObject->Object_RPM_List(&pPropertyList->Required.pList,
|
||||
&pPropertyList->Optional.pList, &pPropertyList->Proprietary.pList);
|
||||
pObject->Object_RPM_List(
|
||||
&pPropertyList->Required.pList, &pPropertyList->Optional.pList,
|
||||
&pPropertyList->Proprietary.pList);
|
||||
}
|
||||
|
||||
/* Fetch the counts if available otherwise zero them */
|
||||
@@ -214,21 +250,35 @@ void Device_Objects_Property_List(BACNET_OBJECT_TYPE object_type,
|
||||
}
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Device_Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_SYSTEM_STATUS, PROP_VENDOR_NAME,
|
||||
PROP_VENDOR_IDENTIFIER, PROP_MODEL_NAME, PROP_FIRMWARE_REVISION,
|
||||
PROP_APPLICATION_SOFTWARE_VERSION, PROP_PROTOCOL_VERSION,
|
||||
PROP_PROTOCOL_REVISION, PROP_PROTOCOL_SERVICES_SUPPORTED,
|
||||
PROP_PROTOCOL_OBJECT_TYPES_SUPPORTED, PROP_OBJECT_LIST,
|
||||
PROP_MAX_APDU_LENGTH_ACCEPTED, PROP_SEGMENTATION_SUPPORTED,
|
||||
PROP_APDU_TIMEOUT, PROP_NUMBER_OF_APDU_RETRIES, PROP_DEVICE_ADDRESS_BINDING,
|
||||
PROP_DATABASE_REVISION, -1 };
|
||||
static const int Device_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_SYSTEM_STATUS,
|
||||
PROP_VENDOR_NAME,
|
||||
PROP_VENDOR_IDENTIFIER,
|
||||
PROP_MODEL_NAME,
|
||||
PROP_FIRMWARE_REVISION,
|
||||
PROP_APPLICATION_SOFTWARE_VERSION,
|
||||
PROP_PROTOCOL_VERSION,
|
||||
PROP_PROTOCOL_REVISION,
|
||||
PROP_PROTOCOL_SERVICES_SUPPORTED,
|
||||
PROP_PROTOCOL_OBJECT_TYPES_SUPPORTED,
|
||||
PROP_OBJECT_LIST,
|
||||
PROP_MAX_APDU_LENGTH_ACCEPTED,
|
||||
PROP_SEGMENTATION_SUPPORTED,
|
||||
PROP_APDU_TIMEOUT,
|
||||
PROP_NUMBER_OF_APDU_RETRIES,
|
||||
PROP_DEVICE_ADDRESS_BINDING,
|
||||
PROP_DATABASE_REVISION,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Device_Properties_Optional[] = {
|
||||
#if defined(BACDL_MSTP)
|
||||
PROP_MAX_MASTER, PROP_MAX_INFO_FRAMES,
|
||||
PROP_MAX_MASTER, PROP_MAX_INFO_FRAMES,
|
||||
#endif
|
||||
PROP_DESCRIPTION, PROP_LOCATION, PROP_ACTIVE_COV_SUBSCRIPTIONS, -1
|
||||
PROP_DESCRIPTION, PROP_LOCATION, PROP_ACTIVE_COV_SUBSCRIPTIONS, -1
|
||||
};
|
||||
|
||||
static const int Device_Properties_Proprietary[] = { -1 };
|
||||
@@ -724,7 +774,8 @@ int Device_Object_List_Element_Encode(
|
||||
* Object.
|
||||
* @return True on success or else False if not found.
|
||||
*/
|
||||
bool Device_Valid_Object_Name(const BACNET_CHARACTER_STRING *object_name1,
|
||||
bool Device_Valid_Object_Name(
|
||||
const BACNET_CHARACTER_STRING *object_name1,
|
||||
BACNET_OBJECT_TYPE *object_type,
|
||||
uint32_t *object_instance)
|
||||
{
|
||||
@@ -743,7 +794,7 @@ bool Device_Valid_Object_Name(const BACNET_CHARACTER_STRING *object_name1,
|
||||
pObject = Device_Objects_Find_Functions(type);
|
||||
if ((pObject != NULL) && (pObject->Object_Name != NULL) &&
|
||||
(pObject->Object_Name(instance, &object_name2) &&
|
||||
characterstring_same(object_name1, &object_name2))) {
|
||||
characterstring_same(object_name1, &object_name2))) {
|
||||
found = true;
|
||||
if (object_type) {
|
||||
*object_type = type;
|
||||
@@ -784,7 +835,8 @@ bool Device_Valid_Object_Id(
|
||||
* @param object_name [out] The Object Name found for this child Object.
|
||||
* @return True on success or else False if not found.
|
||||
*/
|
||||
bool Device_Object_Name_Copy(BACNET_OBJECT_TYPE object_type,
|
||||
bool Device_Object_Name_Copy(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
@@ -980,7 +1032,8 @@ int Device_Read_Property_Local(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
bitstring_init(&bit_string);
|
||||
for (i = 0; i < MAX_BACNET_SERVICES_SUPPORTED; i++) {
|
||||
/* automatic lookup based on handlers set */
|
||||
bitstring_set_bit(&bit_string, (uint8_t)i,
|
||||
bitstring_set_bit(
|
||||
&bit_string, (uint8_t)i,
|
||||
apdu_service_supported((BACNET_SERVICES_SUPPORTED)i));
|
||||
}
|
||||
apdu_len = encode_application_bitstring(&apdu[0], &bit_string);
|
||||
@@ -1006,10 +1059,9 @@ int Device_Read_Property_Local(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
break;
|
||||
case PROP_OBJECT_LIST:
|
||||
count = Device_Object_List_Count();
|
||||
apdu_len = bacnet_array_encode(rpdata->object_instance,
|
||||
rpdata->array_index,
|
||||
Device_Object_List_Element_Encode,
|
||||
count, apdu, apdu_size);
|
||||
apdu_len = bacnet_array_encode(
|
||||
rpdata->object_instance, rpdata->array_index,
|
||||
Device_Object_List_Element_Encode, count, apdu, apdu_size);
|
||||
if (apdu_len == BACNET_STATUS_ABORT) {
|
||||
rpdata->error_code =
|
||||
ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED;
|
||||
@@ -1095,10 +1147,11 @@ int Device_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
if (pObject->Object_Read_Property) {
|
||||
#if (BACNET_PROTOCOL_REVISION >= 14)
|
||||
if ((int)rpdata->object_property == PROP_PROPERTY_LIST) {
|
||||
Device_Objects_Property_List(rpdata->object_type,
|
||||
rpdata->object_instance, &property_list);
|
||||
apdu_len = property_list_encode(rpdata,
|
||||
property_list.Required.pList,
|
||||
Device_Objects_Property_List(
|
||||
rpdata->object_type, rpdata->object_instance,
|
||||
&property_list);
|
||||
apdu_len = property_list_encode(
|
||||
rpdata, property_list.Required.pList,
|
||||
property_list.Optional.pList,
|
||||
property_list.Proprietary.pList);
|
||||
} else
|
||||
@@ -1123,8 +1176,7 @@ int Device_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
* @brief Updates all the object timers with elapsed milliseconds
|
||||
* @param milliseconds - number of milliseconds elapsed
|
||||
*/
|
||||
void Device_Timer(
|
||||
uint16_t milliseconds)
|
||||
void Device_Timer(uint16_t milliseconds)
|
||||
{
|
||||
struct object_functions *pObject;
|
||||
unsigned count = 0;
|
||||
|
||||
@@ -62,13 +62,16 @@ static OS_Keylist Object_List;
|
||||
static color_write_present_value_callback Color_Write_Present_Value_Callback;
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Color_Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_PRESENT_VALUE, PROP_TRACKING_VALUE,
|
||||
PROP_COLOR_COMMAND, PROP_IN_PROGRESS, PROP_DEFAULT_COLOR,
|
||||
PROP_DEFAULT_FADE_TIME, -1 };
|
||||
static const int Color_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER, PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE, PROP_PRESENT_VALUE,
|
||||
PROP_TRACKING_VALUE, PROP_COLOR_COMMAND,
|
||||
PROP_IN_PROGRESS, PROP_DEFAULT_COLOR,
|
||||
PROP_DEFAULT_FADE_TIME, -1
|
||||
};
|
||||
|
||||
static const int Color_Properties_Optional[] = { PROP_DESCRIPTION,
|
||||
PROP_TRANSITION, -1 };
|
||||
PROP_TRANSITION, -1 };
|
||||
|
||||
static const int Color_Properties_Proprietary[] = { -1 };
|
||||
|
||||
@@ -188,7 +191,8 @@ bool Color_Present_Value(uint32_t object_instance, BACNET_XY_COLOR *value)
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
bool Color_Present_Value_Set(uint32_t object_instance, const BACNET_XY_COLOR *value)
|
||||
bool Color_Present_Value_Set(
|
||||
uint32_t object_instance, const BACNET_XY_COLOR *value)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -213,7 +217,8 @@ bool Color_Present_Value_Set(uint32_t object_instance, const BACNET_XY_COLOR *va
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Color_Present_Value_Write(uint32_t object_instance,
|
||||
static bool Color_Present_Value_Write(
|
||||
uint32_t object_instance,
|
||||
const BACNET_XY_COLOR *value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
@@ -342,7 +347,8 @@ bool Color_Command_Set(
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Color_Command_Write(uint32_t object_instance,
|
||||
static bool Color_Command_Write(
|
||||
uint32_t object_instance,
|
||||
const BACNET_COLOR_COMMAND *value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
@@ -468,7 +474,8 @@ bool Color_Default_Color_Set(
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Color_Default_Color_Write(uint32_t object_instance,
|
||||
static bool Color_Default_Color_Write(
|
||||
uint32_t object_instance,
|
||||
const BACNET_XY_COLOR *value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
@@ -532,7 +539,7 @@ bool Color_Default_Fade_Time_Set(uint32_t object_instance, uint32_t value)
|
||||
if (pObject) {
|
||||
if ((value == 0) ||
|
||||
((value >= BACNET_COLOR_FADE_TIME_MIN) &&
|
||||
(value <= BACNET_COLOR_FADE_TIME_MAX))) {
|
||||
(value <= BACNET_COLOR_FADE_TIME_MAX))) {
|
||||
pObject->Default_Fade_Time = value;
|
||||
}
|
||||
status = true;
|
||||
@@ -552,7 +559,8 @@ bool Color_Default_Fade_Time_Set(uint32_t object_instance, uint32_t value)
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Color_Default_Fade_Time_Write(uint32_t object_instance,
|
||||
static bool Color_Default_Fade_Time_Write(
|
||||
uint32_t object_instance,
|
||||
BACNET_UNSIGNED_INTEGER value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
@@ -567,7 +575,7 @@ static bool Color_Default_Fade_Time_Write(uint32_t object_instance,
|
||||
if (pObject->Write_Enabled) {
|
||||
if ((value == 0) ||
|
||||
((value >= BACNET_COLOR_FADE_TIME_MIN) &&
|
||||
(value <= BACNET_COLOR_FADE_TIME_MAX))) {
|
||||
(value <= BACNET_COLOR_FADE_TIME_MAX))) {
|
||||
pObject->Default_Fade_Time = value;
|
||||
status = true;
|
||||
} else {
|
||||
@@ -640,7 +648,8 @@ bool Color_Transition_Set(
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Color_Transition_Write(uint32_t object_instance,
|
||||
static bool Color_Transition_Write(
|
||||
uint32_t object_instance,
|
||||
uint32_t value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
@@ -802,8 +811,8 @@ bool Color_Description_Set(uint32_t object_instance, const char *new_name)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @param milliseconds - number of milliseconds elapsed
|
||||
*/
|
||||
static void Color_Fade_To_Color_Handler(
|
||||
uint32_t object_instance, uint16_t milliseconds)
|
||||
static void
|
||||
Color_Fade_To_Color_Handler(uint32_t object_instance, uint16_t milliseconds)
|
||||
{
|
||||
BACNET_XY_COLOR old_value;
|
||||
struct object_data *pObject;
|
||||
@@ -836,12 +845,12 @@ 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,
|
||||
x3, y1, y3);
|
||||
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,
|
||||
x3, y1, y3);
|
||||
pObject->Tracking_Value.y_coordinate =
|
||||
linear_interpolate(x1, x2, x3, y1, y3);
|
||||
pObject->Color_Command.transit.fade_time -= milliseconds;
|
||||
pObject->In_Progress =
|
||||
BACNET_COLOR_OPERATION_IN_PROGRESS_FADE_ACTIVE;
|
||||
@@ -870,8 +879,7 @@ void Color_Timer(uint32_t object_instance, uint16_t milliseconds)
|
||||
pObject->In_Progress = BACNET_COLOR_OPERATION_IN_PROGRESS_IDLE;
|
||||
break;
|
||||
case BACNET_COLOR_OPERATION_FADE_TO_COLOR:
|
||||
Color_Fade_To_Color_Handler(
|
||||
object_instance, milliseconds);
|
||||
Color_Fade_To_Color_Handler(object_instance, milliseconds);
|
||||
break;
|
||||
case BACNET_COLOR_OPERATION_STOP:
|
||||
pObject->In_Progress = BACNET_COLOR_OPERATION_IN_PROGRESS_IDLE;
|
||||
@@ -995,8 +1003,9 @@ bool Color_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
/* decode the some of the request */
|
||||
apdu = wp_data->application_data;
|
||||
apdu_size = wp_data->application_data_len;
|
||||
len = bacapp_decode_known_property(apdu, apdu_size, &value,
|
||||
wp_data->object_type, wp_data->object_property);
|
||||
len = bacapp_decode_known_property(
|
||||
apdu, apdu_size, &value, wp_data->object_type,
|
||||
wp_data->object_property);
|
||||
/* FIXME: len < application_data_len: more data? */
|
||||
if (len < 0) {
|
||||
/* error while decoding - a value larger than we can handle */
|
||||
@@ -1017,45 +1026,50 @@ bool Color_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_XY_COLOR);
|
||||
if (status) {
|
||||
status = Color_Present_Value_Write(wp_data->object_instance,
|
||||
&value.type.XY_Color, wp_data->priority,
|
||||
&wp_data->error_class, &wp_data->error_code);
|
||||
status = Color_Present_Value_Write(
|
||||
wp_data->object_instance, &value.type.XY_Color,
|
||||
wp_data->priority, &wp_data->error_class,
|
||||
&wp_data->error_code);
|
||||
}
|
||||
break;
|
||||
case PROP_COLOR_COMMAND:
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_COLOR_COMMAND);
|
||||
if (status) {
|
||||
status = Color_Command_Write(wp_data->object_instance,
|
||||
&value.type.Color_Command, wp_data->priority,
|
||||
&wp_data->error_class, &wp_data->error_code);
|
||||
status = Color_Command_Write(
|
||||
wp_data->object_instance, &value.type.Color_Command,
|
||||
wp_data->priority, &wp_data->error_class,
|
||||
&wp_data->error_code);
|
||||
}
|
||||
break;
|
||||
case PROP_DEFAULT_COLOR:
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_XY_COLOR);
|
||||
if (status) {
|
||||
status = Color_Default_Color_Write(wp_data->object_instance,
|
||||
&value.type.XY_Color, wp_data->priority,
|
||||
&wp_data->error_class, &wp_data->error_code);
|
||||
status = Color_Default_Color_Write(
|
||||
wp_data->object_instance, &value.type.XY_Color,
|
||||
wp_data->priority, &wp_data->error_class,
|
||||
&wp_data->error_code);
|
||||
}
|
||||
break;
|
||||
case PROP_DEFAULT_FADE_TIME:
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_UNSIGNED_INT);
|
||||
if (status) {
|
||||
status = Color_Default_Fade_Time_Write(wp_data->object_instance,
|
||||
value.type.Unsigned_Int, wp_data->priority,
|
||||
&wp_data->error_class, &wp_data->error_code);
|
||||
status = Color_Default_Fade_Time_Write(
|
||||
wp_data->object_instance, value.type.Unsigned_Int,
|
||||
wp_data->priority, &wp_data->error_class,
|
||||
&wp_data->error_code);
|
||||
}
|
||||
break;
|
||||
case PROP_TRANSITION:
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_ENUMERATED);
|
||||
if (status) {
|
||||
status = Color_Transition_Write(wp_data->object_instance,
|
||||
value.type.Enumerated, wp_data->priority,
|
||||
&wp_data->error_class, &wp_data->error_code);
|
||||
status = Color_Transition_Write(
|
||||
wp_data->object_instance, value.type.Enumerated,
|
||||
wp_data->priority, &wp_data->error_class,
|
||||
&wp_data->error_code);
|
||||
}
|
||||
break;
|
||||
case PROP_OBJECT_IDENTIFIER:
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
* @param old_value - BACnetXYColor value prior to write
|
||||
* @param value - BACnetXYColor value of the write
|
||||
*/
|
||||
typedef void (*color_write_present_value_callback)(uint32_t object_instance,
|
||||
typedef void (*color_write_present_value_callback)(
|
||||
uint32_t object_instance,
|
||||
BACNET_XY_COLOR *old_value,
|
||||
BACNET_XY_COLOR *value);
|
||||
|
||||
|
||||
@@ -57,14 +57,24 @@ static color_temperature_write_present_value_callback
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Color_Temperature_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER, PROP_OBJECT_NAME, PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE, PROP_TRACKING_VALUE, PROP_COLOR_COMMAND,
|
||||
PROP_IN_PROGRESS, PROP_DEFAULT_COLOR_TEMPERATURE, PROP_DEFAULT_FADE_TIME,
|
||||
PROP_DEFAULT_RAMP_RATE, PROP_DEFAULT_STEP_INCREMENT, -1
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_TRACKING_VALUE,
|
||||
PROP_COLOR_COMMAND,
|
||||
PROP_IN_PROGRESS,
|
||||
PROP_DEFAULT_COLOR_TEMPERATURE,
|
||||
PROP_DEFAULT_FADE_TIME,
|
||||
PROP_DEFAULT_RAMP_RATE,
|
||||
PROP_DEFAULT_STEP_INCREMENT,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Color_Temperature_Properties_Optional[] = { PROP_DESCRIPTION,
|
||||
PROP_TRANSITION, PROP_MIN_PRES_VALUE, PROP_MAX_PRES_VALUE, -1 };
|
||||
static const int Color_Temperature_Properties_Optional[] = {
|
||||
PROP_DESCRIPTION, PROP_TRANSITION, PROP_MIN_PRES_VALUE, PROP_MAX_PRES_VALUE,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Color_Temperature_Properties_Proprietary[] = { -1 };
|
||||
|
||||
@@ -208,7 +218,8 @@ bool Color_Temperature_Present_Value_Set(
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Color_Temperature_Present_Value_Write(uint32_t object_instance,
|
||||
static bool Color_Temperature_Present_Value_Write(
|
||||
uint32_t object_instance,
|
||||
uint32_t value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
@@ -430,8 +441,8 @@ bool Color_Temperature_Command_Set(
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return property value
|
||||
*/
|
||||
BACNET_COLOR_OPERATION_IN_PROGRESS Color_Temperature_In_Progress(
|
||||
uint32_t object_instance)
|
||||
BACNET_COLOR_OPERATION_IN_PROGRESS
|
||||
Color_Temperature_In_Progress(uint32_t object_instance)
|
||||
{
|
||||
BACNET_COLOR_OPERATION_IN_PROGRESS value =
|
||||
BACNET_COLOR_OPERATION_IN_PROGRESS_MAX;
|
||||
@@ -523,7 +534,8 @@ bool Color_Temperature_Default_Color_Temperature_Set(
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Color_Temperature_Default_Write(uint32_t object_instance,
|
||||
static bool Color_Temperature_Default_Write(
|
||||
uint32_t object_instance,
|
||||
BACNET_UNSIGNED_INTEGER value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
@@ -592,7 +604,7 @@ bool Color_Temperature_Default_Fade_Time_Set(
|
||||
if (pObject) {
|
||||
if ((value == 0) ||
|
||||
((value >= BACNET_COLOR_FADE_TIME_MIN) &&
|
||||
(value <= BACNET_COLOR_FADE_TIME_MAX))) {
|
||||
(value <= BACNET_COLOR_FADE_TIME_MAX))) {
|
||||
pObject->Default_Fade_Time = value;
|
||||
}
|
||||
status = true;
|
||||
@@ -612,7 +624,8 @@ bool Color_Temperature_Default_Fade_Time_Set(
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Color_Temperature_Default_Fade_Time_Write(uint32_t object_instance,
|
||||
static bool Color_Temperature_Default_Fade_Time_Write(
|
||||
uint32_t object_instance,
|
||||
BACNET_UNSIGNED_INTEGER value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
@@ -627,7 +640,7 @@ static bool Color_Temperature_Default_Fade_Time_Write(uint32_t object_instance,
|
||||
if (pObject->Write_Enabled) {
|
||||
if ((value == 0) ||
|
||||
((value >= BACNET_COLOR_FADE_TIME_MIN) &&
|
||||
(value <= BACNET_COLOR_FADE_TIME_MAX))) {
|
||||
(value <= BACNET_COLOR_FADE_TIME_MAX))) {
|
||||
pObject->Default_Fade_Time = value;
|
||||
status = true;
|
||||
} else {
|
||||
@@ -698,7 +711,8 @@ bool Color_Temperature_Default_Ramp_Rate_Set(
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Color_Temperature_Default_Ramp_Rate_Write(uint32_t object_instance,
|
||||
static bool Color_Temperature_Default_Ramp_Rate_Write(
|
||||
uint32_t object_instance,
|
||||
BACNET_UNSIGNED_INTEGER value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
@@ -713,7 +727,7 @@ static bool Color_Temperature_Default_Ramp_Rate_Write(uint32_t object_instance,
|
||||
if (pObject->Write_Enabled) {
|
||||
if ((value == 0) ||
|
||||
((value >= BACNET_COLOR_RAMP_RATE_MIN) &&
|
||||
(value <= BACNET_COLOR_RAMP_RATE_MAX))) {
|
||||
(value <= BACNET_COLOR_RAMP_RATE_MAX))) {
|
||||
pObject->Default_Fade_Time = value;
|
||||
status = true;
|
||||
} else {
|
||||
@@ -800,7 +814,7 @@ static bool Color_Temperature_Default_Step_Increment_Write(
|
||||
if (pObject->Write_Enabled) {
|
||||
if ((value == 0) ||
|
||||
((value >= BACNET_COLOR_STEP_INCREMENT_MIN) &&
|
||||
(value <= BACNET_COLOR_STEP_INCREMENT_MAX))) {
|
||||
(value <= BACNET_COLOR_STEP_INCREMENT_MAX))) {
|
||||
pObject->Default_Fade_Time = value;
|
||||
status = true;
|
||||
} else {
|
||||
@@ -873,7 +887,8 @@ bool Color_Temperature_Transition_Set(
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Color_Transition_Write(uint32_t object_instance,
|
||||
static bool Color_Transition_Write(
|
||||
uint32_t object_instance,
|
||||
uint32_t value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
@@ -928,7 +943,8 @@ bool Color_Temperature_Object_Name(
|
||||
status =
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(name_text, sizeof(name_text), "COLOR-TEMPERATURE-%u",
|
||||
snprintf(
|
||||
name_text, sizeof(name_text), "COLOR-TEMPERATURE-%u",
|
||||
object_instance);
|
||||
status = characterstring_init_ansi(object_name, name_text);
|
||||
}
|
||||
@@ -1074,9 +1090,9 @@ static void Color_Temperature_Fade_To_CCT_Handler(
|
||||
pObject->Color_Command.transit.fade_time = 0;
|
||||
} else {
|
||||
/* fading */
|
||||
pObject->Tracking_Value = linear_interpolate_int(0, milliseconds,
|
||||
pObject->Color_Command.transit.fade_time, old_value,
|
||||
target_value);
|
||||
pObject->Tracking_Value = linear_interpolate_int(
|
||||
0, milliseconds, pObject->Color_Command.transit.fade_time,
|
||||
old_value, target_value);
|
||||
pObject->Color_Command.transit.fade_time -= milliseconds;
|
||||
pObject->In_Progress =
|
||||
BACNET_COLOR_OPERATION_IN_PROGRESS_FADE_ACTIVE;
|
||||
@@ -1326,15 +1342,18 @@ int Color_Temperature_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu, Color_Temperature_Present_Value(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_MIN_PRES_VALUE:
|
||||
apdu_len = encode_application_unsigned(apdu,
|
||||
apdu_len = encode_application_unsigned(
|
||||
apdu,
|
||||
Color_Temperature_Min_Pres_Value(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_MAX_PRES_VALUE:
|
||||
apdu_len = encode_application_unsigned(apdu,
|
||||
apdu_len = encode_application_unsigned(
|
||||
apdu,
|
||||
Color_Temperature_Max_Pres_Value(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_TRACKING_VALUE:
|
||||
apdu_len = encode_application_unsigned(apdu,
|
||||
apdu_len = encode_application_unsigned(
|
||||
apdu,
|
||||
Color_Temperature_Tracking_Value(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_COLOR_COMMAND:
|
||||
@@ -1348,20 +1367,24 @@ int Color_Temperature_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu, Color_Temperature_In_Progress(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_DEFAULT_COLOR_TEMPERATURE:
|
||||
apdu_len = encode_application_unsigned(apdu,
|
||||
apdu_len = encode_application_unsigned(
|
||||
apdu,
|
||||
Color_Temperature_Default_Color_Temperature(
|
||||
rpdata->object_instance));
|
||||
break;
|
||||
case PROP_DEFAULT_FADE_TIME:
|
||||
apdu_len = encode_application_unsigned(apdu,
|
||||
apdu_len = encode_application_unsigned(
|
||||
apdu,
|
||||
Color_Temperature_Default_Fade_Time(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_DEFAULT_RAMP_RATE:
|
||||
apdu_len = encode_application_unsigned(apdu,
|
||||
apdu_len = encode_application_unsigned(
|
||||
apdu,
|
||||
Color_Temperature_Default_Ramp_Rate(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_DEFAULT_STEP_INCREMENT:
|
||||
apdu_len = encode_application_unsigned(apdu,
|
||||
apdu_len = encode_application_unsigned(
|
||||
apdu,
|
||||
Color_Temperature_Default_Step_Increment(
|
||||
rpdata->object_instance));
|
||||
break;
|
||||
@@ -1370,7 +1393,8 @@ int Color_Temperature_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu, Color_Temperature_Transition(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_DESCRIPTION:
|
||||
characterstring_init_ansi(&char_string,
|
||||
characterstring_init_ansi(
|
||||
&char_string,
|
||||
Color_Temperature_Description(rpdata->object_instance));
|
||||
apdu_len = encode_application_character_string(apdu, &char_string);
|
||||
break;
|
||||
@@ -1412,8 +1436,9 @@ bool Color_Temperature_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
/* decode the some of the request */
|
||||
apdu = wp_data->application_data;
|
||||
apdu_size = wp_data->application_data_len;
|
||||
len = bacapp_decode_known_property(apdu, apdu_size, &value,
|
||||
wp_data->object_type, wp_data->object_property);
|
||||
len = bacapp_decode_known_property(
|
||||
apdu, apdu_size, &value, wp_data->object_type,
|
||||
wp_data->object_property);
|
||||
if (len < 0) {
|
||||
/* error while decoding - a value larger than we can handle */
|
||||
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||
@@ -1443,10 +1468,10 @@ bool Color_Temperature_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_UNSIGNED_INT);
|
||||
if (status) {
|
||||
status =
|
||||
Color_Temperature_Default_Write(wp_data->object_instance,
|
||||
value.type.Unsigned_Int, wp_data->priority,
|
||||
&wp_data->error_class, &wp_data->error_code);
|
||||
status = Color_Temperature_Default_Write(
|
||||
wp_data->object_instance, value.type.Unsigned_Int,
|
||||
wp_data->priority, &wp_data->error_class,
|
||||
&wp_data->error_code);
|
||||
}
|
||||
break;
|
||||
case PROP_DEFAULT_FADE_TIME:
|
||||
@@ -1463,9 +1488,10 @@ bool Color_Temperature_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_ENUMERATED);
|
||||
if (status) {
|
||||
status = Color_Transition_Write(wp_data->object_instance,
|
||||
value.type.Enumerated, wp_data->priority,
|
||||
&wp_data->error_class, &wp_data->error_code);
|
||||
status = Color_Transition_Write(
|
||||
wp_data->object_instance, value.type.Enumerated,
|
||||
wp_data->priority, &wp_data->error_class,
|
||||
&wp_data->error_code);
|
||||
}
|
||||
break;
|
||||
case PROP_DEFAULT_RAMP_RATE:
|
||||
|
||||
@@ -45,8 +45,7 @@ BACNET_STACK_EXPORT
|
||||
bool Color_Temperature_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Temperature_Name_Set(
|
||||
uint32_t object_instance, const char *new_name);
|
||||
bool Color_Temperature_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Color_Temperature_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
@@ -103,22 +102,20 @@ bool Color_Temperature_Default_Fade_Time_Set(
|
||||
uint32_t object_instance, uint32_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Color_Temperature_Default_Ramp_Rate(
|
||||
uint32_t object_instance);
|
||||
uint32_t Color_Temperature_Default_Ramp_Rate(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Temperature_Default_Ramp_Rate_Set(
|
||||
uint32_t object_instance, uint32_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Color_Temperature_Default_Step_Increment(
|
||||
uint32_t object_instance);
|
||||
uint32_t Color_Temperature_Default_Step_Increment(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Temperature_Default_Step_Increment_Set(
|
||||
uint32_t object_instance, uint32_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_COLOR_OPERATION_IN_PROGRESS Color_Temperature_In_Progress(
|
||||
uint32_t object_instance);
|
||||
BACNET_COLOR_OPERATION_IN_PROGRESS
|
||||
Color_Temperature_In_Progress(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Temperature_In_Progress_Set(
|
||||
uint32_t object_instance, BACNET_COLOR_OPERATION_IN_PROGRESS value);
|
||||
@@ -132,8 +129,7 @@ bool Color_Temperature_Transition_Set(
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Color_Temperature_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Temperature_Description_Set(
|
||||
uint32_t instance, const char *new_name);
|
||||
bool Color_Temperature_Description_Set(uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Temperature_Write_Enabled(uint32_t instance);
|
||||
|
||||
@@ -325,8 +325,7 @@ static COMMAND_DESCR *Object_Data(uint32_t object_instance)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BACNET_ACTION_LIST * Command_Action_List_Entry(
|
||||
uint32_t instance, unsigned index)
|
||||
BACNET_ACTION_LIST *Command_Action_List_Entry(uint32_t instance, unsigned index)
|
||||
{
|
||||
COMMAND_DESCR *pObject;
|
||||
BACNET_ACTION_LIST *pAction = NULL;
|
||||
@@ -342,8 +341,7 @@ BACNET_ACTION_LIST * Command_Action_List_Entry(
|
||||
/**
|
||||
* @brief For a given object instance-number, returns the number of actions
|
||||
*/
|
||||
unsigned Command_Action_List_Count(
|
||||
uint32_t instance)
|
||||
unsigned Command_Action_List_Count(uint32_t instance)
|
||||
{
|
||||
(void)instance;
|
||||
return MAX_COMMAND_ACTIONS;
|
||||
@@ -367,8 +365,7 @@ static int Command_Action_List_Encode(
|
||||
|
||||
pObject = Object_Data(object_instance);
|
||||
if (pObject && (index < MAX_COMMAND_ACTIONS)) {
|
||||
apdu_len = bacnet_action_command_encode(
|
||||
apdu, &pObject->Action[index]);
|
||||
apdu_len = bacnet_action_command_encode(apdu, &pObject->Action[index]);
|
||||
}
|
||||
|
||||
return apdu_len;
|
||||
@@ -427,9 +424,10 @@ int Command_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
Command_All_Writes_Successful(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_ACTION:
|
||||
apdu_len = bacnet_array_encode(rpdata->object_instance,
|
||||
rpdata->array_index, Command_Action_List_Encode,
|
||||
MAX_COMMAND_ACTIONS, apdu, apdu_size);
|
||||
apdu_len = bacnet_array_encode(
|
||||
rpdata->object_instance, rpdata->array_index,
|
||||
Command_Action_List_Encode, MAX_COMMAND_ACTIONS, apdu,
|
||||
apdu_size);
|
||||
if (apdu_len == BACNET_STATUS_ABORT) {
|
||||
rpdata->error_code =
|
||||
ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED;
|
||||
|
||||
@@ -28,116 +28,83 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct command_descr {
|
||||
uint32_t Present_Value;
|
||||
bool In_Process;
|
||||
bool All_Writes_Successful;
|
||||
BACNET_ACTION_LIST Action[MAX_COMMAND_ACTIONS];
|
||||
} COMMAND_DESCR;
|
||||
typedef struct command_descr {
|
||||
uint32_t Present_Value;
|
||||
bool In_Process;
|
||||
bool All_Writes_Successful;
|
||||
BACNET_ACTION_LIST Action[MAX_COMMAND_ACTIONS];
|
||||
} COMMAND_DESCR;
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Command_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void Command_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Command_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Command_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Command_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Command_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Command_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Command_Instance_To_Index(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Name_Set(uint32_t object_instance, char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Command_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Description_Set(
|
||||
uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
char *Command_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Description_Set(uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Command_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Command_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Command_Present_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Command_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Present_Value_Set(uint32_t object_instance, uint32_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_In_Process(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_In_Process_Set(
|
||||
uint32_t object_instance,
|
||||
bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_In_Process(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_In_Process_Set(uint32_t object_instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_All_Writes_Successful(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_All_Writes_Successful_Set(
|
||||
uint32_t object_instance,
|
||||
bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_All_Writes_Successful(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_All_Writes_Successful_Set(uint32_t object_instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Change_Of_Value(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Command_Change_Of_Value_Clear(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Encode_Value_List(
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
float Command_COV_Increment(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Command_COV_Increment_Set(
|
||||
uint32_t instance,
|
||||
float value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Command_Change_Of_Value_Clear(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Encode_Value_List(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
float Command_COV_Increment(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Command_COV_Increment_Set(uint32_t instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_ACTION_LIST * Command_Action_List_Entry(
|
||||
uint32_t instance, unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Command_Action_List_Count(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_ACTION_LIST *
|
||||
Command_Action_List_Entry(uint32_t instance, unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Command_Action_List_Count(uint32_t instance);
|
||||
|
||||
/* note: header of Intrinsic_Reporting function is required
|
||||
even when INTRINSIC_REPORTING is not defined */
|
||||
BACNET_STACK_EXPORT
|
||||
void Command_Intrinsic_Reporting(
|
||||
uint32_t object_instance);
|
||||
/* note: header of Intrinsic_Reporting function is required
|
||||
even when INTRINSIC_REPORTING is not defined */
|
||||
BACNET_STACK_EXPORT
|
||||
void Command_Intrinsic_Reporting(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Command_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Command_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -24,10 +24,13 @@ static bool Credential_Data_Input_Initialized = false;
|
||||
static CREDENTIAL_DATA_INPUT_DESCR cdi_descr[MAX_CREDENTIAL_DATA_INPUTS];
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_PRESENT_VALUE, PROP_STATUS_FLAGS,
|
||||
PROP_RELIABILITY, PROP_OUT_OF_SERVICE, PROP_SUPPORTED_FORMATS,
|
||||
PROP_UPDATE_TIME, -1 };
|
||||
static const int Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER, PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE, PROP_PRESENT_VALUE,
|
||||
PROP_STATUS_FLAGS, PROP_RELIABILITY,
|
||||
PROP_OUT_OF_SERVICE, PROP_SUPPORTED_FORMATS,
|
||||
PROP_UPDATE_TIME, -1
|
||||
};
|
||||
|
||||
static const int Properties_Optional[] = { -1 };
|
||||
|
||||
@@ -122,7 +125,8 @@ bool Credential_Data_Input_Object_Name(
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_CREDENTIAL_DATA_INPUTS) {
|
||||
snprintf(text, sizeof(text), "CREDENTIAL DATA INPUT %lu",
|
||||
snprintf(
|
||||
text, sizeof(text), "CREDENTIAL DATA INPUT %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, text);
|
||||
}
|
||||
@@ -174,8 +178,9 @@ int Credential_Data_Input_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
Credential_Data_Input_Instance_To_Index(rpdata->object_instance);
|
||||
switch (rpdata->object_property) {
|
||||
case PROP_OBJECT_IDENTIFIER:
|
||||
apdu_len = encode_application_object_id(&apdu[0],
|
||||
OBJECT_CREDENTIAL_DATA_INPUT, rpdata->object_instance);
|
||||
apdu_len = encode_application_object_id(
|
||||
&apdu[0], OBJECT_CREDENTIAL_DATA_INPUT,
|
||||
rpdata->object_instance);
|
||||
break;
|
||||
case PROP_OBJECT_NAME:
|
||||
Credential_Data_Input_Object_Name(
|
||||
@@ -217,7 +222,8 @@ int Credential_Data_Input_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
} else if (rpdata->array_index == BACNET_ARRAY_ALL) {
|
||||
for (i = 0; i < cdi_descr[object_index].supported_formats_count;
|
||||
i++) {
|
||||
len = bacapp_encode_authentication_factor_format(&apdu[0],
|
||||
len = bacapp_encode_authentication_factor_format(
|
||||
&apdu[0],
|
||||
&cdi_descr[object_index].supported_formats[i]);
|
||||
if (apdu_len + len < MAX_APDU) {
|
||||
apdu_len += len;
|
||||
@@ -231,10 +237,10 @@ int Credential_Data_Input_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
} else {
|
||||
if (rpdata->array_index <=
|
||||
cdi_descr[object_index].supported_formats_count) {
|
||||
apdu_len =
|
||||
bacapp_encode_authentication_factor_format(&apdu[0],
|
||||
&cdi_descr[object_index]
|
||||
.supported_formats[rpdata->array_index - 1]);
|
||||
apdu_len = bacapp_encode_authentication_factor_format(
|
||||
&apdu[0],
|
||||
&cdi_descr[object_index]
|
||||
.supported_formats[rpdata->array_index - 1]);
|
||||
} else {
|
||||
rpdata->error_class = ERROR_CLASS_PROPERTY;
|
||||
rpdata->error_code = ERROR_CODE_INVALID_ARRAY_INDEX;
|
||||
@@ -300,7 +306,8 @@ bool Credential_Data_Input_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
len = bacapp_decode_authentication_factor(
|
||||
wp_data->application_data, &tmp);
|
||||
if (len > 0) {
|
||||
memcpy(&cdi_descr[object_index].present_value, &tmp,
|
||||
memcpy(
|
||||
&cdi_descr[object_index].present_value, &tmp,
|
||||
sizeof(BACNET_AUTHENTICATION_FACTOR));
|
||||
} else {
|
||||
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "bacnet/rp.h"
|
||||
#include "bacnet/wp.h"
|
||||
|
||||
|
||||
#ifndef MAX_CREDENTIAL_DATA_INPUTS
|
||||
#define MAX_CREDENTIAL_DATA_INPUTS 4
|
||||
#endif
|
||||
@@ -34,75 +33,54 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct {
|
||||
BACNET_AUTHENTICATION_FACTOR present_value;
|
||||
BACNET_RELIABILITY reliability;
|
||||
bool out_of_service;
|
||||
uint32_t supported_formats_count;
|
||||
BACNET_AUTHENTICATION_FACTOR_FORMAT
|
||||
supported_formats[MAX_AUTHENTICATION_FACTOR_FORMAT_COUNT];
|
||||
BACNET_TIMESTAMP timestamp;
|
||||
} CREDENTIAL_DATA_INPUT_DESCR;
|
||||
typedef struct {
|
||||
BACNET_AUTHENTICATION_FACTOR present_value;
|
||||
BACNET_RELIABILITY reliability;
|
||||
bool out_of_service;
|
||||
uint32_t supported_formats_count;
|
||||
BACNET_AUTHENTICATION_FACTOR_FORMAT
|
||||
supported_formats[MAX_AUTHENTICATION_FACTOR_FORMAT_COUNT];
|
||||
BACNET_TIMESTAMP timestamp;
|
||||
} CREDENTIAL_DATA_INPUT_DESCR;
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Credential_Data_Input_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Credential_Data_Input_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Credential_Data_Input_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Credential_Data_Input_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Credential_Data_Input_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Credential_Data_Input_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Credential_Data_Input_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Credential_Data_Input_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Credential_Data_Input_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Credential_Data_Input_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Credential_Data_Input_Instance_To_Index(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Credential_Data_Input_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Credential_Data_Input_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Credential_Data_Input_Name_Set(uint32_t object_instance, char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Credential_Data_Input_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Credential_Data_Input_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Credential_Data_Input_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Credential_Data_Input_Out_Of_Service_Set(uint32_t instance, bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Credential_Data_Input_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Credential_Data_Input_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Credential_Data_Input_Out_Of_Service(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Credential_Data_Input_Out_Of_Service_Set(
|
||||
uint32_t instance,
|
||||
bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Credential_Data_Input_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Credential_Data_Input_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Credential_Data_Input_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Credential_Data_Input_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Credential_Data_Input_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Credential_Data_Input_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Credential_Data_Input_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Credential_Data_Input_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Credential_Data_Input_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Credential_Data_Input_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -34,12 +34,14 @@ static char Object_Description[MAX_CHARACTERSTRING_VALUES][64];
|
||||
static bool Changed[MAX_CHARACTERSTRING_VALUES];
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_PRESENT_VALUE, PROP_STATUS_FLAGS,
|
||||
-1 };
|
||||
static const int Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER, PROP_OBJECT_NAME, PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE, PROP_STATUS_FLAGS, -1
|
||||
};
|
||||
|
||||
static const int Properties_Optional[] = { PROP_EVENT_STATE,
|
||||
PROP_OUT_OF_SERVICE, PROP_DESCRIPTION, -1 };
|
||||
PROP_OUT_OF_SERVICE,
|
||||
PROP_DESCRIPTION, -1 };
|
||||
|
||||
static const int Properties_Proprietary[] = { -1 };
|
||||
|
||||
@@ -76,9 +78,11 @@ void CharacterString_Value_Init(void)
|
||||
|
||||
/* initialize all Present Values */
|
||||
for (i = 0; i < MAX_CHARACTERSTRING_VALUES; i++) {
|
||||
snprintf(&Object_Name[i][0], sizeof(Object_Name[i]),
|
||||
snprintf(
|
||||
&Object_Name[i][0], sizeof(Object_Name[i]),
|
||||
"CHARACTER STRING VALUE %u", i + 1);
|
||||
snprintf(&Object_Description[i][0], sizeof(Object_Description[i]),
|
||||
snprintf(
|
||||
&Object_Description[i][0], sizeof(Object_Description[i]),
|
||||
"A Character String Value Example");
|
||||
characterstring_init_ansi(&Present_Value[i], "");
|
||||
Changed[i] = false;
|
||||
@@ -228,8 +232,8 @@ bool CharacterString_Value_Out_Of_Service(uint32_t object_instance)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @param true/false
|
||||
*/
|
||||
static void CharacterString_Value_Out_Of_Service_Set(
|
||||
uint32_t object_instance, bool value)
|
||||
static void
|
||||
CharacterString_Value_Out_Of_Service_Set(uint32_t object_instance, bool value)
|
||||
{
|
||||
unsigned index = 0;
|
||||
|
||||
@@ -294,8 +298,8 @@ bool CharacterString_Value_Encode_Value_List(
|
||||
|
||||
index = CharacterString_Value_Instance_To_Index(object_instance);
|
||||
if (index < MAX_CHARACTERSTRING_VALUES) {
|
||||
status = cov_value_list_encode_character_string(value_list,
|
||||
&Present_Value[index], in_alarm, fault, overridden,
|
||||
status = cov_value_list_encode_character_string(
|
||||
value_list, &Present_Value[index], in_alarm, fault, overridden,
|
||||
Out_Of_Service[index]);
|
||||
}
|
||||
|
||||
@@ -349,7 +353,8 @@ bool CharacterString_Value_Description_Set(
|
||||
}
|
||||
}
|
||||
} else {
|
||||
memset(&Object_Description[index][0], 0,
|
||||
memset(
|
||||
&Object_Description[index][0], 0,
|
||||
sizeof(Object_Description[index]));
|
||||
}
|
||||
}
|
||||
@@ -454,8 +459,9 @@ int CharacterString_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
|
||||
switch (rpdata->object_property) {
|
||||
case PROP_OBJECT_IDENTIFIER:
|
||||
apdu_len = encode_application_object_id(&apdu[0],
|
||||
OBJECT_CHARACTERSTRING_VALUE, rpdata->object_instance);
|
||||
apdu_len = encode_application_object_id(
|
||||
&apdu[0], OBJECT_CHARACTERSTRING_VALUE,
|
||||
rpdata->object_instance);
|
||||
break;
|
||||
/* note: Name and Description don't have to be the same.
|
||||
You could make Description writable and different */
|
||||
@@ -467,7 +473,8 @@ int CharacterString_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
}
|
||||
break;
|
||||
case PROP_DESCRIPTION:
|
||||
if (characterstring_init_ansi(&char_string,
|
||||
if (characterstring_init_ansi(
|
||||
&char_string,
|
||||
CharacterString_Value_Description(
|
||||
rpdata->object_instance))) {
|
||||
apdu_len =
|
||||
|
||||
@@ -20,77 +20,58 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void CharacterString_Value_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void CharacterString_Value_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned CharacterString_Value_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t CharacterString_Value_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned CharacterString_Value_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned CharacterString_Value_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t CharacterString_Value_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned CharacterString_Value_Instance_To_Index(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int CharacterString_Value_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
int CharacterString_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
/* optional API */
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
/* optional API */
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Name_Set(
|
||||
uint32_t object_instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Name_Set(
|
||||
uint32_t object_instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Present_Value(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
const BACNET_CHARACTER_STRING * value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Description_Set(
|
||||
uint32_t object_instance,
|
||||
const char *text_string);
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Out_Of_Service(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Present_Value(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Present_Value_Set(
|
||||
uint32_t object_instance, const BACNET_CHARACTER_STRING *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Description_Set(
|
||||
uint32_t object_instance, const char *text_string);
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Out_Of_Service(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Change_Of_Value(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void CharacterString_Value_Change_Of_Value_Clear(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Encode_Value_List(
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void CharacterString_Value_Change_Of_Value_Clear(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Encode_Value_List(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void CharacterString_Value_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void CharacterString_Value_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -77,8 +77,8 @@
|
||||
|
||||
/* external prototypes */
|
||||
extern int Routed_Device_Read_Property_Local(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
extern bool Routed_Device_Write_Property_Local(
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
extern bool
|
||||
Routed_Device_Write_Property_Local(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
/* may be overridden by outside table */
|
||||
static object_functions_t *Object_Table;
|
||||
@@ -404,8 +404,8 @@ static object_functions_t My_Object_Table[] = {
|
||||
* @return Pointer to the group of object helper functions that implement this
|
||||
* type of Object.
|
||||
*/
|
||||
static struct object_functions *Device_Objects_Find_Functions(
|
||||
BACNET_OBJECT_TYPE Object_Type)
|
||||
static struct object_functions *
|
||||
Device_Objects_Find_Functions(BACNET_OBJECT_TYPE Object_Type)
|
||||
{
|
||||
struct object_functions *pObject = NULL;
|
||||
|
||||
@@ -451,7 +451,8 @@ rr_info_function Device_Objects_RR_Info(BACNET_OBJECT_TYPE object_type)
|
||||
* list, separately, the Required, Optional, and Proprietary object
|
||||
* properties with their counts.
|
||||
*/
|
||||
void Device_Objects_Property_List(BACNET_OBJECT_TYPE object_type,
|
||||
void Device_Objects_Property_List(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance,
|
||||
struct special_property_list_t *pPropertyList)
|
||||
{
|
||||
@@ -469,8 +470,9 @@ void Device_Objects_Property_List(BACNET_OBJECT_TYPE object_type,
|
||||
|
||||
pObject = Device_Objects_Find_Functions(object_type);
|
||||
if ((pObject != NULL) && (pObject->Object_RPM_List != NULL)) {
|
||||
pObject->Object_RPM_List(&pPropertyList->Required.pList,
|
||||
&pPropertyList->Optional.pList, &pPropertyList->Proprietary.pList);
|
||||
pObject->Object_RPM_List(
|
||||
&pPropertyList->Required.pList, &pPropertyList->Optional.pList,
|
||||
&pPropertyList->Proprietary.pList);
|
||||
}
|
||||
|
||||
/* Fetch the counts if available otherwise zero them */
|
||||
@@ -559,8 +561,8 @@ bool Device_Objects_Property_List_Member(
|
||||
property_list_member(property_list.Optional.pList, object_property);
|
||||
}
|
||||
if (!found) {
|
||||
found = property_list_member(property_list.Proprietary.pList,
|
||||
object_property);
|
||||
found = property_list_member(
|
||||
property_list.Proprietary.pList, object_property);
|
||||
}
|
||||
|
||||
return found;
|
||||
@@ -1124,7 +1126,8 @@ int Device_Object_List_Element_Encode(
|
||||
* Object.
|
||||
* @return True on success or else False if not found.
|
||||
*/
|
||||
bool Device_Valid_Object_Name(const BACNET_CHARACTER_STRING *object_name1,
|
||||
bool Device_Valid_Object_Name(
|
||||
const BACNET_CHARACTER_STRING *object_name1,
|
||||
BACNET_OBJECT_TYPE *object_type,
|
||||
uint32_t *object_instance)
|
||||
{
|
||||
@@ -1143,7 +1146,7 @@ bool Device_Valid_Object_Name(const BACNET_CHARACTER_STRING *object_name1,
|
||||
pObject = Device_Objects_Find_Functions(type);
|
||||
if ((pObject != NULL) && (pObject->Object_Name != NULL) &&
|
||||
(pObject->Object_Name(instance, &object_name2) &&
|
||||
characterstring_same(object_name1, &object_name2))) {
|
||||
characterstring_same(object_name1, &object_name2))) {
|
||||
found = true;
|
||||
if (object_type) {
|
||||
*object_type = type;
|
||||
@@ -1184,7 +1187,8 @@ bool Device_Valid_Object_Id(
|
||||
* @param object_name [out] The Object Name found for this child Object.
|
||||
* @return True on success or else False if not found.
|
||||
*/
|
||||
bool Device_Object_Name_Copy(BACNET_OBJECT_TYPE object_type,
|
||||
bool Device_Object_Name_Copy(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
@@ -1402,7 +1406,8 @@ int Device_Read_Property_Local(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
bitstring_init(&bit_string);
|
||||
for (i = 0; i < MAX_BACNET_SERVICES_SUPPORTED; i++) {
|
||||
/* automatic lookup based on handlers set */
|
||||
bitstring_set_bit(&bit_string, (uint8_t)i,
|
||||
bitstring_set_bit(
|
||||
&bit_string, (uint8_t)i,
|
||||
apdu_service_supported((BACNET_SERVICES_SUPPORTED)i));
|
||||
}
|
||||
apdu_len = encode_application_bitstring(&apdu[0], &bit_string);
|
||||
@@ -1429,9 +1434,9 @@ int Device_Read_Property_Local(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
break;
|
||||
case PROP_OBJECT_LIST:
|
||||
count = Device_Object_List_Count();
|
||||
apdu_len = bacnet_array_encode(rpdata->object_instance,
|
||||
rpdata->array_index, Device_Object_List_Element_Encode, count,
|
||||
apdu, apdu_max);
|
||||
apdu_len = bacnet_array_encode(
|
||||
rpdata->object_instance, rpdata->array_index,
|
||||
Device_Object_List_Element_Encode, count, apdu, apdu_max);
|
||||
if (apdu_len == BACNET_STATUS_ABORT) {
|
||||
rpdata->error_code =
|
||||
ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED;
|
||||
@@ -1554,8 +1559,9 @@ static int Read_Property_Common(
|
||||
} else if (rpdata->object_property == PROP_PROPERTY_LIST) {
|
||||
Device_Objects_Property_List(
|
||||
rpdata->object_type, rpdata->object_instance, &property_list);
|
||||
apdu_len = property_list_encode(rpdata, property_list.Required.pList,
|
||||
property_list.Optional.pList, property_list.Proprietary.pList);
|
||||
apdu_len = property_list_encode(
|
||||
rpdata, property_list.Required.pList, property_list.Optional.pList,
|
||||
property_list.Proprietary.pList);
|
||||
#endif
|
||||
} else if (pObject->Object_Read_Property) {
|
||||
apdu_len = pObject->Object_Read_Property(rpdata);
|
||||
@@ -1693,8 +1699,9 @@ bool Device_Write_Property_Local(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
wp_data, &value, characterstring_capacity(&My_Object_Name));
|
||||
if (status) {
|
||||
/* All the object names in a device must be unique */
|
||||
if (Device_Valid_Object_Name(&value.type.Character_String,
|
||||
&object_type, &object_instance)) {
|
||||
if (Device_Valid_Object_Name(
|
||||
&value.type.Character_String, &object_type,
|
||||
&object_instance)) {
|
||||
if ((object_type == wp_data->object_type) &&
|
||||
(object_instance == wp_data->object_instance)) {
|
||||
/* writing same name to same object */
|
||||
@@ -1821,10 +1828,8 @@ bool Device_Write_Property_Local(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
#endif
|
||||
default:
|
||||
if (property_lists_member(
|
||||
Device_Properties_Required,
|
||||
Device_Properties_Optional,
|
||||
Device_Properties_Proprietary,
|
||||
wp_data->object_property)) {
|
||||
Device_Properties_Required, Device_Properties_Optional,
|
||||
Device_Properties_Proprietary, wp_data->object_property)) {
|
||||
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||
wp_data->error_code = ERROR_CODE_WRITE_ACCESS_DENIED;
|
||||
} else {
|
||||
@@ -1907,8 +1912,7 @@ static bool Device_Write_Property_Object_Name(
|
||||
* @brief Set the callback for a WriteProperty successful operation
|
||||
* @param cb [in] The function to be called, or NULL to disable
|
||||
*/
|
||||
void Device_Write_Property_Store_Callback_Set(
|
||||
write_property_function cb)
|
||||
void Device_Write_Property_Store_Callback_Set(write_property_function cb)
|
||||
{
|
||||
Device_Write_Property_Store_Callback = cb;
|
||||
}
|
||||
@@ -2053,7 +2057,8 @@ int Device_Remove_List_Element(BACNET_LIST_ELEMENT_DATA *list_element)
|
||||
* @param [out] The value list
|
||||
* @return True if the object instance supports this feature and value changed.
|
||||
*/
|
||||
bool Device_Encode_Value_List(BACNET_OBJECT_TYPE object_type,
|
||||
bool Device_Encode_Value_List(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE *value_list)
|
||||
{
|
||||
@@ -2138,7 +2143,8 @@ bool Device_Create_Object(BACNET_CREATE_OBJECT_DATA *data)
|
||||
object for some other reason.*/
|
||||
data->error_class = ERROR_CLASS_OBJECT;
|
||||
data->error_code = ERROR_CODE_DYNAMIC_CREATION_NOT_SUPPORTED;
|
||||
} else if (pObject->Object_Valid_Instance &&
|
||||
} else if (
|
||||
pObject->Object_Valid_Instance &&
|
||||
pObject->Object_Valid_Instance(data->object_instance)) {
|
||||
/* The object being created already exists */
|
||||
data->error_class = ERROR_CLASS_OBJECT;
|
||||
@@ -2196,7 +2202,8 @@ bool Device_Delete_Object(BACNET_DELETE_OBJECT_DATA *data)
|
||||
object for some reason.*/
|
||||
data->error_class = ERROR_CLASS_OBJECT;
|
||||
data->error_code = ERROR_CODE_OBJECT_DELETION_NOT_PERMITTED;
|
||||
} else if (pObject->Object_Valid_Instance &&
|
||||
} else if (
|
||||
pObject->Object_Valid_Instance &&
|
||||
pObject->Object_Valid_Instance(data->object_instance)) {
|
||||
/* The object being deleted must already exist */
|
||||
status = pObject->Object_Delete(data->object_instance);
|
||||
@@ -2299,7 +2306,8 @@ void Device_Init(object_functions_t *object_table)
|
||||
#endif
|
||||
}
|
||||
|
||||
bool DeviceGetRRInfo(BACNET_READ_RANGE_DATA *pRequest, /* Info on the request */
|
||||
bool DeviceGetRRInfo(
|
||||
BACNET_READ_RANGE_DATA *pRequest, /* Info on the request */
|
||||
RR_PROP_INFO *pInfo)
|
||||
{ /* Where to put the response */
|
||||
bool status = false; /* return value */
|
||||
|
||||
+242
-350
@@ -25,41 +25,34 @@
|
||||
/** Called so a BACnet object can perform any necessary initialization.
|
||||
* @ingroup ObjHelpers
|
||||
*/
|
||||
typedef void (
|
||||
*object_init_function) (
|
||||
void);
|
||||
typedef void (*object_init_function)(void);
|
||||
|
||||
/** Counts the number of objects of this type.
|
||||
* @ingroup ObjHelpers
|
||||
* @return Count of implemented objects of this type.
|
||||
*/
|
||||
typedef unsigned (
|
||||
*object_count_function) (
|
||||
void);
|
||||
typedef unsigned (*object_count_function)(void);
|
||||
|
||||
/** Maps an object index position to its corresponding BACnet object instance number.
|
||||
/** Maps an object index position to its corresponding BACnet object instance
|
||||
* number.
|
||||
* @ingroup ObjHelpers
|
||||
* @param index [in] The index of the object, in the array of objects of its type.
|
||||
* @param index [in] The index of the object, in the array of objects of its
|
||||
* type.
|
||||
* @return The BACnet object instance number to be used in a BACNET_OBJECT_ID.
|
||||
*/
|
||||
typedef uint32_t(
|
||||
*object_index_to_instance_function)
|
||||
(
|
||||
unsigned index);
|
||||
typedef uint32_t (*object_index_to_instance_function)(unsigned index);
|
||||
|
||||
/** Provides the BACnet Object_Name for a given object instance of this type.
|
||||
* @ingroup ObjHelpers
|
||||
* @param object_instance [in] The object instance number to be looked up.
|
||||
* @param object_name [in,out] Pointer to a character_string structure that
|
||||
* will hold a copy of the object name if this is a valid object_instance.
|
||||
* will hold a copy of the object name if this is a valid
|
||||
* object_instance.
|
||||
* @return True if the object_instance is valid and object_name has been
|
||||
* filled with a copy of the Object's name.
|
||||
*/
|
||||
typedef bool(
|
||||
*object_name_function)
|
||||
(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
typedef bool (*object_name_function)(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
|
||||
/** Look in the table of objects of this type, and see if this is a valid
|
||||
* instance number.
|
||||
@@ -67,9 +60,7 @@ typedef bool(
|
||||
* @param [in] The object instance number to be looked up.
|
||||
* @return True if the object instance refers to a valid object of this type.
|
||||
*/
|
||||
typedef bool(
|
||||
*object_valid_instance_function) (
|
||||
uint32_t object_instance);
|
||||
typedef bool (*object_valid_instance_function)(uint32_t object_instance);
|
||||
|
||||
/** Helper function to step through an array of objects and find either the
|
||||
* first one or the next one of a given type. Used to step through an array
|
||||
@@ -81,9 +72,7 @@ typedef bool(
|
||||
* @return The index of the next object of the required type or ~0 (all bits
|
||||
* == 1) to indicate no more objects found.
|
||||
*/
|
||||
typedef unsigned (
|
||||
*object_iterate_function) (
|
||||
unsigned current_index);
|
||||
typedef unsigned (*object_iterate_function)(unsigned current_index);
|
||||
|
||||
/** Look in the table of objects of this type, and get the COV Value List.
|
||||
* @ingroup ObjHelpers
|
||||
@@ -91,43 +80,34 @@ typedef unsigned (
|
||||
* @param [out] The value list
|
||||
* @return True if the object instance supports this feature, and has changed.
|
||||
*/
|
||||
typedef bool(
|
||||
*object_value_list_function) (
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
typedef bool (*object_value_list_function)(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
|
||||
/** Look in the table of objects for this instance to see if value changed.
|
||||
* @ingroup ObjHelpers
|
||||
* @param [in] The object instance number to be looked up.
|
||||
* @return True if the object instance has changed.
|
||||
*/
|
||||
typedef bool(
|
||||
*object_cov_function) (
|
||||
uint32_t object_instance);
|
||||
typedef bool (*object_cov_function)(uint32_t object_instance);
|
||||
|
||||
/** Look in the table of objects for this instance to clear the changed flag.
|
||||
* @ingroup ObjHelpers
|
||||
* @param [in] The object instance number to be looked up.
|
||||
*/
|
||||
typedef void (
|
||||
*object_cov_clear_function) (
|
||||
uint32_t object_instance);
|
||||
typedef void (*object_cov_clear_function)(uint32_t object_instance);
|
||||
|
||||
/** Intrinsic Reporting funcionality.
|
||||
* @ingroup ObjHelpers
|
||||
* @param [in] Object instance.
|
||||
*/
|
||||
typedef void (
|
||||
*object_intrinsic_reporting_function) (
|
||||
uint32_t object_instance);
|
||||
typedef void (*object_intrinsic_reporting_function)(uint32_t object_instance);
|
||||
|
||||
/**
|
||||
* @brief Updates the object with the elapsed milliseconds
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @param milliseconds - number of milliseconds elapsed
|
||||
*/
|
||||
typedef void (
|
||||
*object_timer_function) (
|
||||
typedef void (*object_timer_function)(
|
||||
uint32_t object_instance, uint16_t milliseconds);
|
||||
|
||||
/** Defines the group of object helper functions for any supported Object.
|
||||
@@ -164,14 +144,13 @@ typedef struct object_functions {
|
||||
|
||||
/* String Lengths - excluding any nul terminator */
|
||||
#define MAX_DEV_NAME_LEN 32
|
||||
#define MAX_DEV_LOC_LEN 64
|
||||
#define MAX_DEV_MOD_LEN 32
|
||||
#define MAX_DEV_VER_LEN 16
|
||||
#define MAX_DEV_LOC_LEN 64
|
||||
#define MAX_DEV_MOD_LEN 32
|
||||
#define MAX_DEV_VER_LEN 16
|
||||
#define MAX_DEV_DESC_LEN 64
|
||||
|
||||
/** Structure to define the Object Properties common to all Objects. */
|
||||
typedef struct commonBacObj_s {
|
||||
|
||||
/** The BACnet type of this object (ie, what class is this object from?).
|
||||
* This property, of type BACnetObjectType, indicates membership in a
|
||||
* particular object type class. Each inherited class will be of one type.
|
||||
@@ -189,7 +168,6 @@ typedef struct commonBacObj_s {
|
||||
|
||||
} COMMON_BAC_OBJECT;
|
||||
|
||||
|
||||
/** Structure to define the Properties of Device Objects which distinguish
|
||||
* one instance from another.
|
||||
* This structure only defines fields for properties that are unique to
|
||||
@@ -208,356 +186,268 @@ typedef struct devObj_s {
|
||||
/** Device Description. */
|
||||
char Description[MAX_DEV_DESC_LEN];
|
||||
|
||||
/** The upcounter that shows if the Device ID or object structure has changed. */
|
||||
/** The upcounter that shows if the Device ID or object structure has
|
||||
* changed. */
|
||||
uint32_t Database_Revision;
|
||||
} DEVICE_OBJECT_DATA;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_Init(
|
||||
object_functions_t * object_table);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_Init(object_functions_t *object_table);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_Timer(
|
||||
uint16_t milliseconds);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_Timer(uint16_t milliseconds);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Reinitialize(
|
||||
BACNET_REINITIALIZE_DEVICE_DATA * rd_data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Reinitialize_State_Set(BACNET_REINITIALIZED_STATE state);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_REINITIALIZED_STATE Device_Reinitialized_State(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Reinitialize_Password_Set(
|
||||
const char *password);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Reinitialize(BACNET_REINITIALIZE_DEVICE_DATA *rd_data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Reinitialize_State_Set(BACNET_REINITIALIZED_STATE state);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_REINITIALIZED_STATE Device_Reinitialized_State(void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Reinitialize_Password_Set(const char *password);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
rr_info_function Device_Objects_RR_Info(
|
||||
BACNET_OBJECT_TYPE object_type);
|
||||
BACNET_STACK_EXPORT
|
||||
rr_info_function Device_Objects_RR_Info(BACNET_OBJECT_TYPE object_type);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_getCurrentDateTime(
|
||||
BACNET_DATE_TIME * DateTime);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_getCurrentDateTime(BACNET_DATE_TIME *DateTime);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int32_t Device_UTC_Offset(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_UTC_Offset_Set(int16_t offset);
|
||||
BACNET_STACK_EXPORT
|
||||
int32_t Device_UTC_Offset(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_UTC_Offset_Set(int16_t offset);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Daylight_Savings_Status(void);
|
||||
bool Device_Align_Intervals(void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Align_Intervals_Set(bool flag);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Device_Time_Sync_Interval(void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Time_Sync_Interval_Set(uint32_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Device_Interval_Offset(void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Interval_Offset_Set(uint32_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Daylight_Savings_Status(void);
|
||||
bool Device_Align_Intervals(void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Align_Intervals_Set(bool flag);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Device_Time_Sync_Interval(void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Time_Sync_Interval_Set(uint32_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Device_Interval_Offset(void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Interval_Offset_Set(uint32_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_Objects_Property_List(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance,
|
||||
struct special_property_list_t *pPropertyList);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Objects_Property_List_Member(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_ID object_property);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_Objects_Property_List(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance,
|
||||
struct special_property_list_t *pPropertyList);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Objects_Property_List_Member(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_ID object_property);
|
||||
|
||||
/* functions to support COV */
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Encode_Value_List(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
bool Device_Value_List_Supported(
|
||||
BACNET_OBJECT_TYPE object_type);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_COV(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_COV_Clear(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance);
|
||||
/* functions to support COV */
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Encode_Value_List(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE *value_list);
|
||||
bool Device_Value_List_Supported(BACNET_OBJECT_TYPE object_type);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_COV(BACNET_OBJECT_TYPE object_type, uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_COV_Clear(BACNET_OBJECT_TYPE object_type, uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Device_Object_Instance_Number(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Set_Object_Instance_Number(
|
||||
uint32_t object_id);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Valid_Object_Instance_Number(
|
||||
uint32_t object_id);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Device_Object_Instance_Number(void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Set_Object_Instance_Number(uint32_t object_id);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Valid_Object_Instance_Number(uint32_t object_id);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_UUID_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_UUID_Set(
|
||||
const uint8_t *new_uuid,
|
||||
size_t length);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_UUID_Get(
|
||||
uint8_t *uuid,
|
||||
size_t length);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_UUID_Init(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_UUID_Set(const uint8_t *new_uuid, size_t length);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_UUID_Get(uint8_t *uuid, size_t length);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Device_Object_List_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Object_List_Identifier(
|
||||
uint32_t array_index,
|
||||
BACNET_OBJECT_TYPE *object_type,
|
||||
uint32_t * instance);
|
||||
BACNET_STACK_EXPORT
|
||||
int Device_Object_List_Element_Encode(
|
||||
uint32_t object_instance,
|
||||
BACNET_ARRAY_INDEX array_index,
|
||||
uint8_t *apdu);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Device_Object_List_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Object_List_Identifier(
|
||||
uint32_t array_index, BACNET_OBJECT_TYPE *object_type, uint32_t *instance);
|
||||
BACNET_STACK_EXPORT
|
||||
int Device_Object_List_Element_Encode(
|
||||
uint32_t object_instance, BACNET_ARRAY_INDEX array_index, uint8_t *apdu);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Create_Object(
|
||||
BACNET_CREATE_OBJECT_DATA *data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Delete_Object(
|
||||
BACNET_DELETE_OBJECT_DATA *data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Create_Object(BACNET_CREATE_OBJECT_DATA *data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Delete_Object(BACNET_DELETE_OBJECT_DATA *data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Device_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Device_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Device_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Device_Index_To_Instance(unsigned index);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Set_Object_Name(
|
||||
const BACNET_CHARACTER_STRING * object_name);
|
||||
/* Copy a child object name, given its ID. */
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Object_Name_Copy(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Object_Name_ANSI_Init(const char * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
char * Device_Object_Name_ANSI(void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Set_Object_Name(const BACNET_CHARACTER_STRING *object_name);
|
||||
/* Copy a child object name, given its ID. */
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Object_Name_Copy(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Object_Name_ANSI_Init(const char *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
char *Device_Object_Name_ANSI(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_DEVICE_STATUS Device_System_Status(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
int Device_Set_System_Status(
|
||||
BACNET_DEVICE_STATUS status,
|
||||
bool local);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_DEVICE_STATUS Device_System_Status(void);
|
||||
BACNET_STACK_EXPORT
|
||||
int Device_Set_System_Status(BACNET_DEVICE_STATUS status, bool local);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Device_Vendor_Name(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Device_Vendor_Name(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Device_Vendor_Identifier(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_Set_Vendor_Identifier(
|
||||
uint16_t vendor_id);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Device_Vendor_Identifier(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_Set_Vendor_Identifier(uint16_t vendor_id);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Device_Model_Name(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Set_Model_Name(
|
||||
const char *name,
|
||||
size_t length);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Device_Model_Name(void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Set_Model_Name(const char *name, size_t length);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Device_Firmware_Revision(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Device_Firmware_Revision(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Device_Application_Software_Version(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Set_Application_Software_Version(
|
||||
const char *name,
|
||||
size_t length);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Device_Application_Software_Version(void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Set_Application_Software_Version(const char *name, size_t length);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Device_Description(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Set_Description(
|
||||
const char *name,
|
||||
size_t length);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Device_Description(void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Set_Description(const char *name, size_t length);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Device_Location(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Set_Location(
|
||||
const char *name,
|
||||
size_t length);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Device_Location(void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Set_Location(const char *name, size_t length);
|
||||
|
||||
/* some stack-centric constant values - no set methods */
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Device_Protocol_Version(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Device_Protocol_Revision(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_SEGMENTATION Device_Segmentation_Supported(
|
||||
void);
|
||||
/* some stack-centric constant values - no set methods */
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Device_Protocol_Version(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Device_Protocol_Revision(void);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_SEGMENTATION Device_Segmentation_Supported(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Device_Database_Revision(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_Set_Database_Revision(
|
||||
uint32_t revision);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_Inc_Database_Revision(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Device_Database_Revision(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_Set_Database_Revision(uint32_t revision);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_Inc_Database_Revision(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Valid_Object_Name(
|
||||
const BACNET_CHARACTER_STRING * object_name,
|
||||
BACNET_OBJECT_TYPE *object_type,
|
||||
uint32_t * object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Valid_Object_Id(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Valid_Object_Name(
|
||||
const BACNET_CHARACTER_STRING *object_name,
|
||||
BACNET_OBJECT_TYPE *object_type,
|
||||
uint32_t *object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Valid_Object_Id(
|
||||
BACNET_OBJECT_TYPE object_type, uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Device_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Device_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Device_Add_List_Element(
|
||||
BACNET_LIST_ELEMENT_DATA *list_element);
|
||||
BACNET_STACK_EXPORT
|
||||
int Device_Add_List_Element(BACNET_LIST_ELEMENT_DATA *list_element);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Device_Remove_List_Element(
|
||||
BACNET_LIST_ELEMENT_DATA *list_element);
|
||||
BACNET_STACK_EXPORT
|
||||
int Device_Remove_List_Element(BACNET_LIST_ELEMENT_DATA *list_element);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool DeviceGetRRInfo(
|
||||
BACNET_READ_RANGE_DATA * pRequest, /* Info on the request */
|
||||
RR_PROP_INFO * pInfo); /* Where to put the information */
|
||||
BACNET_STACK_EXPORT
|
||||
bool DeviceGetRRInfo(
|
||||
BACNET_READ_RANGE_DATA *pRequest, /* Info on the request */
|
||||
RR_PROP_INFO *pInfo); /* Where to put the information */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Device_Read_Property_Local(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Write_Property_Local(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_Write_Property_Store_Callback_Set(
|
||||
write_property_function cb);
|
||||
BACNET_STACK_EXPORT
|
||||
int Device_Read_Property_Local(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Write_Property_Local(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_Write_Property_Store_Callback_Set(write_property_function cb);
|
||||
|
||||
#if defined(INTRINSIC_REPORTING)
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_local_reporting(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_local_reporting(void);
|
||||
#endif
|
||||
|
||||
/* Prototypes for Routing functionality in the Device Object.
|
||||
* Enable by defining BAC_ROUTING in config.h and including gw_device.c
|
||||
* in the build (lib/Makefile).
|
||||
*/
|
||||
BACNET_STACK_EXPORT
|
||||
void Routing_Device_Init(
|
||||
uint32_t first_object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Routing_Device_Init(uint32_t first_object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Add_Routed_Device(
|
||||
uint32_t Object_Instance,
|
||||
const BACNET_CHARACTER_STRING * Object_Name,
|
||||
const char *Description);
|
||||
BACNET_STACK_EXPORT
|
||||
DEVICE_OBJECT_DATA *Get_Routed_Device_Object(
|
||||
int idx);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_ADDRESS *Get_Routed_Device_Address(
|
||||
int idx);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_Address_Lookup(
|
||||
int idx,
|
||||
uint8_t address_len,
|
||||
const uint8_t * mac_adress);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_GetNext(
|
||||
const BACNET_ADDRESS * dest,
|
||||
const int *DNET_list,
|
||||
int *cursor);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_Is_Valid_Network(
|
||||
uint16_t dest_net,
|
||||
const int *DNET_list);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Routed_Device_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_Valid_Object_Instance_Number(
|
||||
uint32_t object_id);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Routed_Device_Object_Instance_Number(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_Set_Object_Instance_Number(
|
||||
uint32_t object_id);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_Set_Object_Name(
|
||||
uint8_t encoding,
|
||||
const char *value,
|
||||
size_t length);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_Set_Description(
|
||||
const char *name,
|
||||
size_t length);
|
||||
BACNET_STACK_EXPORT
|
||||
void Routed_Device_Inc_Database_Revision(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
int Routed_Device_Service_Approval(
|
||||
BACNET_SERVICES_SUPPORTED service,
|
||||
int service_argument,
|
||||
uint8_t * apdu_buff,
|
||||
uint8_t invoke_id);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Add_Routed_Device(
|
||||
uint32_t Object_Instance,
|
||||
const BACNET_CHARACTER_STRING *Object_Name,
|
||||
const char *Description);
|
||||
BACNET_STACK_EXPORT
|
||||
DEVICE_OBJECT_DATA *Get_Routed_Device_Object(int idx);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_ADDRESS *Get_Routed_Device_Address(int idx);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_Address_Lookup(
|
||||
int idx, uint8_t address_len, const uint8_t *mac_adress);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_GetNext(
|
||||
const BACNET_ADDRESS *dest, const int *DNET_list, int *cursor);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_Is_Valid_Network(uint16_t dest_net, const int *DNET_list);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Routed_Device_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_Valid_Object_Instance_Number(uint32_t object_id);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Routed_Device_Object_Instance_Number(void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_Set_Object_Instance_Number(uint32_t object_id);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_Set_Object_Name(
|
||||
uint8_t encoding, const char *value, size_t length);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_Set_Description(const char *name, size_t length);
|
||||
BACNET_STACK_EXPORT
|
||||
void Routed_Device_Inc_Database_Revision(void);
|
||||
BACNET_STACK_EXPORT
|
||||
int Routed_Device_Service_Approval(
|
||||
BACNET_SERVICES_SUPPORTED service,
|
||||
int service_argument,
|
||||
uint8_t *apdu_buff,
|
||||
uint8_t invoke_id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@@ -571,11 +461,13 @@ extern "C" {
|
||||
* - The interface between the implemented Objects and the BAC-stack services,
|
||||
* specifically the handlers, which are mediated through function calls to
|
||||
* the Device object.
|
||||
*//** @defgroup ObjHelpers Object Helper Functions
|
||||
*/
|
||||
/** @defgroup ObjHelpers Object Helper Functions
|
||||
* @ingroup ObjFrmwk
|
||||
* This section describes the function templates for the helper functions that
|
||||
* provide common object support.
|
||||
*//** @defgroup ObjIntf Handler-to-Object Interface Functions
|
||||
*/
|
||||
/** @defgroup ObjIntf Handler-to-Object Interface Functions
|
||||
* @ingroup ObjFrmwk
|
||||
* This section describes the fairly limited set of functions that link the
|
||||
* BAC-stack handlers to the BACnet Object instances. All of these calls are
|
||||
@@ -584,8 +476,8 @@ extern "C" {
|
||||
* Most of these calls have a common operation:
|
||||
* -# Call Device_Objects_Find_Functions( for the desired Object_Type )
|
||||
* - Gets a pointer to the object_functions for this Type of Object.
|
||||
* -# Call the Object's Object_Valid_Instance( for the desired object_instance )
|
||||
* to make sure there is such an instance.
|
||||
* -# Call the Object's Object_Valid_Instance( for the desired object_instance
|
||||
* ) to make sure there is such an instance.
|
||||
* -# Call the Object helper function needed by the handler,
|
||||
* eg Object_Read_Property() for the RP handler.
|
||||
*
|
||||
|
||||
@@ -88,7 +88,8 @@ uint16_t iCurrent_Device_Idx = 0;
|
||||
* @return The index of this instance in the Devices[] array, or UINT16_MAX if
|
||||
* there isn't enough room to add this Device.
|
||||
*/
|
||||
uint16_t Add_Routed_Device(uint32_t Object_Instance,
|
||||
uint16_t Add_Routed_Device(
|
||||
uint32_t Object_Instance,
|
||||
const BACNET_CHARACTER_STRING *sObject_Name,
|
||||
const char *sDescription)
|
||||
{
|
||||
@@ -100,8 +101,9 @@ uint16_t Add_Routed_Device(uint32_t Object_Instance,
|
||||
pDev->bacObj.mObject_Type = OBJECT_DEVICE;
|
||||
pDev->bacObj.Object_Instance_Number = Object_Instance;
|
||||
if (sObject_Name != NULL) {
|
||||
Routed_Device_Set_Object_Name(sObject_Name->encoding,
|
||||
sObject_Name->value, sObject_Name->length);
|
||||
Routed_Device_Set_Object_Name(
|
||||
sObject_Name->encoding, sObject_Name->value,
|
||||
sObject_Name->length);
|
||||
} else {
|
||||
Routed_Device_Set_Object_Name(
|
||||
CHARACTER_UTF8, "No Name", strlen("No Name"));
|
||||
@@ -170,7 +172,8 @@ BACNET_ADDRESS *Get_Routed_Device_Address(int idx)
|
||||
void routed_get_my_address(BACNET_ADDRESS *my_address)
|
||||
{
|
||||
if (my_address) {
|
||||
memcpy(my_address, &Devices[iCurrent_Device_Idx].bacDevAddr,
|
||||
memcpy(
|
||||
my_address, &Devices[iCurrent_Device_Idx].bacDevAddr,
|
||||
sizeof(BACNET_ADDRESS));
|
||||
}
|
||||
}
|
||||
@@ -590,7 +593,8 @@ void Routed_Device_Inc_Database_Revision(void)
|
||||
* just 1 if no apdu_buff was supplied and service is not supported,
|
||||
* else 0 if service is approved for the current device.
|
||||
*/
|
||||
int Routed_Device_Service_Approval(BACNET_SERVICES_SUPPORTED service,
|
||||
int Routed_Device_Service_Approval(
|
||||
BACNET_SERVICES_SUPPORTED service,
|
||||
int service_argument,
|
||||
uint8_t *apdu_buff,
|
||||
uint8_t invoke_id)
|
||||
@@ -603,7 +607,8 @@ int Routed_Device_Service_Approval(BACNET_SERVICES_SUPPORTED service,
|
||||
/* If not the gateway device, we don't support RD */
|
||||
if (iCurrent_Device_Idx > 0) {
|
||||
if (apdu_buff != NULL) {
|
||||
len = reject_encode_apdu(apdu_buff, invoke_id,
|
||||
len = reject_encode_apdu(
|
||||
apdu_buff, invoke_id,
|
||||
REJECT_REASON_UNRECOGNIZED_SERVICE);
|
||||
} else {
|
||||
len = 1; /* Non-zero return */
|
||||
@@ -614,7 +619,8 @@ int Routed_Device_Service_Approval(BACNET_SERVICES_SUPPORTED service,
|
||||
/* If not the gateway device, we don't support DCC */
|
||||
if (iCurrent_Device_Idx > 0) {
|
||||
if (apdu_buff != NULL) {
|
||||
len = reject_encode_apdu(apdu_buff, invoke_id,
|
||||
len = reject_encode_apdu(
|
||||
apdu_buff, invoke_id,
|
||||
REJECT_REASON_UNRECOGNIZED_SERVICE);
|
||||
} else {
|
||||
len = 1; /* Non-zero return */
|
||||
|
||||
@@ -34,7 +34,6 @@ static OS_Keylist Object_List = NULL;
|
||||
/* common object type */
|
||||
static const BACNET_OBJECT_TYPE Object_Type = OBJECT_INTEGER_VALUE;
|
||||
|
||||
|
||||
struct integer_object {
|
||||
bool Out_Of_Service : 1;
|
||||
bool Changed : 1;
|
||||
@@ -49,13 +48,16 @@ struct integer_object {
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Integer_Value_Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_PRESENT_VALUE, PROP_STATUS_FLAGS,
|
||||
PROP_UNITS, -1 };
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_UNITS,
|
||||
-1 };
|
||||
|
||||
static const int Integer_Value_Properties_Optional[] = { PROP_OUT_OF_SERVICE,
|
||||
PROP_DESCRIPTION,
|
||||
PROP_COV_INCREMENT,
|
||||
-1 };
|
||||
static const int Integer_Value_Properties_Optional[] = {
|
||||
PROP_OUT_OF_SERVICE, PROP_DESCRIPTION, PROP_COV_INCREMENT, -1
|
||||
};
|
||||
|
||||
static const int Integer_Value_Properties_Proprietary[] = { -1 };
|
||||
|
||||
@@ -186,7 +188,7 @@ Integer_Value_COV_Detect(struct integer_object *pObject, int32_t value)
|
||||
if (pObject) {
|
||||
int32_t prior_value = pObject->Prior_Value;
|
||||
uint32_t cov_increment = pObject->COV_Increment;
|
||||
uint32_t cov_delta = (uint32_t) abs(prior_value - value);
|
||||
uint32_t cov_delta = (uint32_t)abs(prior_value - value);
|
||||
|
||||
if (cov_delta >= cov_increment) {
|
||||
pObject->Changed = true;
|
||||
@@ -209,7 +211,7 @@ bool Integer_Value_Present_Value_Set(
|
||||
bool status = false;
|
||||
struct integer_object *pObject = Integer_Value_Object(object_instance);
|
||||
|
||||
(void) priority;
|
||||
(void)priority;
|
||||
|
||||
if (pObject) {
|
||||
Integer_Value_COV_Detect(pObject, value);
|
||||
@@ -259,8 +261,7 @@ bool Integer_Value_Object_Name(
|
||||
* @param new_name - holds the object-name to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Integer_Value_Name_Set(uint32_t object_instance,
|
||||
const char *new_name)
|
||||
bool Integer_Value_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false;
|
||||
struct integer_object *pObject;
|
||||
@@ -311,8 +312,8 @@ bool Integer_Value_Description(
|
||||
pObject = Integer_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
if (pObject->Description) {
|
||||
status = characterstring_init_ansi(description,
|
||||
pObject->Description);
|
||||
status =
|
||||
characterstring_init_ansi(description, pObject->Description);
|
||||
} else {
|
||||
status = characterstring_init_ansi(description, "");
|
||||
}
|
||||
@@ -327,8 +328,8 @@ bool Integer_Value_Description(
|
||||
* @param new_name - holds the description to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Integer_Value_Description_Set(uint32_t object_instance,
|
||||
const char *new_name)
|
||||
bool Integer_Value_Description_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct integer_object *pObject;
|
||||
@@ -478,8 +479,7 @@ int Integer_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
encode_application_character_string(&apdu[0], &char_string);
|
||||
break;
|
||||
case PROP_OBJECT_TYPE:
|
||||
apdu_len =
|
||||
encode_application_enumerated(&apdu[0], Object_Type);
|
||||
apdu_len = encode_application_enumerated(&apdu[0], Object_Type);
|
||||
break;
|
||||
case PROP_DESCRIPTION:
|
||||
if (Integer_Value_Description(
|
||||
@@ -512,8 +512,8 @@ int Integer_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu_len = encode_application_enumerated(&apdu[0], units);
|
||||
break;
|
||||
case PROP_COV_INCREMENT:
|
||||
apdu_len =
|
||||
encode_application_unsigned(&apdu[0], Integer_Value_COV_Increment(rpdata->object_instance));
|
||||
apdu_len = encode_application_unsigned(
|
||||
&apdu[0], Integer_Value_COV_Increment(rpdata->object_instance));
|
||||
break;
|
||||
default:
|
||||
rpdata->error_class = ERROR_CLASS_PROPERTY;
|
||||
@@ -571,8 +571,9 @@ bool Integer_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_SIGNED_INT);
|
||||
if (status) {
|
||||
Integer_Value_Present_Value_Set(wp_data->object_instance,
|
||||
value.type.Signed_Int, wp_data->priority);
|
||||
Integer_Value_Present_Value_Set(
|
||||
wp_data->object_instance, value.type.Signed_Int,
|
||||
wp_data->priority);
|
||||
}
|
||||
break;
|
||||
case PROP_COV_INCREMENT:
|
||||
@@ -604,7 +605,6 @@ bool Integer_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
wp_data->error_code = ERROR_CODE_UNKNOWN_PROPERTY;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return status;
|
||||
@@ -678,8 +678,9 @@ bool Integer_Value_Encode_Value_List(
|
||||
const bool fault = false;
|
||||
const bool overridden = false;
|
||||
|
||||
status = cov_value_list_encode_signed_int(value_list, present_value,
|
||||
in_alarm, fault, overridden, out_of_service);
|
||||
status = cov_value_list_encode_signed_int(
|
||||
value_list, present_value, in_alarm, fault, overridden,
|
||||
out_of_service);
|
||||
}
|
||||
|
||||
return status;
|
||||
@@ -734,7 +735,7 @@ uint32_t Integer_Value_Create(uint32_t object_instance)
|
||||
pObject->Description = NULL;
|
||||
pObject->COV_Increment = 1;
|
||||
pObject->Present_Value = 0;
|
||||
pObject->Prior_Value = 0;
|
||||
pObject->Prior_Value = 0;
|
||||
pObject->Units = UNITS_PERCENT;
|
||||
pObject->Out_Of_Service = false;
|
||||
pObject->Changed = false;
|
||||
@@ -756,7 +757,8 @@ uint32_t Integer_Value_Create(uint32_t object_instance)
|
||||
bool Integer_Value_Delete(uint32_t object_instance)
|
||||
{
|
||||
bool status = false;
|
||||
struct integer_object *pObject = Keylist_Data_Delete(Object_List, object_instance);
|
||||
struct integer_object *pObject =
|
||||
Keylist_Data_Delete(Object_List, object_instance);
|
||||
|
||||
if (pObject) {
|
||||
free(pObject);
|
||||
|
||||
@@ -20,115 +20,79 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Integer_Value_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Integer_Value_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Integer_Value_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Integer_Value_Instance_To_Index(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Integer_Value_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Integer_Value_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Integer_Value_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Integer_Value_Instance_To_Index(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Name_Set(
|
||||
uint32_t object_instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Integer_Value_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Integer_Value_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Integer_Value_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
int Integer_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
int32_t value,
|
||||
uint8_t priority);
|
||||
BACNET_STACK_EXPORT
|
||||
int32_t Integer_Value_Present_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Present_Value_Set(
|
||||
uint32_t object_instance, int32_t value, uint8_t priority);
|
||||
BACNET_STACK_EXPORT
|
||||
int32_t Integer_Value_Present_Value(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Change_Of_Value(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Integer_Value_Change_Of_Value_Clear(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Encode_Value_List(
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Integer_Value_COV_Increment(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Integer_Value_COV_Increment_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Integer_Value_Change_Of_Value_Clear(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Encode_Value_List(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Integer_Value_COV_Increment(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Integer_Value_COV_Increment_Set(uint32_t object_instance, uint32_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Description(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING *description);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Description_Set(
|
||||
uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
char *Integer_Value_Description_ANSI(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Description(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *description);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Description_Set(uint32_t instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
char *Integer_Value_Description_ANSI(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Integer_Value_Units(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Units_Set(
|
||||
uint32_t instance,
|
||||
uint16_t unit);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Integer_Value_Units(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Units_Set(uint32_t instance, uint16_t unit);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Out_Of_Service(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Integer_Value_Out_Of_Service_Set(
|
||||
uint32_t instance,
|
||||
bool oos_flag);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Integer_Value_Out_Of_Service_Set(uint32_t instance, bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Integer_Value_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Integer_Value_Init(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Integer_Value_Create(
|
||||
uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Delete(
|
||||
uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Integer_Value_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Integer_Value_Create(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Delete(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Integer_Value_Cleanup(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -359,8 +359,8 @@ static float Requested_Shed_Level_Value(struct object_data *pObject)
|
||||
* @param dest - destination data
|
||||
* @param src - source data
|
||||
*/
|
||||
static void Shed_Level_Copy(
|
||||
BACNET_SHED_LEVEL *dest, const BACNET_SHED_LEVEL *src)
|
||||
static void
|
||||
Shed_Level_Copy(BACNET_SHED_LEVEL *dest, const BACNET_SHED_LEVEL *src)
|
||||
{
|
||||
if (dest && src) {
|
||||
dest->type = src->type;
|
||||
@@ -446,7 +446,8 @@ static bool Able_To_Meet_Shed_Request(struct object_data *pObject)
|
||||
* @param object_index - object index in the list
|
||||
* @param bdatetime - current date and time
|
||||
*/
|
||||
void Load_Control_State_Machine(int object_index, const BACNET_DATE_TIME *bdatetime)
|
||||
void Load_Control_State_Machine(
|
||||
int object_index, const BACNET_DATE_TIME *bdatetime)
|
||||
{
|
||||
int diff = 0; /* used for datetime comparison */
|
||||
float amount;
|
||||
@@ -909,8 +910,8 @@ static int Load_Control_Shed_Level_Descriptions_Encode(
|
||||
* @param value [in] The value to encode
|
||||
* @return The length of the apdu encoded
|
||||
*/
|
||||
static int BACnet_Shed_Level_Encode(
|
||||
uint8_t *apdu, const BACNET_SHED_LEVEL *value)
|
||||
static int
|
||||
BACnet_Shed_Level_Encode(uint8_t *apdu, const BACNET_SHED_LEVEL *value)
|
||||
{
|
||||
int apdu_len = 0;
|
||||
|
||||
|
||||
@@ -158,7 +158,8 @@ bool Load_Control_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
/* functions used for unit testing */
|
||||
BACNET_STACK_EXPORT
|
||||
void Load_Control_State_Machine(int object_index, const BACNET_DATE_TIME *bdatetime);
|
||||
void Load_Control_State_Machine(
|
||||
int object_index, const BACNET_DATE_TIME *bdatetime);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -197,8 +197,7 @@ unsigned Lighting_Output_Instance_To_Index(uint32_t object_instance)
|
||||
* 0 to N for individual array members
|
||||
* @return the priority-array active status for the specific priority
|
||||
*/
|
||||
static bool
|
||||
Priority_Array_Active(
|
||||
static bool Priority_Array_Active(
|
||||
const struct object_data *pObject, BACNET_ARRAY_INDEX priority)
|
||||
{
|
||||
bool active = false;
|
||||
@@ -219,8 +218,7 @@ Priority_Array_Active(
|
||||
* 0 to N for individual array members
|
||||
* @return The priority-array value for the specific priority
|
||||
*/
|
||||
static float
|
||||
Priority_Array_Value(
|
||||
static float Priority_Array_Value(
|
||||
const struct object_data *pObject, BACNET_ARRAY_INDEX priority)
|
||||
{
|
||||
float real_value = 0.0;
|
||||
@@ -536,9 +534,11 @@ Lighting_Command_Warn_Relinquish(struct object_data *pObject, unsigned priority)
|
||||
* @param value [in] BACnet lighting value
|
||||
* @param fade_time [in] BACnet lighting fade time
|
||||
*/
|
||||
static void
|
||||
Lighting_Command_Fade_To(struct object_data *pObject,
|
||||
unsigned priority, float value, uint32_t fade_time)
|
||||
static void Lighting_Command_Fade_To(
|
||||
struct object_data *pObject,
|
||||
unsigned priority,
|
||||
float value,
|
||||
uint32_t fade_time)
|
||||
{
|
||||
unsigned current_priority;
|
||||
|
||||
@@ -562,9 +562,11 @@ Lighting_Command_Fade_To(struct object_data *pObject,
|
||||
* @param value [in] BACnet lighting value
|
||||
* @param ramp_rate [in] BACnet lighting ramp rate
|
||||
*/
|
||||
static void
|
||||
Lighting_Command_Ramp_To(struct object_data *pObject,
|
||||
unsigned priority, float value, float ramp_rate)
|
||||
static void Lighting_Command_Ramp_To(
|
||||
struct object_data *pObject,
|
||||
unsigned priority,
|
||||
float value,
|
||||
float ramp_rate)
|
||||
{
|
||||
unsigned current_priority;
|
||||
|
||||
@@ -994,8 +996,7 @@ static bool Lighting_Output_Lighting_Command_Write(
|
||||
*error_code = ERROR_CODE_WRITE_ACCESS_DENIED;
|
||||
return status;
|
||||
}
|
||||
if ((priority < BACNET_MIN_PRIORITY) ||
|
||||
(priority > BACNET_MAX_PRIORITY)) {
|
||||
if ((priority < BACNET_MIN_PRIORITY) || (priority > BACNET_MAX_PRIORITY)) {
|
||||
*error_class = ERROR_CLASS_PROPERTY;
|
||||
*error_code = ERROR_CODE_VALUE_OUT_OF_RANGE;
|
||||
return status;
|
||||
@@ -1007,41 +1008,43 @@ static bool Lighting_Output_Lighting_Command_Write(
|
||||
}
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
debug_printf("LO[%u]: Lighting-Command@%u: %s\n",
|
||||
object_instance, priority,
|
||||
debug_printf(
|
||||
"LO[%u]: Lighting-Command@%u: %s\n", object_instance, priority,
|
||||
bactext_lighting_operation_name(value->operation));
|
||||
switch (value->operation) {
|
||||
case BACNET_LIGHTS_NONE:
|
||||
status = true;
|
||||
break;
|
||||
case BACNET_LIGHTS_FADE_TO:
|
||||
debug_printf("LO[%u]: Lighting-Command@%u Fade-To "
|
||||
debug_printf(
|
||||
"LO[%u]: Lighting-Command@%u Fade-To "
|
||||
"Target=%f Fade=%u\n",
|
||||
object_instance, priority,
|
||||
(double)value->target_level, value->fade_time);
|
||||
Lighting_Command_Fade_To(pObject, priority,
|
||||
value->target_level, value->fade_time);
|
||||
object_instance, priority, (double)value->target_level,
|
||||
value->fade_time);
|
||||
Lighting_Command_Fade_To(
|
||||
pObject, priority, value->target_level, value->fade_time);
|
||||
status = true;
|
||||
break;
|
||||
case BACNET_LIGHTS_RAMP_TO:
|
||||
debug_printf("LO[%u]: Lighting-Command@%u Ramp-To "
|
||||
debug_printf(
|
||||
"LO[%u]: Lighting-Command@%u Ramp-To "
|
||||
"Target=%f Ramp-Rate=%f\n",
|
||||
object_instance, priority,
|
||||
(double)value->target_level, (double)value->ramp_rate);
|
||||
Lighting_Command_Ramp_To(pObject, priority,
|
||||
value->target_level, value->ramp_rate);
|
||||
object_instance, priority, (double)value->target_level,
|
||||
(double)value->ramp_rate);
|
||||
Lighting_Command_Ramp_To(
|
||||
pObject, priority, value->target_level, value->ramp_rate);
|
||||
status = true;
|
||||
break;
|
||||
case BACNET_LIGHTS_STEP_UP:
|
||||
case BACNET_LIGHTS_STEP_DOWN:
|
||||
case BACNET_LIGHTS_STEP_ON:
|
||||
case BACNET_LIGHTS_STEP_OFF:
|
||||
debug_printf("LO[%u]: Lighting-Command@%u Step "
|
||||
debug_printf(
|
||||
"LO[%u]: Lighting-Command@%u Step "
|
||||
"Step-Increment=%f\n",
|
||||
object_instance, priority,
|
||||
(double)value->step_increment);
|
||||
Lighting_Command_Step(pObject,priority,
|
||||
value->operation,value->step_increment);
|
||||
object_instance, priority, (double)value->step_increment);
|
||||
Lighting_Command_Step(
|
||||
pObject, priority, value->operation, value->step_increment);
|
||||
status = true;
|
||||
break;
|
||||
case BACNET_LIGHTS_WARN:
|
||||
@@ -1544,8 +1547,7 @@ static bool Lighting_Output_Default_Step_Increment_Write(
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
(void)priority;
|
||||
if (isgreaterequal(value, 0.1f) &&
|
||||
islessequal(value, 100.0f)) {
|
||||
if (isgreaterequal(value, 0.1f) && islessequal(value, 100.0f)) {
|
||||
pObject->Default_Step_Increment = value;
|
||||
status = true;
|
||||
} else {
|
||||
@@ -2185,8 +2187,8 @@ bool Lighting_Output_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
if (status) {
|
||||
status = Lighting_Output_Lighting_Command_Write(
|
||||
wp_data->object_instance, &value.type.Lighting_Command,
|
||||
wp_data->priority,
|
||||
&wp_data->error_class, &wp_data->error_code);
|
||||
wp_data->priority, &wp_data->error_class,
|
||||
&wp_data->error_code);
|
||||
if (!status) {
|
||||
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||
wp_data->error_code = ERROR_CODE_VALUE_OUT_OF_RANGE;
|
||||
@@ -2324,10 +2326,10 @@ Lighting_Output_Fade_Handler(uint32_t object_instance, uint16_t milliseconds)
|
||||
Lighting_Output_Write_Present_Value_Callback(
|
||||
object_instance, old_value, pObject->Tracking_Value);
|
||||
} else {
|
||||
debug_printf("LO[%u] Fade Handler Operation=%s Value=%f\n",
|
||||
object_instance,
|
||||
debug_printf(
|
||||
"LO[%u] Fade Handler Operation=%s Value=%f\n", object_instance,
|
||||
bactext_lighting_operation_name(
|
||||
pObject->Lighting_Command.operation),
|
||||
pObject->Lighting_Command.operation),
|
||||
(double)pObject->Tracking_Value);
|
||||
}
|
||||
}
|
||||
@@ -2391,7 +2393,8 @@ Lighting_Output_Ramp_Handler(uint32_t object_instance, uint16_t milliseconds)
|
||||
pObject->Lighting_Command.operation = BACNET_LIGHTS_STOP;
|
||||
}
|
||||
} else if (isgreater(old_value, target_value)) {
|
||||
debug_printf("LO[%u] Ramp Handler Down steps=%f tracking=%f\n",
|
||||
debug_printf(
|
||||
"LO[%u] Ramp Handler Down steps=%f tracking=%f\n",
|
||||
object_instance, (double)steps, (double)old_value);
|
||||
if (isgreater(old_value, steps)) {
|
||||
step_value = old_value - steps;
|
||||
@@ -2403,7 +2406,8 @@ Lighting_Output_Ramp_Handler(uint32_t object_instance, uint16_t milliseconds)
|
||||
pObject->Lighting_Command.operation = BACNET_LIGHTS_STOP;
|
||||
}
|
||||
} else {
|
||||
debug_printf("LO[%u] Ramp Handler at target=%f tracking=%f\n",
|
||||
debug_printf(
|
||||
"LO[%u] Ramp Handler at target=%f tracking=%f\n",
|
||||
object_instance, (double)target_value, (double)old_value);
|
||||
/* stop ramping */
|
||||
step_value = target_value;
|
||||
@@ -2427,10 +2431,10 @@ Lighting_Output_Ramp_Handler(uint32_t object_instance, uint16_t milliseconds)
|
||||
Lighting_Output_Write_Present_Value_Callback(
|
||||
object_instance, old_value, pObject->Tracking_Value);
|
||||
} else {
|
||||
debug_printf("LO[%u] Ramp Handler Operation=%s Value=%f\n",
|
||||
object_instance,
|
||||
debug_printf(
|
||||
"LO[%u] Ramp Handler Operation=%s Value=%f\n", object_instance,
|
||||
bactext_lighting_operation_name(
|
||||
pObject->Lighting_Command.operation),
|
||||
pObject->Lighting_Command.operation),
|
||||
(double)pObject->Tracking_Value);
|
||||
}
|
||||
}
|
||||
@@ -2475,10 +2479,11 @@ static void Lighting_Output_Step_Up_Handler(uint32_t object_instance)
|
||||
Lighting_Output_Write_Present_Value_Callback(
|
||||
object_instance, old_value, pObject->Tracking_Value);
|
||||
} else {
|
||||
debug_printf("LO[%u] Step Up Handler Operation=%s Value=%f\n",
|
||||
debug_printf(
|
||||
"LO[%u] Step Up Handler Operation=%s Value=%f\n",
|
||||
object_instance,
|
||||
bactext_lighting_operation_name(
|
||||
pObject->Lighting_Command.operation),
|
||||
pObject->Lighting_Command.operation),
|
||||
(double)pObject->Tracking_Value);
|
||||
}
|
||||
}
|
||||
@@ -2526,10 +2531,10 @@ static void Lighting_Output_Step_Down_Handler(uint32_t object_instance)
|
||||
Lighting_Output_Write_Present_Value_Callback(
|
||||
object_instance, old_value, pObject->Tracking_Value);
|
||||
} else {
|
||||
debug_printf("LO[%u] Step Down Handler Operation=%s Value=%f\n",
|
||||
object_instance,
|
||||
debug_printf(
|
||||
"LO[%u] Step Down Handler Operation=%s Value=%f\n", object_instance,
|
||||
bactext_lighting_operation_name(
|
||||
pObject->Lighting_Command.operation),
|
||||
pObject->Lighting_Command.operation),
|
||||
(double)pObject->Tracking_Value);
|
||||
}
|
||||
}
|
||||
@@ -2572,10 +2577,10 @@ static void Lighting_Output_Step_On_Handler(uint32_t object_instance)
|
||||
Lighting_Output_Write_Present_Value_Callback(
|
||||
object_instance, old_value, pObject->Tracking_Value);
|
||||
} else {
|
||||
debug_printf("LO[%u] Step On Handler Operation=%s Value=%f\n",
|
||||
object_instance,
|
||||
debug_printf(
|
||||
"LO[%u] Step On Handler Operation=%s Value=%f\n", object_instance,
|
||||
bactext_lighting_operation_name(
|
||||
pObject->Lighting_Command.operation),
|
||||
pObject->Lighting_Command.operation),
|
||||
(double)pObject->Tracking_Value);
|
||||
}
|
||||
}
|
||||
@@ -2623,10 +2628,10 @@ static void Lighting_Output_Step_Off_Handler(uint32_t object_instance)
|
||||
Lighting_Output_Write_Present_Value_Callback(
|
||||
object_instance, old_value, pObject->Tracking_Value);
|
||||
} else {
|
||||
debug_printf("LO[%u] Step Off Handler Operation=%s Value=%f\n",
|
||||
object_instance,
|
||||
debug_printf(
|
||||
"LO[%u] Step Off Handler Operation=%s Value=%f\n", object_instance,
|
||||
bactext_lighting_operation_name(
|
||||
pObject->Lighting_Command.operation),
|
||||
pObject->Lighting_Command.operation),
|
||||
(double)pObject->Tracking_Value);
|
||||
}
|
||||
}
|
||||
|
||||
+140
-203
@@ -29,232 +29,169 @@ typedef void (*lighting_output_write_present_value_callback)(
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Lighting_Output_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Lighting_Output_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Lighting_Output_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Lighting_Output_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Lighting_Output_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Lighting_Output_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Lighting_Output_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Lighting_Output_Instance_To_Index(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Lighting_Output_Present_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Lighting_Output_Present_Value_Priority(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
float value,
|
||||
unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Present_Value_Relinquish(
|
||||
uint32_t object_instance,
|
||||
unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
float Lighting_Output_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Lighting_Output_Present_Value_Priority(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Present_Value_Set(
|
||||
uint32_t object_instance, float value, unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Present_Value_Relinquish(
|
||||
uint32_t object_instance, unsigned priority);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Lighting_Output_Relinquish_Default(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Relinquish_Default_Set(
|
||||
uint32_t object_instance,
|
||||
float value);
|
||||
BACNET_STACK_EXPORT
|
||||
float Lighting_Output_Relinquish_Default(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Relinquish_Default_Set(
|
||||
uint32_t object_instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Change_Of_Value(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Lighting_Output_Change_Of_Value_Clear(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Encode_Value_List(
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
float Lighting_Output_COV_Increment(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Lighting_Output_COV_Increment_Set(
|
||||
uint32_t instance,
|
||||
float value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Lighting_Output_Change_Of_Value_Clear(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Encode_Value_List(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
float Lighting_Output_COV_Increment(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Lighting_Output_COV_Increment_Set(uint32_t instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Name_Set(
|
||||
uint32_t object_instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Lighting_Output_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Lighting_Output_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Lighting_Output_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Description_Set(
|
||||
uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Lighting_Output_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Description_Set(uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Out_Of_Service(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Lighting_Output_Out_Of_Service_Set(
|
||||
uint32_t instance,
|
||||
bool oos_flag);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Lighting_Output_Out_Of_Service_Set(uint32_t instance, bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Lighting_Command_Set(
|
||||
uint32_t object_instance,
|
||||
const BACNET_LIGHTING_COMMAND *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Lighting_Command(
|
||||
uint32_t object_instance,
|
||||
BACNET_LIGHTING_COMMAND *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Lighting_Command_Set(
|
||||
uint32_t object_instance, const BACNET_LIGHTING_COMMAND *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Lighting_Command(
|
||||
uint32_t object_instance, BACNET_LIGHTING_COMMAND *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_LIGHTING_IN_PROGRESS Lighting_Output_In_Progress(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_In_Progress_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_LIGHTING_IN_PROGRESS in_progress);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_LIGHTING_IN_PROGRESS
|
||||
Lighting_Output_In_Progress(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_In_Progress_Set(
|
||||
uint32_t object_instance, BACNET_LIGHTING_IN_PROGRESS in_progress);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Lighting_Output_Tracking_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Tracking_Value_Set(
|
||||
uint32_t object_instance,
|
||||
float value);
|
||||
BACNET_STACK_EXPORT
|
||||
float Lighting_Output_Tracking_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Tracking_Value_Set(uint32_t object_instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Blink_Warn_Enable(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Blink_Warn_Enable_Set(
|
||||
uint32_t object_instance,
|
||||
bool enable);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Blink_Warn_Enable(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Blink_Warn_Enable_Set(
|
||||
uint32_t object_instance, bool enable);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Lighting_Output_Egress_Time(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Egress_Time_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t seconds);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Egress_Active(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Lighting_Output_Egress_Time(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Egress_Time_Set(
|
||||
uint32_t object_instance, uint32_t seconds);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Egress_Active(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Lighting_Output_Default_Fade_Time(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Default_Fade_Time_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t milliseconds);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Lighting_Output_Default_Fade_Time(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Default_Fade_Time_Set(
|
||||
uint32_t object_instance, uint32_t milliseconds);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Lighting_Output_Default_Ramp_Rate(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Default_Ramp_Rate_Set(
|
||||
uint32_t object_instance,
|
||||
float percent_per_second);
|
||||
BACNET_STACK_EXPORT
|
||||
float Lighting_Output_Default_Ramp_Rate(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Default_Ramp_Rate_Set(
|
||||
uint32_t object_instance, float percent_per_second);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Lighting_Output_Default_Step_Increment(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Default_Step_Increment_Set(
|
||||
uint32_t object_instance,
|
||||
float step_increment);
|
||||
BACNET_STACK_EXPORT
|
||||
float Lighting_Output_Default_Step_Increment(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Default_Step_Increment_Set(
|
||||
uint32_t object_instance, float step_increment);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_LIGHTING_TRANSITION Lighting_Output_Transition(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Transition_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_LIGHTING_TRANSITION value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_LIGHTING_TRANSITION Lighting_Output_Transition(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Transition_Set(
|
||||
uint32_t object_instance, BACNET_LIGHTING_TRANSITION value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Lighting_Output_Default_Priority(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Default_Priority_Set(
|
||||
uint32_t object_instance,
|
||||
unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Lighting_Output_Default_Priority(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Default_Priority_Set(
|
||||
uint32_t object_instance, unsigned priority);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Color_Override(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Color_Override_Set(
|
||||
uint32_t object_instance,
|
||||
bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Color_Override(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Color_Override_Set(uint32_t object_instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Color_Reference(
|
||||
uint32_t object_instance,
|
||||
BACNET_OBJECT_ID *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Color_Reference_Set(
|
||||
uint32_t object_instance,
|
||||
const BACNET_OBJECT_ID *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Color_Reference(
|
||||
uint32_t object_instance, BACNET_OBJECT_ID *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Color_Reference_Set(
|
||||
uint32_t object_instance, const BACNET_OBJECT_ID *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Override_Color_Reference(
|
||||
uint32_t object_instance,
|
||||
BACNET_OBJECT_ID *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Override_Color_Reference_Set(
|
||||
uint32_t object_instance,
|
||||
const BACNET_OBJECT_ID *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Override_Color_Reference(
|
||||
uint32_t object_instance, BACNET_OBJECT_ID *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Override_Color_Reference_Set(
|
||||
uint32_t object_instance, const BACNET_OBJECT_ID *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Lighting_Output_Timer(
|
||||
uint32_t object_instance,
|
||||
uint16_t milliseconds);
|
||||
BACNET_STACK_EXPORT
|
||||
void Lighting_Output_Timer(uint32_t object_instance, uint16_t milliseconds);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Lighting_Output_Write_Present_Value_Callback_Set(
|
||||
lighting_output_write_present_value_callback cb);
|
||||
BACNET_STACK_EXPORT
|
||||
void Lighting_Output_Write_Present_Value_Callback_Set(
|
||||
lighting_output_write_present_value_callback cb);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Lighting_Output_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Lighting_Output_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Lighting_Output_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Lighting_Output_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Lighting_Output_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Lighting_Output_Init(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Lighting_Output_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int Lighting_Output_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -38,10 +38,13 @@ static const BACNET_OBJECT_TYPE Object_Type = OBJECT_LIFE_SAFETY_POINT;
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Life_Safety_Point_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER, PROP_OBJECT_NAME, PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE, PROP_TRACKING_VALUE, PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE, PROP_OUT_OF_SERVICE, PROP_RELIABILITY, PROP_MODE,
|
||||
PROP_ACCEPTED_MODES, PROP_SILENCED, PROP_OPERATION_EXPECTED, -1
|
||||
PROP_OBJECT_IDENTIFIER, PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE, PROP_PRESENT_VALUE,
|
||||
PROP_TRACKING_VALUE, PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE, PROP_OUT_OF_SERVICE,
|
||||
PROP_RELIABILITY, PROP_MODE,
|
||||
PROP_ACCEPTED_MODES, PROP_SILENCED,
|
||||
PROP_OPERATION_EXPECTED, -1
|
||||
};
|
||||
|
||||
static const int Life_Safety_Point_Properties_Optional[] = { -1 };
|
||||
@@ -136,8 +139,8 @@ unsigned Life_Safety_Point_Instance_To_Index(uint32_t object_instance)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return present-value of the object
|
||||
*/
|
||||
BACNET_LIFE_SAFETY_STATE Life_Safety_Point_Present_Value(
|
||||
uint32_t object_instance)
|
||||
BACNET_LIFE_SAFETY_STATE
|
||||
Life_Safety_Point_Present_Value(uint32_t object_instance)
|
||||
{
|
||||
BACNET_LIFE_SAFETY_STATE value = LIFE_SAFETY_STATE_QUIET;
|
||||
struct object_data *pObject;
|
||||
@@ -194,7 +197,8 @@ bool Life_Safety_Point_Object_Name(
|
||||
status =
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(name_text, sizeof(name_text), "LIFE-SAFETY-POINT-%u",
|
||||
snprintf(
|
||||
name_text, sizeof(name_text), "LIFE-SAFETY-POINT-%u",
|
||||
object_instance);
|
||||
status = characterstring_init_ansi(object_name, name_text);
|
||||
}
|
||||
@@ -328,8 +332,8 @@ bool Life_Safety_Point_Mode_Set(
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return property value
|
||||
*/
|
||||
BACNET_LIFE_SAFETY_OPERATION Life_Safety_Point_Operation_Expected(
|
||||
uint32_t object_instance)
|
||||
BACNET_LIFE_SAFETY_OPERATION
|
||||
Life_Safety_Point_Operation_Expected(uint32_t object_instance)
|
||||
{
|
||||
BACNET_LIFE_SAFETY_OPERATION value = LIFE_SAFETY_OP_NONE;
|
||||
struct object_data *pObject;
|
||||
@@ -545,7 +549,8 @@ int Life_Safety_Point_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu_len = encode_application_enumerated(&apdu[0], silenced_state);
|
||||
break;
|
||||
case PROP_OPERATION_EXPECTED:
|
||||
operation = Life_Safety_Point_Operation_Expected(rpdata->object_instance);
|
||||
operation =
|
||||
Life_Safety_Point_Operation_Expected(rpdata->object_instance);
|
||||
apdu_len = encode_application_enumerated(&apdu[0], operation);
|
||||
break;
|
||||
default:
|
||||
@@ -593,7 +598,8 @@ bool Life_Safety_Point_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_ENUMERATED);
|
||||
if (status) {
|
||||
if (value.type.Enumerated <= MAX_LIFE_SAFETY_MODE) {
|
||||
Life_Safety_Point_Mode_Set(wp_data->object_instance,
|
||||
Life_Safety_Point_Mode_Set(
|
||||
wp_data->object_instance,
|
||||
(BACNET_LIFE_SAFETY_MODE)value.type.Enumerated);
|
||||
} else {
|
||||
status = false;
|
||||
@@ -630,7 +636,8 @@ bool Life_Safety_Point_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_ENUMERATED);
|
||||
if (status) {
|
||||
if (value.type.Enumerated <= UINT16_MAX) {
|
||||
Life_Safety_Point_Silenced_Set(wp_data->object_instance,
|
||||
Life_Safety_Point_Silenced_Set(
|
||||
wp_data->object_instance,
|
||||
(BACNET_SILENCED_STATE)value.type.Enumerated);
|
||||
} else {
|
||||
status = false;
|
||||
|
||||
@@ -20,102 +20,75 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Point_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Life_Safety_Point_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Life_Safety_Point_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Life_Safety_Point_Instance_To_Index(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Point_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Life_Safety_Point_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Life_Safety_Point_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Life_Safety_Point_Instance_To_Index(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Name_Set(
|
||||
uint32_t object_instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Life_Safety_Point_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Life_Safety_Point_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_LIFE_SAFETY_STATE Life_Safety_Point_Present_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_LIFE_SAFETY_STATE present_value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_LIFE_SAFETY_STATE
|
||||
Life_Safety_Point_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Present_Value_Set(
|
||||
uint32_t object_instance, BACNET_LIFE_SAFETY_STATE present_value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_SILENCED_STATE Life_Safety_Point_Silenced(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Silenced_Set(
|
||||
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,
|
||||
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,
|
||||
BACNET_LIFE_SAFETY_OPERATION value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_SILENCED_STATE Life_Safety_Point_Silenced(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Silenced_Set(
|
||||
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, 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, BACNET_LIFE_SAFETY_OPERATION value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Out_Of_Service(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Point_Out_Of_Service_Set(
|
||||
uint32_t instance,
|
||||
bool oos_flag);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Point_Out_Of_Service_Set(uint32_t instance, bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Life_Safety_Point_Reliability(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Reliability_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Life_Safety_Point_Reliability(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Reliability_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Life_Safety_Point_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
int Life_Safety_Point_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Life_Safety_Point_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Point_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Point_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Life_Safety_Point_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Point_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Point_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -48,11 +48,14 @@ static const BACNET_OBJECT_TYPE Object_Type = OBJECT_LIFE_SAFETY_ZONE;
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Life_Safety_Zone_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER, PROP_OBJECT_NAME, PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE, PROP_TRACKING_VALUE, PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE, PROP_RELIABILITY, PROP_OUT_OF_SERVICE, PROP_MODE,
|
||||
PROP_ACCEPTED_MODES, PROP_SILENCED, PROP_OPERATION_EXPECTED,
|
||||
PROP_ZONE_MEMBERS, PROP_MAINTENANCE_REQUIRED, -1
|
||||
PROP_OBJECT_IDENTIFIER, PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE, PROP_PRESENT_VALUE,
|
||||
PROP_TRACKING_VALUE, PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE, PROP_RELIABILITY,
|
||||
PROP_OUT_OF_SERVICE, PROP_MODE,
|
||||
PROP_ACCEPTED_MODES, PROP_SILENCED,
|
||||
PROP_OPERATION_EXPECTED, PROP_ZONE_MEMBERS,
|
||||
PROP_MAINTENANCE_REQUIRED, -1
|
||||
};
|
||||
|
||||
static const int Life_Safety_Zone_Properties_Optional[] = { -1 };
|
||||
@@ -147,8 +150,8 @@ unsigned Life_Safety_Zone_Instance_To_Index(uint32_t object_instance)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return present-value of the object
|
||||
*/
|
||||
BACNET_LIFE_SAFETY_STATE Life_Safety_Zone_Present_Value(
|
||||
uint32_t object_instance)
|
||||
BACNET_LIFE_SAFETY_STATE
|
||||
Life_Safety_Zone_Present_Value(uint32_t object_instance)
|
||||
{
|
||||
BACNET_LIFE_SAFETY_STATE value = LIFE_SAFETY_STATE_QUIET;
|
||||
struct object_data *pObject;
|
||||
@@ -205,7 +208,8 @@ bool Life_Safety_Zone_Object_Name(
|
||||
status =
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(name_text, sizeof(name_text), "LIFE-SAFETY-ZONE-%u",
|
||||
snprintf(
|
||||
name_text, sizeof(name_text), "LIFE-SAFETY-ZONE-%u",
|
||||
object_instance);
|
||||
status = characterstring_init_ansi(object_name, name_text);
|
||||
}
|
||||
@@ -339,8 +343,8 @@ bool Life_Safety_Zone_Mode_Set(
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return property value
|
||||
*/
|
||||
BACNET_LIFE_SAFETY_OPERATION Life_Safety_Zone_Operation_Expected(
|
||||
uint32_t object_instance)
|
||||
BACNET_LIFE_SAFETY_OPERATION
|
||||
Life_Safety_Zone_Operation_Expected(uint32_t object_instance)
|
||||
{
|
||||
BACNET_LIFE_SAFETY_OPERATION value = LIFE_SAFETY_OP_NONE;
|
||||
struct object_data *pObject;
|
||||
@@ -525,16 +529,14 @@ bool Life_Safety_Zone_Members_Add(
|
||||
status = Keylist_Data_Add(
|
||||
pObject->Zone_Members, Keylist_Count(pObject->Zone_Members), entry);
|
||||
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Remove all members from the Zone Members list
|
||||
* @param object_instance - object-instance number of the object
|
||||
*/
|
||||
void Life_Safety_Zone_Members_Clear(
|
||||
uint32_t object_instance)
|
||||
*/
|
||||
void Life_Safety_Zone_Members_Clear(uint32_t object_instance)
|
||||
{
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -549,7 +551,7 @@ void Life_Safety_Zone_Members_Clear(
|
||||
* @param wp_data - BACNET_WRITE_PROPERTY_DATA data, including
|
||||
* requested data and space for the reply, or error response.
|
||||
* @return true if the list was written
|
||||
*/
|
||||
*/
|
||||
static bool Life_Safety_Zone_Members_Write(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
{
|
||||
int len = 0, apdu_len = 0, apdu_size = 0;
|
||||
@@ -599,13 +601,14 @@ bool Life_Safety_Zone_Maintenance_Required(uint32_t object_instance)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, sets the maintenance-required status
|
||||
* flag
|
||||
* @brief For a given object instance-number, sets the maintenance-required
|
||||
* status flag
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @param value - boolean property value
|
||||
* @return true if the property flag was set
|
||||
*/
|
||||
void Life_Safety_Zone_Maintenance_Required_Set(uint32_t object_instance, bool value)
|
||||
void Life_Safety_Zone_Maintenance_Required_Set(
|
||||
uint32_t object_instance, bool value)
|
||||
{
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -774,7 +777,8 @@ bool Life_Safety_Zone_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_ENUMERATED);
|
||||
if (status) {
|
||||
if (value.type.Enumerated <= MAX_LIFE_SAFETY_MODE) {
|
||||
Life_Safety_Zone_Mode_Set(wp_data->object_instance,
|
||||
Life_Safety_Zone_Mode_Set(
|
||||
wp_data->object_instance,
|
||||
(BACNET_LIFE_SAFETY_MODE)value.type.Enumerated);
|
||||
} else {
|
||||
status = false;
|
||||
@@ -788,7 +792,8 @@ bool Life_Safety_Zone_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_ENUMERATED);
|
||||
if (status) {
|
||||
if (value.type.Enumerated <= UINT16_MAX) {
|
||||
Life_Safety_Zone_Present_Value_Set(wp_data->object_instance,
|
||||
Life_Safety_Zone_Present_Value_Set(
|
||||
wp_data->object_instance,
|
||||
(BACNET_LIFE_SAFETY_STATE)value.type.Enumerated);
|
||||
} else {
|
||||
status = false;
|
||||
@@ -810,7 +815,8 @@ bool Life_Safety_Zone_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_ENUMERATED);
|
||||
if (status) {
|
||||
if (value.type.Enumerated <= UINT16_MAX) {
|
||||
Life_Safety_Zone_Silenced_Set(wp_data->object_instance,
|
||||
Life_Safety_Zone_Silenced_Set(
|
||||
wp_data->object_instance,
|
||||
(BACNET_SILENCED_STATE)value.type.Enumerated);
|
||||
} else {
|
||||
status = false;
|
||||
@@ -839,10 +845,10 @@ bool Life_Safety_Zone_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
break;
|
||||
default:
|
||||
if (property_lists_member(
|
||||
Life_Safety_Zone_Properties_Required,
|
||||
Life_Safety_Zone_Properties_Optional,
|
||||
Life_Safety_Zone_Properties_Proprietary,
|
||||
wp_data->object_property)) {
|
||||
Life_Safety_Zone_Properties_Required,
|
||||
Life_Safety_Zone_Properties_Optional,
|
||||
Life_Safety_Zone_Properties_Proprietary,
|
||||
wp_data->object_property)) {
|
||||
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||
wp_data->error_code = ERROR_CODE_WRITE_ACCESS_DENIED;
|
||||
} else {
|
||||
|
||||
+72
-102
@@ -20,118 +20,88 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Zone_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Life_Safety_Zone_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Life_Safety_Zone_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Life_Safety_Zone_Instance_To_Index(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Zone_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Life_Safety_Zone_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Life_Safety_Zone_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Life_Safety_Zone_Instance_To_Index(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Name_Set(
|
||||
uint32_t object_instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Life_Safety_Zone_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Life_Safety_Zone_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_LIFE_SAFETY_STATE Life_Safety_Zone_Present_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_LIFE_SAFETY_STATE present_value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_LIFE_SAFETY_STATE
|
||||
Life_Safety_Zone_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Present_Value_Set(
|
||||
uint32_t object_instance, BACNET_LIFE_SAFETY_STATE present_value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_SILENCED_STATE Life_Safety_Zone_Silenced(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Silenced_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_SILENCED_STATE value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_LIFE_SAFETY_MODE Life_Safety_Zone_Mode(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Mode_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_LIFE_SAFETY_MODE value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_LIFE_SAFETY_OPERATION Life_Safety_Zone_Operation_Expected(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Operation_Expected_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_LIFE_SAFETY_OPERATION value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_SILENCED_STATE Life_Safety_Zone_Silenced(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Silenced_Set(
|
||||
uint32_t object_instance, BACNET_SILENCED_STATE value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_LIFE_SAFETY_MODE Life_Safety_Zone_Mode(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Mode_Set(
|
||||
uint32_t object_instance, BACNET_LIFE_SAFETY_MODE value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_LIFE_SAFETY_OPERATION
|
||||
Life_Safety_Zone_Operation_Expected(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Operation_Expected_Set(
|
||||
uint32_t object_instance, BACNET_LIFE_SAFETY_OPERATION value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Out_Of_Service(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Zone_Out_Of_Service_Set(
|
||||
uint32_t instance,
|
||||
bool oos_flag);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Zone_Out_Of_Service_Set(uint32_t instance, bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Life_Safety_Zone_Reliability(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Reliability_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Life_Safety_Zone_Reliability(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Reliability_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Members_Add(
|
||||
uint32_t object_instance,
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *data);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Zone_Members_Clear(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Members_Add(
|
||||
uint32_t object_instance,
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *data);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Zone_Members_Clear(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Maintenance_Required(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Zone_Maintenance_Required_Set(
|
||||
uint32_t object_instance,
|
||||
bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Maintenance_Required(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Zone_Maintenance_Required_Set(
|
||||
uint32_t object_instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Life_Safety_Zone_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
int Life_Safety_Zone_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Life_Safety_Zone_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Zone_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Zone_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Life_Safety_Zone_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Zone_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Zone_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -42,15 +42,19 @@ static const BACNET_OBJECT_TYPE Object_Type = OBJECT_MULTI_STATE_INPUT;
|
||||
static multistate_input_write_present_value_callback
|
||||
Multistate_Input_Write_Present_Value_Callback;
|
||||
/* default state text when none is specified */
|
||||
static const char *Default_State_Text = "State 1\0" "State 2\0" "State 3\0" ;
|
||||
static const char *Default_State_Text = "State 1\0"
|
||||
"State 2\0"
|
||||
"State 3\0";
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
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_NUMBER_OF_STATES, -1 };
|
||||
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_NUMBER_OF_STATES, -1
|
||||
};
|
||||
|
||||
static const int Properties_Optional[] = { PROP_DESCRIPTION, PROP_STATE_TEXT,
|
||||
-1 };
|
||||
-1 };
|
||||
|
||||
static const int Properties_Proprietary[] = { -1 };
|
||||
|
||||
@@ -215,8 +219,8 @@ uint32_t Multistate_Input_Max_States(uint32_t object_instance)
|
||||
* @param state_index - state index number 1..N of the text requested
|
||||
* @return C string retrieved
|
||||
*/
|
||||
const char *Multistate_Input_State_Text(
|
||||
uint32_t object_instance, uint32_t state_index)
|
||||
const char *
|
||||
Multistate_Input_State_Text(uint32_t object_instance, uint32_t state_index)
|
||||
{
|
||||
const char *pName = NULL; /* return value */
|
||||
const struct object_data *pObject;
|
||||
@@ -224,8 +228,7 @@ const char *Multistate_Input_State_Text(
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if (state_index > 0) {
|
||||
pName = state_name_by_index(pObject->State_Text,
|
||||
state_index);
|
||||
pName = state_name_by_index(pObject->State_Text, state_index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,8 +257,7 @@ static int Multistate_Input_State_Text_Encode(
|
||||
pName = Multistate_Input_State_Text(object_instance, state_index);
|
||||
if (pName) {
|
||||
characterstring_init_ansi(&char_string, pName);
|
||||
apdu_len = encode_application_character_string(
|
||||
apdu, &char_string);
|
||||
apdu_len = encode_application_character_string(apdu, &char_string);
|
||||
}
|
||||
|
||||
return apdu_len;
|
||||
@@ -280,8 +282,7 @@ static int Multistate_Input_State_Text_Encode(
|
||||
* @return true if the state text was set
|
||||
*/
|
||||
bool Multistate_Input_State_Text_List_Set(
|
||||
uint32_t object_instance,
|
||||
const char *state_text_list)
|
||||
uint32_t object_instance, const char *state_text_list)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -365,7 +366,8 @@ bool Multistate_Input_Present_Value_Set(
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Multistate_Input_Present_Value_Write(
|
||||
uint32_t object_instance, uint32_t value,
|
||||
uint32_t object_instance,
|
||||
uint32_t value,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
BACNET_ERROR_CODE *error_code)
|
||||
{
|
||||
@@ -437,8 +439,8 @@ void Multistate_Input_Out_Of_Service_Set(uint32_t object_instance, bool value)
|
||||
|
||||
pObject = Multistate_Input_Object(object_instance);
|
||||
if (pObject) {
|
||||
pObject->Out_Of_Service = value;
|
||||
pObject->Change_Of_Value = true;
|
||||
pObject->Out_Of_Service = value;
|
||||
pObject->Change_Of_Value = true;
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -463,10 +465,11 @@ bool Multistate_Input_Object_Name(
|
||||
pObject = Multistate_Input_Object(object_instance);
|
||||
if (pObject) {
|
||||
if (pObject->Object_Name) {
|
||||
status = characterstring_init_ansi(object_name,
|
||||
pObject->Object_Name);
|
||||
status =
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(name_text, sizeof(name_text), "MULTI-STATE INPUT %lu",
|
||||
snprintf(
|
||||
name_text, sizeof(name_text), "MULTI-STATE INPUT %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, name_text);
|
||||
}
|
||||
@@ -682,9 +685,9 @@ bool Multistate_Input_Encode_Value_List(
|
||||
pObject = Multistate_Input_Object(object_instance);
|
||||
if (pObject) {
|
||||
fault = Multistate_Input_Object_Fault(pObject);
|
||||
status =
|
||||
cov_value_list_encode_unsigned(value_list, pObject->Present_Value,
|
||||
in_alarm, fault, overridden, pObject->Out_Of_Service);
|
||||
status = cov_value_list_encode_unsigned(
|
||||
value_list, pObject->Present_Value, in_alarm, fault, overridden,
|
||||
pObject->Out_Of_Service);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
@@ -725,8 +728,7 @@ int Multistate_Input_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
encode_application_character_string(&apdu[0], &char_string);
|
||||
break;
|
||||
case PROP_OBJECT_TYPE:
|
||||
apdu_len = encode_application_enumerated(
|
||||
&apdu[0], Object_Type);
|
||||
apdu_len = encode_application_enumerated(&apdu[0], Object_Type);
|
||||
break;
|
||||
case PROP_PRESENT_VALUE:
|
||||
present_value =
|
||||
@@ -745,7 +747,8 @@ int Multistate_Input_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu_len = encode_application_bitstring(&apdu[0], &bit_string);
|
||||
break;
|
||||
case PROP_RELIABILITY:
|
||||
apdu_len = encode_application_enumerated(&apdu[0],
|
||||
apdu_len = encode_application_enumerated(
|
||||
&apdu[0],
|
||||
Multistate_Input_Reliability(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_EVENT_STATE:
|
||||
@@ -758,14 +761,16 @@ int Multistate_Input_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu_len = encode_application_boolean(&apdu[0], state);
|
||||
break;
|
||||
case PROP_NUMBER_OF_STATES:
|
||||
apdu_len = encode_application_unsigned(&apdu[apdu_len],
|
||||
apdu_len = encode_application_unsigned(
|
||||
&apdu[apdu_len],
|
||||
Multistate_Input_Max_States(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_STATE_TEXT:
|
||||
max_states = Multistate_Input_Max_States(rpdata->object_instance);
|
||||
apdu_len = bacnet_array_encode(rpdata->object_instance,
|
||||
rpdata->array_index, Multistate_Input_State_Text_Encode,
|
||||
max_states, apdu, apdu_size);
|
||||
apdu_len = bacnet_array_encode(
|
||||
rpdata->object_instance, rpdata->array_index,
|
||||
Multistate_Input_State_Text_Encode, max_states, apdu,
|
||||
apdu_size);
|
||||
if (apdu_len == BACNET_STATUS_ABORT) {
|
||||
rpdata->error_code =
|
||||
ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED;
|
||||
@@ -775,7 +780,8 @@ int Multistate_Input_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
}
|
||||
break;
|
||||
case PROP_DESCRIPTION:
|
||||
characterstring_init_ansi(&char_string,
|
||||
characterstring_init_ansi(
|
||||
&char_string,
|
||||
Multistate_Input_Description(rpdata->object_instance));
|
||||
apdu_len =
|
||||
encode_application_character_string(&apdu[0], &char_string);
|
||||
@@ -832,10 +838,9 @@ bool Multistate_Input_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_UNSIGNED_INT);
|
||||
if (status) {
|
||||
status =
|
||||
Multistate_Input_Present_Value_Write(wp_data->object_instance,
|
||||
value.type.Enumerated,
|
||||
&wp_data->error_class, &wp_data->error_code);
|
||||
status = Multistate_Input_Present_Value_Write(
|
||||
wp_data->object_instance, value.type.Enumerated,
|
||||
&wp_data->error_class, &wp_data->error_code);
|
||||
}
|
||||
break;
|
||||
case PROP_OUT_OF_SERVICE:
|
||||
@@ -848,10 +853,8 @@ bool Multistate_Input_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
break;
|
||||
default:
|
||||
if (property_lists_member(
|
||||
Properties_Required,
|
||||
Properties_Optional,
|
||||
Properties_Proprietary,
|
||||
wp_data->object_property)) {
|
||||
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 {
|
||||
|
||||
@@ -24,137 +24,101 @@
|
||||
* @param value - multistate preset-value of the write
|
||||
*/
|
||||
typedef void (*multistate_input_write_present_value_callback)(
|
||||
uint32_t object_instance, uint32_t old_value,
|
||||
uint32_t value);
|
||||
uint32_t object_instance, uint32_t old_value, uint32_t value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Input_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Input_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Multistate_Input_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Input_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Multistate_Input_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Multistate_Input_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Input_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Multistate_Input_Instance_To_Index(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Multistate_Input_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
int Multistate_Input_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
/* optional API */
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
/* optional API */
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Name_Set(
|
||||
uint32_t object_instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Input_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Input_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Input_Present_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Input_Write_Present_Value_Callback_Set(
|
||||
multistate_input_write_present_value_callback cb);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Input_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Present_Value_Set(
|
||||
uint32_t object_instance, uint32_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Input_Write_Present_Value_Callback_Set(
|
||||
multistate_input_write_present_value_callback cb);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Change_Of_Value(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Input_Change_Of_Value_Clear(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Encode_Value_List(
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Input_Change_Of_Value_Clear(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Encode_Value_List(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Out_Of_Service(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Input_Out_Of_Service_Set(
|
||||
uint32_t object_instance,
|
||||
bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Out_Of_Service(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Input_Out_Of_Service_Set(uint32_t object_instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Input_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Description_Set(
|
||||
uint32_t object_instance,
|
||||
const char *text_string);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Input_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Description_Set(
|
||||
uint32_t object_instance, const char *text_string);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Multistate_Input_Reliability(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Reliability_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_RELIABILITY value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Multistate_Input_Reliability(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Reliability_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_State_Text_List_Set(
|
||||
uint32_t object_instance,
|
||||
const char *state_text_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_State_Text_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t state_index,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Max_States_Set(
|
||||
uint32_t instance,
|
||||
uint32_t max_states_requested);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Input_Max_States(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Input_State_Text(
|
||||
uint32_t object_instance,
|
||||
uint32_t state_index);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_State_Text_List_Set(
|
||||
uint32_t object_instance, const char *state_text_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_State_Text_Set(
|
||||
uint32_t object_instance, uint32_t state_index, char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Max_States_Set(
|
||||
uint32_t instance, uint32_t max_states_requested);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Input_Max_States(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *
|
||||
Multistate_Input_State_Text(uint32_t object_instance, uint32_t state_index);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Input_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Input_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Input_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Input_Cleanup(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Input_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Input_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -50,19 +50,27 @@ static const BACNET_OBJECT_TYPE Object_Type = OBJECT_MULTI_STATE_OUTPUT;
|
||||
static multistate_output_write_present_value_callback
|
||||
Multistate_Output_Write_Present_Value_Callback;
|
||||
/* default state text when none is specified */
|
||||
static const char *Default_State_Text = "State 1\0" "State 2\0" "State 3\0" ;
|
||||
static const char *Default_State_Text = "State 1\0"
|
||||
"State 2\0"
|
||||
"State 3\0";
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
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_NUMBER_OF_STATES,
|
||||
PROP_PRIORITY_ARRAY, PROP_RELINQUISH_DEFAULT,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
PROP_NUMBER_OF_STATES,
|
||||
PROP_PRIORITY_ARRAY,
|
||||
PROP_RELINQUISH_DEFAULT,
|
||||
#if (BACNET_PROTOCOL_REVISION >= 17)
|
||||
PROP_CURRENT_COMMAND_PRIORITY,
|
||||
PROP_CURRENT_COMMAND_PRIORITY,
|
||||
#endif
|
||||
-1 };
|
||||
-1 };
|
||||
|
||||
static const int Properties_Optional[] = { PROP_STATE_TEXT, PROP_DESCRIPTION,
|
||||
-1 };
|
||||
-1 };
|
||||
|
||||
static const int Properties_Proprietary[] = { -1 };
|
||||
|
||||
@@ -331,8 +339,8 @@ uint32_t Multistate_Output_Relinquish_Default(uint32_t object_instance)
|
||||
* @param value - floating point analog output relinquish-default value
|
||||
* @return true if values are within range and relinquish-default value is set.
|
||||
*/
|
||||
bool Multistate_Output_Relinquish_Default_Set(uint32_t object_instance,
|
||||
uint32_t value)
|
||||
bool Multistate_Output_Relinquish_Default_Set(
|
||||
uint32_t object_instance, uint32_t value)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -365,8 +373,8 @@ bool Multistate_Output_Present_Value_Set(
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
max_states = state_name_count(pObject->State_Text);
|
||||
if ((value >= 1) && (value <= max_states) &&
|
||||
(priority >= 1) && (priority <= BACNET_MAX_PRIORITY)) {
|
||||
if ((value >= 1) && (value <= max_states) && (priority >= 1) &&
|
||||
(priority <= BACNET_MAX_PRIORITY)) {
|
||||
old_value = Object_Present_Value(pObject);
|
||||
pObject->Relinquished[priority - 1] = false;
|
||||
pObject->Priority_Array[priority - 1] = value;
|
||||
@@ -423,7 +431,9 @@ bool Multistate_Output_Present_Value_Relinquish(
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Multistate_Output_Present_Value_Write(
|
||||
uint32_t object_instance, uint32_t value, uint8_t priority,
|
||||
uint32_t object_instance,
|
||||
uint32_t value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
BACNET_ERROR_CODE *error_code)
|
||||
{
|
||||
@@ -440,8 +450,8 @@ static bool Multistate_Output_Present_Value_Write(
|
||||
(value >= 1) && (value <= max_states)) {
|
||||
if (priority != 6) {
|
||||
old_value = Object_Present_Value(pObject);
|
||||
Multistate_Output_Present_Value_Set(object_instance, value,
|
||||
priority);
|
||||
Multistate_Output_Present_Value_Set(
|
||||
object_instance, value, priority);
|
||||
if (pObject->Out_Of_Service) {
|
||||
/* The physical point that the object represents
|
||||
is not in service. This means that changes to the
|
||||
@@ -480,7 +490,8 @@ static bool Multistate_Output_Present_Value_Write(
|
||||
* @return true if values are within range and write is requested
|
||||
*/
|
||||
static bool Multistate_Output_Present_Value_Relinquish_Write(
|
||||
uint32_t object_instance, uint8_t priority,
|
||||
uint32_t object_instance,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
BACNET_ERROR_CODE *error_code)
|
||||
{
|
||||
@@ -494,8 +505,8 @@ static bool Multistate_Output_Present_Value_Relinquish_Write(
|
||||
if ((priority >= 1) && (priority <= BACNET_MAX_PRIORITY)) {
|
||||
if (priority != 6) {
|
||||
old_value = Object_Present_Value(pObject);
|
||||
Multistate_Output_Present_Value_Relinquish(object_instance,
|
||||
priority);
|
||||
Multistate_Output_Present_Value_Relinquish(
|
||||
object_instance, priority);
|
||||
if (pObject->Out_Of_Service) {
|
||||
/* The physical point that the object represents
|
||||
is not in service. This means that changes to the
|
||||
@@ -580,10 +591,11 @@ bool Multistate_Output_Object_Name(
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if (pObject->Object_Name) {
|
||||
status = characterstring_init_ansi(object_name,
|
||||
pObject->Object_Name);
|
||||
status =
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(name_text, sizeof(name_text), "MULTI-STATE OUTPUT %lu",
|
||||
snprintf(
|
||||
name_text, sizeof(name_text), "MULTI-STATE OUTPUT %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, name_text);
|
||||
}
|
||||
@@ -638,8 +650,8 @@ const char *Multistate_Output_Name_ASCII(uint32_t object_instance)
|
||||
* @param state_index - state index number 1..N of the text requested
|
||||
* @return C string retrieved
|
||||
*/
|
||||
const char *Multistate_Output_State_Text(
|
||||
uint32_t object_instance, uint32_t state_index)
|
||||
const char *
|
||||
Multistate_Output_State_Text(uint32_t object_instance, uint32_t state_index)
|
||||
{
|
||||
const char *pName = NULL; /* return value */
|
||||
const struct object_data *pObject;
|
||||
@@ -647,8 +659,7 @@ const char *Multistate_Output_State_Text(
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if (state_index > 0) {
|
||||
pName = state_name_by_index(pObject->State_Text,
|
||||
state_index);
|
||||
pName = state_name_by_index(pObject->State_Text, state_index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -677,8 +688,7 @@ static int Multistate_Output_State_Text_Encode(
|
||||
pName = Multistate_Output_State_Text(object_instance, state_index);
|
||||
if (pName) {
|
||||
characterstring_init_ansi(&char_string, pName);
|
||||
apdu_len = encode_application_character_string(
|
||||
apdu, &char_string);
|
||||
apdu_len = encode_application_character_string(apdu, &char_string);
|
||||
}
|
||||
|
||||
return apdu_len;
|
||||
@@ -703,8 +713,7 @@ static int Multistate_Output_State_Text_Encode(
|
||||
* @return true if the state text was set
|
||||
*/
|
||||
bool Multistate_Output_State_Text_List_Set(
|
||||
uint32_t object_instance,
|
||||
const char *state_text_list)
|
||||
uint32_t object_instance, const char *state_text_list)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -888,9 +897,9 @@ bool Multistate_Output_Encode_Value_List(
|
||||
if (pObject) {
|
||||
fault = Multistate_Output_Object_Fault(pObject);
|
||||
present_value = Object_Present_Value(pObject);
|
||||
status =
|
||||
cov_value_list_encode_unsigned(value_list, present_value,
|
||||
in_alarm, fault, overridden, pObject->Out_Of_Service);
|
||||
status = cov_value_list_encode_unsigned(
|
||||
value_list, present_value, in_alarm, fault, overridden,
|
||||
pObject->Out_Of_Service);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
@@ -927,7 +936,8 @@ int Multistate_Output_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
&apdu[0], Object_Type, rpdata->object_instance);
|
||||
break;
|
||||
case PROP_OBJECT_NAME:
|
||||
Multistate_Output_Object_Name(rpdata->object_instance, &char_string);
|
||||
Multistate_Output_Object_Name(
|
||||
rpdata->object_instance, &char_string);
|
||||
apdu_len =
|
||||
encode_application_character_string(&apdu[0], &char_string);
|
||||
break;
|
||||
@@ -951,7 +961,8 @@ int Multistate_Output_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu_len = encode_application_bitstring(&apdu[0], &bit_string);
|
||||
break;
|
||||
case PROP_RELIABILITY:
|
||||
apdu_len = encode_application_enumerated(&apdu[0],
|
||||
apdu_len = encode_application_enumerated(
|
||||
&apdu[0],
|
||||
Multistate_Output_Reliability(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_EVENT_STATE:
|
||||
@@ -964,13 +975,15 @@ int Multistate_Output_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu_len = encode_application_boolean(&apdu[0], state);
|
||||
break;
|
||||
case PROP_NUMBER_OF_STATES:
|
||||
apdu_len = encode_application_unsigned(&apdu[apdu_len],
|
||||
apdu_len = encode_application_unsigned(
|
||||
&apdu[apdu_len],
|
||||
Multistate_Output_Max_States(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_PRIORITY_ARRAY:
|
||||
apdu_len = bacnet_array_encode(rpdata->object_instance,
|
||||
rpdata->array_index, Multistate_Output_Priority_Array_Encode,
|
||||
BACNET_MAX_PRIORITY, apdu, apdu_size);
|
||||
apdu_len = bacnet_array_encode(
|
||||
rpdata->object_instance, rpdata->array_index,
|
||||
Multistate_Output_Priority_Array_Encode, BACNET_MAX_PRIORITY,
|
||||
apdu, apdu_size);
|
||||
if (apdu_len == BACNET_STATUS_ABORT) {
|
||||
rpdata->error_code =
|
||||
ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED;
|
||||
@@ -986,9 +999,10 @@ int Multistate_Output_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
break;
|
||||
case PROP_STATE_TEXT:
|
||||
max_states = Multistate_Output_Max_States(rpdata->object_instance);
|
||||
apdu_len = bacnet_array_encode(rpdata->object_instance,
|
||||
rpdata->array_index, Multistate_Output_State_Text_Encode,
|
||||
max_states, apdu, apdu_size);
|
||||
apdu_len = bacnet_array_encode(
|
||||
rpdata->object_instance, rpdata->array_index,
|
||||
Multistate_Output_State_Text_Encode, max_states, apdu,
|
||||
apdu_size);
|
||||
if (apdu_len == BACNET_STATUS_ABORT) {
|
||||
rpdata->error_code =
|
||||
ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED;
|
||||
@@ -998,7 +1012,8 @@ int Multistate_Output_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
}
|
||||
break;
|
||||
case PROP_DESCRIPTION:
|
||||
characterstring_init_ansi(&char_string,
|
||||
characterstring_init_ansi(
|
||||
&char_string,
|
||||
Multistate_Output_Description(rpdata->object_instance));
|
||||
apdu_len =
|
||||
encode_application_character_string(&apdu[0], &char_string);
|
||||
@@ -1063,23 +1078,22 @@ bool Multistate_Output_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
}
|
||||
switch (wp_data->object_property) {
|
||||
case PROP_PRESENT_VALUE:
|
||||
status = write_property_type_valid(wp_data, &value,
|
||||
BACNET_APPLICATION_TAG_UNSIGNED_INT);
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_UNSIGNED_INT);
|
||||
if (status) {
|
||||
status = false;
|
||||
if (value.type.Unsigned_Int <= UINT32_MAX) {
|
||||
status =
|
||||
Multistate_Output_Present_Value_Write(
|
||||
wp_data->object_instance,
|
||||
value.type.Unsigned_Int, wp_data->priority,
|
||||
&wp_data->error_class, &wp_data->error_code);
|
||||
status = Multistate_Output_Present_Value_Write(
|
||||
wp_data->object_instance, value.type.Unsigned_Int,
|
||||
wp_data->priority, &wp_data->error_class,
|
||||
&wp_data->error_code);
|
||||
} else {
|
||||
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||
wp_data->error_code = ERROR_CODE_VALUE_OUT_OF_RANGE;
|
||||
}
|
||||
} else {
|
||||
status = write_property_type_valid(wp_data, &value,
|
||||
BACNET_APPLICATION_TAG_NULL);
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_NULL);
|
||||
if (status) {
|
||||
status = Multistate_Output_Present_Value_Relinquish_Write(
|
||||
wp_data->object_instance, wp_data->priority,
|
||||
@@ -1088,8 +1102,8 @@ bool Multistate_Output_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
}
|
||||
break;
|
||||
case PROP_OUT_OF_SERVICE:
|
||||
status = write_property_type_valid(wp_data, &value,
|
||||
BACNET_APPLICATION_TAG_BOOLEAN);
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_BOOLEAN);
|
||||
if (status) {
|
||||
Multistate_Output_Out_Of_Service_Set(
|
||||
wp_data->object_instance, value.type.Boolean);
|
||||
@@ -1097,10 +1111,8 @@ bool Multistate_Output_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
break;
|
||||
default:
|
||||
if (property_lists_member(
|
||||
Properties_Required,
|
||||
Properties_Optional,
|
||||
Properties_Proprietary,
|
||||
wp_data->object_property)) {
|
||||
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 {
|
||||
|
||||
+84
-124
@@ -25,147 +25,107 @@
|
||||
* @param value - multistate preset-value of the write
|
||||
*/
|
||||
typedef void (*multistate_output_write_present_value_callback)(
|
||||
uint32_t object_instance, uint32_t old_value,
|
||||
uint32_t value);
|
||||
uint32_t object_instance, uint32_t old_value, uint32_t value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Output_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Multistate_Output_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Output_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Multistate_Output_Instance_To_Index(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Output_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Multistate_Output_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Output_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Multistate_Output_Instance_To_Index(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Multistate_Output_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
int Multistate_Output_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Name_Set(
|
||||
uint32_t object_instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Output_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Output_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Output_Present_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t value,
|
||||
unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Present_Value_Relinquish(
|
||||
uint32_t instance,
|
||||
unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Multistate_Output_Present_Value_Priority(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Output_Write_Present_Value_Callback_Set(
|
||||
multistate_output_write_present_value_callback cb);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Output_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Present_Value_Set(
|
||||
uint32_t object_instance, uint32_t value, unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Present_Value_Relinquish(
|
||||
uint32_t instance, unsigned priority);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Multistate_Output_Present_Value_Priority(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Output_Write_Present_Value_Callback_Set(
|
||||
multistate_output_write_present_value_callback cb);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Change_Of_Value(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Output_Change_Of_Value_Clear(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Encode_Value_List(
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Output_Change_Of_Value_Clear(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Encode_Value_List(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Out_Of_Service(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Output_Out_Of_Service_Set(
|
||||
uint32_t object_instance,
|
||||
bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Out_Of_Service(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Output_Out_Of_Service_Set(uint32_t object_instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Output_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Description_Set(
|
||||
uint32_t object_instance,
|
||||
const char *text_string);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Output_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Description_Set(
|
||||
uint32_t object_instance, const char *text_string);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_State_Text_List_Set(
|
||||
uint32_t object_instance,
|
||||
const char *state_text_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_State_Text_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t state_index,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Max_States_Set(
|
||||
uint32_t instance,
|
||||
uint32_t max_states_requested);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Output_Max_States(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Output_State_Text(
|
||||
uint32_t object_instance,
|
||||
uint32_t state_index);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_State_Text_List_Set(
|
||||
uint32_t object_instance, const char *state_text_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_State_Text_Set(
|
||||
uint32_t object_instance, uint32_t state_index, char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Max_States_Set(
|
||||
uint32_t instance, uint32_t max_states_requested);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Output_Max_States(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *
|
||||
Multistate_Output_State_Text(uint32_t object_instance, uint32_t state_index);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Multistate_Output_Reliability(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Reliability_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_RELIABILITY value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Multistate_Output_Reliability(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Reliability_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Output_Relinquish_Default(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Relinquish_Default_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Output_Relinquish_Default(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Relinquish_Default_Set(
|
||||
uint32_t object_instance, uint32_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Output_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Output_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Output_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Output_Cleanup(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Output_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Output_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -47,12 +47,14 @@ static const char *Default_State_Text = "State 1\0"
|
||||
"State 3\0";
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
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_NUMBER_OF_STATES, -1 };
|
||||
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_NUMBER_OF_STATES, -1
|
||||
};
|
||||
|
||||
static const int Properties_Optional[] = { PROP_DESCRIPTION, PROP_STATE_TEXT,
|
||||
-1 };
|
||||
-1 };
|
||||
|
||||
static const int Properties_Proprietary[] = { -1 };
|
||||
|
||||
@@ -217,8 +219,8 @@ uint32_t Multistate_Value_Max_States(uint32_t object_instance)
|
||||
* @param state_index - state index number 1..N of the text requested
|
||||
* @return C string retrieved
|
||||
*/
|
||||
const char *Multistate_Value_State_Text(
|
||||
uint32_t object_instance, uint32_t state_index)
|
||||
const char *
|
||||
Multistate_Value_State_Text(uint32_t object_instance, uint32_t state_index)
|
||||
{
|
||||
const char *pName = NULL; /* return value */
|
||||
const struct object_data *pObject;
|
||||
@@ -363,7 +365,8 @@ bool Multistate_Value_Present_Value_Set(
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Multistate_Value_Present_Value_Write(uint32_t object_instance,
|
||||
static bool Multistate_Value_Present_Value_Write(
|
||||
uint32_t object_instance,
|
||||
uint32_t value,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
BACNET_ERROR_CODE *error_code)
|
||||
@@ -465,7 +468,8 @@ bool Multistate_Value_Object_Name(
|
||||
status =
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(name_text, sizeof(name_text), "MULTI-STATE INPUT %lu",
|
||||
snprintf(
|
||||
name_text, sizeof(name_text), "MULTI-STATE INPUT %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, name_text);
|
||||
}
|
||||
@@ -681,9 +685,9 @@ bool Multistate_Value_Encode_Value_List(
|
||||
pObject = Multistate_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
fault = Multistate_Value_Object_Fault(pObject);
|
||||
status =
|
||||
cov_value_list_encode_unsigned(value_list, pObject->Present_Value,
|
||||
in_alarm, fault, overridden, pObject->Out_Of_Service);
|
||||
status = cov_value_list_encode_unsigned(
|
||||
value_list, pObject->Present_Value, in_alarm, fault, overridden,
|
||||
pObject->Out_Of_Service);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
@@ -745,7 +749,8 @@ int Multistate_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu_len = encode_application_bitstring(&apdu[0], &bit_string);
|
||||
break;
|
||||
case PROP_RELIABILITY:
|
||||
apdu_len = encode_application_enumerated(&apdu[0],
|
||||
apdu_len = encode_application_enumerated(
|
||||
&apdu[0],
|
||||
Multistate_Value_Reliability(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_EVENT_STATE:
|
||||
@@ -758,14 +763,16 @@ int Multistate_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
apdu_len = encode_application_boolean(&apdu[0], state);
|
||||
break;
|
||||
case PROP_NUMBER_OF_STATES:
|
||||
apdu_len = encode_application_unsigned(&apdu[apdu_len],
|
||||
apdu_len = encode_application_unsigned(
|
||||
&apdu[apdu_len],
|
||||
Multistate_Value_Max_States(rpdata->object_instance));
|
||||
break;
|
||||
case PROP_STATE_TEXT:
|
||||
max_states = Multistate_Value_Max_States(rpdata->object_instance);
|
||||
apdu_len = bacnet_array_encode(rpdata->object_instance,
|
||||
rpdata->array_index, Multistate_Value_State_Text_Encode,
|
||||
max_states, apdu, apdu_size);
|
||||
apdu_len = bacnet_array_encode(
|
||||
rpdata->object_instance, rpdata->array_index,
|
||||
Multistate_Value_State_Text_Encode, max_states, apdu,
|
||||
apdu_size);
|
||||
if (apdu_len == BACNET_STATUS_ABORT) {
|
||||
rpdata->error_code =
|
||||
ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED;
|
||||
@@ -775,7 +782,8 @@ int Multistate_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
}
|
||||
break;
|
||||
case PROP_DESCRIPTION:
|
||||
characterstring_init_ansi(&char_string,
|
||||
characterstring_init_ansi(
|
||||
&char_string,
|
||||
Multistate_Value_Description(rpdata->object_instance));
|
||||
apdu_len =
|
||||
encode_application_character_string(&apdu[0], &char_string);
|
||||
@@ -848,7 +856,8 @@ bool Multistate_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (property_lists_member(Properties_Required, Properties_Optional,
|
||||
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;
|
||||
|
||||
+76
-112
@@ -24,136 +24,100 @@
|
||||
* @param value - multistate preset-value of the write
|
||||
*/
|
||||
typedef void (*multistate_value_write_present_value_callback)(
|
||||
uint32_t object_instance, uint32_t old_value,
|
||||
uint32_t value);
|
||||
uint32_t object_instance, uint32_t old_value, uint32_t value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Value_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Value_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Multistate_Value_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Value_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Multistate_Value_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Multistate_Value_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Value_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Multistate_Value_Instance_To_Index(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Multistate_Value_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
int Multistate_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
/* optional API */
|
||||
bool Multistate_Value_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
/* optional API */
|
||||
bool Multistate_Value_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Name_Set(
|
||||
uint32_t object_instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Value_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Value_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Value_Present_Value(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Value_Write_Present_Value_Callback_Set(
|
||||
multistate_value_write_present_value_callback cb);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Value_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Present_Value_Set(
|
||||
uint32_t object_instance, uint32_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Value_Write_Present_Value_Callback_Set(
|
||||
multistate_value_write_present_value_callback cb);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Change_Of_Value(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Value_Change_Of_Value_Clear(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Encode_Value_List(
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Value_Change_Of_Value_Clear(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Encode_Value_List(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Out_Of_Service(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Value_Out_Of_Service_Set(
|
||||
uint32_t object_instance,
|
||||
bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Out_Of_Service(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Value_Out_Of_Service_Set(uint32_t object_instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Value_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Description_Set(
|
||||
uint32_t object_instance,
|
||||
const char *text_string);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Value_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Description_Set(
|
||||
uint32_t object_instance, const char *text_string);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_State_Text_List_Set(
|
||||
uint32_t object_instance,
|
||||
const char *state_text_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_State_Text_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t state_index,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Max_States_Set(
|
||||
uint32_t instance,
|
||||
uint32_t max_states_requested);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Value_Max_States(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Value_State_Text(
|
||||
uint32_t object_instance,
|
||||
uint32_t state_index);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_State_Text_List_Set(
|
||||
uint32_t object_instance, const char *state_text_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_State_Text_Set(
|
||||
uint32_t object_instance, uint32_t state_index, char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Max_States_Set(
|
||||
uint32_t instance, uint32_t max_states_requested);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Value_Max_States(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *
|
||||
Multistate_Value_State_Text(uint32_t object_instance, uint32_t state_index);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Multistate_Value_Reliability(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Reliability_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_RELIABILITY value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Multistate_Value_Reliability(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Reliability_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Value_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Value_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Multistate_Value_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Value_Cleanup(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Value_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Multistate_Value_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+105
-70
@@ -39,9 +39,12 @@ static NOTIFICATION_CLASS_INFO NC_Info[MAX_NOTIFICATION_CLASSES];
|
||||
static uint8_t Event_Buffer[MAX_APDU];
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Notification_Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_NOTIFICATION_CLASS, PROP_PRIORITY,
|
||||
PROP_ACK_REQUIRED, PROP_RECIPIENT_LIST, -1 };
|
||||
static const int Notification_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER, PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE, PROP_NOTIFICATION_CLASS,
|
||||
PROP_PRIORITY, PROP_ACK_REQUIRED,
|
||||
PROP_RECIPIENT_LIST, -1
|
||||
};
|
||||
|
||||
static const int Notification_Properties_Optional[] = { PROP_DESCRIPTION, -1 };
|
||||
|
||||
@@ -50,12 +53,15 @@ static const int Notification_Properties_Proprietary[] = { -1 };
|
||||
void Notification_Class_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary)
|
||||
{
|
||||
if (pRequired)
|
||||
if (pRequired) {
|
||||
*pRequired = Notification_Properties_Required;
|
||||
if (pOptional)
|
||||
}
|
||||
if (pOptional) {
|
||||
*pOptional = Notification_Properties_Optional;
|
||||
if (pProprietary)
|
||||
}
|
||||
if (pProprietary) {
|
||||
*pProprietary = Notification_Properties_Proprietary;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -92,8 +98,9 @@ bool Notification_Class_Valid_Instance(uint32_t object_instance)
|
||||
unsigned int index;
|
||||
|
||||
index = Notification_Class_Instance_To_Index(object_instance);
|
||||
if (index < MAX_NOTIFICATION_CLASSES)
|
||||
if (index < MAX_NOTIFICATION_CLASSES) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -120,8 +127,9 @@ unsigned Notification_Class_Instance_To_Index(uint32_t object_instance)
|
||||
{
|
||||
unsigned index = MAX_NOTIFICATION_CLASSES;
|
||||
|
||||
if (object_instance < MAX_NOTIFICATION_CLASSES)
|
||||
if (object_instance < MAX_NOTIFICATION_CLASSES) {
|
||||
index = object_instance;
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
@@ -135,7 +143,8 @@ 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);
|
||||
}
|
||||
@@ -189,18 +198,22 @@ int Notification_Class_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
break;
|
||||
|
||||
case PROP_PRIORITY:
|
||||
if (rpdata->array_index == 0)
|
||||
if (rpdata->array_index == 0) {
|
||||
apdu_len += encode_application_unsigned(&apdu[0], 3);
|
||||
else {
|
||||
} else {
|
||||
if (rpdata->array_index == BACNET_ARRAY_ALL) {
|
||||
apdu_len += encode_application_unsigned(&apdu[apdu_len],
|
||||
apdu_len += encode_application_unsigned(
|
||||
&apdu[apdu_len],
|
||||
CurrentNotify->Priority[TRANSITION_TO_OFFNORMAL]);
|
||||
apdu_len += encode_application_unsigned(&apdu[apdu_len],
|
||||
apdu_len += encode_application_unsigned(
|
||||
&apdu[apdu_len],
|
||||
CurrentNotify->Priority[TRANSITION_TO_FAULT]);
|
||||
apdu_len += encode_application_unsigned(&apdu[apdu_len],
|
||||
apdu_len += encode_application_unsigned(
|
||||
&apdu[apdu_len],
|
||||
CurrentNotify->Priority[TRANSITION_TO_NORMAL]);
|
||||
} else if (rpdata->array_index <= MAX_BACNET_EVENT_TRANSITION) {
|
||||
apdu_len += encode_application_unsigned(&apdu[apdu_len],
|
||||
apdu_len += encode_application_unsigned(
|
||||
&apdu[apdu_len],
|
||||
CurrentNotify->Priority[rpdata->array_index - 1]);
|
||||
} else {
|
||||
rpdata->error_class = ERROR_CLASS_PROPERTY;
|
||||
@@ -214,11 +227,14 @@ int Notification_Class_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
u8Val = CurrentNotify->Ack_Required;
|
||||
|
||||
bitstring_init(&bit_string);
|
||||
bitstring_set_bit(&bit_string, TRANSITION_TO_OFFNORMAL,
|
||||
bitstring_set_bit(
|
||||
&bit_string, TRANSITION_TO_OFFNORMAL,
|
||||
(u8Val & TRANSITION_TO_OFFNORMAL_MASKED) ? true : false);
|
||||
bitstring_set_bit(&bit_string, TRANSITION_TO_FAULT,
|
||||
bitstring_set_bit(
|
||||
&bit_string, TRANSITION_TO_FAULT,
|
||||
(u8Val & TRANSITION_TO_FAULT_MASKED) ? true : false);
|
||||
bitstring_set_bit(&bit_string, TRANSITION_TO_NORMAL,
|
||||
bitstring_set_bit(
|
||||
&bit_string, TRANSITION_TO_NORMAL,
|
||||
(u8Val & TRANSITION_TO_NORMAL_MASKED) ? true : false);
|
||||
/* encode bitstring */
|
||||
apdu_len +=
|
||||
@@ -323,7 +339,7 @@ bool Notification_Class_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
wp_data->application_data_len, &value);
|
||||
if ((len == 0) ||
|
||||
(value.tag !=
|
||||
BACNET_APPLICATION_TAG_UNSIGNED_INT)) {
|
||||
BACNET_APPLICATION_TAG_UNSIGNED_INT)) {
|
||||
/* Bad decode, wrong tag or following required
|
||||
* parameter missing */
|
||||
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||
@@ -341,17 +357,20 @@ bool Notification_Class_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
iOffset += len;
|
||||
}
|
||||
if (status == true) {
|
||||
for (idx = 0; idx < MAX_BACNET_EVENT_TRANSITION; idx++)
|
||||
for (idx = 0; idx < MAX_BACNET_EVENT_TRANSITION;
|
||||
idx++) {
|
||||
CurrentNotify->Priority[idx] = TmpPriority[idx];
|
||||
}
|
||||
}
|
||||
} else if (wp_data->array_index <= 3) {
|
||||
if (value.type.Unsigned_Int > 255) {
|
||||
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||
wp_data->error_code = ERROR_CODE_VALUE_OUT_OF_RANGE;
|
||||
status = false;
|
||||
} else
|
||||
} else {
|
||||
CurrentNotify->Priority[wp_data->array_index - 1] =
|
||||
value.type.Unsigned_Int;
|
||||
}
|
||||
} else {
|
||||
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||
wp_data->error_code = ERROR_CODE_INVALID_ARRAY_INDEX;
|
||||
@@ -452,77 +471,87 @@ void Notification_Class_Get_Priorities(
|
||||
|
||||
object_index = Notification_Class_Instance_To_Index(Object_Instance);
|
||||
|
||||
if (object_index < MAX_NOTIFICATION_CLASSES)
|
||||
if (object_index < MAX_NOTIFICATION_CLASSES) {
|
||||
CurrentNotify = &NC_Info[object_index];
|
||||
else {
|
||||
for (i = 0; i < 3; i++)
|
||||
} else {
|
||||
for (i = 0; i < 3; i++) {
|
||||
pPriorityArray[i] = 255;
|
||||
}
|
||||
return; /* unknown object */
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
for (i = 0; i < 3; i++) {
|
||||
pPriorityArray[i] = CurrentNotify->Priority[i];
|
||||
}
|
||||
}
|
||||
|
||||
bool Notification_Class_Get_Recipient_List(
|
||||
uint32_t Object_Instance, BACNET_DESTINATION *pRecipientList)
|
||||
{
|
||||
uint32_t object_index = Notification_Class_Instance_To_Index(Object_Instance);
|
||||
uint32_t object_index =
|
||||
Notification_Class_Instance_To_Index(Object_Instance);
|
||||
|
||||
if (object_index < MAX_NOTIFICATION_CLASSES) {
|
||||
NOTIFICATION_CLASS_INFO *CurrentNotify = &NC_Info[object_index];
|
||||
int i;
|
||||
if (object_index < MAX_NOTIFICATION_CLASSES) {
|
||||
NOTIFICATION_CLASS_INFO *CurrentNotify = &NC_Info[object_index];
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NC_MAX_RECIPIENTS; i++)
|
||||
pRecipientList[i] = CurrentNotify->Recipient_List[i];
|
||||
} else {
|
||||
return false; /* unknown object */
|
||||
}
|
||||
for (i = 0; i < NC_MAX_RECIPIENTS; i++) {
|
||||
pRecipientList[i] = CurrentNotify->Recipient_List[i];
|
||||
}
|
||||
} else {
|
||||
return false; /* unknown object */
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Notification_Class_Set_Recipient_List(
|
||||
uint32_t Object_Instance, BACNET_DESTINATION *pRecipientList)
|
||||
{
|
||||
uint32_t object_index = Notification_Class_Instance_To_Index(Object_Instance);
|
||||
uint32_t object_index =
|
||||
Notification_Class_Instance_To_Index(Object_Instance);
|
||||
|
||||
if (object_index < MAX_NOTIFICATION_CLASSES) {
|
||||
NOTIFICATION_CLASS_INFO *CurrentNotify = &NC_Info[object_index];
|
||||
int i;
|
||||
if (object_index < MAX_NOTIFICATION_CLASSES) {
|
||||
NOTIFICATION_CLASS_INFO *CurrentNotify = &NC_Info[object_index];
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NC_MAX_RECIPIENTS; i++)
|
||||
CurrentNotify->Recipient_List[i] = pRecipientList[i];
|
||||
} else {
|
||||
return false; /* unknown object */
|
||||
}
|
||||
for (i = 0; i < NC_MAX_RECIPIENTS; i++) {
|
||||
CurrentNotify->Recipient_List[i] = pRecipientList[i];
|
||||
}
|
||||
} else {
|
||||
return false; /* unknown object */
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Notification_Class_Set_Priorities(
|
||||
uint32_t Object_Instance, uint32_t *pPriorityArray)
|
||||
{
|
||||
uint32_t object_index = Notification_Class_Instance_To_Index(Object_Instance);
|
||||
uint32_t object_index =
|
||||
Notification_Class_Instance_To_Index(Object_Instance);
|
||||
|
||||
if (object_index < MAX_NOTIFICATION_CLASSES) {
|
||||
NOTIFICATION_CLASS_INFO *CurrentNotify = &NC_Info[object_index];
|
||||
int i;
|
||||
if (object_index < MAX_NOTIFICATION_CLASSES) {
|
||||
NOTIFICATION_CLASS_INFO *CurrentNotify = &NC_Info[object_index];
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
if (pPriorityArray[i] <= 255)
|
||||
CurrentNotify->Priority[i] = pPriorityArray[i];
|
||||
}
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (pPriorityArray[i] <= 255) {
|
||||
CurrentNotify->Priority[i] = pPriorityArray[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Notification_Class_Get_Ack_Required(
|
||||
uint32_t Object_Instance, uint8_t *pAckRequired)
|
||||
{
|
||||
uint32_t object_index = Notification_Class_Instance_To_Index(Object_Instance);
|
||||
uint32_t object_index =
|
||||
Notification_Class_Instance_To_Index(Object_Instance);
|
||||
|
||||
if (object_index < MAX_NOTIFICATION_CLASSES) {
|
||||
NOTIFICATION_CLASS_INFO *CurrentNotify = &NC_Info[object_index];
|
||||
*pAckRequired = CurrentNotify->Ack_Required;
|
||||
NOTIFICATION_CLASS_INFO *CurrentNotify = &NC_Info[object_index];
|
||||
*pAckRequired = CurrentNotify->Ack_Required;
|
||||
} else {
|
||||
*pAckRequired = 0;
|
||||
return; /* unknown object */
|
||||
@@ -532,7 +561,8 @@ void Notification_Class_Get_Ack_Required(
|
||||
void Notification_Class_Set_Ack_Required(
|
||||
uint32_t Object_Instance, uint8_t Ack_Required)
|
||||
{
|
||||
uint32_t object_index = Notification_Class_Instance_To_Index(Object_Instance);
|
||||
uint32_t object_index =
|
||||
Notification_Class_Instance_To_Index(Object_Instance);
|
||||
|
||||
if (object_index < MAX_NOTIFICATION_CLASSES) {
|
||||
NOTIFICATION_CLASS_INFO *CurrentNotify = &NC_Info[object_index];
|
||||
@@ -540,9 +570,8 @@ void Notification_Class_Set_Ack_Required(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static bool IsRecipientActive(
|
||||
BACNET_DESTINATION *pBacDest, uint8_t EventToState)
|
||||
static bool
|
||||
IsRecipientActive(BACNET_DESTINATION *pBacDest, uint8_t EventToState)
|
||||
{
|
||||
BACNET_DATE_TIME DateTime;
|
||||
|
||||
@@ -606,10 +635,11 @@ void Notification_Class_common_reporting_function(
|
||||
notify_index =
|
||||
Notification_Class_Instance_To_Index(event_data->notificationClass);
|
||||
|
||||
if (notify_index < MAX_NOTIFICATION_CLASSES)
|
||||
if (notify_index < MAX_NOTIFICATION_CLASSES) {
|
||||
CurrentNotify = &NC_Info[notify_index];
|
||||
else
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Initiating Device Identifier */
|
||||
event_data->initiatingObjectIdentifier.type = OBJECT_DEVICE;
|
||||
@@ -651,7 +681,8 @@ void Notification_Class_common_reporting_function(
|
||||
}
|
||||
|
||||
/* send notifications for active recipients */
|
||||
PRINTF("Notification Class[%u]: send notifications\n",
|
||||
PRINTF(
|
||||
"Notification Class[%u]: send notifications\n",
|
||||
event_data->notificationClass);
|
||||
/* pointer to first recipient */
|
||||
pBacDest = &CurrentNotify->Recipient_List[0];
|
||||
@@ -671,20 +702,24 @@ void Notification_Class_common_reporting_function(
|
||||
if (pBacDest->Recipient.tag == BACNET_RECIPIENT_TAG_DEVICE) {
|
||||
/* send notification to the specified device */
|
||||
device_id = pBacDest->Recipient.type.device.instance;
|
||||
PRINTF("Notification Class[%u]: send notification to %u\n",
|
||||
PRINTF(
|
||||
"Notification Class[%u]: send notification to %u\n",
|
||||
event_data->notificationClass, (unsigned)device_id);
|
||||
if (pBacDest->ConfirmedNotify == true)
|
||||
if (pBacDest->ConfirmedNotify == true) {
|
||||
Send_CEvent_Notify(device_id, event_data);
|
||||
else if (address_get_by_device(device_id, &max_apdu, &dest))
|
||||
} else if (address_get_by_device(device_id, &max_apdu, &dest)) {
|
||||
Send_UEvent_Notify(Event_Buffer, event_data, &dest);
|
||||
} else if (pBacDest->Recipient.tag ==
|
||||
BACNET_RECIPIENT_TAG_ADDRESS) {
|
||||
PRINTF("Notification Class[%u]: send notification to ADDR\n",
|
||||
}
|
||||
} else if (
|
||||
pBacDest->Recipient.tag == BACNET_RECIPIENT_TAG_ADDRESS) {
|
||||
PRINTF(
|
||||
"Notification Class[%u]: send notification to ADDR\n",
|
||||
event_data->notificationClass);
|
||||
/* send notification to the address indicated */
|
||||
if (pBacDest->ConfirmedNotify == true) {
|
||||
if (address_get_device_id(&dest, &device_id))
|
||||
if (address_get_device_id(&dest, &device_id)) {
|
||||
Send_CEvent_Notify(device_id, event_data);
|
||||
}
|
||||
} else {
|
||||
dest = pBacDest->Recipient.type.address;
|
||||
Send_UEvent_Notify(Event_Buffer, event_data, &dest);
|
||||
|
||||
@@ -33,7 +33,7 @@ typedef struct Notification_Class_info {
|
||||
Priority[MAX_BACNET_EVENT_TRANSITION]; /* BACnetARRAY[3] of Unsigned */
|
||||
uint8_t Ack_Required; /* BACnetEventTransitionBits */
|
||||
BACNET_DESTINATION
|
||||
Recipient_List[NC_MAX_RECIPIENTS]; /* List of BACnetDestination */
|
||||
Recipient_List[NC_MAX_RECIPIENTS]; /* List of BACnetDestination */
|
||||
} NOTIFICATION_CLASS_INFO;
|
||||
|
||||
/* Indicates whether the transaction has been confirmed */
|
||||
|
||||
@@ -729,7 +729,7 @@ bool Network_Port_MAC_Address(
|
||||
if (mac_address) {
|
||||
mac_len = Network_Port_MAC_Address_Value(
|
||||
object_instance, mac_address->value, sizeof(mac_address->value));
|
||||
mac_address->length = mac_len;
|
||||
mac_address->length = mac_len;
|
||||
}
|
||||
|
||||
return mac_len > 0;
|
||||
@@ -3035,7 +3035,8 @@ bool Network_Port_MSTP_Max_Info_Frames_Set(
|
||||
* @param object_property [in] BACnet object property
|
||||
* @return true if the object property is a BACnetARRAY datatype
|
||||
*/
|
||||
static bool Network_Port_BACnetArray_Property(BACNET_PROPERTY_ID object_property)
|
||||
static bool
|
||||
Network_Port_BACnetArray_Property(BACNET_PROPERTY_ID object_property)
|
||||
{
|
||||
bool status = false;
|
||||
|
||||
|
||||
+296
-418
@@ -21,470 +21,348 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Network_Port_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void Network_Port_Property_List(
|
||||
uint32_t object_instance,
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void Network_Port_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void Network_Port_Property_List(
|
||||
uint32_t object_instance,
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Name_Set(
|
||||
uint32_t object_instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Network_Port_Object_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Network_Port_Object_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Network_Port_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Description_Set(
|
||||
uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
char *Network_Port_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Description_Set(uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Network_Port_Reliability(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Reliability_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_RELIABILITY value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Network_Port_Reliability(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Reliability_Set(
|
||||
uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Out_Of_Service(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Out_Of_Service_Set(
|
||||
uint32_t instance,
|
||||
bool oos_flag);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Out_Of_Service_Set(uint32_t instance, bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Network_Port_Type(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Type_Set(
|
||||
uint32_t object_instance,
|
||||
uint8_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Network_Port_Type(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Type_Set(uint32_t object_instance, uint8_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Network_Port_Network_Number(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Network_Number_Set(
|
||||
uint32_t object_instance,
|
||||
uint16_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Network_Port_Network_Number(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Network_Number_Set(uint32_t object_instance, uint16_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_PORT_QUALITY Network_Port_Quality(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Quality_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_PORT_QUALITY value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_PORT_QUALITY Network_Port_Quality(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Quality_Set(
|
||||
uint32_t object_instance, BACNET_PORT_QUALITY value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_MAC_Address(
|
||||
uint32_t object_instance,
|
||||
BACNET_OCTET_STRING *mac_address);
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Network_Port_MAC_Address_Value(
|
||||
uint32_t object_instance,
|
||||
uint8_t *mac_address,
|
||||
size_t mac_size);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_MAC_Address_Set(
|
||||
uint32_t object_instance,
|
||||
const uint8_t *mac_src,
|
||||
uint8_t mac_len);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_MAC_Address(
|
||||
uint32_t object_instance, BACNET_OCTET_STRING *mac_address);
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Network_Port_MAC_Address_Value(
|
||||
uint32_t object_instance, uint8_t *mac_address, size_t mac_size);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_MAC_Address_Set(
|
||||
uint32_t object_instance, const uint8_t *mac_src, uint8_t mac_len);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Network_Port_APDU_Length(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_APDU_Length_Set(
|
||||
uint32_t object_instance,
|
||||
uint16_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Network_Port_APDU_Length(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_APDU_Length_Set(uint32_t object_instance, uint16_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Network_Port_MSTP_MAC_Address(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_MSTP_MAC_Address_Set(
|
||||
uint32_t object_instance,
|
||||
uint8_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Network_Port_MSTP_MAC_Address(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
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);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_MSTP_Max_Master_Set(
|
||||
uint32_t object_instance,
|
||||
uint8_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Network_Port_MSTP_Max_Master(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_MSTP_Max_Master_Set(uint32_t object_instance, uint8_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Network_Port_MSTP_Max_Info_Frames(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_MSTP_Max_Info_Frames_Set(
|
||||
uint32_t object_instance,
|
||||
uint8_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Network_Port_MSTP_Max_Info_Frames(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_MSTP_Max_Info_Frames_Set(
|
||||
uint32_t object_instance, uint8_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Network_Port_Link_Speed(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Link_Speed_Set(
|
||||
uint32_t object_instance,
|
||||
float value);
|
||||
BACNET_STACK_EXPORT
|
||||
float Network_Port_Link_Speed(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Link_Speed_Set(uint32_t object_instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Address(
|
||||
uint32_t object_instance,
|
||||
BACNET_OCTET_STRING *ip_address);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Address_Get(
|
||||
uint32_t object_instance,
|
||||
uint8_t *a, uint8_t *b, uint8_t *c, uint8_t *d);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Address_Set(
|
||||
uint32_t object_instance,
|
||||
uint8_t a, uint8_t b, uint8_t c, uint8_t d);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Address(
|
||||
uint32_t object_instance, BACNET_OCTET_STRING *ip_address);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Address_Get(
|
||||
uint32_t object_instance, uint8_t *a, uint8_t *b, uint8_t *c, uint8_t *d);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Address_Set(
|
||||
uint32_t object_instance, uint8_t a, uint8_t b, uint8_t c, uint8_t d);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Network_Port_IP_Subnet_Prefix(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Subnet_Prefix_Set(
|
||||
uint32_t object_instance,
|
||||
uint8_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Network_Port_IP_Subnet_Prefix(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Subnet_Prefix_Set(uint32_t object_instance, uint8_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Subnet(
|
||||
uint32_t object_instance,
|
||||
BACNET_OCTET_STRING *subnet_mask);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Subnet_Get(
|
||||
uint32_t object_instance,
|
||||
uint8_t *a, uint8_t *b, uint8_t *c, uint8_t *d);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Subnet_Set(
|
||||
uint32_t object_instance,
|
||||
uint8_t a, uint8_t b, uint8_t c, uint8_t d);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Subnet(
|
||||
uint32_t object_instance, BACNET_OCTET_STRING *subnet_mask);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Subnet_Get(
|
||||
uint32_t object_instance, uint8_t *a, uint8_t *b, uint8_t *c, uint8_t *d);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Subnet_Set(
|
||||
uint32_t object_instance, uint8_t a, uint8_t b, uint8_t c, uint8_t d);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Gateway(
|
||||
uint32_t object_instance,
|
||||
BACNET_OCTET_STRING *subnet_mask);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Gateway_Get(
|
||||
uint32_t object_instance,
|
||||
uint8_t *a, uint8_t *b, uint8_t *c, uint8_t *d);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Gateway_Set(
|
||||
uint32_t object_instance,
|
||||
uint8_t a, uint8_t b, uint8_t c, uint8_t d);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Gateway(
|
||||
uint32_t object_instance, BACNET_OCTET_STRING *subnet_mask);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Gateway_Get(
|
||||
uint32_t object_instance, uint8_t *a, uint8_t *b, uint8_t *c, uint8_t *d);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_Gateway_Set(
|
||||
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);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_DHCP_Enable_Set(uint32_t object_instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_DHCP_Enable(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_DHCP_Enable_Set(
|
||||
uint32_t object_instance, bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_DNS_Server(
|
||||
uint32_t object_instance, unsigned index, BACNET_OCTET_STRING *subnet_mask);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_DNS_Server_Get(
|
||||
uint32_t object_instance,
|
||||
unsigned index,
|
||||
uint8_t *a,
|
||||
uint8_t *b,
|
||||
uint8_t *c,
|
||||
uint8_t *d);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_DNS_Server_Set(
|
||||
uint32_t object_instance,
|
||||
unsigned index,
|
||||
uint8_t a,
|
||||
uint8_t b,
|
||||
uint8_t c,
|
||||
uint8_t d);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_DNS_Server(
|
||||
uint32_t object_instance,
|
||||
unsigned index,
|
||||
BACNET_OCTET_STRING *subnet_mask);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_DNS_Server_Get(
|
||||
uint32_t object_instance,
|
||||
unsigned index,
|
||||
uint8_t *a, uint8_t *b, uint8_t *c, uint8_t *d);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IP_DNS_Server_Set(
|
||||
uint32_t object_instance,
|
||||
unsigned index,
|
||||
uint8_t a, uint8_t b, uint8_t c, uint8_t d);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Network_Port_BIP_Port(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BIP_Port_Set(uint32_t object_instance, uint16_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Network_Port_BIP_Port(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BIP_Port_Set(
|
||||
uint32_t object_instance,
|
||||
uint16_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_IP_MODE Network_Port_BIP_Mode(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BIP_Mode_Set(uint32_t object_instance, BACNET_IP_MODE value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_IP_MODE Network_Port_BIP_Mode(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BIP_Mode_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_IP_MODE value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BBMD_Accept_FD_Registrations(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BBMD_Accept_FD_Registrations_Set(
|
||||
uint32_t object_instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BBMD_Accept_FD_Registrations(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BBMD_Accept_FD_Registrations_Set(
|
||||
uint32_t object_instance,
|
||||
bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
void *Network_Port_BBMD_BD_Table(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BBMD_BD_Table_Set(uint32_t object_instance, void *bdt_head);
|
||||
BACNET_STACK_EXPORT
|
||||
void *Network_Port_BBMD_FD_Table(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BBMD_FD_Table_Set(uint32_t object_instance, void *fdt_head);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void *Network_Port_BBMD_BD_Table(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BBMD_BD_Table_Set(
|
||||
uint32_t object_instance,
|
||||
void *bdt_head);
|
||||
BACNET_STACK_EXPORT
|
||||
void *Network_Port_BBMD_FD_Table(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BBMD_FD_Table_Set(
|
||||
uint32_t object_instance,
|
||||
void *fdt_head);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Remote_BBMD_IP_Address(
|
||||
uint32_t object_instance,
|
||||
uint8_t *a, uint8_t *b, uint8_t *c, uint8_t *d);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Remote_BBMD_IP_Address_Set(
|
||||
uint32_t object_instance,
|
||||
uint8_t a, uint8_t b, uint8_t c, uint8_t d);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Network_Port_Remote_BBMD_BIP_Port(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Remote_BBMD_BIP_Port_Set(
|
||||
uint32_t object_instance,
|
||||
uint16_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Network_Port_Remote_BBMD_BIP_Lifetime(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Remote_BBMD_BIP_Lifetime_Set(
|
||||
uint32_t object_instance,
|
||||
uint16_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Remote_BBMD_IP_Address(
|
||||
uint32_t object_instance, uint8_t *a, uint8_t *b, uint8_t *c, uint8_t *d);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Remote_BBMD_IP_Address_Set(
|
||||
uint32_t object_instance, uint8_t a, uint8_t b, uint8_t c, uint8_t d);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Network_Port_Remote_BBMD_BIP_Port(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Remote_BBMD_BIP_Port_Set(
|
||||
uint32_t object_instance, uint16_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Network_Port_Remote_BBMD_BIP_Lifetime(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Remote_BBMD_BIP_Lifetime_Set(
|
||||
uint32_t object_instance, uint16_t value);
|
||||
|
||||
#if (defined(BACDL_ALL) || defined(BACDL_BIP6))
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BBMD_IP6_Accept_FD_Registrations(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BBMD_IP6_Accept_FD_Registrations_Set(
|
||||
uint32_t object_instance,
|
||||
bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BBMD_IP6_Accept_FD_Registrations(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BBMD_IP6_Accept_FD_Registrations_Set(
|
||||
uint32_t object_instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void *Network_Port_BBMD_IP6_BD_Table(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BBMD_IP6_BD_Table_Set(
|
||||
uint32_t object_instance,
|
||||
void *bdt_head);
|
||||
BACNET_STACK_EXPORT
|
||||
void *Network_Port_BBMD_IP6_FD_Table(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BBMD_IP6_FD_Table_Set(
|
||||
uint32_t object_instance,
|
||||
void *fdt_head);
|
||||
BACNET_STACK_EXPORT
|
||||
void *Network_Port_BBMD_IP6_BD_Table(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BBMD_IP6_BD_Table_Set(
|
||||
uint32_t object_instance, void *bdt_head);
|
||||
BACNET_STACK_EXPORT
|
||||
void *Network_Port_BBMD_IP6_FD_Table(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BBMD_IP6_FD_Table_Set(
|
||||
uint32_t object_instance, void *fdt_head);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Remote_BBMD_IP6_Address(
|
||||
uint32_t object_instance,
|
||||
uint8_t *addr);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Remote_BBMD_IP6_Address_Set(
|
||||
uint32_t object_instance,
|
||||
const uint8_t *addr);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Network_Port_Remote_BBMD_BIP6_Port(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Remote_BBMD_BIP6_Port_Set(
|
||||
uint32_t object_instance,
|
||||
uint16_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Network_Port_Remote_BBMD_BIP6_Lifetime(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Remote_BBMD_BIP6_Lifetime_Set(
|
||||
uint32_t object_instance,
|
||||
uint16_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Remote_BBMD_IP6_Address(
|
||||
uint32_t object_instance, uint8_t *addr);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Remote_BBMD_IP6_Address_Set(
|
||||
uint32_t object_instance, const uint8_t *addr);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Network_Port_Remote_BBMD_BIP6_Port(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Remote_BBMD_BIP6_Port_Set(
|
||||
uint32_t object_instance, uint16_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Network_Port_Remote_BBMD_BIP6_Lifetime(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Remote_BBMD_BIP6_Lifetime_Set(
|
||||
uint32_t object_instance, uint16_t value);
|
||||
#endif
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_IP_MODE Network_Port_BIP6_Mode(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BIP6_Mode_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_IP_MODE value);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_IP_MODE Network_Port_BIP6_Mode(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BIP6_Mode_Set(uint32_t object_instance, BACNET_IP_MODE value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Address(
|
||||
uint32_t object_instance,
|
||||
BACNET_OCTET_STRING *ip_address);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Address_Set(
|
||||
uint32_t object_instance,
|
||||
const uint8_t *ip_address);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Address(
|
||||
uint32_t object_instance, BACNET_OCTET_STRING *ip_address);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Address_Set(
|
||||
uint32_t object_instance, const uint8_t *ip_address);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Multicast_Address(
|
||||
uint32_t object_instance,
|
||||
BACNET_OCTET_STRING *ip_address);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Multicast_Address_Set(
|
||||
uint32_t object_instance,
|
||||
const uint8_t *ip_address);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Multicast_Address(
|
||||
uint32_t object_instance, BACNET_OCTET_STRING *ip_address);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Multicast_Address_Set(
|
||||
uint32_t object_instance, const uint8_t *ip_address);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Network_Port_IPv6_Subnet_Prefix(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Subnet_Prefix_Set(
|
||||
uint32_t object_instance,
|
||||
uint8_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Network_Port_IPv6_Subnet_Prefix(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Subnet_Prefix_Set(
|
||||
uint32_t object_instance, uint8_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Gateway(
|
||||
uint32_t object_instance,
|
||||
BACNET_OCTET_STRING *ip_address);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Gateway_Set(
|
||||
uint32_t object_instance,
|
||||
const uint8_t *ip_address);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Gateway(
|
||||
uint32_t object_instance, BACNET_OCTET_STRING *ip_address);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Gateway_Set(
|
||||
uint32_t object_instance, const uint8_t *ip_address);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_DNS_Server(
|
||||
uint32_t object_instance,
|
||||
unsigned dns_index,
|
||||
BACNET_OCTET_STRING *ip_address);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_DNS_Server_Set(
|
||||
uint32_t object_instance,
|
||||
unsigned dns_index,
|
||||
const uint8_t *ip_address);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_DNS_Server(
|
||||
uint32_t object_instance,
|
||||
unsigned dns_index,
|
||||
BACNET_OCTET_STRING *ip_address);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_DNS_Server_Set(
|
||||
uint32_t object_instance, unsigned dns_index, const uint8_t *ip_address);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_DHCP_Server(
|
||||
uint32_t object_instance,
|
||||
BACNET_OCTET_STRING *ip_address);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_DHCP_Server_Set(
|
||||
uint32_t object_instance,
|
||||
const uint8_t *ip_address);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_DHCP_Server(
|
||||
uint32_t object_instance, BACNET_OCTET_STRING *ip_address);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_DHCP_Server_Set(
|
||||
uint32_t object_instance, const uint8_t *ip_address);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Zone_Index(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING *zone_index);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Gateway_Zone_Index_Set(
|
||||
uint32_t object_instance,
|
||||
char *zone_index);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Zone_Index(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *zone_index);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Gateway_Zone_Index_Set(
|
||||
uint32_t object_instance, char *zone_index);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Auto_Addressing_Enable(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Auto_Addressing_Enable_Set(
|
||||
uint32_t object_instance, bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Auto_Addressing_Enable(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Auto_Addressing_Enable_Set(
|
||||
uint32_t object_instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Network_Port_BIP6_Port(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BIP6_Port_Set(
|
||||
uint32_t object_instance,
|
||||
uint16_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Network_Port_BIP6_Port(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_BIP6_Port_Set(uint32_t object_instance, uint16_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Changes_Pending(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Changes_Pending_Set(
|
||||
uint32_t instance,
|
||||
bool flag);
|
||||
BACNET_STACK_EXPORT
|
||||
void Network_Port_Changes_Pending_Activate(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Network_Port_Changes_Pending_Discard(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Changes_Pending(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Changes_Pending_Set(uint32_t instance, bool flag);
|
||||
BACNET_STACK_EXPORT
|
||||
void Network_Port_Changes_Pending_Activate(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Network_Port_Changes_Pending_Discard(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Network_Port_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Network_Port_Index_To_Instance(
|
||||
unsigned find_index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Network_Port_Instance_To_Index(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Network_Port_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Network_Port_Index_To_Instance(unsigned find_index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Network_Port_Instance_To_Index(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Object_Instance_Number_Set(
|
||||
unsigned index,
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Object_Instance_Number_Set(
|
||||
unsigned index, uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Network_Port_Read_Range_BDT(
|
||||
uint8_t * apdu,
|
||||
BACNET_READ_RANGE_DATA * pRequest);
|
||||
BACNET_STACK_EXPORT
|
||||
int Network_Port_Read_Range_FDT(
|
||||
uint8_t * apdu,
|
||||
BACNET_READ_RANGE_DATA * pRequest);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Read_Range(
|
||||
BACNET_READ_RANGE_DATA * pRequest,
|
||||
RR_PROP_INFO * pInfo);
|
||||
BACNET_STACK_EXPORT
|
||||
int Network_Port_Read_Range_BDT(
|
||||
uint8_t *apdu, BACNET_READ_RANGE_DATA *pRequest);
|
||||
BACNET_STACK_EXPORT
|
||||
int Network_Port_Read_Range_FDT(
|
||||
uint8_t *apdu, BACNET_READ_RANGE_DATA *pRequest);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Read_Range(
|
||||
BACNET_READ_RANGE_DATA *pRequest, RR_PROP_INFO *pInfo);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Network_Port_Create(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Delete(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Network_Port_Changes_Activate(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Network_Port_Changes_Discard(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Network_Port_Cleanup(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Network_Port_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Network_Port_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Delete(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Network_Port_Changes_Activate(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Network_Port_Changes_Discard(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Network_Port_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Network_Port_Init(void);
|
||||
|
||||
/* handling for read property service */
|
||||
BACNET_STACK_EXPORT
|
||||
int Network_Port_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
/* handling for read property service */
|
||||
BACNET_STACK_EXPORT
|
||||
int Network_Port_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
/* handling for write property service */
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
/* handling for write property service */
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -43,26 +43,26 @@ typedef struct object_device_t {
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool objects_device_delete(int index);
|
||||
BACNET_STACK_EXPORT
|
||||
bool objects_device_delete(int index);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
OBJECT_DEVICE_T *objects_device_new(uint32_t device_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
OBJECT_DEVICE_T *objects_device_new(uint32_t device_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
OBJECT_DEVICE_T *objects_device_by_instance(uint32_t device_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
OBJECT_DEVICE_T *objects_device_by_instance(uint32_t device_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
OBJECT_DEVICE_T *objects_device_data(int index);
|
||||
BACNET_STACK_EXPORT
|
||||
OBJECT_DEVICE_T *objects_device_data(int index);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int objects_device_count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
int objects_device_count(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t objects_device_id(int index);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t objects_device_id(int index);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void objects_init(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void objects_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -27,12 +27,13 @@ static OCTETSTRING_VALUE_DESCR OSV_Descr[MAX_OCTETSTRING_VALUES];
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int OctetString_Value_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER, PROP_OBJECT_NAME, PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE, PROP_STATUS_FLAGS, -1
|
||||
PROP_OBJECT_IDENTIFIER, PROP_OBJECT_NAME, PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE, PROP_STATUS_FLAGS, -1
|
||||
};
|
||||
|
||||
static const int OctetString_Value_Properties_Optional[] = { PROP_EVENT_STATE,
|
||||
PROP_OUT_OF_SERVICE, PROP_DESCRIPTION, -1 };
|
||||
static const int OctetString_Value_Properties_Optional[] = {
|
||||
PROP_EVENT_STATE, PROP_OUT_OF_SERVICE, PROP_DESCRIPTION, -1
|
||||
};
|
||||
|
||||
static const int OctetString_Value_Properties_Proprietary[] = { -1 };
|
||||
|
||||
@@ -151,7 +152,8 @@ bool OctetString_Value_Object_Name(
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_OCTETSTRING_VALUES) {
|
||||
snprintf(text, sizeof(text), "OCTETSTRING VALUE %lu",
|
||||
snprintf(
|
||||
text, sizeof(text), "OCTETSTRING VALUE %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, text);
|
||||
}
|
||||
@@ -215,7 +217,8 @@ int OctetString_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_IN_ALARM, false);
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_FAULT, false);
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_OVERRIDDEN, false);
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_OUT_OF_SERVICE,
|
||||
bitstring_set_bit(
|
||||
&bit_string, STATUS_FLAG_OUT_OF_SERVICE,
|
||||
CurrentAV->Out_Of_Service);
|
||||
|
||||
apdu_len = encode_application_bitstring(&apdu[0], &bit_string);
|
||||
|
||||
@@ -20,72 +20,67 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct octetstring_value_descr {
|
||||
unsigned Event_State:3;
|
||||
bool Out_Of_Service;
|
||||
BACNET_OCTET_STRING Present_Value;
|
||||
} OCTETSTRING_VALUE_DESCR;
|
||||
typedef struct octetstring_value_descr {
|
||||
unsigned Event_State : 3;
|
||||
bool Out_Of_Service;
|
||||
BACNET_OCTET_STRING Present_Value;
|
||||
} OCTETSTRING_VALUE_DESCR;
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void OctetString_Value_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned OctetString_Value_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t OctetString_Value_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned OctetString_Value_Instance_To_Index(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void OctetString_Value_Property_Lists(const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned OctetString_Value_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t OctetString_Value_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned OctetString_Value_Instance_To_Index(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Object_Name(uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
int OctetString_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int OctetString_Value_Read_Property(BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *
|
||||
wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
const BACNET_OCTET_STRING *value,
|
||||
uint8_t priority);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_OCTET_STRING *OctetString_Value_Present_Value(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Present_Value_Set(uint32_t object_instance,
|
||||
const BACNET_OCTET_STRING * value,
|
||||
uint8_t priority);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_OCTET_STRING *OctetString_Value_Present_Value(uint32_t
|
||||
object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void OctetString_Value_Change_Of_Value_Clear(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Encode_Value_List(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void OctetString_Value_Change_Of_Value_Clear(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Encode_Value_List(uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
char *OctetString_Value_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Description_Set(uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *OctetString_Value_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Description_Set(uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void OctetString_Value_Out_Of_Service_Set(uint32_t instance, bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void OctetString_Value_Out_Of_Service_Set(uint32_t instance,
|
||||
bool oos_flag);
|
||||
/* note: header of Intrinsic_Reporting function is required
|
||||
even when INTRINSIC_REPORTING is not defined */
|
||||
BACNET_STACK_EXPORT
|
||||
void OctetString_Value_Intrinsic_Reporting(uint32_t object_instance);
|
||||
|
||||
/* note: header of Intrinsic_Reporting function is required
|
||||
even when INTRINSIC_REPORTING is not defined */
|
||||
BACNET_STACK_EXPORT
|
||||
void OctetString_Value_Intrinsic_Reporting(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void OctetString_Value_Init(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void OctetString_Value_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -27,8 +27,13 @@ static POSITIVEINTEGER_VALUE_DESCR PIV_Descr[MAX_POSITIVEINTEGER_VALUES];
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int PositiveInteger_Value_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER, PROP_OBJECT_NAME, PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE, PROP_STATUS_FLAGS, PROP_UNITS, -1
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_UNITS,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int PositiveInteger_Value_Properties_Optional[] = {
|
||||
@@ -150,7 +155,8 @@ bool PositiveInteger_Value_Object_Name(
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_POSITIVEINTEGER_VALUES) {
|
||||
snprintf(text, sizeof(text), "POSITIVEINTEGER VALUE %lu",
|
||||
snprintf(
|
||||
text, sizeof(text), "POSITIVEINTEGER VALUE %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, text);
|
||||
}
|
||||
@@ -186,8 +192,9 @@ int PositiveInteger_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
|
||||
switch (rpdata->object_property) {
|
||||
case PROP_OBJECT_IDENTIFIER:
|
||||
apdu_len = encode_application_object_id(&apdu[0],
|
||||
OBJECT_POSITIVE_INTEGER_VALUE, rpdata->object_instance);
|
||||
apdu_len = encode_application_object_id(
|
||||
&apdu[0], OBJECT_POSITIVE_INTEGER_VALUE,
|
||||
rpdata->object_instance);
|
||||
break;
|
||||
|
||||
case PROP_OBJECT_NAME:
|
||||
@@ -203,7 +210,8 @@ int PositiveInteger_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
break;
|
||||
|
||||
case PROP_PRESENT_VALUE:
|
||||
apdu_len = encode_application_unsigned(&apdu[0],
|
||||
apdu_len = encode_application_unsigned(
|
||||
&apdu[0],
|
||||
PositiveInteger_Value_Present_Value(rpdata->object_instance));
|
||||
break;
|
||||
|
||||
@@ -212,7 +220,8 @@ int PositiveInteger_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_IN_ALARM, false);
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_FAULT, false);
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_OVERRIDDEN, false);
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_OUT_OF_SERVICE,
|
||||
bitstring_set_bit(
|
||||
&bit_string, STATUS_FLAG_OUT_OF_SERVICE,
|
||||
CurrentAV->Out_Of_Service);
|
||||
|
||||
apdu_len = encode_application_bitstring(&apdu[0], &bit_string);
|
||||
|
||||
@@ -20,71 +20,65 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct positiveinteger_value_descr {
|
||||
bool Out_Of_Service:1;
|
||||
uint32_t Present_Value;
|
||||
uint16_t Units;
|
||||
} POSITIVEINTEGER_VALUE_DESCR;
|
||||
typedef struct positiveinteger_value_descr {
|
||||
bool Out_Of_Service : 1;
|
||||
uint32_t Present_Value;
|
||||
uint16_t Units;
|
||||
} POSITIVEINTEGER_VALUE_DESCR;
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void PositiveInteger_Value_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Valid_Instance(uint32_t object_instance);
|
||||
unsigned PositiveInteger_Value_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t PositiveInteger_Value_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned PositiveInteger_Value_Instance_To_Index(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void PositiveInteger_Value_Property_Lists(const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Valid_Instance(uint32_t object_instance);
|
||||
unsigned PositiveInteger_Value_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t PositiveInteger_Value_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned PositiveInteger_Value_Instance_To_Index(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Object_Name(uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
int PositiveInteger_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int PositiveInteger_Value_Read_Property(BACNET_READ_PROPERTY_DATA *
|
||||
rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *
|
||||
wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Present_Value_Set(
|
||||
uint32_t object_instance, uint32_t value, uint8_t priority);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t PositiveInteger_Value_Present_Value(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Present_Value_Set(uint32_t object_instance,
|
||||
uint32_t value,
|
||||
uint8_t priority);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t PositiveInteger_Value_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void PositiveInteger_Value_Change_Of_Value_Clear(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Encode_Value_List(
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void PositiveInteger_Value_Change_Of_Value_Clear(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Encode_Value_List(uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
char *PositiveInteger_Value_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Description_Set(
|
||||
uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *PositiveInteger_Value_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Description_Set(uint32_t instance,
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void PositiveInteger_Value_Out_Of_Service_Set(uint32_t instance, bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void PositiveInteger_Value_Out_Of_Service_Set(uint32_t instance,
|
||||
bool oos_flag);
|
||||
/* note: header of Intrinsic_Reporting function is required
|
||||
even when INTRINSIC_REPORTING is not defined */
|
||||
BACNET_STACK_EXPORT
|
||||
void PositiveInteger_Value_Intrinsic_Reporting(uint32_t object_instance);
|
||||
|
||||
/* note: header of Intrinsic_Reporting function is required
|
||||
even when INTRINSIC_REPORTING is not defined */
|
||||
BACNET_STACK_EXPORT
|
||||
void PositiveInteger_Value_Intrinsic_Reporting(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void PositiveInteger_Value_Init(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void PositiveInteger_Value_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -24,17 +24,26 @@
|
||||
|
||||
static SCHEDULE_DESCR Schedule_Descr[MAX_SCHEDULES];
|
||||
|
||||
static const int Schedule_Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_PRESENT_VALUE,
|
||||
PROP_EFFECTIVE_PERIOD, PROP_SCHEDULE_DEFAULT,
|
||||
PROP_LIST_OF_OBJECT_PROPERTY_REFERENCES, PROP_PRIORITY_FOR_WRITING,
|
||||
PROP_STATUS_FLAGS, PROP_RELIABILITY, PROP_OUT_OF_SERVICE, -1 };
|
||||
static const int Schedule_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_EFFECTIVE_PERIOD,
|
||||
PROP_SCHEDULE_DEFAULT,
|
||||
PROP_LIST_OF_OBJECT_PROPERTY_REFERENCES,
|
||||
PROP_PRIORITY_FOR_WRITING,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_RELIABILITY,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Schedule_Properties_Optional[] = { PROP_WEEKLY_SCHEDULE,
|
||||
#if BACNET_EXCEPTION_SCHEDULE_SIZE
|
||||
PROP_EXCEPTION_SCHEDULE,
|
||||
PROP_EXCEPTION_SCHEDULE,
|
||||
#endif
|
||||
-1 };
|
||||
-1 };
|
||||
|
||||
static const int Schedule_Properties_Proprietary[] = { -1 };
|
||||
|
||||
@@ -94,7 +103,8 @@ void Schedule_Init(void)
|
||||
for (j = 0; j < 7; j++) {
|
||||
psched->Weekly_Schedule[j].TV_Count = 0;
|
||||
}
|
||||
memcpy(&psched->Present_Value, &psched->Schedule_Default,
|
||||
memcpy(
|
||||
&psched->Present_Value, &psched->Schedule_Default,
|
||||
sizeof(psched->Present_Value));
|
||||
psched->Schedule_Default.context_specific = false;
|
||||
psched->Schedule_Default.tag = BACNET_APPLICATION_TAG_REAL;
|
||||
@@ -111,8 +121,7 @@ void Schedule_Init(void)
|
||||
&event->period.calendarEntry.type.DateRange.startdate,
|
||||
&start_date);
|
||||
datetime_copy_date(
|
||||
&event->period.calendarEntry.type.DateRange.enddate,
|
||||
&end_date);
|
||||
&event->period.calendarEntry.type.DateRange.enddate, &end_date);
|
||||
event->period.calendarEntry.next = NULL;
|
||||
event->timeValues.TV_Count = 0;
|
||||
event->priority = 16;
|
||||
@@ -188,7 +197,8 @@ bool Schedule_Object_Name(
|
||||
|
||||
index = Schedule_Instance_To_Index(object_instance);
|
||||
if (index < MAX_SCHEDULES) {
|
||||
snprintf(text, sizeof(text), "SCHEDULE %lu", (unsigned long)object_instance);
|
||||
snprintf(
|
||||
text, sizeof(text), "SCHEDULE %lu", (unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, text);
|
||||
}
|
||||
|
||||
@@ -241,8 +251,8 @@ static int Schedule_Weekly_Schedule_Encode(
|
||||
apdu += len;
|
||||
}
|
||||
for (i = 0; i < pObject->Weekly_Schedule[day].TV_Count; i++) {
|
||||
len = bacnet_time_value_encode(apdu,
|
||||
&pObject->Weekly_Schedule[day].Time_Values[i]);
|
||||
len = bacnet_time_value_encode(
|
||||
apdu, &pObject->Weekly_Schedule[day].Time_Values[i]);
|
||||
apdu_len += len;
|
||||
if (apdu) {
|
||||
apdu += len;
|
||||
@@ -278,8 +288,8 @@ static int Schedule_Exception_Schedule_Encode(
|
||||
if (!pObject) {
|
||||
return BACNET_STATUS_ERROR;
|
||||
}
|
||||
apdu_len = bacnet_special_event_encode(apdu,
|
||||
&pObject->Exception_Schedule[array_index]);
|
||||
apdu_len = bacnet_special_event_encode(
|
||||
apdu, &pObject->Exception_Schedule[array_index]);
|
||||
|
||||
return apdu_len;
|
||||
}
|
||||
@@ -439,8 +449,9 @@ bool Schedule_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
break;
|
||||
default:
|
||||
if (property_lists_member(
|
||||
Schedule_Properties_Required, Schedule_Properties_Optional,
|
||||
Schedule_Properties_Proprietary, wp_data->object_property)) {
|
||||
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;
|
||||
} else {
|
||||
@@ -498,13 +509,15 @@ void Schedule_Recalculate_PV(
|
||||
if (diff >= 0 &&
|
||||
desc->Weekly_Schedule[wday - 1].Time_Values[i].Value.tag !=
|
||||
BACNET_APPLICATION_TAG_NULL) {
|
||||
bacnet_primitive_to_application_data_value(&desc->Present_Value,
|
||||
bacnet_primitive_to_application_data_value(
|
||||
&desc->Present_Value,
|
||||
&desc->Weekly_Schedule[wday - 1].Time_Values[i].Value);
|
||||
}
|
||||
}
|
||||
|
||||
if (desc->Present_Value.tag == BACNET_APPLICATION_TAG_NULL) {
|
||||
memcpy(&desc->Present_Value, &desc->Schedule_Default,
|
||||
memcpy(
|
||||
&desc->Present_Value, &desc->Schedule_Default,
|
||||
sizeof(desc->Present_Value));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,97 +22,96 @@
|
||||
#include "bacnet/special_event.h"
|
||||
|
||||
#ifndef BACNET_WEEKLY_SCHEDULE_SIZE
|
||||
#define BACNET_WEEKLY_SCHEDULE_SIZE 8 /* maximum number of data points for each day */
|
||||
/* Maximum number of data points for each day */
|
||||
#define BACNET_WEEKLY_SCHEDULE_SIZE 8
|
||||
#endif
|
||||
|
||||
#ifndef BACNET_SCHEDULE_OBJ_PROP_REF_SIZE
|
||||
#define BACNET_SCHEDULE_OBJ_PROP_REF_SIZE 4 /* maximum number of obj prop references */
|
||||
/* Maximum number of obj prop references */
|
||||
#define BACNET_SCHEDULE_OBJ_PROP_REF_SIZE 4
|
||||
#endif
|
||||
|
||||
#ifndef BACNET_EXCEPTION_SCHEDULE_SIZE
|
||||
#define BACNET_EXCEPTION_SCHEDULE_SIZE 8 /* maximum number of special events */
|
||||
/* Maximum number of special events */
|
||||
#define BACNET_EXCEPTION_SCHEDULE_SIZE 8
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Note:
|
||||
* This is a different struct from BACNET_DAILY_SCHEDULE used in prop value encoding!
|
||||
* The number of entries is different.
|
||||
*/
|
||||
typedef struct bacnet_obj_daily_schedule {
|
||||
BACNET_TIME_VALUE Time_Values[BACNET_WEEKLY_SCHEDULE_SIZE];
|
||||
uint16_t TV_Count; /* the number of time values actually used */
|
||||
} BACNET_OBJ_DAILY_SCHEDULE;
|
||||
/*
|
||||
* Note:
|
||||
* This is a different struct from BACNET_DAILY_SCHEDULE used in prop value
|
||||
* encoding! The number of entries is different.
|
||||
*/
|
||||
typedef struct bacnet_obj_daily_schedule {
|
||||
BACNET_TIME_VALUE Time_Values[BACNET_WEEKLY_SCHEDULE_SIZE];
|
||||
uint16_t TV_Count; /* the number of time values actually used */
|
||||
} BACNET_OBJ_DAILY_SCHEDULE;
|
||||
|
||||
typedef struct schedule {
|
||||
/* Effective Period: Start and End Date */
|
||||
BACNET_DATE Start_Date;
|
||||
BACNET_DATE End_Date;
|
||||
/* Properties concerning Present Value */
|
||||
BACNET_OBJ_DAILY_SCHEDULE Weekly_Schedule[7];
|
||||
typedef struct schedule {
|
||||
/* Effective Period: Start and End Date */
|
||||
BACNET_DATE Start_Date;
|
||||
BACNET_DATE End_Date;
|
||||
/* Properties concerning Present Value */
|
||||
BACNET_OBJ_DAILY_SCHEDULE Weekly_Schedule[7];
|
||||
#if BACNET_EXCEPTION_SCHEDULE_SIZE
|
||||
BACNET_SPECIAL_EVENT Exception_Schedule[BACNET_EXCEPTION_SCHEDULE_SIZE];
|
||||
BACNET_SPECIAL_EVENT Exception_Schedule[BACNET_EXCEPTION_SCHEDULE_SIZE];
|
||||
#endif
|
||||
BACNET_APPLICATION_DATA_VALUE Schedule_Default;
|
||||
/*
|
||||
* Caution: This is a converted to BACNET_PRIMITIVE_APPLICATION_DATA_VALUE.
|
||||
* Only some data types may be used!
|
||||
*/
|
||||
BACNET_APPLICATION_DATA_VALUE Present_Value; /* must be set to a valid value
|
||||
* default is Schedule_Default */
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE
|
||||
Object_Property_References[BACNET_SCHEDULE_OBJ_PROP_REF_SIZE];
|
||||
uint8_t obj_prop_ref_cnt; /* actual number of obj_prop references */
|
||||
uint8_t Priority_For_Writing; /* (1..16) */
|
||||
bool Out_Of_Service;
|
||||
} SCHEDULE_DESCR;
|
||||
BACNET_APPLICATION_DATA_VALUE Schedule_Default;
|
||||
/*
|
||||
* Caution: This is a converted to BACNET_PRIMITIVE_APPLICATION_DATA_VALUE.
|
||||
* Only some data types may be used!
|
||||
*
|
||||
* Must be set to a valid value. Default is Schedule_Default.
|
||||
*/
|
||||
BACNET_APPLICATION_DATA_VALUE Present_Value;
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE
|
||||
Object_Property_References[BACNET_SCHEDULE_OBJ_PROP_REF_SIZE];
|
||||
uint8_t obj_prop_ref_cnt; /* actual number of obj_prop references */
|
||||
uint8_t Priority_For_Writing; /* (1..16) */
|
||||
bool Out_Of_Service;
|
||||
} SCHEDULE_DESCR;
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Schedule_Property_Lists(const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void Schedule_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Schedule_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Schedule_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Schedule_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Schedule_Instance_To_Index(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Schedule_Init(void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Schedule_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Schedule_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Schedule_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Schedule_Instance_To_Index(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Schedule_Init(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Schedule_Out_Of_Service_Set(
|
||||
uint32_t object_instance,
|
||||
bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Schedule_Out_Of_Service(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Schedule_Out_Of_Service_Set(uint32_t object_instance, bool value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Schedule_Out_Of_Service(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Schedule_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Schedule_Object_Name(uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
int Schedule_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Schedule_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Schedule_Read_Property(BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Schedule_Write_Property(BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
/* utility functions for calculating current Present Value
|
||||
* if Exception Schedule is to be added, these functions must take that into account */
|
||||
BACNET_STACK_EXPORT
|
||||
bool Schedule_In_Effective_Period(const SCHEDULE_DESCR * desc,
|
||||
const BACNET_DATE * date);
|
||||
BACNET_STACK_EXPORT
|
||||
void Schedule_Recalculate_PV(SCHEDULE_DESCR * desc,
|
||||
BACNET_WEEKDAY wday,
|
||||
const BACNET_TIME * time);
|
||||
/* utility functions for calculating current Present Value
|
||||
* if Exception Schedule is to be added, these functions must take that into
|
||||
* account */
|
||||
BACNET_STACK_EXPORT
|
||||
bool Schedule_In_Effective_Period(
|
||||
const SCHEDULE_DESCR *desc, const BACNET_DATE *date);
|
||||
BACNET_STACK_EXPORT
|
||||
void Schedule_Recalculate_PV(
|
||||
SCHEDULE_DESCR *desc, BACNET_WEEKDAY wday, const BACNET_TIME *time);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -59,7 +59,8 @@ int Structured_View_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Structured_View_Description(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Structured_View_Description_Set(uint32_t object_instance, const char *new_name);
|
||||
bool Structured_View_Description_Set(
|
||||
uint32_t object_instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_NODE_TYPE Structured_View_Node_Type(uint32_t object_instance);
|
||||
@@ -70,7 +71,8 @@ bool Structured_View_Node_Type_Set(
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Structured_View_Node_Subtype(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Structured_View_Node_Subtype_Set(uint32_t object_instance, const char *new_name);
|
||||
bool Structured_View_Node_Subtype_Set(
|
||||
uint32_t object_instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_SUBORDINATE_DATA *
|
||||
@@ -79,8 +81,7 @@ BACNET_STACK_EXPORT
|
||||
void Structured_View_Subordinate_List_Set(
|
||||
uint32_t object_instance, BACNET_SUBORDINATE_DATA *subordinate_list);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_SUBORDINATE_DATA *
|
||||
Structured_View_Subordinate_List_Member(
|
||||
BACNET_SUBORDINATE_DATA *Structured_View_Subordinate_List_Member(
|
||||
uint32_t object_instance, BACNET_ARRAY_INDEX array_index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned int Structured_View_Subordinate_List_Count(uint32_t object_instance);
|
||||
@@ -110,8 +111,7 @@ BACNET_DEVICE_OBJECT_REFERENCE *
|
||||
Structured_View_Represents(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Structured_View_Represents_Set(
|
||||
uint32_t object_instance,
|
||||
const BACNET_DEVICE_OBJECT_REFERENCE *represents);
|
||||
uint32_t object_instance, const BACNET_DEVICE_OBJECT_REFERENCE *represents);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Structured_View_Create(uint32_t object_instance);
|
||||
|
||||
@@ -49,21 +49,27 @@ static time_value_write_present_value_callback
|
||||
Time_Value_Write_Present_Value_Callback;
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Time_Value_Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_PRESENT_VALUE, PROP_STATUS_FLAGS,
|
||||
-1 };
|
||||
static const int Time_Value_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER, PROP_OBJECT_NAME, PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE, PROP_STATUS_FLAGS, -1
|
||||
};
|
||||
|
||||
static const int Time_Value_Properties_Optional[] = { PROP_DESCRIPTION,
|
||||
PROP_EVENT_STATE, PROP_OUT_OF_SERVICE, -1 };
|
||||
PROP_EVENT_STATE,
|
||||
PROP_OUT_OF_SERVICE, -1 };
|
||||
|
||||
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,
|
||||
PROP_COMMAND_TIME_ARRAY, PROP_TAGS, -1 };
|
||||
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 };
|
||||
|
||||
/**
|
||||
* Returns the list of required, optional, and proprietary properties.
|
||||
@@ -227,7 +233,8 @@ bool Time_Value_Present_Value_Set(
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Time_Value_Present_Value_Write(uint32_t object_instance,
|
||||
static bool Time_Value_Present_Value_Write(
|
||||
uint32_t object_instance,
|
||||
BACNET_TIME *value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
@@ -375,7 +382,6 @@ const char *Time_Value_Name_ASCII(uint32_t object_instance)
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For a given object instance-number, returns the description
|
||||
*
|
||||
@@ -496,11 +502,13 @@ bool Time_Value_Encode_Value_List(
|
||||
bitstring_set_bit(
|
||||
&value_list->value.type.Bit_String, STATUS_FLAG_OVERRIDDEN, false);
|
||||
if (Time_Value_Out_Of_Service(object_instance)) {
|
||||
bitstring_set_bit(&value_list->value.type.Bit_String,
|
||||
STATUS_FLAG_OUT_OF_SERVICE, true);
|
||||
bitstring_set_bit(
|
||||
&value_list->value.type.Bit_String, STATUS_FLAG_OUT_OF_SERVICE,
|
||||
true);
|
||||
} else {
|
||||
bitstring_set_bit(&value_list->value.type.Bit_String,
|
||||
STATUS_FLAG_OUT_OF_SERVICE, false);
|
||||
bitstring_set_bit(
|
||||
&value_list->value.type.Bit_String, STATUS_FLAG_OUT_OF_SERVICE,
|
||||
false);
|
||||
}
|
||||
value_list->priority = BACNET_NO_PRIORITY;
|
||||
value_list->next = NULL;
|
||||
@@ -559,7 +567,8 @@ int Time_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_IN_ALARM, false);
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_FAULT, false);
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_OVERRIDDEN, false);
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_OUT_OF_SERVICE,
|
||||
bitstring_set_bit(
|
||||
&bit_string, STATUS_FLAG_OUT_OF_SERVICE,
|
||||
Time_Value_Out_Of_Service(rpdata->object_instance));
|
||||
apdu_len = encode_application_bitstring(&apdu[0], &bit_string);
|
||||
break;
|
||||
@@ -631,10 +640,10 @@ bool Time_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
status = write_property_type_valid(
|
||||
wp_data, &value, BACNET_APPLICATION_TAG_TIME);
|
||||
if (status) {
|
||||
status =
|
||||
Time_Value_Present_Value_Write(wp_data->object_instance,
|
||||
&value.type.Time, wp_data->priority,
|
||||
&wp_data->error_class, &wp_data->error_code);
|
||||
status = Time_Value_Present_Value_Write(
|
||||
wp_data->object_instance, &value.type.Time,
|
||||
wp_data->priority, &wp_data->error_class,
|
||||
&wp_data->error_code);
|
||||
}
|
||||
} else {
|
||||
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||
@@ -650,7 +659,8 @@ bool Time_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (property_lists_member(Time_Value_Properties_Required,
|
||||
if (property_lists_member(
|
||||
Time_Value_Properties_Required,
|
||||
Time_Value_Properties_Optional,
|
||||
Time_Value_Properties_Proprietary,
|
||||
wp_data->object_property)) {
|
||||
@@ -689,7 +699,8 @@ uint8_t Time_Value_Status_Flags(uint32_t object_instance)
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_IN_ALARM, false);
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_FAULT, false);
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_OVERRIDDEN, false);
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_OUT_OF_SERVICE,
|
||||
bitstring_set_bit(
|
||||
&bit_string, STATUS_FLAG_OUT_OF_SERVICE,
|
||||
Time_Value_Out_Of_Service(object_instance));
|
||||
|
||||
return bitstring_octet(&bit_string, 0);
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
* @param old_value - BACNET_TIME value prior to write
|
||||
* @param value - BACNET_TIME value of the write
|
||||
*/
|
||||
typedef void (*time_value_write_present_value_callback)(uint32_t object_instance,
|
||||
BACNET_TIME *old_value,
|
||||
BACNET_TIME *value);
|
||||
typedef void (*time_value_write_present_value_callback)(
|
||||
uint32_t object_instance, BACNET_TIME *old_value, BACNET_TIME *value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -88,14 +87,11 @@ void Time_Value_Write_Disable(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Time_Value_Encode_Value_List(
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Time_Value_Change_Of_Value(
|
||||
uint32_t instance);
|
||||
bool Time_Value_Change_Of_Value(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Time_Value_Change_Of_Value_Clear(
|
||||
uint32_t instance);
|
||||
void Time_Value_Change_Of_Value_Clear(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Time_Value_Create(uint32_t object_instance);
|
||||
|
||||
@@ -37,14 +37,22 @@ static TL_LOG_INFO LogInfo[MAX_TREND_LOGS];
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Trend_Log_Properties_Required[] = { PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME, PROP_OBJECT_TYPE, PROP_ENABLE, PROP_STOP_WHEN_FULL,
|
||||
PROP_BUFFER_SIZE, PROP_LOG_BUFFER, PROP_RECORD_COUNT,
|
||||
PROP_TOTAL_RECORD_COUNT, PROP_EVENT_STATE, PROP_LOGGING_TYPE,
|
||||
PROP_STATUS_FLAGS, -1 };
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_ENABLE,
|
||||
PROP_STOP_WHEN_FULL,
|
||||
PROP_BUFFER_SIZE,
|
||||
PROP_LOG_BUFFER,
|
||||
PROP_RECORD_COUNT,
|
||||
PROP_TOTAL_RECORD_COUNT,
|
||||
PROP_EVENT_STATE,
|
||||
PROP_LOGGING_TYPE,
|
||||
PROP_STATUS_FLAGS,
|
||||
-1 };
|
||||
|
||||
static const int Trend_Log_Properties_Optional[] = { PROP_DESCRIPTION,
|
||||
PROP_START_TIME, PROP_STOP_TIME, PROP_LOG_DEVICE_OBJECT_PROPERTY,
|
||||
PROP_LOG_INTERVAL,
|
||||
static const int Trend_Log_Properties_Optional[] = {
|
||||
PROP_DESCRIPTION, PROP_START_TIME, PROP_STOP_TIME,
|
||||
PROP_LOG_DEVICE_OBJECT_PROPERTY, PROP_LOG_INTERVAL,
|
||||
|
||||
/* Required if COV logging supported
|
||||
PROP_COV_RESUBSCRIPTION_INTERVAL,
|
||||
@@ -60,7 +68,8 @@ static const int Trend_Log_Properties_Optional[] = { PROP_DESCRIPTION,
|
||||
PROP_NOTIFY_TYPE,
|
||||
PROP_EVENT_TIME_STAMPS, */
|
||||
|
||||
PROP_ALIGN_INTERVALS, PROP_INTERVAL_OFFSET, PROP_TRIGGER, -1 };
|
||||
PROP_ALIGN_INTERVALS, PROP_INTERVAL_OFFSET, PROP_TRIGGER, -1
|
||||
};
|
||||
|
||||
static const int Trend_Log_Properties_Proprietary[] = { -1 };
|
||||
|
||||
@@ -234,7 +243,8 @@ 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);
|
||||
}
|
||||
@@ -569,9 +579,9 @@ bool Trend_Log_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
}
|
||||
start_date = value.type.Date;
|
||||
/* Then decode the time part */
|
||||
len =
|
||||
bacapp_decode_application_data(wp_data->application_data + len,
|
||||
wp_data->application_data_len - len, &value);
|
||||
len = bacapp_decode_application_data(
|
||||
wp_data->application_data + len,
|
||||
wp_data->application_data_len - len, &value);
|
||||
|
||||
if (len) {
|
||||
status = write_property_type_valid(
|
||||
@@ -620,9 +630,9 @@ bool Trend_Log_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
}
|
||||
stop_date = value.type.Date;
|
||||
/* Then decode the time part */
|
||||
len =
|
||||
bacapp_decode_application_data(wp_data->application_data + len,
|
||||
wp_data->application_data_len - len, &value);
|
||||
len = bacapp_decode_application_data(
|
||||
wp_data->application_data + len,
|
||||
wp_data->application_data_len - len, &value);
|
||||
|
||||
if (len) {
|
||||
status = write_property_type_valid(
|
||||
@@ -664,7 +674,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;
|
||||
@@ -674,7 +684,7 @@ bool Trend_Log_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
/* We only support references to objects in ourself for now */
|
||||
if ((TempSource.deviceIdentifier.type == OBJECT_DEVICE) &&
|
||||
(TempSource.deviceIdentifier.instance !=
|
||||
Device_Object_Instance_Number())) {
|
||||
Device_Object_Instance_Number())) {
|
||||
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||
wp_data->error_code =
|
||||
ERROR_CODE_OPTIONAL_FUNCTIONALITY_NOT_SUPPORTED;
|
||||
@@ -682,7 +692,8 @@ bool Trend_Log_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
}
|
||||
|
||||
/* Quick comparison if structures are packed ... */
|
||||
if (memcmp(&TempSource, &CurrentLog->Source,
|
||||
if (memcmp(
|
||||
&TempSource, &CurrentLog->Source,
|
||||
sizeof(BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE)) != 0) {
|
||||
/* Clear buffer if property being logged is changed */
|
||||
CurrentLog->ulRecordCount = 0;
|
||||
@@ -866,7 +877,8 @@ bool TL_Is_Enabled(int iLog)
|
||||
if (CurrentLog->bEnable == false) {
|
||||
/* Not enabled so time is irrelevant */
|
||||
bStatus = false;
|
||||
} else if ((CurrentLog->ucTimeFlags == 0) &&
|
||||
} else if (
|
||||
(CurrentLog->ucTimeFlags == 0) &&
|
||||
(CurrentLog->tStopTime < CurrentLog->tStartTime)) {
|
||||
/* Start time was after stop time as per 12.25.6 and 12.25.7 */
|
||||
bStatus = false;
|
||||
@@ -1444,12 +1456,13 @@ int TL_encode_entry(uint8_t *apdu, int iLog, int iEntry)
|
||||
* have limited to 32 bits maximum as allowed by the standard
|
||||
*/
|
||||
bitstring_init(&TempBits);
|
||||
bitstring_set_bits_used(&TempBits,
|
||||
(pSource->Datum.Bits.ucLen >> 4) & 0x0F,
|
||||
bitstring_set_bits_used(
|
||||
&TempBits, (pSource->Datum.Bits.ucLen >> 4) & 0x0F,
|
||||
pSource->Datum.Bits.ucLen & 0x0F);
|
||||
for (ucCount = pSource->Datum.Bits.ucLen >> 4; ucCount > 0;
|
||||
ucCount--) {
|
||||
bitstring_set_octet(&TempBits, ucCount - 1,
|
||||
bitstring_set_octet(
|
||||
&TempBits, ucCount - 1,
|
||||
pSource->Datum.Bits.ucStore[ucCount - 1]);
|
||||
}
|
||||
|
||||
@@ -1496,7 +1509,8 @@ int TL_encode_entry(uint8_t *apdu, int iLog, int iEntry)
|
||||
return (iLen);
|
||||
}
|
||||
|
||||
static int local_read_property(uint8_t *value,
|
||||
static int local_read_property(
|
||||
uint8_t *value,
|
||||
uint8_t *status,
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *Source,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
@@ -1699,12 +1713,13 @@ void trend_log_timer(uint16_t uSeconds)
|
||||
* CurrentLog->ulLogInterval)) { */
|
||||
if ((tNow % CurrentLog->ulLogInterval) ==
|
||||
(CurrentLog->ulIntervalOffset %
|
||||
CurrentLog->ulLogInterval)) {
|
||||
CurrentLog->ulLogInterval)) {
|
||||
/* Record value if time synchronised trigger condition
|
||||
* is met and at least one period has elapsed.
|
||||
*/
|
||||
TL_fetch_property(iCount);
|
||||
} else if ((tNow - CurrentLog->tLastDataTime) >
|
||||
} else if (
|
||||
(tNow - CurrentLog->tLastDataTime) >
|
||||
CurrentLog->ulLogInterval) {
|
||||
/* Also record value if we have waited more than a
|
||||
* period since the last reading. This ensures we take a
|
||||
@@ -1713,8 +1728,9 @@ void trend_log_timer(uint16_t uSeconds)
|
||||
*/
|
||||
TL_fetch_property(iCount);
|
||||
}
|
||||
} else if (((tNow - CurrentLog->tLastDataTime) >=
|
||||
CurrentLog->ulLogInterval) ||
|
||||
} else if (
|
||||
((tNow - CurrentLog->tLastDataTime) >=
|
||||
CurrentLog->ulLogInterval) ||
|
||||
(CurrentLog->bTrigger == true)) {
|
||||
/* If not aligned take a reading when we have either waited
|
||||
* long enough or a trigger is set.
|
||||
|
||||
+108
-134
@@ -23,17 +23,18 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Error code for Trend Log storage */
|
||||
typedef struct tl_error {
|
||||
uint16_t usClass;
|
||||
uint16_t usCode;
|
||||
} TL_ERROR;
|
||||
typedef struct tl_error {
|
||||
uint16_t usClass;
|
||||
uint16_t usCode;
|
||||
} TL_ERROR;
|
||||
|
||||
/* Bit string of up to 32 bits for Trend Log storage */
|
||||
|
||||
typedef struct tl_bits {
|
||||
uint8_t ucLen; /* bytes used in upper nibble/bits free in lower nibble */
|
||||
uint8_t ucStore[4];
|
||||
} TL_BITS;
|
||||
typedef struct tl_bits {
|
||||
/* Bytes used in upper nibble/bits free in lower nibble */
|
||||
uint8_t ucLen;
|
||||
uint8_t ucStore[4];
|
||||
} TL_BITS;
|
||||
|
||||
/* Storage structure for Trend Log data
|
||||
*
|
||||
@@ -45,49 +46,53 @@ extern "C" {
|
||||
* logging capacity as possible every little byte counts!
|
||||
*/
|
||||
|
||||
typedef struct tl_data_record {
|
||||
bacnet_time_t tTimeStamp; /* When the event occurred */
|
||||
uint8_t ucRecType; /* What type of Event */
|
||||
uint8_t ucStatus; /* Optional Status for read value in b0-b2, b7 = 1 if status is used */
|
||||
union {
|
||||
uint8_t ucLogStatus; /* Change of log state flags */
|
||||
uint8_t ucBoolean; /* Stored boolean value */
|
||||
float fReal; /* Stored floating point value */
|
||||
uint32_t ulEnum; /* Stored enumerated value - max 32 bits */
|
||||
uint32_t ulUValue; /* Stored unsigned value - max 32 bits */
|
||||
int32_t lSValue; /* Stored signed value - max 32 bits */
|
||||
TL_BITS Bits; /* Stored bitstring - max 32 bits */
|
||||
TL_ERROR Error; /* Two part error class/code combo */
|
||||
float fTime; /* Interval value for change of time - seconds */
|
||||
} Datum;
|
||||
} TL_DATA_REC;
|
||||
typedef struct tl_data_record {
|
||||
bacnet_time_t tTimeStamp; /* When the event occurred */
|
||||
uint8_t ucRecType; /* What type of Event */
|
||||
/* Optional Status for read value in b0-b2, b7 = 1 if status is used */
|
||||
uint8_t ucStatus;
|
||||
union {
|
||||
uint8_t ucLogStatus; /* Change of log state flags */
|
||||
uint8_t ucBoolean; /* Stored boolean value */
|
||||
float fReal; /* Stored floating point value */
|
||||
uint32_t ulEnum; /* Stored enumerated value - max 32 bits */
|
||||
uint32_t ulUValue; /* Stored unsigned value - max 32 bits */
|
||||
int32_t lSValue; /* Stored signed value - max 32 bits */
|
||||
TL_BITS Bits; /* Stored bitstring - max 32 bits */
|
||||
TL_ERROR Error; /* Two part error class/code combo */
|
||||
float fTime; /* Interval value for change of time - seconds */
|
||||
} Datum;
|
||||
} TL_DATA_REC;
|
||||
|
||||
#define TL_T_START_WILD 1 /* Start time is wild carded */
|
||||
#define TL_T_STOP_WILD 2 /* Stop Time is wild carded */
|
||||
#define TL_T_START_WILD 1 /* Start time is wild carded */
|
||||
#define TL_T_STOP_WILD 2 /* Stop Time is wild carded */
|
||||
|
||||
#define TL_MAX_ENTRIES 1000 /* Entries per datalog */
|
||||
#define TL_MAX_ENTRIES 1000 /* Entries per datalog */
|
||||
|
||||
/* Structure containing config and status info for a Trend Log */
|
||||
|
||||
typedef struct tl_log_info {
|
||||
bool bEnable; /* Trend log is active when this is true */
|
||||
BACNET_DATE_TIME StartTime; /* BACnet format start time */
|
||||
bacnet_time_t tStartTime; /* Local time working copy of start time */
|
||||
BACNET_DATE_TIME StopTime; /* BACnet format stop time */
|
||||
bacnet_time_t tStopTime; /* Local time working copy of stop time */
|
||||
uint8_t ucTimeFlags; /* Shorthand info on times */
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE Source; /* Where the data comes from */
|
||||
uint32_t ulLogInterval; /* Time between entries in seconds */
|
||||
bool bStopWhenFull; /* Log halts when full if true */
|
||||
uint32_t ulRecordCount; /* Count of items currently in the buffer */
|
||||
uint32_t ulTotalRecordCount; /* Count of all items that have ever been inserted into the buffer */
|
||||
BACNET_LOGGING_TYPE LoggingType; /* Polled/cov/triggered */
|
||||
bool bAlignIntervals; /* If true align to the clock */
|
||||
uint32_t ulIntervalOffset; /* Offset from start of period for taking reading in seconds */
|
||||
bool bTrigger; /* Set to 1 to cause a reading to be taken */
|
||||
int iIndex; /* Current insertion point */
|
||||
bacnet_time_t tLastDataTime;
|
||||
} TL_LOG_INFO;
|
||||
typedef struct tl_log_info {
|
||||
bool bEnable; /* Trend log is active when this is true */
|
||||
BACNET_DATE_TIME StartTime; /* BACnet format start time */
|
||||
bacnet_time_t tStartTime; /* Local time working copy of start time */
|
||||
BACNET_DATE_TIME StopTime; /* BACnet format stop time */
|
||||
bacnet_time_t tStopTime; /* Local time working copy of stop time */
|
||||
uint8_t ucTimeFlags; /* Shorthand info on times */
|
||||
/* Where the data comes from */
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE Source;
|
||||
uint32_t ulLogInterval; /* Time between entries in seconds */
|
||||
bool bStopWhenFull; /* Log halts when full if true */
|
||||
uint32_t ulRecordCount; /* Count of items currently in the buffer */
|
||||
/* Count of all items that have ever been inserted into the buffer */
|
||||
uint32_t ulTotalRecordCount;
|
||||
BACNET_LOGGING_TYPE LoggingType; /* Polled/cov/triggered */
|
||||
bool bAlignIntervals; /* If true align to the clock */
|
||||
/* Offset from start of period for taking reading in seconds */
|
||||
uint32_t ulIntervalOffset;
|
||||
bool bTrigger; /* Set to 1 to cause a reading to be taken */
|
||||
int iIndex; /* Current insertion point */
|
||||
bacnet_time_t tLastDataTime;
|
||||
} TL_LOG_INFO;
|
||||
|
||||
/*
|
||||
* Data types associated with a BACnet Log Record. We use these for managing the
|
||||
@@ -95,110 +100,79 @@ extern "C" {
|
||||
* the log datum field.
|
||||
*/
|
||||
|
||||
#define TL_TYPE_STATUS 0
|
||||
#define TL_TYPE_BOOL 1
|
||||
#define TL_TYPE_REAL 2
|
||||
#define TL_TYPE_ENUM 3
|
||||
#define TL_TYPE_UNSIGN 4
|
||||
#define TL_TYPE_SIGN 5
|
||||
#define TL_TYPE_BITS 6
|
||||
#define TL_TYPE_NULL 7
|
||||
#define TL_TYPE_ERROR 8
|
||||
#define TL_TYPE_DELTA 9
|
||||
#define TL_TYPE_ANY 10 /* We don't support this particular can of worms! */
|
||||
#define TL_TYPE_STATUS 0
|
||||
#define TL_TYPE_BOOL 1
|
||||
#define TL_TYPE_REAL 2
|
||||
#define TL_TYPE_ENUM 3
|
||||
#define TL_TYPE_UNSIGN 4
|
||||
#define TL_TYPE_SIGN 5
|
||||
#define TL_TYPE_BITS 6
|
||||
#define TL_TYPE_NULL 7
|
||||
#define TL_TYPE_ERROR 8
|
||||
#define TL_TYPE_DELTA 9
|
||||
#define TL_TYPE_ANY 10 /* We don't support this particular can of worms! */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Trend_Log_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Trend_Log_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Trend_Log_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Trend_Log_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Trend_Log_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Trend_Log_Instance_To_Index(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Trend_Log_Object_Instance_Add(uint32_t instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Trend_Log_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Trend_Log_Count(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Trend_Log_Index_To_Instance(
|
||||
unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Trend_Log_Instance_To_Index(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Trend_Log_Object_Instance_Add(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Trend_Log_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Trend_Log_Object_Name(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
int Trend_Log_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Trend_Log_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Trend_Log_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
void Trend_Log_Init(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Trend_Log_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
BACNET_STACK_EXPORT
|
||||
void Trend_Log_Init(
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void TL_Insert_Status_Rec(int iLog, BACNET_LOG_STATUS eStatus, bool bState);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void TL_Insert_Status_Rec(
|
||||
int iLog,
|
||||
BACNET_LOG_STATUS eStatus,
|
||||
bool bState);
|
||||
BACNET_STACK_EXPORT
|
||||
bool TL_Is_Enabled(int iLog);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool TL_Is_Enabled(
|
||||
int iLog);
|
||||
BACNET_STACK_EXPORT
|
||||
bacnet_time_t TL_BAC_Time_To_Local(const BACNET_DATE_TIME *SourceTime);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bacnet_time_t TL_BAC_Time_To_Local(
|
||||
const BACNET_DATE_TIME * SourceTime);
|
||||
BACNET_STACK_EXPORT
|
||||
void TL_Local_Time_To_BAC(BACNET_DATE_TIME *DestTime, bacnet_time_t SourceTime);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void TL_Local_Time_To_BAC(
|
||||
BACNET_DATE_TIME * DestTime,
|
||||
bacnet_time_t SourceTime);
|
||||
BACNET_STACK_EXPORT
|
||||
int TL_encode_entry(uint8_t *apdu, int iLog, int iEntry);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int TL_encode_entry(
|
||||
uint8_t * apdu,
|
||||
int iLog,
|
||||
int iEntry);
|
||||
BACNET_STACK_EXPORT
|
||||
int TL_encode_by_position(uint8_t *apdu, BACNET_READ_RANGE_DATA *pRequest);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int TL_encode_by_position(
|
||||
uint8_t * apdu,
|
||||
BACNET_READ_RANGE_DATA * pRequest);
|
||||
BACNET_STACK_EXPORT
|
||||
int TL_encode_by_sequence(uint8_t *apdu, BACNET_READ_RANGE_DATA *pRequest);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int TL_encode_by_sequence(
|
||||
uint8_t * apdu,
|
||||
BACNET_READ_RANGE_DATA * pRequest);
|
||||
BACNET_STACK_EXPORT
|
||||
int TL_encode_by_time(uint8_t *apdu, BACNET_READ_RANGE_DATA *pRequest);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int TL_encode_by_time(
|
||||
uint8_t * apdu,
|
||||
BACNET_READ_RANGE_DATA * pRequest);
|
||||
BACNET_STACK_EXPORT
|
||||
bool TrendLogGetRRInfo(
|
||||
BACNET_READ_RANGE_DATA *pRequest, /* Info on the request */
|
||||
RR_PROP_INFO *pInfo); /* Where to put the information */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool TrendLogGetRRInfo(
|
||||
BACNET_READ_RANGE_DATA * pRequest, /* Info on the request */
|
||||
RR_PROP_INFO * pInfo); /* Where to put the information */
|
||||
BACNET_STACK_EXPORT
|
||||
int rr_trend_log_encode(uint8_t *apdu, BACNET_READ_RANGE_DATA *pRequest);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int rr_trend_log_encode(
|
||||
uint8_t * apdu,
|
||||
BACNET_READ_RANGE_DATA * pRequest);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void trend_log_timer(
|
||||
uint16_t uSeconds);
|
||||
BACNET_STACK_EXPORT
|
||||
void trend_log_timer(uint16_t uSeconds);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user