Add bip_get_socket (#210)

* Add function to get BIP socket

* Add bip_get_socket to all applicable ports
This commit is contained in:
Alexander Wells
2022-01-10 16:15:54 +00:00
committed by GitHub
parent 861eff121c
commit ca32676662
4 changed files with 34 additions and 0 deletions
+9
View File
@@ -80,6 +80,15 @@ static void debug_print_ipv4(const char *str,
}
}
/**
* @brief Return the active BIP socket.
* @return The active BIP socket, or -1 if uninitialized.
*/
int bip_get_socket(void)
{
return BIP_Socket;
}
/**
* @brief Enabled debug printing of BACnet/IPv4
*/
+11
View File
@@ -94,6 +94,17 @@ static void debug_print_ipv4(const char *str,
}
}
/**
* @brief Return the active BIP socket.
* @return The active BIP socket, or -1 if uninitialized.
*/
int bip_get_socket(void)
{
return BIP_Socket;
}
/**
* @brief Enabled debug printing of BACnet/IPv4
*/
+11
View File
@@ -87,6 +87,17 @@ static void debug_print_ipv4(const char *str,
}
}
/**
* @brief Return the active BIP socket.
* @return The active BIP socket, or INVALID_SOCKET if uninitialized.
* @note Strictly, the return type should be SOCKET, however in practice
* Windows never returns values large enough that truncation is an issue.
*/
int bip_get_socket(void)
{
return (int)BIP_Socket;
}
/**
* @brief Enabled debug printing of BACnet/IPv4
*/
+3
View File
@@ -115,6 +115,9 @@ extern "C" {
BACNET_STACK_EXPORT
void bip_debug_enable(void);
BACNET_STACK_EXPORT
int bip_get_socket(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */