Enhanced the object API with optional functions.
This commit is contained in:
@@ -67,6 +67,7 @@ static const int Properties_Required[] = {
|
|||||||
|
|
||||||
static const int Properties_Optional[] = {
|
static const int Properties_Optional[] = {
|
||||||
PROP_DESCRIPTION,
|
PROP_DESCRIPTION,
|
||||||
|
PROP_STATE_TEXT,
|
||||||
-1
|
-1
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -399,7 +400,7 @@ int Multistate_Input_Encode_Property_APDU(
|
|||||||
characterstring_init_ansi(&char_string,
|
characterstring_init_ansi(&char_string,
|
||||||
Multistate_Input_State_Text(object_instance, i));
|
Multistate_Input_State_Text(object_instance, i));
|
||||||
/* FIXME: this might go beyond MAX_APDU length! */
|
/* FIXME: this might go beyond MAX_APDU length! */
|
||||||
apdu_len = encode_application_character_string(
|
len = encode_application_character_string(
|
||||||
&apdu[apdu_len],
|
&apdu[apdu_len],
|
||||||
&char_string);
|
&char_string);
|
||||||
/* add it if we have room */
|
/* add it if we have room */
|
||||||
|
|||||||
@@ -45,8 +45,11 @@ extern "C" {
|
|||||||
void);
|
void);
|
||||||
uint32_t Analog_Output_Index_To_Instance(
|
uint32_t Analog_Output_Index_To_Instance(
|
||||||
unsigned index);
|
unsigned index);
|
||||||
char *Analog_Output_Name(
|
unsigned Analog_Output_Instance_To_Index(
|
||||||
uint32_t object_instance);
|
uint32_t instance);
|
||||||
|
bool Analog_Output_Object_Instance_Add(
|
||||||
|
uint32_t instance);
|
||||||
|
|
||||||
float Analog_Output_Present_Value(
|
float Analog_Output_Present_Value(
|
||||||
uint32_t object_instance);
|
uint32_t object_instance);
|
||||||
unsigned Analog_Output_Present_Value_Priority(
|
unsigned Analog_Output_Present_Value_Priority(
|
||||||
@@ -58,6 +61,18 @@ extern "C" {
|
|||||||
bool Analog_Output_Present_Value_Relinquish(
|
bool Analog_Output_Present_Value_Relinquish(
|
||||||
uint32_t object_instance,
|
uint32_t object_instance,
|
||||||
unsigned priority);
|
unsigned priority);
|
||||||
|
|
||||||
|
char *Analog_Output_Name(
|
||||||
|
uint32_t object_instance);
|
||||||
|
bool Analog_Output_Name_Set(
|
||||||
|
uint32_t object_instance,
|
||||||
|
char *new_name);
|
||||||
|
|
||||||
|
char *Analog_Output_Description(
|
||||||
|
uint32_t instance);
|
||||||
|
bool Analog_Output_Description_Set(
|
||||||
|
uint32_t instance,
|
||||||
|
char *new_name);
|
||||||
|
|
||||||
void Analog_Output_Init(void);
|
void Analog_Output_Init(void);
|
||||||
|
|
||||||
|
|||||||
@@ -39,14 +39,15 @@ extern "C" {
|
|||||||
const int **pRequired,
|
const int **pRequired,
|
||||||
const int **pOptional,
|
const int **pOptional,
|
||||||
const int **pProprietary);
|
const int **pProprietary);
|
||||||
|
|
||||||
bool Multistate_Input_Valid_Instance(
|
bool Multistate_Input_Valid_Instance(
|
||||||
uint32_t object_instance);
|
uint32_t object_instance);
|
||||||
unsigned Multistate_Input_Count(
|
unsigned Multistate_Input_Count(
|
||||||
void);
|
void);
|
||||||
uint32_t Multistate_Input_Index_To_Instance(
|
uint32_t Multistate_Input_Index_To_Instance(
|
||||||
unsigned index);
|
unsigned index);
|
||||||
char *Multistate_Input_Name(
|
unsigned Multistate_Input_Instance_To_Index(
|
||||||
uint32_t object_instance);
|
uint32_t instance);
|
||||||
|
|
||||||
int Multistate_Input_Encode_Property_APDU(
|
int Multistate_Input_Encode_Property_APDU(
|
||||||
uint8_t * apdu,
|
uint8_t * apdu,
|
||||||
@@ -61,18 +62,29 @@ extern "C" {
|
|||||||
BACNET_ERROR_CLASS * error_class,
|
BACNET_ERROR_CLASS * error_class,
|
||||||
BACNET_ERROR_CODE * error_code);
|
BACNET_ERROR_CODE * error_code);
|
||||||
|
|
||||||
|
/* optional API */
|
||||||
|
bool Multistate_Input_Object_Instance_Add(
|
||||||
|
uint32_t instance);
|
||||||
|
char *Multistate_Input_Name(
|
||||||
|
uint32_t object_instance);
|
||||||
|
bool Multistate_Input_Name_Set(
|
||||||
|
uint32_t object_instance,
|
||||||
|
char *new_name);
|
||||||
|
uint32_t Multistate_Input_Present_Value(
|
||||||
|
uint32_t object_instance);
|
||||||
bool Multistate_Input_Present_Value_Set(
|
bool Multistate_Input_Present_Value_Set(
|
||||||
uint32_t object_instance,
|
uint32_t object_instance,
|
||||||
uint32_t value);
|
uint32_t value);
|
||||||
|
|
||||||
bool Multistate_Input_Description_Set(
|
bool Multistate_Input_Description_Set(
|
||||||
uint32_t object_instance,
|
uint32_t object_instance,
|
||||||
char *text_string);
|
char *text_string);
|
||||||
|
|
||||||
bool Multistate_Input_State_Text_Set(
|
bool Multistate_Input_State_Text_Set(
|
||||||
uint32_t object_instance,
|
uint32_t object_instance,
|
||||||
uint32_t state_index,
|
uint32_t state_index,
|
||||||
char *new_name);
|
char *new_name);
|
||||||
|
bool Multistate_Input_Max_States_Set(
|
||||||
|
uint32_t instance,
|
||||||
|
uint32_t max_states_requested);
|
||||||
|
|
||||||
void Multistate_Input_Init(
|
void Multistate_Input_Init(
|
||||||
void);
|
void);
|
||||||
|
|||||||
Reference in New Issue
Block a user