kdriveExpress SDK 22.1.1
kdrive_express_services.h File Reference

kdriveExpress Services API More...

Go to the source code of this file.

Data Structures

struct  device_descriptor_type2_t
 Structure holding device descriptor 2 (easy channel information) More...
 
struct  property_description_t
 Structure holding a property description. More...
 
struct  ext_property_description_t
 Structure holding a extended property description. More...
 
struct  system_network_param_read_t
 Structure holding individual address and test info and test result for the SystemNetworkParameterRead service. More...
 
struct  domain_addr_prog_mode_read_t
 Structure holding individual address, serial number, domain address for the DomainAddressProgModeRead service. More...
 

Macros

#define KDRIVE_LOAD_STATE_ADDITIONAL_INFO_LEN   (9)
 The length of the additional info in a A_LoadSate_Write service. More...
 

Typedefs

typedef struct device_descriptor_type2_t device_descriptor_type2_t
 Structure holding device descriptor 2 (easy channel information) More...
 
typedef struct property_description_t property_description_t
 Structure holding a property description. More...
 
typedef struct ext_property_description_t ext_property_description_t
 Structure holding a extended property description. More...
 
typedef struct system_network_param_read_t system_network_param_read_t
 Structure holding individual address and test info and test result for the SystemNetworkParameterRead service. More...
 
typedef struct domain_addr_prog_mode_read_t domain_addr_prog_mode_read_t
 Structure holding individual address, serial number, domain address for the DomainAddressProgModeRead service. More...
 

Functions

kdriveExpress_API int32_t kdrive_sp_create (int32_t ap)
 Creates an internal ServicePort interface This should be the first function called when working with the services library. More...
 
kdriveExpress_API bool_t kdrive_sp_release (int32_t sp)
 Releases the ServicePort interface. More...
 
kdriveExpress_API error_t kdrive_sp_set_response_timeout (int32_t sp, uint32_t timeout)
 Sets the response timeout. More...
 
kdriveExpress_API error_t kdrive_sp_get_response_timeout (int32_t sp, uint32_t *timeout)
 Gets the response timeout. More...
 
kdriveExpress_API error_t kdrive_sp_set_co (int32_t sp, bool_t connection_oriented)
 Sets whether the device services are run as connection-oriented or connection-less. More...
 
kdriveExpress_API bool_t kdrive_sp_is_co (int32_t sp)
 Returns whether the device services are run as connection-oriented or connection-less. More...
 
kdriveExpress_API error_t kdrive_sp_set_max_apdu_length (int32_t sp, uint32_t max_apdu_length)
 Sets the maximum apdu length for device services. More...
 
kdriveExpress_API error_t kdrive_sp_get_max_apdu_length (int32_t sp, uint32_t *max_apdu_length)
 Gets the maximum apdu length for device services. More...
 
kdriveExpress_API error_t kdrive_sp_set_ext_memory_services_used (int32_t sp, bool_t ext_used)
 Sets whether the memory block services use the (new) extended memory services or the 'normal' memory service. More...
 
kdriveExpress_API error_t kdrive_sp_are_ext_memory_services_used (int32_t sp, bool_t *ext_used)
 Gets whether the memory block services are use the (new) extended memory services or the 'normal' memory service. More...
 
kdriveExpress_API error_t kdrive_sp_device_descriptor_type0_read (int32_t sp, uint16_t ind_addr, uint16_t *mask_version)
 Reads device descriptor 0 (mask version) from a device. More...
 
kdriveExpress_API error_t kdrive_sp_device_descriptor_type2_read (int32_t sp, uint16_t ind_addr, device_descriptor_type2_t *desc)
 Reads device descriptor 2 (easy channel information) from a device. More...
 
kdriveExpress_API error_t kdrive_sp_restart_device_type0 (int32_t sp, uint16_t ind_addr)
 Restarts the device using restart (type 0) There is no response to this telegram so it is not possible to know when the device is ready. More...
 
kdriveExpress_API error_t kdrive_sp_restart_device_type1 (int32_t sp, uint16_t ind_addr, uint8_t erase_code, uint8_t channel_number, uint8_t *error_code, uint16_t *process_time)
 Restarts the device using restart (type 1) More...
 
kdriveExpress_API error_t kdrive_sp_property_description_read (int32_t sp, uint16_t ind_addr, uint8_t object_index, uint8_t prop_id, uint8_t prop_index, property_description_t *property_description)
 Reads a property description from a device. More...
 
