Setup API

Library initialisation and connection setup. More...


Data Structures

struct  sENMX_Server
 information of EIBnet/IP servers responding to multicast search request More...

Functions

void enmx_close (ENMX_HANDLE conn)
 close connection with eibnetmux socket server
ENMX_HANDLE enmx_open (char *hostname, char *clientid)
 establish connection with eibnetmux socket server
ENMX_HANDLE enmx_pth_open (char *hostname, char *clientid)
 connection with eibnetmux socket server (PTH version)
char * enmx_gethost (ENMX_HANDLE handle)
 retrieve hostname of connected eibnetmux server
int enmx_init (void)
 initialise eibnetmux client library
sENMX_Serverenmx_getservers (int seconds)
 return list of eibnetmux servers
sENMX_Serverenmx_pth_getservers (int seconds)
 return list of eibnetmux servers (PTH mode)
void enmx_releaseservers (sENMX_Server *list)
 release memory allocated for list of eibnetmux servers

Detailed Description

Library initialisation and connection setup.

This API supports the following features:


Function Documentation

void enmx_close ( ENMX_HANDLE  conn  ) 

close connection with eibnetmux socket server

Parameters:
conn connection handle as returned by enmx_open()
Examples:
eibcommand.c, eibread.c, eibstatus.c, eibtrace.c, layer7.c, pth_search.c, and search.c.

char* enmx_gethost ( ENMX_HANDLE  handle  ) 

retrieve hostname of connected eibnetmux server

Parameters:
handle connection handle as returned by enmx_open()
Returns:
name or ip address and port of eibnetmux server, format hostname:port
Examples:
eibcommand.c, eibread.c, eibstatus.c, eibtrace.c, and layer7.c.

sENMX_Server* enmx_getservers ( int  seconds  ) 

return list of eibnetmux servers

The client sends an EIBnet/IP search request to the standard EIBnet/IP multicast IP address. Active servers reply by sending their server information.

The function constructs a linked list of all replying servers with all eibnetmux servers at the head of the list.

An eibnetmux server is only found if its EIBnet/IP server is active (-s given on command line)

Parameters:
seconds number of seconds to wait for servers to answer
Returns:
server list or NULL upon error

int enmx_init ( void   ) 

initialise eibnetmux client library

Currently, this function does nothing but return the current API version number. Calling it first thing in a client application is enforced, however, as future enhancements may require initialisation before any other library function can be used.

Returns:
API version number

ENMX_HANDLE enmx_open ( char *  hostname,
char *  clientid 
)

establish connection with eibnetmux socket server

Parameters:
hostname name or ip address and port of eibnetmux server, format hostname:port
clientid user selectable identification of client
Returns:
handle, <0: error
error codes: -1 resource problems -2 unknown server name -3 unable to establish connection (server not running, etc.)
Examples:
eibcommand.c, eibread.c, eibstatus.c, eibtrace.c, and layer7.c.

sENMX_Server* enmx_pth_getservers ( int  seconds  ) 

return list of eibnetmux servers (PTH mode)

The client sends an EIBnet/IP search request to the standard EIBnet/IP multicast IP address. Active servers reply by sending their server information.

The function constructs a linked list of all replying servers with all eibnetmux servers at the head of the list.

An eibnetmux server is only found if its EIBnet/IP server is active (-s given on command line)

This function uses PTH calls to cooperate in a non-preemptive thread environment.

Parameters:
seconds number of seconds to wait for servers to answer
Returns:
server list or NULL upon error

ENMX_HANDLE enmx_pth_open ( char *  hostname,
char *  clientid 
)

connection with eibnetmux socket server (PTH version)

Parameters:
hostname name or ip address and port of eibnetmux server, format hostname:port
clientid user selectable identification of client
Returns:
handle, <0: error
error codes: -1 resource problems -2 unknown server name -3 unable to establish connection (server not running, etc.)

void enmx_releaseservers ( sENMX_Server list  ) 

release memory allocated for list of eibnetmux servers

Parameters:
list list of servers
Returns:
-