Functions | |
int | enmx_auth (ENMX_HANDLE handle, char *user, char *password) |
authenticate user | |
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_L7Passthrough (sConnectionInfo *pConn, ENMX_ADDRESS knxaddress) |
initialise layer 7/passthrough connection to eibnetmux | |
int | _enmx_L7State (sConnectionInfo *pConn) |
check layer 7 connection state | |
int | _enmx_L7GetAckNak (sConnectionInfo *pConn) |
get layer 7 Ack/Nak | |
int | _enmx_L7Response (sConnectionInfo *pConn, ENMX_ADDRESS knxaddress, unsigned char *buf, int *length, uint8_t tpci, uint16_t apci) |
get and check response to last layer 7 request | |
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 | |
unsigned char * | enmx_monitor (ENMX_HANDLE handle, ENMX_ADDRESS mask, unsigned char *buf, uint16_t *buflen, uint16_t *length) |
monitor group addresses | |
unsigned char * | enmx_read (ENMX_HANDLE handle, ENMX_ADDRESS knxaddress, uint16_t *length) |
read value from group address | |
int | enmx_write (ENMX_HANDLE handle, ENMX_ADDRESS knxaddress, uint16_t length, unsigned char *value) |
write value to group address |
This API supports the following features:
int _enmx_L7GetAckNak | ( | sConnectionInfo * | pConn | ) |
get layer 7 Ack/Nak
pConn | pointer to connection structure |
int _enmx_L7Passthrough | ( | sConnectionInfo * | pConn, | |
ENMX_ADDRESS | knxaddress | |||
) |
initialise layer 7/passthrough connection to eibnetmux
pConn | pointer to connection structure | |
knxaddress | physical address of remote device |
int _enmx_L7Response | ( | sConnectionInfo * | pConn, | |
ENMX_ADDRESS | knxaddress, | |||
unsigned char * | buf, | |||
int * | length, | |||
uint8_t | tpci, | |||
uint16_t | apci | |||
) |
get and check response to last layer 7 request
pConn | pointer to connection structure | |
knxaddress | physical address of remote device | |
buf | pointer to buffer receiving data (tpci, apci, data) | |
length | pointer to variable specifying maximum size of data buffer, receives actual length of received data | |
tpci | required transport control field setting | |
apci | required application control field setting |
int _enmx_L7State | ( | sConnectionInfo * | pConn | ) |
check layer 7 connection state
pConn | pointer to connection structure |
int enmx_auth | ( | ENMX_HANDLE | handle, | |
char * | user, | |||
char * | password | |||
) |
authenticate user
eibnetmux supports simple, password-based authentication for its socketserver clients. To authenticate, a client must send username and corresponding password (full, not hashed). To protect against network sniffers, secrets are encrypted before transmission.
To calculate the encryption key, the client initiates the Diffie-Hellman-Merkle key exchange. It receives the corresponding DHM parameters from the server, calculates its own public key and sends it to the server. With this, both parties have enough information to independently and secretly compute a shared session key which is used here only for encryption.
The C library only supports authentication if compiled with authentication support which depends on the availability of the PolarSSL library.
handle | connection handle as returned by enmx_open() | |
user | name of user trying to authenticate | |
password | user's password |
int enmx_L7_connect | ( | ENMX_HANDLE | handle, | |
ENMX_ADDRESS | knxaddress | |||
) |
connect to remote KNX device
handle | connection handle as returned by enmx_open() | |
knxaddress | knx group address as 16-bit integer |
int enmx_L7_disconnect | ( | ENMX_HANDLE | handle, | |
ENMX_ADDRESS | knxaddress | |||
) |
connect to remote KNX device
handle | connection handle as returned by enmx_open() | |
knxaddress | knx group address as 16-bit integer |
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
handle | connection handle as returned by enmx_open() | |
knxaddress | knx group address as 16-bit integer | |
offset | start address of memory to read | |
length | number of bytes to read | |
buf | buffer receiving read bytes |
int enmx_L7_reset | ( | ENMX_HANDLE | handle, | |
ENMX_ADDRESS | knxaddress | |||
) |
reset remote KNX device
handle | connection handle as returned by enmx_open() | |
knxaddress | knx group address as 16-bit integer |
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
handle | connection handle as returned by enmx_open() | |
knxaddress | knx group address as 16-bit integer | |
offset | start address of memory to read | |
length | number of bytes to read | |
buf | bytes to write |
unsigned char* enmx_monitor | ( | ENMX_HANDLE | handle, | |
ENMX_ADDRESS | mask, | |||
unsigned char * | buf, | |||
uint16_t * | buflen, | |||
uint16_t * | length | |||
) |
monitor group addresses
Use this function to monitor the activity on the KNX bus. This function is similar to a simple read but returns all requests addressed to a set of KNX logical groups.
For each request, the complete CEMI frame is returned. The caller must understand its format and extract the data according to the addressed group's EIS data type.
ATTENTION: caller has to release returned buffer
handle | connection handle as returned by enmx_open() | |
mask | mask of knx group addresses to monitor (as 16-bit integer) | |
buf | buffer which will receive byte stream, enlarged if required | |
buflen | pointer to current size of buffer, updated if buffer enlarged | |
length | pointer to variable which will receive length of byte stream |
unsigned char* enmx_read | ( | ENMX_HANDLE | handle, | |
ENMX_ADDRESS | knxaddress, | |||
uint16_t * | length | |||
) |
read value from group address
Returned data comes directly from the CEMI frame and must be analysed according to the KNX group's EIS data type.
ATTENTION: caller has to release returned buffer
handle | connection handle as returned by enmx_open() | |
knxaddress | knx group address as 16-bit integer | |
length | pointer to variable which will receive length of byte stream |
int enmx_write | ( | ENMX_HANDLE | handle, | |
ENMX_ADDRESS | knxaddress, | |||
uint16_t | length, | |||
unsigned char * | value | |||
) |
write value to group address
The data is used directly for the TPCI, APCI, and DATA part of the CEMI frame. It must be preformatted accordingly. In particular, the data must correspond to the EIS data type assigned to the addressed KNX group.
handle | connection handle as returned by enmx_open() | |
knxaddress | knx group address as 16-bit integer | |
value | byte stream | |
length | length of byte stream |