kdriveExpress SDK 22.1.1
kdriveExpress Services API

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...
 

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

Typedef Documentation

◆ device_descriptor_type2_t

Structure holding device descriptor 2 (easy channel information)

See also
kdrive_sp_device_descriptor_type2_read

◆ domain_addr_prog_mode_read_t

Structure holding individual address, serial number, domain address for the DomainAddressProgModeRead service.

The service returns 0 or more of these tuples.

See also
kdrive_sp_domain_addr_prog_mode_read

◆ ext_property_description_t

Structure holding a extended property description.

See also
kdrive_sp_ext_prop_description_read
Todo:
Ef: my first thought was dpt_main and dpt_sub (when we sort the names "all" dpt's where sorted in order) but it's also right as it is

◆ property_description_t

Structure holding a property description.

See also
kdrive_sp_property_description_read

◆ system_network_param_read_t

Structure holding individual address and test info and test result for the SystemNetworkParameterRead service.

The service returns 0 or more of these tuples.

See also
kdrive_sp_system_network_param_read

Function Documentation

◆ kdrive_is_ind_addr_free()

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)

Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[out]is_free1 when the address is not used otherwise 0
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_are_ext_memory_services_used()

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.

Parameters
[in]spthe service port descriptor
[out]ext_usedare the extended memory services
See also
kdrive_sp_memory_block_read and kdrive_sp_memory_block_write

◆ kdrive_sp_authorize_request()

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.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]keyauthorize key
[out]levelaccess level
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_create()

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.

It creates a unique service port descriptor which will be passed to all kdrive services functions. When finished, call kdrive_sp_release. If create fails the function returns KDRIVE_INVALID_DESCRIPTOR

Parameters
[in]apthe access port descriptor
Returns
service port descriptor if successful
Examples
kdrive_express_services.c.

◆ kdrive_sp_device_descriptor_type0_read()

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.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[out]mask_versionmask version
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_device_descriptor_type2_read()

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.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[out]descstruct with the data from the device descriptor 2
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_domain_addr_prog_mode_read()

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.

with the Learn LED enabled)

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]wait_timethe time to wait in milliseconds for all responses, i.e. 500ms or so
[out]itemsthe array of (individual address, serial number, domain address) items generated by the service
[in,out]items_lengththe data array capacity (in) and actual length of the data array (out)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
Examples
kdrive_express_services.c.

◆ kdrive_sp_domain_addr_prog_mode_write()

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.

with the Learn LED enabled) This function validates that there is only one device in programming mode and verifies that the domain address was successfully written

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]dathe new domain address
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
Examples
kdrive_express_services.c.

◆ kdrive_sp_domain_addr_sn_read()

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.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]snthe serial number
[out]ind_addrthe individual address read from the device
[out]dathe domain address read from the device
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
Examples
kdrive_express_services.c.

◆ kdrive_sp_domain_addr_sn_write()

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.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]snthe serial number
[in]dathe domain address read from the device
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
Examples
kdrive_express_services.c.

◆ kdrive_sp_ext_function_property_command()

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 
)
Calls a function property of an interface object in a device via A_FunctionPropertyExt_Command service.
The output_data buffer must exist (should be pre-allocated by the user) and its size
should be equal to or greater than the output value of the function response.
The max size of the buffer must be passed in as output_data_length.
output_data_length will be updated to correspond to the length of the value response.
\note Only available in the Commercial kdriveExpress SDK
\param [in] sp the service port descriptor
\param [in] ind_addr individual address
\param [in] object_type object type
Parameters
[in]object_instanceobject instance
[in]prop_idproperty id
[in]input_datathe function specific input data
[in]input_data_lengththe length of the input_data array
[out]return_codereturn code
[out]output_datathe function specific output data
[in,out]output_data_lengththe output_data array capacity (in) and actual length of the output_data array (out)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_ext_function_property_state_read()

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 
)
Calls a function property of an interface object in a device via A_FunctionPropertyExt_StateRead service.
The output_data buffer must exist (should be pre-allocated by the user) and its size
should be equal to or greater than the output value of the function response.
The max size of the buffer must be passed in as output_data_length.
output_data_length will be updated to correspond to the length of the value response.
\note Only available in the Commercial kdriveExpress SDK
\param [in] sp the service port descriptor
\param [in] ind_addr individual address
Parameters
[in]object_typeobject type
[in]object_instanceobject instance
[in]prop_idproperty id
[in]input_datathe function specific input data
[in]input_data_lengththe length of the input_data array
[out]return_codereturn code
[out]output_datathe function specific output data
[in,out]output_data_lengththe output_data array capacity (in) and actual length of the output_data array (out)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_ext_memory_read()

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.

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. The max size of the buffer must be passed in as data_length. data_length will be updated to correspond to the length of the value read.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]memory_addrstart memory address
[in]numbernumber of octet to be read
[out]datathe memory data read from the device
[in,out]data_lengththe data array capacity (in) and actual length of the data array (out)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_ext_memory_write()

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.