kdriveExpress_API error_t kdrive_sp_prop_value_read (int32_t sp, uint16_t ind_addr, uint8_t object_index, uint8_t prop_id, uint8_t nr_of_elems, uint16_t start_index, uint8_t data[], uint32_t *data_length)
 Reads a property value from a device The data buffer must exist (should be pre-allocated by the user) and its size should be equal to or greater than the property value to be read. More...
 
kdriveExpress_API error_t kdrive_sp_prop_value_write (int32_t sp, uint16_t ind_addr, uint8_t object_index, uint8_t prop_id, uint8_t nr_of_elems, uint16_t start_index, const uint8_t data[], uint32_t data_length)
 Writes the value of a property to a device. More...
 
kdriveExpress_API error_t kdrive_sp_prop_value_write_without_verify (int32_t sp, uint16_t ind_addr, uint8_t object_index, uint8_t prop_id, uint8_t nr_of_elems, uint16_t start_index, const uint8_t input_data[], uint32_t input_data_length, uint8_t output_data[], uint32_t *output_data_length)
 Writes the value of a property to a device. More...
 
kdriveExpress_API error_t kdrive_sp_function_property_command (int32_t sp, uint16_t ind_addr, uint8_t object_index, uint8_t prop_id, const uint8_t input_data[], uint32_t input_data_length, uint8_t *return_code, uint8_t output_data[], uint32_t *output_data_length)
 Calls a function property of an interface object in a device. More...
 
kdriveExpress_API error_t kdrive_sp_function_property_state_read (int32_t sp, uint16_t ind_addr, uint8_t object_index, uint8_t prop_id, const uint8_t input_data[], uint32_t input_data_length, uint8_t *return_code, uint8_t output_data[], uint32_t *output_data_length)
 Calls a function property of an interface object in a device. More...
 
kdriveExpress_API error_t kdrive_sp_ext_prop_description_read (int32_t sp, uint16_t ind_addr, uint16_t object_type, uint16_t object_instance, uint16_t prop_id, uint16_t prop_index, ext_property_description_t *property_description)
 Reads a property description from a device via A_PropertyExtDescription_Read service. More...
 
kdriveExpress_API error_t kdrive_sp_ext_prop_value_read (int32_t sp, uint16_t ind_addr, uint16_t object_type, uint16_t object_instance, uint16_t prop_id, uint8_t nr_of_elems, uint16_t start_index, uint8_t data[], uint32_t *data_length)
 
kdriveExpress_API error_t kdrive_sp_ext_prop_value_write (int32_t sp, uint16_t ind_addr, uint16_t object_type, uint16_t object_instance, uint16_t prop_id, uint8_t nr_of_elems, uint16_t start_index, const uint8_t data[], uint32_t data_length, uint8_t *return_code)
 
kdriveExpress_API error_t kdrive_sp_ext_prop_value_write_uncon (int32_t sp, uint16_t ind_addr, uint16_t object_type, uint16_t object_instance, uint16_t prop_id, uint8_t nr_of_elems, uint16_t start_index, const uint8_t data[], uint32_t data_length)
 
kdriveExpress_API error_t kdrive_sp_ext_function_property_command (int32_t sp, uint16_t ind_addr, uint16_t object_type, uint16_t object_instance, uint16_t prop_id, const uint8_t input_data[], uint32_t input_data_length, uint8_t *return_code, uint8_t output_data[], uint32_t *output_data_length)
 
kdriveExpress_API error_t kdrive_sp_ext_function_property_state_read (int32_t sp, uint16_t ind_addr, uint16_t object_type, uint16_t object_instance, uint16_t prop_id, const uint8_t input_data[], uint32_t input_data_length, uint8_t *return_code, uint8_t output_data[], uint32_t *output_data_length)
 
kdriveExpress_API error_t kdrive_sp_memory_read (int32_t sp, uint16_t ind_addr, uint16_t memory_addr, uint8_t number, uint8_t data[], uint32_t *data_length)
 Reads data via DMA. More...
 
kdriveExpress_API error_t kdrive_sp_memory_write (int32_t sp, uint16_t ind_addr, uint16_t memory_addr, const uint8_t data[], uint32_t data_length)
 Writes data via DMA. More...
 
kdriveExpress_API error_t kdrive_sp_memory_write_without_verify (int32_t sp, uint16_t ind_addr, uint16_t memory_addr, const uint8_t input_data[], uint32_t input_data_length, uint8_t output_data[], uint32_t *output_data_length)
 Writes data via DMA. More...
 
