Added object-name c-string getter function to basic objects so they can be referenced to free if dynamically created. (#754)
* Added basic object-name get for ASCII names to enable free if they were dynamically created. Added unit testing to validate the basic object ASCII object-name API. * Removed static scope on character array used for name since the array gets copied into characterstring array and static is not needed.
This commit is contained in:
@@ -134,7 +134,7 @@ unsigned Accumulator_Instance_To_Index(uint32_t object_instance)
|
||||
bool Accumulator_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32]; /* okay for single thread */
|
||||
char text[32];
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_ACCUMULATORS) {
|
||||
|
||||
@@ -119,7 +119,7 @@ unsigned Access_Credential_Instance_To_Index(uint32_t object_instance)
|
||||
bool Access_Credential_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32] = ""; /* okay for single thread */
|
||||
char text[32] = "";
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_ACCESS_CREDENTIALS) {
|
||||
|
||||
@@ -256,7 +256,7 @@ static int Access_Door_Priority_Array_Encode(
|
||||
bool Access_Door_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32] = ""; /* okay for single thread */
|
||||
char text[32] = "";
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_ACCESS_DOORS) {
|
||||
|
||||
@@ -122,7 +122,7 @@ unsigned Access_Point_Instance_To_Index(uint32_t object_instance)
|
||||
bool Access_Point_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32] = ""; /* okay for single thread */
|
||||
char text[32] = "";
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_ACCESS_POINTS) {
|
||||
|
||||
@@ -114,7 +114,7 @@ unsigned Access_Rights_Instance_To_Index(uint32_t object_instance)
|
||||
bool Access_Rights_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32] = ""; /* okay for single thread */
|
||||
char text[32] = "";
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_ACCESS_RIGHTSS) {
|
||||
|
||||
@@ -111,7 +111,7 @@ unsigned Access_User_Instance_To_Index(uint32_t object_instance)
|
||||
bool Access_User_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32] = ""; /* okay for single thread */
|
||||
char text[32] = "";
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_ACCESS_USERS) {
|
||||
|
||||
@@ -116,7 +116,7 @@ unsigned Access_Zone_Instance_To_Index(uint32_t object_instance)
|
||||
bool Access_Zone_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32] = ""; /* okay for single thread */
|
||||
char text[32] = "";
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_ACCESS_ZONES) {
|
||||
|
||||
@@ -233,7 +233,7 @@ void Analog_Input_Present_Value_Set(uint32_t object_instance, float value)
|
||||
bool Analog_Input_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text_string[32] = "";
|
||||
char text_string[32] = "";
|
||||
bool status = false;
|
||||
struct analog_input_descr *pObject;
|
||||
|
||||
@@ -275,6 +275,24 @@ bool Analog_Input_Name_Set(uint32_t object_instance, char *new_name)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Analog_Input_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct analog_input_descr *pObject;
|
||||
|
||||
pObject = Analog_Input_Object(object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given object instance-number, gets the event-state property value
|
||||
*
|
||||
|
||||
@@ -86,6 +86,9 @@ extern "C" {
|
||||
bool Analog_Input_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char * Analog_Input_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Analog_Input_Description(
|
||||
|
||||
@@ -514,7 +514,7 @@ bool Analog_Output_Name_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
@@ -522,6 +522,24 @@ bool Analog_Output_Name_Set(uint32_t object_instance, char *new_name)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Analog_Output_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given object instance-number, returns the units property value
|
||||
*
|
||||
@@ -751,7 +769,7 @@ bool Analog_Output_Description_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Description = new_name;
|
||||
}
|
||||
|
||||
@@ -105,6 +105,9 @@ extern "C" {
|
||||
bool Analog_Output_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char * Analog_Output_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Analog_Output_Description(
|
||||
|
||||
@@ -245,7 +245,7 @@ bool Analog_Value_Present_Value_Set(
|
||||
bool Analog_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text_string[32] = "";
|
||||
char text_string[32] = "";
|
||||
bool status = false;
|
||||
struct analog_value_descr *pObject;
|
||||
|
||||
@@ -287,6 +287,24 @@ bool Analog_Value_Name_Set(uint32_t object_instance, char *new_name)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Analog_Value_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct analog_value_descr *pObject;
|
||||
|
||||
pObject = Analog_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given object instance-number, gets the event-state property value
|
||||
*
|
||||
|
||||
@@ -33,7 +33,7 @@ typedef struct analog_value_descr {
|
||||
float Prior_Value;
|
||||
float COV_Increment;
|
||||
bool Changed;
|
||||
char* Object_Name;
|
||||
const char* Object_Name;
|
||||
char* Description;
|
||||
BACNET_RELIABILITY Reliability;
|
||||
#if defined(INTRINSIC_REPORTING)
|
||||
@@ -83,7 +83,8 @@ extern "C" {
|
||||
bool Analog_Value_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
char *Analog_Value_Name(
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Analog_Value_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#define FILE_RECORD_SIZE MAX_OCTET_STRING_BYTES
|
||||
#endif
|
||||
struct object_data {
|
||||
char *Object_Name;
|
||||
const char *Object_Name;
|
||||
char *Pathname;
|
||||
BACNET_DATE_TIME Modification_Date;
|
||||
char *File_Type;
|
||||
@@ -206,7 +206,7 @@ bool bacfile_object_name_set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
@@ -214,6 +214,25 @@ bool bacfile_object_name_set(uint32_t object_instance, char *new_name)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *bacfile_name_ansi(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Determines if a given object instance is valid
|
||||
* @param object_instance - object-instance number of the object
|
||||
|
||||
@@ -29,6 +29,7 @@ extern "C" {
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_object_name(
|
||||
uint32_t object_instance,
|
||||
@@ -38,6 +39,10 @@ extern "C" {
|
||||
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
|
||||
|
||||
@@ -581,7 +581,7 @@ static bool Binary_Input_Present_Value_Write(
|
||||
bool Binary_Input_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32] = ""; /* okay for single thread */
|
||||
char text[32] = "";
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -614,15 +614,31 @@ bool Binary_Input_Name_Set(uint32_t object_instance, char *new_name)
|
||||
|
||||
pObject = Binary_Input_Object(object_instance);
|
||||
if (pObject) {
|
||||
if (new_name) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Binary_Input_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Binary_Input_Object(object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, returns the polarity property.
|
||||
* @param object_instance - object-instance number of the object
|
||||
|
||||
@@ -69,6 +69,9 @@ extern "C" {
|
||||
bool Binary_Input_Name_Set(
|
||||
uint32_t object_instance,
|
||||
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(
|
||||
|
||||
@@ -467,15 +467,31 @@ bool BitString_Value_Name_Set(uint32_t object_instance, char *new_name)
|
||||
|
||||
pObject = BitString_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
if (new_name) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *BitString_Value_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = BitString_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, return the description.
|
||||
* @param object_instance - object-instance number of the object
|
||||
|
||||
@@ -77,6 +77,9 @@ extern "C" {
|
||||
bool BitString_Value_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *BitString_Value_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Present_Value(
|
||||
|
||||
@@ -793,7 +793,7 @@ bool Binary_Lighting_Output_Name_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
@@ -801,6 +801,24 @@ bool Binary_Lighting_Output_Name_Set(uint32_t object_instance, char *new_name)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Binary_Lighting_Output_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given object instance-number, returns the description
|
||||
*
|
||||
@@ -840,7 +858,7 @@ bool Binary_Lighting_Output_Description_Set(
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Description = new_name;
|
||||
}
|
||||
|
||||
@@ -85,6 +85,8 @@ bool Binary_Lighting_Output_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Lighting_Output_Name_Set(uint32_t object_instance, char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Lighting_Output_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Binary_Lighting_Output_Description(uint32_t instance);
|
||||
|
||||
@@ -543,7 +543,7 @@ bool Binary_Output_Name_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
@@ -551,6 +551,24 @@ bool Binary_Output_Name_Set(uint32_t object_instance, char *new_name)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Binary_Output_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given object instance-number, returns the polarity property.
|
||||
*
|
||||
@@ -776,7 +794,7 @@ bool Binary_Output_Description_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Description = new_name;
|
||||
}
|
||||
|
||||
@@ -67,6 +67,9 @@ extern "C" {
|
||||
bool Binary_Output_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Output_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Binary_Output_Inactive_Text(
|
||||
|
||||
@@ -584,7 +584,7 @@ static bool Binary_Value_Present_Value_Write(
|
||||
bool Binary_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32] = ""; /* okay for single thread */
|
||||
char text[32] = "";
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -617,15 +617,31 @@ bool Binary_Value_Name_Set(uint32_t object_instance, char *new_name)
|
||||
|
||||
pObject = Binary_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
if (new_name) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Binary_Value_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Binary_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, returns the polarity property.
|
||||
* @param object_instance - object-instance number of the object
|
||||
|
||||
@@ -73,7 +73,7 @@ extern "C" {
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
char *Binary_Value_Name(
|
||||
const char *Binary_Value_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
@@ -409,7 +409,7 @@ bool Calendar_Name_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
@@ -417,6 +417,24 @@ bool Calendar_Name_Set(uint32_t object_instance, char *new_name)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Calendar_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given object instance-number, returns the description
|
||||
*
|
||||
|
||||
@@ -48,6 +48,8 @@ bool Calendar_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Calendar_Name_Set(uint32_t object_instance, char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Calendar_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Calendar_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
@@ -1322,7 +1322,7 @@ bool Channel_Name_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
@@ -1330,6 +1330,24 @@ bool Channel_Name_Set(uint32_t object_instance, char *new_name)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Channel_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given object instance-number, returns the out-of-service
|
||||
* property value
|
||||
|
||||
@@ -120,6 +120,8 @@ bool Channel_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Channel_Name_Set(uint32_t object_instance, char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Channel_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Channel_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
@@ -714,7 +714,7 @@ bool Color_Name_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
pObject->Object_Name = new_name;
|
||||
status = true;
|
||||
}
|
||||
@@ -722,6 +722,24 @@ bool Color_Name_Set(uint32_t object_instance, char *new_name)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name ANSI-C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Color_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given object instance-number, returns the description
|
||||
*
|
||||
@@ -760,7 +778,7 @@ bool Color_Description_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Description = new_name;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@ bool Color_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Name_Set(uint32_t object_instance, char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Color_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Color_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
@@ -951,7 +951,7 @@ bool Color_Temperature_Name_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
@@ -959,6 +959,24 @@ bool Color_Temperature_Name_Set(uint32_t object_instance, char *new_name)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Color_Temperature_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given object instance-number, returns the description
|
||||
*
|
||||
@@ -997,7 +1015,7 @@ bool Color_Temperature_Description_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Description = new_name;
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@ 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, char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Color_Temperature_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Color_Temperature_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
@@ -296,7 +296,7 @@ bool Command_All_Writes_Successful_Set(uint32_t object_instance, bool value)
|
||||
bool Command_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32] = ""; /* okay for single thread */
|
||||
char text[32] = "";
|
||||
unsigned int index;
|
||||
bool status = false;
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ unsigned Credential_Data_Input_Instance_To_Index(uint32_t object_instance)
|
||||
bool Credential_Data_Input_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32] = ""; /* okay for single thread */
|
||||
char text[32] = "";
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_CREDENTIAL_DATA_INPUTS) {
|
||||
|
||||
+106
-19
@@ -43,8 +43,8 @@ struct integer_object {
|
||||
uint32_t COV_Increment;
|
||||
uint16_t Units;
|
||||
uint32_t Instance;
|
||||
BACNET_CHARACTER_STRING Name;
|
||||
BACNET_CHARACTER_STRING Description;
|
||||
const char *Object_Name;
|
||||
const char *Description;
|
||||
} INTERGER_VALUE_DESCR;
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
@@ -233,22 +233,65 @@ bool Integer_Value_Present_Value_Set(
|
||||
bool Integer_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
char text[32] = "";
|
||||
bool status = false;
|
||||
struct integer_object *pObject;
|
||||
|
||||
struct integer_object *pObject = Integer_Value_Object(object_instance);
|
||||
|
||||
if (!object_name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
pObject = Integer_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
*object_name = pObject->Name;
|
||||
status = true;
|
||||
if (pObject->Object_Name) {
|
||||
status =
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(
|
||||
text, sizeof(text), "INTEGER-VALUE-%lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, text);
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, sets the object-name
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @param new_name - holds the object-name to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Integer_Value_Name_Set(uint32_t object_instance,
|
||||
const char *new_name)
|
||||
{
|
||||
bool status = false;
|
||||
struct integer_object *pObject;
|
||||
|
||||
pObject = Integer_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Integer_Value_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct integer_object *pObject;
|
||||
|
||||
pObject = Integer_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given object instance-number, return the description.
|
||||
*
|
||||
@@ -263,20 +306,64 @@ bool Integer_Value_Description(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *description)
|
||||
{
|
||||
bool status = false;
|
||||
struct integer_object *pObject = Integer_Value_Object(object_instance);
|
||||
|
||||
if (!description) {
|
||||
return false;
|
||||
}
|
||||
struct integer_object *pObject;
|
||||
|
||||
pObject = Integer_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
*description = pObject->Description;
|
||||
return true;
|
||||
if (pObject->Description) {
|
||||
status = characterstring_init_ansi(description,
|
||||
pObject->Description);
|
||||
} else {
|
||||
status = characterstring_init_ansi(description, "");
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, sets the description
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @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 status = false; /* return value */
|
||||
struct integer_object *pObject;
|
||||
|
||||
pObject = Integer_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Description = new_name;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, returns the description
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return description text or NULL if not found
|
||||
*/
|
||||
char *Integer_Value_Description_ANSI(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct integer_object *pObject;
|
||||
|
||||
pObject = Integer_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
if (pObject->Description == NULL) {
|
||||
name = "";
|
||||
} else {
|
||||
name = (char *)pObject->Description;
|
||||
}
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given object instance-number, returns the units property value
|
||||
*
|
||||
@@ -643,8 +730,8 @@ uint32_t Integer_Value_Create(uint32_t object_instance)
|
||||
return BACNET_MAX_INSTANCE;
|
||||
}
|
||||
|
||||
characterstring_init_ansi(&pObject->Name, "");
|
||||
characterstring_init_ansi(&pObject->Description, "");
|
||||
pObject->Object_Name = NULL;
|
||||
pObject->Description = NULL;
|
||||
pObject->COV_Increment = 1;
|
||||
pObject->Present_Value = 0;
|
||||
pObject->Prior_Value = 0;
|
||||
|
||||
@@ -42,6 +42,13 @@ extern "C" {
|
||||
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(
|
||||
@@ -78,7 +85,6 @@ extern "C" {
|
||||
uint32_t object_instance,
|
||||
uint32_t value);
|
||||
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Description(
|
||||
uint32_t object_instance,
|
||||
@@ -86,7 +92,10 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Integer_Value_Description_Set(
|
||||
uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
char *Integer_Value_Description_ANSI(
|
||||
uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Integer_Value_Units(
|
||||
|
||||
@@ -266,15 +266,31 @@ bool Load_Control_Name_Set(uint32_t object_instance, char *new_name)
|
||||
|
||||
pObject = Object_Instance_Data(object_instance);
|
||||
if (pObject) {
|
||||
if (new_name) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Load_Control_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Object_Instance_Data(object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief convert the shed level request into a percentage of full duty
|
||||
* baseline power
|
||||
|
||||
@@ -93,6 +93,8 @@ bool Load_Control_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Load_Control_Name_Set(uint32_t object_instance, char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Load_Control_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_SHED_STATE Load_Control_Present_Value(uint32_t object_instance);
|
||||
|
||||
@@ -843,7 +843,7 @@ bool Lighting_Output_Name_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
@@ -851,6 +851,24 @@ bool Lighting_Output_Name_Set(uint32_t object_instance, char *new_name)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Lighting_Output_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given object instance-number, returns the description
|
||||
*
|
||||
@@ -889,7 +907,7 @@ bool Lighting_Output_Description_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Description = new_name;
|
||||
}
|
||||
|
||||
@@ -100,6 +100,9 @@ extern "C" {
|
||||
bool Lighting_Output_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Lighting_Output_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Lighting_Output_Description(
|
||||
|
||||
@@ -203,6 +203,44 @@ bool Life_Safety_Point_Object_Name(
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, sets the object-name
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @param new_name - holds the object-name to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Life_Safety_Point_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Life_Safety_Point_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, gets the property value
|
||||
* @param object_instance - object-instance number of the object
|
||||
|
||||
@@ -45,8 +45,10 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Point_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
|
||||
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(
|
||||
|
||||
@@ -214,6 +214,44 @@ bool Life_Safety_Zone_Object_Name(
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, sets the object-name
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @param new_name - holds the object-name to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Life_Safety_Zone_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Life_Safety_Zone_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, gets the property value
|
||||
* @param object_instance - object-instance number of the object
|
||||
|
||||
@@ -45,8 +45,10 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
|
||||
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(
|
||||
|
||||
@@ -488,7 +488,7 @@ bool Multistate_Input_Name_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Multistate_Input_Object(object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
@@ -496,6 +496,24 @@ bool Multistate_Input_Name_Set(uint32_t object_instance, char *new_name)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Multistate_Input_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Multistate_Input_Object(object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, gets the reliability.
|
||||
* @param object_instance - object-instance number of the object
|
||||
@@ -604,7 +622,7 @@ bool Multistate_Input_Description_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Multistate_Input_Object(object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Description = new_name;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,9 @@ extern "C" {
|
||||
bool Multistate_Input_Name_Set(
|
||||
uint32_t object_instance,
|
||||
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(
|
||||
|
||||
@@ -605,7 +605,7 @@ bool Multistate_Output_Name_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
@@ -613,6 +613,24 @@ bool Multistate_Output_Name_Set(uint32_t object_instance, char *new_name)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Multistate_Output_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, returns the state-text in
|
||||
* a C string.
|
||||
@@ -808,7 +826,7 @@ bool Multistate_Output_Description_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Description = new_name;
|
||||
}
|
||||
|
||||
@@ -66,6 +66,9 @@ extern "C" {
|
||||
bool Multistate_Output_Name_Set(
|
||||
uint32_t object_instance,
|
||||
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(
|
||||
|
||||
@@ -488,7 +488,7 @@ bool Multistate_Value_Name_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Multistate_Value_Object(object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
@@ -496,6 +496,24 @@ bool Multistate_Value_Name_Set(uint32_t object_instance, char *new_name)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Multistate_Value_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Multistate_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For a given object instance-number, gets the reliability.
|
||||
* @param object_instance - object-instance number of the object
|
||||
@@ -604,7 +622,7 @@ bool Multistate_Value_Description_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Multistate_Value_Object(object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Description = new_name;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,9 @@ extern "C" {
|
||||
bool Multistate_Value_Name_Set(
|
||||
uint32_t object_instance,
|
||||
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(
|
||||
|
||||
@@ -129,7 +129,7 @@ unsigned Notification_Class_Instance_To_Index(uint32_t object_instance)
|
||||
bool Notification_Class_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32] = ""; /* okay for single thread */
|
||||
char text[32] = "";
|
||||
unsigned int index;
|
||||
bool status = false;
|
||||
|
||||
|
||||
@@ -322,6 +322,7 @@ bool Network_Port_Name_Set(uint32_t object_instance, char *new_name)
|
||||
index = Network_Port_Instance_To_Index(object_instance);
|
||||
if (index < BACNET_NETWORK_PORTS_MAX) {
|
||||
Object_List[index].Object_Name = new_name;
|
||||
status = true;
|
||||
}
|
||||
|
||||
return status;
|
||||
|
||||
@@ -145,7 +145,7 @@ BACNET_OCTET_STRING *OctetString_Value_Present_Value(uint32_t object_instance)
|
||||
bool OctetString_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32] = ""; /* okay for single thread */
|
||||
char text[32] = "";
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_OCTETSTRING_VALUES) {
|
||||
|
||||
@@ -146,7 +146,7 @@ uint32_t PositiveInteger_Value_Present_Value(uint32_t object_instance)
|
||||
bool PositiveInteger_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32] = ""; /* okay for single thread */
|
||||
char text[32] = "";
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_POSITIVEINTEGER_VALUES) {
|
||||
|
||||
@@ -182,7 +182,7 @@ unsigned Schedule_Instance_To_Index(uint32_t instance)
|
||||
bool Schedule_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32] = ""; /* okay for single thread */
|
||||
char text[32] = "";
|
||||
unsigned int index;
|
||||
bool status = false;
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ bool Structured_View_Name_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
@@ -209,6 +209,24 @@ bool Structured_View_Name_Set(uint32_t object_instance, char *new_name)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Structured_View_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given object instance-number, returns the description
|
||||
*
|
||||
|
||||
@@ -50,6 +50,8 @@ bool Structured_View_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Structured_View_Name_Set(uint32_t object_instance, char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Structured_View_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Structured_View_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
@@ -348,7 +348,7 @@ bool Time_Value_Name_Set(uint32_t object_instance, char *new_name)
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && new_name) {
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Object_Name = new_name;
|
||||
}
|
||||
@@ -356,6 +356,25 @@ bool Time_Value_Name_Set(uint32_t object_instance, char *new_name)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the object name C string
|
||||
* @param object_instance [in] BACnet object instance number
|
||||
* @return object name or NULL if not found
|
||||
*/
|
||||
const char *Time_Value_Name_ASCII(uint32_t object_instance)
|
||||
{
|
||||
const char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = pObject->Object_Name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For a given object instance-number, returns the description
|
||||
*
|
||||
|
||||
@@ -48,6 +48,8 @@ bool Time_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Time_Value_Name_Set(uint32_t object_instance, char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Time_Value_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Time_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
@@ -230,7 +230,7 @@ void Trend_Log_Init(void)
|
||||
bool Trend_Log_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32] = ""; /* okay for single thread */
|
||||
char text[32] = "";
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_TREND_LOGS) {
|
||||
|
||||
Reference in New Issue
Block a user