Note
The optional CRC from the device is not yet checked
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]memory_addrstart memory address
[in]datathe data array
[in]data_lengththe length of the data array
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_ext_prop_description_read()

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.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]object_typeobject type
[in]object_instanceobject instance
[in]prop_idproperty id
[in]prop_indexproperty index
[out]property_descriptionproperty description (write enabled, read level, ...)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_ext_prop_value_read()

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 
)
Reads a property value from a device via A_PropertyExtValue_Read service.
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.
The max size of the buffer must be passed in as data_length.
data_length will be updated to correspond to the length of the value read.
\note Only available in the Commercial kdriveExpress SDK
\param [in] sp the service port descriptor
\param [in] ind_addr individual address
\param [in] object_type object type
Parameters
[in]object_instanceobject instance
[in]prop_idProperty ID
[in]nr_of_elemsElement Count
[in]start_indexStart Index
[out]datathe property value read from the device
[in,out]data_lengththe data array capacity (in) and actual length of the data array (out)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_ext_prop_value_write()

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 
)
Writes the value of a property to a device via A_PropertyExtValue_Write_Con service.
This service waits for the response.
\note Only available in the Commercial kdriveExpress SDK
\param [in] sp the service port descriptor
\param [in] ind_addr individual address
\param [in] object_type object type
Parameters
[in]object_instanceobject instance
[in]prop_idproperty id
[in]nr_of_elemselement count
[in]start_indexstart index
[in]datathe data array
[in]data_lengththe length of the data array
[out]return_codethe return code from the device
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_ext_prop_value_write_uncon()

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 
)
Writes the value of a property to a device via A_PropertyExtValue_Write_UnCon service.
This service do not wait for a response.
\note Only available in the Commercial kdriveExpress SDK
\param [in] sp the service port descriptor
\param [in] ind_addr individual address
\param [in] object_type object type
Parameters
[in]object_instanceobject instance
[in]prop_idproperty id
[in]nr_of_elemselement count
[in]start_indexstart index
[in]datathe data array
[in]data_lengththe length of the data array
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_function_property_command()

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.

The output_data buffer must exist (should be pre-allocated by the user) and its size should be equal to or greater than the output value of the function response. The max size of the buffer must be passed in as output_data_length. output_data_length will be updated to correspond to the length of the value response.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]object_indexobject index
[in]prop_idproperty id
[in]input_datathe function specific input data
[in]input_data_lengththe length of the input_data array
[out]return_codereturn code
[out]output_datathe function specific output data
[in,out]output_data_lengththe output_data array capacity (in) and actual length of the output_data array (out)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_function_property_state_read()

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.

The output_data buffer must exist (should be pre-allocated by the user) and its size should be equal to or greater than the output value of the function response. The max size of the buffer must be passed in as output_data_length. output_data_length will be updated to correspond to the length of the value response.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]object_indexobject index
[in]prop_idproperty id
[in]input_datathe function specific input data
[in]input_data_lengththe length of the input_data array
[out]return_codereturn code
[out]output_datathe function specific output data
[in,out]output_data_lengththe output_data array capacity (in) and actual length of the output_data array (out)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_get_max_apdu_length()

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.

Parameters
[in]spthe service port descriptor
[out]max_apdu_lengththe set device services maximum apdu length

◆ kdrive_sp_get_response_timeout()

kdriveExpress_API error_t kdrive_sp_get_response_timeout ( int32_t  sp,
uint32_t timeout 
)

Gets the response timeout.

Parameters
[in]spthe service port descriptor
[out]timeoutresponse timeout in ms. 0 means use service specific default timeout

◆ kdrive_sp_ind_addr_prog_mode_read()

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.

with the Learn LED enabled) The data buffer must exist (should be pre-allocated by the user) and its size should be equal to or greater than the number of individual addresses to be read. The max number of elements in data (its capacity) must be passed in as data_length. data_length will be updated to correspond to the actual number of elements written.

