Added default option to some bactext name functions so that NULL can be returned when a name does not exist. (#1160)
This commit is contained in:
@@ -74,6 +74,13 @@ const char *bactext_confirmed_service_name(uint32_t index)
|
||||
bacnet_confirmed_service_names, index, ASHRAE_Reserved_String);
|
||||
}
|
||||
|
||||
const char *bactext_confirmed_service_name_default(
|
||||
uint32_t index, const char *default_string)
|
||||
{
|
||||
return indtext_by_index_default(
|
||||
bacnet_confirmed_service_names, index, default_string);
|
||||
}
|
||||
|
||||
INDTEXT_DATA bacnet_unconfirmed_service_names[] = {
|
||||
{ SERVICE_UNCONFIRMED_I_AM, "I-Am" },
|
||||
{ SERVICE_UNCONFIRMED_I_HAVE, "I-Have" },
|
||||
@@ -100,6 +107,13 @@ const char *bactext_unconfirmed_service_name(uint32_t index)
|
||||
bacnet_unconfirmed_service_names, index, ASHRAE_Reserved_String);
|
||||
}
|
||||
|
||||
const char *bactext_unconfirmed_service_name_default(
|
||||
uint32_t index, const char *default_string)
|
||||
{
|
||||
return indtext_by_index_default(
|
||||
bacnet_unconfirmed_service_names, index, default_string);
|
||||
}
|
||||
|
||||
INDTEXT_DATA bacnet_application_tag_names[] = {
|
||||
{ BACNET_APPLICATION_TAG_NULL, "Null" },
|
||||
{ BACNET_APPLICATION_TAG_BOOLEAN, "Boolean" },
|
||||
@@ -319,6 +333,13 @@ const char *bactext_object_type_name(uint32_t index)
|
||||
ASHRAE_Reserved_String, Vendor_Proprietary_String);
|
||||
}
|
||||
|
||||
const char *
|
||||
bactext_object_type_name_default(uint32_t index, const char *default_string)
|
||||
{
|
||||
return indtext_by_index_default(
|
||||
bacnet_object_type_names, index, default_string);
|
||||
}
|
||||
|
||||
const char *bactext_object_type_name_capitalized(uint32_t index)
|
||||
{
|
||||
return indtext_by_index_split_default(
|
||||
@@ -326,6 +347,13 @@ const char *bactext_object_type_name_capitalized(uint32_t index)
|
||||
ASHRAE_Reserved_String, Vendor_Proprietary_String);
|
||||
}
|
||||
|
||||
const char *bactext_object_type_name_capitalized_default(
|
||||
uint32_t index, const char *default_string)
|
||||
{
|
||||
return indtext_by_index_default(
|
||||
bacnet_object_type_names_capitalized, index, default_string);
|
||||
}
|
||||
|
||||
bool bactext_object_type_index(const char *search_name, uint32_t *found_index)
|
||||
{
|
||||
return indtext_by_istring(
|
||||
@@ -1415,6 +1443,13 @@ const char *bactext_engineering_unit_name(uint32_t index)
|
||||
return ASHRAE_Reserved_String;
|
||||
}
|
||||
|
||||
const char *bactext_engineering_unit_name_default(
|
||||
uint32_t index, const char *default_string)
|
||||
{
|
||||
return indtext_by_index_default(
|
||||
bacnet_engineering_unit_names, index, default_string);
|
||||
}
|
||||
|
||||
bool bactext_engineering_unit_index(
|
||||
const char *search_name, uint32_t *found_index)
|
||||
{
|
||||
@@ -1446,6 +1481,13 @@ const char *bactext_reject_reason_name(uint32_t index)
|
||||
ASHRAE_Reserved_String, Vendor_Proprietary_String);
|
||||
}
|
||||
|
||||
const char *
|
||||
bactext_reject_reason_name_default(uint32_t index, const char *default_string)
|
||||
{
|
||||
return indtext_by_index_default(
|
||||
bacnet_reject_reason_names, index, default_string);
|
||||
}
|
||||
|
||||
INDTEXT_DATA bacnet_abort_reason_names[] = {
|
||||
{ ABORT_REASON_OTHER, "Other" },
|
||||
{ ABORT_REASON_BUFFER_OVERFLOW, "Buffer Overflow" },
|
||||
@@ -1472,6 +1514,13 @@ const char *bactext_abort_reason_name(uint32_t index)
|
||||
ASHRAE_Reserved_String, Vendor_Proprietary_String);
|
||||
}
|
||||
|
||||
const char *
|
||||
bactext_abort_reason_name_default(uint32_t index, const char *default_string)
|
||||
{
|
||||
return indtext_by_index_default(
|
||||
bacnet_abort_reason_names, index, default_string);
|
||||
}
|
||||
|
||||
INDTEXT_DATA bacnet_error_class_names[] = {
|
||||
{ ERROR_CLASS_DEVICE, "device" },
|
||||
{ ERROR_CLASS_OBJECT, "object" },
|
||||
@@ -1491,6 +1540,13 @@ const char *bactext_error_class_name(uint32_t index)
|
||||
ASHRAE_Reserved_String, Vendor_Proprietary_String);
|
||||
}
|
||||
|
||||
const char *
|
||||
bactext_error_class_name_default(uint32_t index, const char *default_string)
|
||||
{
|
||||
return indtext_by_index_default(
|
||||
bacnet_error_class_names, index, default_string);
|
||||
}
|
||||
|
||||
INDTEXT_DATA bacnet_error_code_names[] = {
|
||||
{ ERROR_CODE_OTHER, "other" },
|
||||
{ ERROR_CODE_AUTHENTICATION_FAILED, "authentication-failed" },
|
||||
@@ -1768,6 +1824,13 @@ const char *bactext_error_code_name(uint32_t index)
|
||||
ASHRAE_Reserved_String, Vendor_Proprietary_String);
|
||||
}
|
||||
|
||||
const char *
|
||||
bactext_error_code_name_default(uint32_t index, const char *default_string)
|
||||
{
|
||||
return indtext_by_index_default(
|
||||
bacnet_error_code_names, index, default_string);
|
||||
}
|
||||
|
||||
INDTEXT_DATA bacnet_month_names[] = {
|
||||
{ 1, "January" }, { 2, "February" }, { 3, "March" },
|
||||
{ 4, "April" }, { 5, "May" }, { 6, "June" },
|
||||
@@ -1783,6 +1846,12 @@ const char *bactext_month_name(uint32_t index)
|
||||
bacnet_month_names, index, ASHRAE_Reserved_String);
|
||||
}
|
||||
|
||||
const char *
|
||||
bactext_month_name_default(uint32_t index, const char *default_string)
|
||||
{
|
||||
return indtext_by_index_default(bacnet_month_names, index, default_string);
|
||||
}
|
||||
|
||||
INDTEXT_DATA bacnet_week_of_month_names[] = {
|
||||
{ 1, "days numbered 1-7" }, { 2, "days numbered 8-14" },
|
||||
{ 3, "days numbered 15-21" }, { 4, "days numbered 22-28" },
|
||||
@@ -1796,6 +1865,13 @@ const char *bactext_week_of_month_name(uint32_t index)
|
||||
bacnet_week_of_month_names, index, ASHRAE_Reserved_String);
|
||||
}
|
||||
|
||||
const char *
|
||||
bactext_week_of_month_name_default(uint32_t index, const char *default_string)
|
||||
{
|
||||
return indtext_by_index_default(
|
||||
bacnet_week_of_month_names, index, default_string);
|
||||
}
|
||||
|
||||
/* note: different than DaysOfWeek bit string where 0=monday */
|
||||
INDTEXT_DATA bacnet_day_of_week_names[] = {
|
||||
{ 1, "Monday" }, { 2, "Tuesday" },
|
||||
@@ -1811,6 +1887,13 @@ const char *bactext_day_of_week_name(uint32_t index)
|
||||
bacnet_day_of_week_names, index, ASHRAE_Reserved_String);
|
||||
}
|
||||
|
||||
const char *
|
||||
bactext_day_of_week_name_default(uint32_t index, const char *default_string)
|
||||
{
|
||||
return indtext_by_index_default(
|
||||
bacnet_day_of_week_names, index, default_string);
|
||||
}
|
||||
|
||||
/* note: different than DayOfWeek bit string where 1=monday */
|
||||
INDTEXT_DATA bacnet_days_of_week_names[] = {
|
||||
{ BACNET_DAYS_OF_WEEK_MONDAY, "Monday" },
|
||||
|
||||
@@ -27,8 +27,14 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_confirmed_service_name(uint32_t index);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_confirmed_service_name_default(
|
||||
uint32_t index, const char *default_string);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_unconfirmed_service_name(uint32_t index);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_unconfirmed_service_name_default(
|
||||
uint32_t index, const char *default_string);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_application_tag_name(uint32_t index);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bactext_application_tag_index(
|
||||
@@ -36,8 +42,14 @@ bool bactext_application_tag_index(
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_object_type_name(uint32_t index);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *
|
||||
bactext_object_type_name_default(uint32_t index, const char *default_string);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_object_type_name_capitalized(uint32_t index);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_object_type_name_capitalized_default(
|
||||
uint32_t index, const char *default_string);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bactext_object_type_index(const char *search_name, uint32_t *found_index);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bactext_object_type_strtol(const char *search_name, uint32_t *found_index);
|
||||
@@ -57,23 +69,44 @@ bool bactext_engineering_unit_name_proprietary(uint32_t index);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_engineering_unit_name(uint32_t index);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_engineering_unit_name_default(
|
||||
uint32_t index, const char *default_string);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bactext_engineering_unit_index(
|
||||
const char *search_name, uint32_t *found_index);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_reject_reason_name(uint32_t index);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *
|
||||
bactext_reject_reason_name_default(uint32_t index, const char *default_string);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_abort_reason_name(uint32_t index);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *
|
||||
bactext_abort_reason_name_default(uint32_t index, const char *default_string);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_error_class_name(uint32_t index);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *
|
||||
bactext_error_class_name_default(uint32_t index, const char *default_string);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_error_code_name(uint32_t index);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *
|
||||
bactext_error_code_name_default(uint32_t index, const char *default_string);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t bactext_property_id(const char *name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_month_name(uint32_t index);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *
|
||||
bactext_month_name_default(uint32_t index, const char *default_string);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_week_of_month_name(uint32_t index);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *
|
||||
bactext_week_of_month_name_default(uint32_t index, const char *default_string);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_day_of_week_name(uint32_t index);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *bactext_notify_type_name(uint32_t index);
|
||||
|
||||
Reference in New Issue
Block a user