Add functions to enable/disable debug logging (#280)

* Add "bip_debug_disable()"

* Add "bvlc_debug_disable()"

* Add setters for BIP_DL_Debug (BBMD registration debug logging)
This commit is contained in:
Ondřej Hruška
2022-05-26 04:43:08 +02:00
committed by GitHub
parent 44bd46d395
commit 0dec80fae7
10 changed files with 75 additions and 1 deletions
+8
View File
@@ -102,6 +102,14 @@ void bvlc_debug_enable(void)
BVLC_Debug = true;
}
/**
* @brief Disable debug printing of BACnet/IPv4 BBMD
*/
void bvlc_debug_disable(void)
{
BVLC_Debug = true;
}
/**
* @brief Print the IPv4 address with debug info for this module
* @param str - debug info string
+3
View File
@@ -85,6 +85,9 @@ void bvlc_init(void);
BACNET_STACK_EXPORT
void bvlc_debug_enable(void);
BACNET_STACK_EXPORT
void bvlc_debug_disable(void);
/* send a Read BDT request */
BACNET_STACK_EXPORT
int bvlc_bbmd_read_bdt(BACNET_IP_ADDRESS *bbmd_addr);
+3
View File
@@ -113,6 +113,9 @@ extern "C" {
BACNET_STACK_EXPORT
void bip_debug_enable(void);
BACNET_STACK_EXPORT
void bip_debug_disable(void);
BACNET_STACK_EXPORT
int bip_get_socket(void);
+19 -1
View File
@@ -57,6 +57,24 @@ static BACNET_IP_BROADCAST_DISTRIBUTION_TABLE_ENTRY BBMD_Table_Entry;
/* enable debugging */
static bool BIP_DL_Debug = false;
/* Debug toggle */
/**
* @brief Enabled debug printing of BACnet/IPv4 DL
*/
void bip_dl_debug_enable(void)
{
BIP_DL_Debug = true;
}
/**
* @brief Disable debug printing of BACnet/IPv4 DL
*/
void bip_dl_debug_disable(void)
{
BIP_DL_Debug = false;
}
/* Simple setters for BBMD registration variables. */
/**
@@ -473,7 +491,7 @@ void dlenv_init(void)
if (pEnv) {
bip_debug_enable();
bvlc_debug_enable();
BIP_DL_Debug = true;
bip_dl_debug_enable();
}
pEnv = getenv("BACNET_IP_PORT");
if (pEnv) {
+8
View File
@@ -39,6 +39,14 @@ extern "C" {
void dlenv_init(
void);
BACNET_STACK_EXPORT
void bip_dl_debug_enable(
void);
BACNET_STACK_EXPORT
void bip_dl_debug_disable(
void);
BACNET_STACK_EXPORT
int dlenv_register_as_foreign_device(
void);