Parameters
[in]spthe service port descriptor
[in]wait_timethe time to wait in milliseconds for all responses, i.e. 500ms or so
[out]datathe array of individual addresses generated by the service
[in,out]data_lengththe data array capacity (in) and actual length of the data array (out)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
Examples
kdrive_express_services.c.

◆ kdrive_sp_ind_addr_prog_mode_write()

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.

with the Learn LED enabled) This function validates that there is only one device in programming mode and verifies that the individual address was successfully written

Note
This function do not check if the individual address is free. For this use kdrive_is_ind_addr_free.
Parameters
[in]spthe service port descriptor
[in]new_ind_addrthe individual address that is written to the device
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
Examples
kdrive_express_services.c.

◆ kdrive_sp_ind_addr_sn_read()

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.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]snthe KNX Serial Number of the device to be addressed
[out]ind_addrthe individual address (if found) of the corresponding device
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
Examples
kdrive_express_services.c.

◆ kdrive_sp_ind_addr_sn_write()

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.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]snthe KNX Serial Number of the device to be addressed
[in]new_ind_addrthe individual address that is written to the device
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
Examples
kdrive_express_services.c.

◆ kdrive_sp_is_co()

kdriveExpress_API bool_t kdrive_sp_is_co ( int32_t  sp)

Returns whether the device services are run as connection-oriented or connection-less.

If there is an error, i.e. the service port sp doesn't exist the function will return 0.

Parameters
[in]spthe service port descriptor

◆ kdrive_sp_key_write()

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.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in,out]levelrequested access level (in) and responsed access level (out)
[in]keyauthorize key
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_load_state_read()

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).

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]object_indexobject index
[out]load_stateload state
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_load_state_write()

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).

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]object_indexobject index
[in]load_eventload event
[out]load_stateload state
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_load_state_write_ex()

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).

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]object_indexobject index
[in]load_eventload event
[in]additional_infoadditional load information
[out]load_stateload state
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_memory_block_read()

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.

The data buffer must exist (should be pre-allocated by the user) and its size should be equal to or greater than the memory block to be read. The max size of the buffer must be passed in as data_length. data_length will be updated to correspond to the length of the memory read.

The service supports the reading of blocks where the exact start and end address in unknown.
For example, we want to read from 0x4000 and read 512 bytes.
The following cases are possible:

  • The entire memory range is valid.
    Return memory_addr of 0x4000, data_length of 512, and memory buffer.
  • The start address and less than 512 bytes are valid (for example, 32 bytes).
    Return memory_addr of 0x4000 and data_length of 32 bytes, with the corresponding buffer.
    Note: There could be additional valid memory blocks in the range 0x4020 to 0x4200 and these can be "discovered" with subsequent reads, see next case.
  • The start address is not valid.
    Return the first valid memory block in the range.
  • There are no valid memory blocks in the range.
    Return data_length of 0 and an empty buffer. The return address in this case is undefined.
See also
kdrive_sp_set_ext_memory_services_used ext_used: Use extended memory services 0 (default): It used for addresses 0 - 0xFFFF normal memory service (A_Memory_Read) and for address > 0xFFFF user memory service (A_UserMemory_Read) 1: It used for all memory addresses the extended memory services (A_ExtendedMemory_Read, ...)
Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in,out]memory_addrstart memory address (in), start address of the first valid data (out)
[in]numbernumber of octet to be read
[out]datathe memory data read from the device
[in,out]data_lengththe data array capacity (in) and actual length of the data array (out)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_memory_block_write()

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.

See also
kdrive_sp_set_ext_memory_services_used ext_used: Use extended memory services 0 (default): It used for addresses 0 - 0xFFFF normal memory service (A_Memory_Write) and for address > 0xFFFF user memory service (A_UserMemory_Write) 1: It used for all memory addresses the extended memory services (A_ExtendedMemory_Write, ...)
Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]memory_addrstart memory address
[in]datathe data array
[in]data_lengththe length of the data array
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_memory_read()

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.

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. The max size of the buffer must be passed in as data_length. data_length will be updated to correspond to the length of the value read.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]memory_addrstart memory address
[in]numbernumber of octet to be read
[out]datathe memory data read from the device
[in,out]data_lengththe data array capacity (in) and actual length of the data array (out)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
Examples
kdrive_express_services.c.

◆ kdrive_sp_memory_write()

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.

The field data from the A_Memory_Response will verify with the field data from the A_Memory_Write.

