Add BACnet reinitialized state names and parser (#1228)
This commit is contained in:
@@ -40,6 +40,7 @@ The git repositories are hosted at the following sites:
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
* Added text and parser for BACnet ReinitializeDevice service states. (#1228)
|
||||||
* Added Device Management-Backup and Restore-B to example object/device.c
|
* Added Device Management-Backup and Restore-B to example object/device.c
|
||||||
and basic/server/bacnet-device.c so that when ReinitializeDevice STARTBACKUP
|
and basic/server/bacnet-device.c so that when ReinitializeDevice STARTBACKUP
|
||||||
is requested a backup file is stored in CreateObject format for all the
|
is requested a backup file is stored in CreateObject format for all the
|
||||||
|
|||||||
@@ -214,6 +214,33 @@ bool bactext_application_tag_index(
|
|||||||
bacnet_application_tag_names, search_name, found_index);
|
bacnet_application_tag_names, search_name, found_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INDTEXT_DATA bacnet_reinitialized_state_names[] = {
|
||||||
|
{ BACNET_REINIT_COLDSTART, "coldstart" },
|
||||||
|
{ BACNET_REINIT_WARMSTART, "warmstart" },
|
||||||
|
{ BACNET_REINIT_STARTBACKUP, "startbackup" },
|
||||||
|
{ BACNET_REINIT_ENDBACKUP, "endbackup" },
|
||||||
|
{ BACNET_REINIT_STARTRESTORE, "startrestore" },
|
||||||
|
{ BACNET_REINIT_ENDRESTORE, "endrestore" },
|
||||||
|
{ BACNET_REINIT_ABORTRESTORE, "abortrestore" },
|
||||||
|
{ BACNET_REINIT_ACTIVATE_CHANGES, "activate-changes" },
|
||||||
|
{ BACNET_REINIT_IDLE, "idle" },
|
||||||
|
{ 0, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
const char *bactext_reinitialized_state_name_default(
|
||||||
|
uint32_t index, const char *default_string)
|
||||||
|
{
|
||||||
|
return indtext_by_index_default(
|
||||||
|
bacnet_reinitialized_state_names, index, default_string);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool bactext_reinitialized_state_strtol(
|
||||||
|
const char *search_name, uint32_t *found_index)
|
||||||
|
{
|
||||||
|
return bactext_string_to_uint32_index(
|
||||||
|
bacnet_reinitialized_state_names, search_name, found_index);
|
||||||
|
}
|
||||||
|
|
||||||
INDTEXT_DATA bacnet_character_string_encoding_names[] = {
|
INDTEXT_DATA bacnet_character_string_encoding_names[] = {
|
||||||
{ CHARACTER_ANSI_X34, "ANSI X3.4" },
|
{ CHARACTER_ANSI_X34, "ANSI X3.4" },
|
||||||
{ CHARACTER_MS_DBCS, "IBM/Microsoft DBCS" },
|
{ CHARACTER_MS_DBCS, "IBM/Microsoft DBCS" },
|
||||||
|
|||||||
@@ -51,6 +51,13 @@ BACNET_STACK_EXPORT
|
|||||||
bool bactext_application_tag_index(
|
bool bactext_application_tag_index(
|
||||||
const char *search_name, uint32_t *found_index);
|
const char *search_name, uint32_t *found_index);
|
||||||
|
|
||||||
|
BACNET_STACK_EXPORT
|
||||||
|
const char *bactext_reinitialized_state_name_default(
|
||||||
|
uint32_t index, const char *default_string);
|
||||||
|
BACNET_STACK_EXPORT
|
||||||
|
bool bactext_reinitialized_state_strtol(
|
||||||
|
const char *search_name, uint32_t *found_index);
|
||||||
|
|
||||||
BACNET_STACK_EXPORT
|
BACNET_STACK_EXPORT
|
||||||
const char *bactext_object_type_name(uint32_t index);
|
const char *bactext_object_type_name(uint32_t index);
|
||||||
BACNET_STACK_EXPORT
|
BACNET_STACK_EXPORT
|
||||||
|
|||||||
@@ -50,7 +50,15 @@ static void testBacText(void)
|
|||||||
zassert_equal(index, i, "index=%u i=%u", index, i);
|
zassert_equal(index, i, "index=%u i=%u", index, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* BACNET_REINITIALIZED_STATE */
|
||||||
|
for (i = 0; i < BACNET_REINIT_MAX; i++) {
|
||||||
|
pString = bactext_reinitialized_state_name_default(i, NULL);
|
||||||
|
if (pString) {
|
||||||
|
status = bactext_reinitialized_state_strtol(pString, &index);
|
||||||
|
zassert_true(status, "i=%u", i);
|
||||||
|
zassert_equal(index, i, "index=%u i=%u", index, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
/* BACNET_APPLICATION_TAG */
|
/* BACNET_APPLICATION_TAG */
|
||||||
for (i = 0; i < BACNET_APPLICATION_TAG_EXTENDED_MAX; i++) {
|
for (i = 0; i < BACNET_APPLICATION_TAG_EXTENDED_MAX; i++) {
|
||||||
pString = bactext_application_tag_name(i);
|
pString = bactext_application_tag_name(i);
|
||||||
|
|||||||
Reference in New Issue
Block a user