Started a Doxygen module for DataLink layer, for the default DataLink templates and for BACnet/IP.

This commit is contained in:
tbrennan3
2010-03-24 03:41:39 +00:00
parent 026a489fc5
commit f92316649b
6 changed files with 114 additions and 9 deletions
+20 -2
View File
@@ -52,12 +52,20 @@ static struct in_addr BIP_Address;
/* Broadcast Address - stored in host byte order */
static struct in_addr BIP_Broadcast_Address;
/** Setter for the BACnet/IP socket handle.
*
* @param sock_fd [in] Handle for the BACnet/IP socket.
*/
void bip_set_socket(
int sock_fd)
{
BIP_Socket = sock_fd;
}
/** Getter for the BACnet/IP socket handle.
*
* @return The handle to the BACnet/IP socket.
*/
int bip_socket(
void)
{
@@ -70,6 +78,9 @@ bool bip_valid(
return (BIP_Socket != -1);
}
/** Cleanup and close out the BACnet/IP services by closing the socket.
* @ingroup DLBIP
*/
void bip_cleanup(
void)
{
@@ -140,8 +151,15 @@ static int bip_decode_bip_address(
return len;
}
/* function to send a packet out the BACnet/IP socket (Annex J) */
/* returns number of bytes sent on success, negative number on failure */
/** Function to send a packet out the BACnet/IP socket (Annex J).
* @ingroup DLBIP
*
* @param dest [in] Destination address (may encode an IP address and port #).
* @param npdu_data [in] The NPDU header (Network) information (not used).
* @param pdu [in] Buffer of data to be sent - may be null (why?).
* @param pdu_len [in] Number of bytes in the pdu buffer.
* @return Number of bytes sent on success, negative number on failure.
*/
int bip_send_pdu(
BACNET_ADDRESS * dest, /* destination address */
BACNET_NPDU_DATA * npdu_data, /* network information */
+24 -1
View File
@@ -36,10 +36,30 @@
/** @file datalink.c Optional run-time assignment of datalink transport */
#if defined(BACDL_ALL)
#if defined(BACDL_ALL) || defined FOR_DOXYGEN
/* Function pointers - point to your datalink */
/** Function template to Initialize the DataLink services at the given interface.
* @ingroup DLTemplates
*
* @note For Linux, ifname is eth0, ath0, arc0, ttyS0, and others.
For Windows, ifname is the COM port or dotted ip address of the interface.
* @param ifname [in] The named interface to use for the network layer.
* @return True if the interface is successfully initialized,
* else False if the initialization fails.
*/
bool(*datalink_init) (char *ifname);
/** Function template to send a packet via the DataLink.
* @ingroup DLTemplates
*
* @param dest [in] Destination address.
* @param npdu_data [in] The NPDU header (Network) information.
* @param pdu [in] Buffer of data to be sent - may be null.
* @param pdu_len [in] Number of bytes in the pdu buffer.
* @return Number of bytes sent on success, negative number on failure.
*/
int (
*datalink_send_pdu) (
BACNET_ADDRESS * dest,
@@ -50,6 +70,9 @@ int (
uint16_t(*datalink_receive) (BACNET_ADDRESS * src, uint8_t * pdu,
uint16_t max_pdu, unsigned timeout);
/** Function template to close the DataLink services and perform any cleanup.
* @ingroup DLTemplates
*/
void (
*datalink_cleanup) (
void);