kdriveExpress_API error_t kdrive_sp_user_memory_read (int32_t sp, uint16_t ind_addr, uint32_t memory_addr, uint8_t number, uint8_t data[], uint32_t *data_length)
 Reads data via DMA. More...
 
kdriveExpress_API error_t kdrive_sp_user_memory_write (int32_t sp, uint16_t ind_addr, uint32_t memory_addr, const uint8_t data[], uint32_t data_length)
 Writes data via DMA. More...
 
kdriveExpress_API error_t kdrive_sp_user_memory_write_without_verify (int32_t sp, uint16_t ind_addr, uint32_t memory_addr, const uint8_t input_data[], uint32_t input_data_length, uint8_t output_data[], uint32_t *output_data_length)
 Writes data via DMA. More...
 
kdriveExpress_API error_t kdrive_sp_ext_memory_read (int32_t sp, uint16_t ind_addr, uint32_t memory_addr, uint8_t number, uint8_t data[], uint32_t *data_length)
 Reads data via A_Extended_Memory_Read service. More...
 
kdriveExpress_API error_t kdrive_sp_ext_memory_write (int32_t sp, uint16_t ind_addr, uint32_t memory_addr, const uint8_t data[], uint32_t data_length)
 Reads data via A_Extended_Memory_Write service. More...
 
kdriveExpress_API error_t kdrive_sp_authorize_request (int32_t sp, uint16_t ind_addr, uint32_t key, uint8_t *level)
 Sends an authorize request. More...
 
kdriveExpress_API error_t kdrive_sp_key_write (int32_t sp, uint16_t ind_addr, uint8_t *level, uint32_t key)
 Writes an authorization key. More...
 
kdriveExpress_API error_t kdrive_is_ind_addr_free (int32_t sp, uint16_t ind_addr, bool_t *is_free)
 Checks if the given individual address is free (not used by a device on the bus) More...
 
kdriveExpress_API error_t kdrive_sp_load_state_read (int32_t sp, uint16_t ind_addr, uint8_t object_index, uint8_t *load_state)
 Reads the load state via PropertyValueRead (PID_LOAD_STATE_CONTROL). More...
 
kdriveExpress_API error_t kdrive_sp_load_state_write (int32_t sp, uint16_t ind_addr, uint8_t object_index, uint8_t load_event, uint8_t *load_state)
 Writes the load state via PropertyValueWrite (PID_LOAD_STATE_CONTROL). More...
 
kdriveExpress_API error_t kdrive_sp_load_state_write_ex (int32_t sp, uint16_t ind_addr, uint8_t object_index, uint8_t load_event, const uint8_t additional_info[KDRIVE_LOAD_STATE_ADDITIONAL_INFO_LEN], uint8_t *load_state)
 Writes the load state via PropertyValueWrite (PID_LOAD_STATE_CONTROL). More...
 
kdriveExpress_API error_t kdrive_sp_read_prog_mode (int32_t sp, uint16_t ind_addr, bool_t *enabled)
 Reads the current programming mode. More...
 
kdriveExpress_API error_t kdrive_sp_read_prog_mode_mask_based (int32_t sp, uint16_t ind_addr, uint16_t mask_version, bool_t *enabled)
 Reads the current programming mode. More...
 
kdriveExpress_API error_t kdrive_sp_read_prog_mode_property_based (int32_t sp, uint16_t ind_addr, bool_t *enabled)
 Reads the current programming mode via PropertyValueRead. More...
 
kdriveExpress_API error_t kdrive_sp_read_prog_mode_memory_mapped (int32_t sp, uint16_t ind_addr, bool_t *enabled)
 Reads the current programming mode via MemoryRead. More...
 
kdriveExpress_API error_t kdrive_sp_switch_prog_mode (int32_t sp, uint16_t ind_addr, bool_t enable)
 Enable / Disable the programming mode (switches the learn LED). More...
 
kdriveExpress_API error_t kdrive_sp_switch_prog_mode_mask_based (int32_t sp, uint16_t ind_addr, uint16_t mask_version, bool_t enable)
 Enable / Disable the programming mode (switches the learn LED). More...
 
kdriveExpress_API error_t kdrive_sp_switch_prog_mode_property_based (int32_t sp, uint16_t ind_addr, bool_t enable)
 Enable / Disable the programming mode (switches the learn LED). More...
 
