/** Cleanup and close out the BACnet/IP services by closing the socket.
 * @ingroup DLBIP
  */
void bip_cleanup(
    void)
{
    int sock_fd = 0;

    if (bip_valid()) {
        sock_fd = bip_socket();
        close(sock_fd);
    }
    bip_set_socket(-1);
    WSACleanup();

    return;
}
Ejemplo n.º 2
0
static int bvlc_send_mpdu(uint8_t * dest_addr,  /* the destination address */

    uint16_t * dest_port,       /* the destination port */

    uint8_t * mtu,      /* the data */

    uint16_t mtu_len)
{       /* amount of data to send  */
    /* assumes that the driver has already been initialized */
    if (bip_valid()) {
        return 0;
    }

    return sendto_func(bip_socket(), mtu, mtu_len, dest_addr, *dest_port);
}