See also
kdrive_sp_memory_write
Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]memory_addrstart memory address
[in]datathe data array
[in]data_lengththe length of the data array
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
Examples
kdrive_express_services.c.

◆ kdrive_sp_memory_write_without_verify()

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.

This service do not verify the field data from the A_Memory_Response. The output_data buffer must exist (should be pre-allocated by the user) and its size should be equal to or greater than the output value of the response (normally the same size as the input_data_length). The max size of the buffer must be passed in as output_data_length. output_data_length will be updated to correspond to the length of the value response.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]memory_addrstart memory address
[in]input_datathe input data array
[in]input_data_lengththe length of the input_data array
[out]output_datathe output data (from the response)
[in,out]output_data_lengththe output_data array capacity (in) and actual length of the output_data array (out)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_network_param_write_broadcast()

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.

Sends the service as broadcast.

Note
Only available in the Commercial kdriveExpress SDK
See also
kdrive_sp_network_param_write_systembroadcast
Parameters
[in]spthe service port descriptor
[in]object_typethe object type
[in]prop_idthe property id
[in]datathe data to write
[in]data_lengththe length of the data to write
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_network_param_write_systembroadcast()

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.

Sends the service as system broadcast.

Note
Only available in the Commercial kdriveExpress SDK
See also
kdrive_sp_network_param_write_broadcast
Parameters
[in]spthe service port descriptor
[in]object_typethe object type
[in]prop_idthe property id
[in]dataThe data to write
[in]data_lengththe length of the data to write
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_prop_value_read()

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.

The max size of the buffer must be passed in as data_length. data_length will be updated to correspond to the length of the value read.

Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]object_indexObject Index
[in]prop_idProperty ID
[in]nr_of_elemsElement Count
[in]start_indexStart Index
[out]datathe property value read from the device
[in,out]data_lengththe data array capacity (in) and actual length of the data array (out)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
Examples
kdrive_express_services.c.

◆ kdrive_sp_prop_value_write()

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.

Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]object_indexobject index
[in]prop_idproperty id
[in]nr_of_elemselement count
[in]start_indexstart index
[in]datathe data array
[in]data_lengththe length of the data array
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
Examples
kdrive_express_services.c.

◆ kdrive_sp_prop_value_write_without_verify()

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.

This function do not verify the field data from the A_PropertyValue_Response. The output_data buffer must exist (should be pre-allocated by the user) and its size should be equal to or greater than the output value of the response (normally the same size as the input_data_length). The max size of the buffer must be passed in as output_data_length. output_data_length will be updated to correspond to the length of the value response.

Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]object_indexobject index
[in]prop_idproperty id
[in]nr_of_elemselement count
[in]start_indexstart index
[in]input_datathe input data array
[in]input_data_lengththe length of the input_data array
[out]output_datathe output data (from the response)
[in,out]output_data_lengththe output_data array capacity (in) and actual length of the output_data array (out)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_property_description_read()

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.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]object_indexobject index
[in]prop_idproperty iD
[in]prop_indexproperty index
[out]property_descriptionproperty description (write enabled, read level, ...)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_read_prog_mode()

kdriveExpress_API error_t kdrive_sp_read_prog_mode ( int32_t  sp,
uint16_t  ind_addr,
bool_t enabled 
)

Reads the current programming mode.

Reads the mask version first an determines the realization type from it

Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[out]enabledIs the programming mode enabled
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
See also
kdrive_sp_read_prog_mode_property_based and kdrive_sp_read_prog_mode_memory_mapped
Examples
kdrive_express_services.c.

◆ kdrive_sp_read_prog_mode_mask_based()

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.

Use the given mask version to determine which realization type is suitable. Mask version can be manually set or read via kdrive_sp_device_descriptor_type0_read (commercial only)

Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]mask_versionthe mask version
[out]enabledIs the programming mode enabled
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
See also
kdrive_sp_device_descriptor_type0_read

◆ kdrive_sp_read_prog_mode_memory_mapped()

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.

Memory Address 0x0060

Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[out]enabledIs the programming mode enabled
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
See also
kdrive_sp_read_prog_mode

◆ kdrive_sp_read_prog_mode_property_based()

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.

PID_PROG_MODE

Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[out]enabledIs the programming mode enabled
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
See also
kdrive_sp_read_prog_mode

◆ kdrive_sp_release()

kdriveExpress_API bool_t kdrive_sp_release ( int32_t  sp)

Releases the ServicePort interface.