kdriveExpress_API error_t kdrive_sp_switch_prog_mode_memory_mapped (int32_t sp, uint16_t ind_addr, bool_t enable)
 Enable / Disable the programming mode (switches the learn LED). More...
 
kdriveExpress_API error_t kdrive_sp_memory_block_read (int32_t sp, uint16_t ind_addr, uint32_t *memory_addr, uint8_t number, uint8_t data[], uint32_t *data_length)
 Reads a contiguous memory block via DMA. More...
 
kdriveExpress_API error_t kdrive_sp_memory_block_write (int32_t sp, uint16_t ind_addr, uint32_t memory_addr, const uint8_t data[], uint32_t data_length)
 Writes a contiguous memory block via DMA. More...
 
kdriveExpress_API error_t kdrive_sp_ind_addr_prog_mode_read (int32_t sp, uint32_t wait_time, uint16_t data[], uint32_t *data_length)
 Reads the individual addresses of devices in Programming Mode (i.e. More...
 
kdriveExpress_API error_t kdrive_sp_ind_addr_prog_mode_write (int32_t sp, uint16_t new_ind_addr)
 Writes the specified individual address to a device in Programming Mode (i.e. More...
 
kdriveExpress_API error_t kdrive_sp_ind_addr_sn_read (int32_t sp, const uint8_t sn[KDRIVE_SN_LEN], uint16_t *ind_addr)
 Reads the individual address of a device that matches the specified Serial Number. More...
 
kdriveExpress_API error_t kdrive_sp_ind_addr_sn_write (int32_t sp, const uint8_t sn[KDRIVE_SN_LEN], uint16_t new_ind_addr)
 Writes the individual address of a device that matches the specified Serial Number. More...
 
kdriveExpress_API error_t kdrive_sp_network_param_write_broadcast (int32_t sp, uint16_t object_type, uint8_t prop_id, const uint8_t data[], uint32_t data_length)
 Writes a parameter with the NetworkParameterWriteBroadcast service. More...
 
kdriveExpress_API error_t kdrive_sp_network_param_write_systembroadcast (int32_t sp, uint16_t object_type, uint8_t prop_id, const uint8_t data[], uint32_t data_length)
 Writes a parameter with the NetworkParameterWriteBroadcast service. More...
 
kdriveExpress_API error_t kdrive_sp_system_network_param_write (int32_t sp, uint16_t object_type, uint16_t prop_id, const uint8_t data[], uint32_t data_length)
 Writes a system parameter with the SystemNetworkParameterWrite service. More...
 
kdriveExpress_API error_t kdrive_sp_system_network_param_read (int32_t sp, uint16_t object_type, uint16_t prop_id, const uint8_t data[], uint32_t data_length, uint32_t wait_time, system_network_param_read_t items[], uint32_t *items_length)
 Reads system parameter with the SystemNetworkParameterRead service. More...
 
kdriveExpress_API error_t kdrive_sp_domain_addr_prog_mode_read (int32_t sp, uint32_t wait_time, domain_addr_prog_mode_read_t items[], uint32_t *items_length)
 Reads the Domain Addresses of devices in Programming Mode (i.e. More...
 
kdriveExpress_API error_t kdrive_sp_domain_addr_prog_mode_write (int32_t sp, const uint8_t da[KDRIVE_DA_LEN])
 Writes the Domain Address to a device in Programming Mode (i.e. More...
 
kdriveExpress_API error_t kdrive_sp_domain_addr_sn_read (int32_t sp, const uint8_t sn[KDRIVE_SN_LEN], uint16_t *ind_addr, uint8_t da[KDRIVE_DA_LEN])
 Reads the Domain Address of a device that matches the specified Serial Number. More...
 
kdriveExpress_API error_t kdrive_sp_domain_addr_sn_write (int32_t sp, const uint8_t sn[KDRIVE_SN_LEN], const uint8_t da[KDRIVE_DA_LEN])
 Writes the Domain Address of a device This function validates that the domain address was successfully written. More...
 

Detailed Description

kdriveExpress Services API

Author
Copyright (c) 2002-2022 WEINZIERL ENGINEERING GmbH

Macro Definition Documentation

◆ KDRIVE_LOAD_STATE_ADDITIONAL_INFO_LEN

#define KDRIVE_LOAD_STATE_ADDITIONAL_INFO_LEN   (9)

The length of the additional info in a A_LoadSate_Write service.