Add bip_get_socket (#210)
* Add function to get BIP socket * Add bip_get_socket to all applicable ports
This commit is contained in:
@@ -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
|
* @brief Enabled debug printing of BACnet/IPv4
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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
|
* @brief Enabled debug printing of BACnet/IPv4
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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
|
* @brief Enabled debug printing of BACnet/IPv4
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -115,6 +115,9 @@ extern "C" {
|
|||||||
BACNET_STACK_EXPORT
|
BACNET_STACK_EXPORT
|
||||||
void bip_debug_enable(void);
|
void bip_debug_enable(void);
|
||||||
|
|
||||||
|
BACNET_STACK_EXPORT
|
||||||
|
int bip_get_socket(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|||||||
Reference in New Issue
Block a user