This should be the last function called when working with the services library. Returns true if successfully released false otherwise (i.e. the descriptor wasn't found).

Parameters
[in]spthe service port descriptor
Examples
kdrive_express_services.c.

◆ kdrive_sp_restart_device_type0()

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.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_restart_device_type1()

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)

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]erase_codeerase code
[in]channel_numberchannel number
[out]error_codeerror code
[out]process_timeprocess time
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_set_co()

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.

The default is connection-less.

Parameters
[in]spthe service port descriptor
[in]connection_oriented1: connection-oriented 0: connection-less
Examples
kdrive_express_services.c.

◆ kdrive_sp_set_ext_memory_services_used()

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.

The default is 0 (false) = use standard memory services.

Parameters
[in]spthe service port descriptor
[in]ext_used1 : extended services 0: standard services
See also
kdrive_sp_memory_block_read and kdrive_sp_memory_block_write

◆ kdrive_sp_set_max_apdu_length()

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.

The default is 15 (standard frame).

Note
For normal usage this define haven't be edit.
Parameters
[in]spthe service port descriptor
[in]max_apdu_lengththe maximum apdu length which supports the interface and device

◆ kdrive_sp_set_response_timeout()

kdriveExpress_API error_t kdrive_sp_set_response_timeout ( int32_t  sp,
uint32_t  timeout 
)

Sets the response timeout.

If the parameter timeout is 0 than use the service specific default timeout.

Note
For normal usage this timeout haven't be edit.
Parameters
[in]spthe service port descriptor
[in]timeoutresponse timeout in ms. 0 means use service specific default timeout

◆ kdrive_sp_switch_prog_mode()

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).

Reads the mask version first an determines the realization type from it

Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]enableenable programming mode
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
See also
kdrive_sp_switch_prog_mode_property_based and kdrive_sp_switch_prog_mode_memory_mapped
Examples
kdrive_express_services.c.

◆ kdrive_sp_switch_prog_mode_mask_based()

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).

Use the given mask version to determine which realization type is suitable. Mask version can be manually set or read via kdrive_sp_device_descriptor_type0_read (commercial only)

Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]mask_versionthe mask version
[in]enableenable programming mode
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
See also
kdrive_sp_device_descriptor_type0_read

◆ kdrive_sp_switch_prog_mode_memory_mapped()

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).

Reads the current value via service MemoryRead and writes the new value via MemoryWrite. Memory Address 0x0060

Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]enableenable programming mode
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
See also
kdrive_sp_switch_prog_mode

◆ kdrive_sp_switch_prog_mode_property_based()

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).

Reads the current value via service PropertyValueRead and writes the new value via PropertyValueWrite. PID_PROG_MODE

Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]enableenable programming mode
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised
See also
kdrive_sp_switch_prog_mode

◆ kdrive_sp_system_network_param_read()

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.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]object_typethe object type
[in]prop_idthe property id
[in]dataThe test info to send
[in]data_lengththe length of the test info to send
[in]wait_timethe time to wait in milliseconds for all responses, i.e. 2500ms or so
[out]itemsthe array of (individual address, test info and result) items generated by the service
[in,out]items_lengththe data array capacity (in) and actual length of the data array (out)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_system_network_param_write()

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.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]object_typethe object type
[in]prop_idthe property id
[in]dataThe data to write
[in]data_lengththe length of the data to write
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_user_memory_read()

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.

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. The max size of the buffer must be passed in as data_length. data_length will be updated to correspond to the length of the value read.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]memory_addrstart memory address
[in]numbernumber of octet to be read
[out]datathe memory data read from the device
[out]data_lengththe data array capacity (in) and actual length of the data array (out)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_user_memory_write()

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.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]memory_addrstart memory address
[in]datathe data array
[in]data_lengththe length of the data array
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ kdrive_sp_user_memory_write_without_verify()

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.

This service do not verify the field data from the A_UserMemory_Response. The output_data buffer must exist (should be pre-allocated by the user) and its size should be equal to or greater than the output value of the response (normally the same size as the input_data_length). The max size of the buffer must be passed in as output_data_length. output_data_length will be updated to correspond to the length of the value response.

Note
Only available in the Commercial kdriveExpress SDK
Parameters
[in]spthe service port descriptor
[in]ind_addrindividual address
[in]memory_addrstart memory address
[in]input_datathe input data array
[in]input_data_lengththe length of the input_data array
[out]output_datathe output data (from the response)
[in,out]output_data_lengththe output_data array capacity (in) and actual length of the output_data array (out)
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised