#include <stdio.h>
#include <stdlib.h>
#define ERROR_MESSAGE_LEN (128)
#define MAX_ITEMS (50)
static void enumerate_tunneling_devices(
int32_t ap);
static void error_callback(
error_t e,
void* user_data);
int main(int argc, char* argv[])
{
{
printf("Unable to create access port. This is a terminal failure\n");
while (1)
{
;
}
}
enumerate_tunneling_devices(ap);
return 0;
}
void enumerate_tunneling_devices(
int32_t ap)
{
{
for (index = 0; index < items_length; ++index)
{
items[index].mac_address[0], items[index].mac_address[1], items[index].mac_address[2],
items[index].mac_address[3], items[index].mac_address[4], items[index].mac_address[5]);
items[index].serial_number[0], items[index].serial_number[1], items[index].serial_number[2],
items[index].serial_number[3], items[index].serial_number[4], items[index].serial_number[5]);
print_tunneling_slots(items[index].slot_infos, items[index].slot_infos_count);
}
}
}
{
for (index = 0; index < slot_infos_count; ++index)
{
address = slot_infos[index].
address;
status = slot_infos[index].
status;
index, address,
is_usable ? " Usable " : "!Usable ",
is_authorised ? " Authorised " : "!Authorised ",
is_free ? " Free " : "!Free ");
}
}
void error_callback(
error_t e,
void* user_data)
{
{
static char error_message[ERROR_MESSAGE_LEN];
}
}
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_enum_ip_tunn(int32_t ap, ip_tunn_dev_t items[], uint32_t *items_length)
Scans for all KNX IP Tunneling Interface devices The items array must exist (should be pre-allocated ...
kdriveExpress_API void kdrive_logger(uint8_t level, const char *message)
Writes to the kdrive express logger.
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:31
bool bool_t
Definition: kdrive_express_config.h:58
int int32_t
32 bit signed int
Definition: kdrive_express_config.h:35
unsigned int uint32_t
32 bit unsigned char
Definition: kdrive_express_config.h:32
int32_t error_t
Definition: kdrive_express_config.h:47
#define KDRIVE_TUNNEL_SLOT_STATUS_FREE
Tunneling slot status Free: 0 = not free; 1 = free.
Definition: kdrive_express_defs.h:73
#define KDRIVE_TUNNEL_SLOT_STATUS_AUTH
Tunneling slot status Authorised: 0 = authorisation is required; 1 = no authorisation is required.
Definition: kdrive_express_defs.h:77
#define KDRIVE_INVALID_DESCRIPTOR
Indicates an invalid descriptor.
Definition: kdrive_express_defs.h:39
#define KDRIVE_TUNNEL_SLOT_STATUS_USABLE
Tunneling slot status Usable: 0 = This slot is not usable; 1 = This slot is usable.
Definition: kdrive_express_defs.h:81
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_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 ip tunneling device information.
Definition: kdrive_express_access.h:176
Structure holding ip tunnling slot information.
Definition: kdrive_express_access.h:162
uint16_t status
2 bytes of status bits, currently only the last 3 are used, they are Usable(third bit),...
Definition: kdrive_express_access.h:164
uint16_t address
the individual address of the tunnel
Definition: kdrive_express_access.h:163