enmx_lib.h File Reference


Data Structures

struct  sENMX_StatusEIB
 status information for an active EIBnet/IP connection to eibnetmux More...
struct  sENMX_StatusSocket
 status information for an active eibnetmux socketserver connection More...
struct  sENMX_StatusEIBD
 status information for an active eibd-compatible server connection More...
struct  sENMX_Status
 status information of eibnetmux server More...
struct  sENMX_Server
 information of EIBnet/IP servers responding to multicast search request More...

Defines

#define ENMX_NO_ERROR   0
 Everything ok.
#define ENMX_E_NO_ERROR   0
 Everything ok.
#define ENMX_E_COMMUNICATION   -1
 Error communicating with EIBnetmux server.
#define ENMX_E_SERVER_ABORTED   -2
 EIBnetmux server unexpectedly closed connection.
#define ENMX_E_UNKNOWN_GROUP   -3
 KNX group unknown.
#define ENMX_E_INTERNAL   -4
 EIBnetmux server experienced an internal error.
#define ENMX_E_NO_MEMORY   -5
 Memory could not be allocated by the library for receive buffers, status structures, etc.
#define ENMX_E_TIMEOUT   -6
 Timeout while sending/receiving to EIBnetmux server.
#define ENMX_E_WRONG_USAGE   -7
 This connection was already used for a different command.
#define ENMX_E_AUTH_UNSUPPORTED   -8
 Authentication is not supported (either by server or by library).
#define ENMX_E_AUTH_FAILURE   -9
 User authentication failed (wrong username/password).
#define ENMX_E_DHM_FAILURE   -10
 DHM key exchange failed.
#define ENMX_E_PARAMETER   -11
 Invalid parameter passed to library.
#define ENMX_E_UNAUTHORISED   -12
 Not authorised to perform this function.
#define ENMX_E_HOST_NOTFOUND   -13
 Specified host could not be found, no ip address available.
#define ENMX_E_SEARCH   -14
 Either none or more than one EIBnetmux server(s) found. Specify target host.
#define ENMX_E_SERVER_NOTRUNNING   -15
 EIBnetmux not running on host (or socketserver not activated).
#define ENMX_E_NOT_INITIALISED   -16
 Library not initialised, call enmx_init().
#define ENMX_E_NOCLIENTID   -17
 Client identifier must be specified.
#define ENMX_E_REGISTER_CLIENT   -18
 Unable to register client identifier.
#define ENMX_E_RESOURCE   -19
 System resource problem.
#define ENMX_E_NO_CONNECTION   -20
 Invalid connection handle.
#define ENMX_E_VERSIONMISMATCH   -21
 Library does not match/support version of EIBnetmux server.
#define ENMX_E_L7_NO_CONNECTION   -22
 No connection with other device established.
#define ENMX_E_L7_NAK_RECEIVED   -23
 Remote device replied with NAK.
#define ENMX_E_L7_SEQUENCE   -24
 Remote device's answer was not what we expected.
#define ENMX_E_L7_BUFSIZE   -25
 Buffer not large enough to receive all data.
#define ENMX_E_L7_MASK   -26
 Invalid mask version of remote device.

Typedefs

typedef int ENMX_HANDLE
 Variable type to indicate an EIBnetmux connection.
typedef uint16_t ENMX_ADDRESS
 Variable type for KNX group addresses as used by the library.

Enumerations

enum  enmx_KNXTypes {
  enmx_KNXerror, enmx_KNXinteger, enmx_KNXfloat, enmx_KNXchar,
  enmx_KNXstring
}
 Variable types returned by the conversion functions. More...

Functions

int enmx_init (void)
 initialise eibnetmux client library
ENMX_HANDLE enmx_open (char *hostname, char *myname)
 establish connection with eibnetmux socket server
ENMX_HANDLE enmx_pth_open (char *hostname, char *myname)
 connection with eibnetmux socket server (PTH version)
void enmx_close (ENMX_HANDLE conn)
 close connection with eibnetmux socket server
char * enmx_gethost (ENMX_HANDLE handle)
 retrieve hostname of connected eibnetmux server
int enmx_auth (ENMX_HANDLE handle, char *user, char *password)
 authenticate user
int enmx_write (ENMX_HANDLE handle, ENMX_ADDRESS knxaddress, uint16_t length, unsigned char *value)
 write value to group address
unsigned char * enmx_read (ENMX_HANDLE handle, ENMX_ADDRESS knxaddress, uint16_t *length)
 read value from group address
unsigned char * enmx_monitor (ENMX_HANDLE handle, ENMX_ADDRESS mask, unsigned char *buf, uint16_t *buflen, uint16_t *length)
 monitor group addresses
int enmx_geterror (ENMX_HANDLE handle)
char * enmx_errormessage (ENMX_HANDLE handle)
 return error message of last operation
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
unsigned int enmx_frame2value (int eis, void *cemiframe, void *value)
 Extract data from CEMI frame - as returned by enmx_monitor() - and convert to C variable.
unsigned int enmx_eis2value (int eis, unsigned char *datastream, int length, void *value)
 Convert KNX data stream - as returned by enmx_read() - to C variable.
int enmx_value2eis (int eis, void *buf, unsigned char *datastream)
 Convert C variable to KNX data stream.
ENMX_ADDRESS enmx_getaddress (const char *KNXgroup)
 Convert KNX group address to ENMX_ADDRESS.
