#include <stdio.h>
#include <stdlib.h>
#define ERROR_MESSAGE_LEN (128)
#define MAX_USB_INTERFACES (10)
static void on_telegram_callback(
const uint8_t* telegram,
uint32_t telegram_len,
void* user_data);
static void error_callback(
error_t e,
void* user_data);
int main(int argc, char* argv[])
{
uint32_t iface_items_length = MAX_USB_INTERFACES;
{
while (1)
{
;
}
}
for (index = 0; index < iface_items_length; ++index)
{
iface = &iface_items[index];
}
{
getchar();
}
return 0;
}
void on_telegram_callback(
const uint8_t* telegram,
uint32_t telegram_len,
void* user_data)
{
{
{
}
if (is_rf)
{
{
}
}
}
}
void error_callback(
error_t e,
void* user_data)
{
{
static char error_message[ERROR_MESSAGE_LEN];
}
}
{
switch (e)
{
break;
break;
break;
break;
break;
break;
break;
break;
break;
break;
break;
break;
break;
default:
break;
}
}
kdriveExpress_API error_t kdrive_ap_get_group_data(const uint8_t telegram[], uint32_t telegram_len, uint8_t *data, uint32_t *data_len)
Extracts the Group Value data from the KNX telegram.
kdriveExpress_API error_t kdrive_ap_packet_trace_connect(int32_t ap)
Starts the Packet Trace, for a specific access port.
kdriveExpress_API error_t kdrive_ap_group_write(int32_t ap, uint16_t address, const uint8_t *value, uint32_t bits)
Sends a GroupValue_Write Telegram The length is specified in bits to enable values less than one byte...
kdriveExpress_API bool_t kdrive_ap_is_group_write(const uint8_t telegram[], uint32_t telegram_len)
Determines if the specified telegram is a GroupValue_Write telegram.
kdriveExpress_API bool_t kdrive_ap_release(int32_t ap)
Releases the AccessPort interface.
kdriveExpress_API int32_t kdrive_ap_create(void)
Creates an internal AccessPort interface This should be the first function called when working with t...
kdriveExpress_API error_t kdrive_ap_close(int32_t ap)
Closes the access port If the access port is not open nothing happens.
kdriveExpress_API error_t kdrive_ap_open_usb(int32_t ap, uint32_t iface_index)
Opens a connection to a KNX USB Interface device iface_index should be in the range 0....
kdriveExpress_API error_t kdrive_ap_enum_usb_ex(usb_dev_t items[], uint32_t *items_length)
Scan for all KNX USB Interface devices.
kdriveExpress_API error_t kdrive_ap_get_message_code(const uint8_t telegram[], uint32_t telegram_len, uint8_t *message_code)
Extracts the Message Code from the Telegram.
kdriveExpress_API error_t kdrive_ap_get_dest(const uint8_t telegram[], uint32_t telegram_len, uint16_t *address)
Extracts the Destination Address from the Telegram.
kdriveExpress_API error_t kdrive_ap_register_telegram_callback(int32_t ap, kdrive_ap_telegram_callback c, void *user_data, uint32_t *key)
Registers a callback function.
kdriveExpress_API error_t kdrive_ap_get_serial_number(const uint8_t telegram[], uint32_t telegram_len, uint8_t sn[KDRIVE_SN_LEN])
Extracts the Serial Number from the Additional Info (if available) This is extracted from the Additio...
kdriveExpress_API void kdrive_logger(uint8_t level, const char *message)
Writes to the kdrive express logger.
kdriveExpress_API void kdrive_logger_dump(uint8_t level, const char *message, const void *buffer, uint32_t buffer_len)
Logs the given message, followed by the data in buffer.
kdriveExpress_API void kdrive_logger_console(void)
Sets the logger to write to the console.
kdriveExpress_API void kdrive_logger_ex(uint8_t level, const char *fmt,...)
Writes to the kdrive express logger.
kdriveExpress_API void kdrive_logger_set_level(uint8_t level)
Sets the root logger level This is once of:
unsigned short uint16_t
16 bit unsigned char
Definition: kdrive_express_config.h:30
int int32_t
32 bit signed int
Definition: kdrive_express_config.h:34
unsigned int uint32_t
32 bit unsigned char
Definition: kdrive_express_config.h:31
int32_t error_t
Definition: kdrive_express_config.h:46
int32_t bool_t
Definition: kdrive_express_config.h:57
unsigned char uint8_t
8 bit unsigned char
Definition: kdrive_express_config.h:29
#define KDRIVE_SN_LEN
The Length of a KNX Serial Number.
Definition: kdrive_express_defs.h:34
#define KDRIVE_CEMI_L_DATA_IND
cEMI message code for L_Data.ind
Definition: kdrive_express_defs.h:47
#define KDRIVE_INVALID_DESCRIPTOR
Indicates an invalid descriptor.
Definition: kdrive_express_defs.h:39
#define KDRIVE_MAX_GROUP_VALUE_LEN
The Maximum Length of a Datapoint Value in a GroupValue Telegram.
Definition: kdrive_express_defs.h:33
kdriveExpress_API void kdrive_register_error_callback(kdrive_error_callback c, void *user_data)
Registers the error callback function.
#define KDRIVE_TIMEOUT_ERROR
Timeout.
Definition: kdrive_express_error.h:26
#define KDRIVE_ERROR_NONE
No Error, Everything OK.
Definition: kdrive_express_error.h:22
kdriveExpress_API void kdrive_get_error_message(error_t e, char *str, uint32_t str_len)
Gets the error message.
#define KDRIVE_EVENT_CLOSING
The closing signal is emitted when the port is about to be closed.
Definition: kdrive_express_event.h:26
kdriveExpress_API error_t kdrive_set_event_callback(int32_t ap, kdrive_event_callback c, void *user_data)
Sets the event callback, for a specific access port.
#define KDRIVE_EVENT_OPENING
The opening signal is emitted when the port is about to be opened.
Definition: kdrive_express_event.h:24
#define KDRIVE_EVENT_TELEGRAM_INDICATION
Definition: kdrive_express_event.h:34
#define KDRIVE_EVENT_TERMINATED
The terminated signal is emitted when the port was closed (internally) on error.
Definition: kdrive_express_event.h:28
#define KDRIVE_EVENT_CLOSED
The closed signal is emitted when the port was closed.
Definition: kdrive_express_event.h:27
#define KDRIVE_EVENT_INTERNAL_01
Definition: kdrive_express_event.h:38
#define KDRIVE_EVENT_KNX_BUS_DISCONNECTED
The knx bus disconnected signal is emitted when the KNX bus was disconnected.
Definition: kdrive_express_event.h:31
#define KDRIVE_EVENT_ERROR
The error signal is emitted when an error was occurred.
Definition: kdrive_express_event.h:22
#define KDRIVE_EVENT_LOCAL_DEVICE_RESET
The local device reset signal is emitted when a KNX reset.ind was received.
Definition: kdrive_express_event.h:32
#define KDRIVE_EVENT_TELEGRAM_CONFIRM_TIMEOUT
Definition: kdrive_express_event.h:36
#define KDRIVE_EVENT_KNX_BUS_CONNECTED
The knx bus connected signal is emitted when the KNX bus was connected.
Definition: kdrive_express_event.h:30
#define KDRIVE_EVENT_OPENED
The opened signal is emitted when the port was opened.
Definition: kdrive_express_event.h:25
#define KDRIVE_EVENT_TELEGRAM_CONFIRM
Definition: kdrive_express_event.h:35
#define KDRIVE_LOGGER_FATAL
A fatal error.
Definition: kdrive_express_logger.h:26
#define KDRIVE_LOGGER_ERROR
An error.
Definition: kdrive_express_logger.h:28
#define KDRIVE_LOGGER_INFORMATION
An informational message, usually denoting the successful completion of an operation.
Definition: kdrive_express_logger.h:31
Structure holding usb device information.
Definition: kdrive_express_access.h:89
uint32_t usb_vendor_id
usb device vendor id
Definition: kdrive_express_access.h:93
uint16_t media_tytes
knx media types (bit field, encoding is DPT_Media)
Definition: kdrive_express_access.h:91
uint32_t usb_product_id
usb device product id
Definition: kdrive_express_access.h:94
uint32_t internal_usb_index
numbered in the order that the hid driver enumerates the devices
Definition: kdrive_express_access.h:92
uint16_t ind_addr
KNX individual address.
Definition: kdrive_express_access.h:90