Functions | |
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. | |
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. | |
int | enmx_value2eis (int eis, void *value, 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. | |
Variables | |
int | enmx_EISsizeC [16] = { -1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 1, 4, 15 } |
Variable sizes for EIS types. | |
int | enmx_EISsizeKNX [16] = { -1, 1, 1, 4, 4, 3, 2, 1, 1, 5, 3, 5, 5, 2, 2, 15 } |
Buffer sizes for EIS types. |
This API supports the following features:
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.
Requests sent on the KNX bus have no indication as to how its data should be interpreted. Knowledge of the data format is part of the KNX group definition or assignment, respectively. It is expressed as the EIS (EIB Interchange Standard), a number in the range of 1-15 which defines the data type.
Given the correct EIS, this function allows to easily convert the data part of a KNX request to a C variable which then can be used for further calculations or displaying.
ATTENTION: Caller must ensure that buffer is large enough to hold result See enmx_EISsizeC[].
eis | EIS type (range 1-15) | |
datastream | pointer to KNX data stream as returned by enmx_read() | |
length | length of KNX data stream | |
value | pointer to the buffer receiving the converted result |
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.
Requests sent on the KNX bus have no indication as to how its data should be interpreted. Knowledge of the data format is part of the KNX group definition or assignment, respectively. It is expressed as the EIS (EIB Interchange Standard), a number in the range of 1-15 which defines the data type.
Given the correct EIS, this function allows to easily convert the data part of a KNX request to a C variable which then can be used for further calculations or displaying.
ATTENTION: Caller must ensure that buffer is large enough to hold result See enmx_EISsizeC[].
eis | EIS type (range 1-15) | |
cemiframe | pointer to CEMIFRAME as returned by enmx_monitor() | |
value | pointer to the buffer receiving the converted result |
ENMX_ADDRESS enmx_getaddress | ( | const char * | KNXgroup | ) |
Convert KNX group address to ENMX_ADDRESS.
The KNX bus and, consequently, this library use a 16-bit integer to address a specific group. The value is formatted as follows:
0mmm msss gggg gggg
This function converts a human-readable KNX group address of the form "x/y/z" to the 16-bit integer ENMX_ADDRESS.
KNXgroup | group address, string in the form "x/y/z" |
char* enmx_getgroup | ( | ENMX_ADDRESS | knxaddress | ) |
Convert KNX group address to string.
The KNX bus and, consequently, this library use a 16-bit integer to address a specific group. The value is formatted as follows:
0mmm msss gggg gggg
This function converts a 16-bit integer ENMX_ADDRESS into a human-readable KNX group address of the form "x/y/z".
ATTENTION: caller has to release returned buffer
knxaddress | encoded KNX group address |
int enmx_value2eis | ( | int | eis, | |
void * | value, | |||
unsigned char * | datastream | |||
) |
Convert C variable to KNX data stream.
Requests sent on the KNX bus have no indication as to how its data should be interpreted. Knowledge of the data format is part of the KNX group definition or assignment, respectively. It is expressed as the EIS (EIB Interchange Standard), a number in the range of 1-15 which defines the data type.
Given the correct EIS, this function allows to easily create the data part of a KNX request from a C variable. The result can be used directly for enmx_write().
ATTENTION: Caller must ensure that buffer is large enough to hold result. See enmx_EISsizeKNX[].
eis | EIS type (range 1-15) | |
value | pointer to the buffer containing the C variable | |
datastream | pointer to the buffer receiving the converted result |
int enmx_EISsizeC[16] = { -1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 1, 4, 15 } |
Variable sizes for EIS types.
Client application developers can use the following table to determine the minimum buffer size required to convert KNX data to a C variable.
Retrieve the size as:
enmx_EISsizeC[eis]
int enmx_EISsizeKNX[16] = { -1, 1, 1, 4, 4, 3, 2, 1, 1, 5, 3, 5, 5, 2, 2, 15 } |
Buffer sizes for EIS types.
Client application developers can use the following table to determine the minimum buffer size required to convert a C variable to a KNX data stream.
Retrieve the size as:
enmx_EISsizeKNX[eis]