char * enmx_getgroup (ENMX_ADDRESS knxaddress)
 Convert KNX group address to string.
int enmx_mgmt_connect (ENMX_HANDLE handle)
 connect eibnet/ip client to remote server
int enmx_mgmt_disconnect (ENMX_HANDLE handle)
 disconnect eibnet/ip client from remote server
int enmx_mgmt_getloglevel (ENMX_HANDLE handle)
 get current eibnetmux log level
int enmx_mgmt_setloglevel (ENMX_HANDLE handle, uint16_t level)
 set new eibnetmux log level
int enmx_mgmt_close_session (ENMX_HANDLE handle, int session_type, uint32_t session_id)
 forcibly close a client session
sENMX_Statusenmx_mgmt_getstatus (ENMX_HANDLE handle)
 return structure with eibnetmux status
void enmx_mgmt_releasestatus (sENMX_Status *status)
 release all memory used by status structure
int enmx_L7_connect (ENMX_HANDLE handle, ENMX_ADDRESS knxaddress)
 connect to remote KNX device
int enmx_L7_disconnect (ENMX_HANDLE handle, ENMX_ADDRESS knxaddress)
 connect to remote KNX device
int enmx_L7_readmemory (ENMX_HANDLE handle, ENMX_ADDRESS knxaddress, uint16_t offset, uint16_t length, unsigned char *buf)
 read memory of remote KNX device
int enmx_L7_writememory (ENMX_HANDLE handle, ENMX_ADDRESS knxaddress, uint16_t offset, uint16_t length, unsigned char *buf)
 write memory of remote KNX device
int enmx_L7_reset (ENMX_HANDLE handle, ENMX_ADDRESS knxaddress)
 reset remote KNX device

Variables

int enmx_EISsizeC []
 Variable sizes for EIS types.
int enmx_EISsizeKNX []
 Buffer sizes for EIS types.

Define Documentation

#define ENMX_E_AUTH_FAILURE   -9

User authentication failed (wrong username/password).

#define ENMX_E_AUTH_UNSUPPORTED   -8

Authentication is not supported (either by server or by library).

#define ENMX_E_COMMUNICATION   -1

Error communicating with EIBnetmux server.

Examples:
eibstatus.c, and eibtrace.c.

#define ENMX_E_DHM_FAILURE   -10

DHM key exchange failed.

#define ENMX_E_HOST_NOTFOUND   -13

Specified host could not be found, no ip address available.

#define ENMX_E_INTERNAL   -4

EIBnetmux server experienced an internal error.

Examples:
eibstatus.c, and eibtrace.c.

#define ENMX_E_L7_BUFSIZE   -25

Buffer not large enough to receive all data.

#define ENMX_E_L7_MASK   -26

Invalid mask version of remote device.

#define ENMX_E_L7_NAK_RECEIVED   -23

Remote device replied with NAK.

#define ENMX_E_L7_NO_CONNECTION   -22

No connection with other device established.

#define ENMX_E_L7_SEQUENCE   -24

Remote device's answer was not what we expected.

#define ENMX_E_NO_CONNECTION   -20

Invalid connection handle.

Examples:
eibstatus.c, eibtrace.c, and layer7.c.

#define ENMX_E_NO_ERROR   0

Everything ok.

#define ENMX_E_NO_MEMORY   -5

Memory could not be allocated by the library for receive buffers, status structures, etc.

Examples:
eibstatus.c, and eibtrace.c.

#define ENMX_E_NOCLIENTID   -17

Client identifier must be specified.

#define ENMX_E_NOT_INITIALISED   -16

Library not initialised, call enmx_init().

#define ENMX_E_PARAMETER   -11

Invalid parameter passed to library.

#define ENMX_E_REGISTER_CLIENT   -18

Unable to register client identifier.

#define ENMX_E_RESOURCE   -19

System resource problem.

#define ENMX_E_SEARCH   -14

Either none or more than one EIBnetmux server(s) found. Specify target host.

#define ENMX_E_SERVER_ABORTED   -2

EIBnetmux server unexpectedly closed connection.

Examples:
eibstatus.c, and eibtrace.c.

#define ENMX_E_SERVER_NOTRUNNING   -15

EIBnetmux not running on host (or socketserver not activated).

#define ENMX_E_TIMEOUT   -6

Timeout while sending/receiving to EIBnetmux server.

Examples:
eibstatus.c, and eibtrace.c.

#define ENMX_E_UNAUTHORISED   -12

Not authorised to perform this function.

#define ENMX_E_UNKNOWN_GROUP   -3

KNX group unknown.

#define ENMX_E_VERSIONMISMATCH   -21

Library does not match/support version of EIBnetmux server.

#define ENMX_E_WRONG_USAGE   -7

This connection was already used for a different command.

Examples:
eibstatus.c, and eibtrace.c.

#define ENMX_NO_ERROR   0

Everything ok.


Typedef Documentation

typedef uint16_t ENMX_ADDRESS

Variable type for KNX group addresses as used by the library.

typedef int ENMX_HANDLE

Variable type to indicate an EIBnetmux connection.

Examples:
eibcommand.c, eibread.c, eibstatus.c, eibtrace.c, layer7.c, pth_search.c, and search.c.


Enumeration Type Documentation

Variable types returned by the conversion functions.

Enumerator:
enmx_KNXerror 
enmx_KNXinteger 
enmx_KNXfloat 
enmx_KNXchar 
enmx_KNXstring