BaosModuleConfig SDK 2.2.0
Loading...
Searching...
No Matches
BaosModuleConfig API

Data Structures

struct  mc_t
 Structure holding the baos module configuration. More...
 

Typedefs

typedef struct mc_t mc_t
 Structure holding the baos module configuration.
 

Functions

moduleConfig_API error_t mc_set_sp (int32_t sp)
 Sets the service port for the ModuleConfiguration.
 
moduleConfig_API error_t mc_remove_sp ()
 Remove the used service port from the ModuleConfiguration.
 
moduleConfig_API error_t mc_set_ind_addr (uint16_t ind_addr)
 Sets the individual address of the baos module to configure.
 
moduleConfig_API error_t mc_get_ind_addr (uint16_t *ind_addr)
 Gets the individual address of the baos module to configure.
 
moduleConfig_API error_t mc_set_auth_key (const uint32_t authorize_key)
 Sets the used authorize key of the baos module to configure.
 
moduleConfig_API error_t mc_clear_auth_key ()
 Clears the authorize key to be used when writing properties to the baos module to configure.
 
moduleConfig_API error_t mc_write_auth_key (const uint32_t authorize_key)
 Writes a new authorize key to the baos module to configure.
 
moduleConfig_API error_t mc_read_manufacturer_id (uint8_t manufacturer_id[2])
 Reads the manufacturer id from a baos module.
 
moduleConfig_API error_t mc_write_manufacturer_id (uint8_t manufacturer_id[2])
 Writes the manufacturer id to the baos module to configure.
 
moduleConfig_API error_t mc_read_manufacturer_data (uint8_t manufacturer_data[4])
 Reads the manufacturer data from a baos module.
 
moduleConfig_API error_t mc_write_manufacturer_data (uint8_t manufacturer_data[4])
 Writes the manufacturer data to the baos module to configure.
 
moduleConfig_API error_t mc_read_order_info (uint8_t order_info[10])
 Reads the order info from a baos module.
 
moduleConfig_API error_t mc_write_order_info (uint8_t order_info[10])
 Writes the order info to the baos module to configure.
 
moduleConfig_API error_t mc_read_hardware_type (uint8_t hardware_type[6])
 Reads the hardware type from a baos module.
 
moduleConfig_API error_t mc_write_hardware_type (uint8_t hardware_type[6])
 Writes the hardware type to the baos module to configure.
 
moduleConfig_API error_t mc_read_serial_number (uint8_t serial_number[6])
 Reads the serial number from a baos module.
 
moduleConfig_API error_t mc_write_serial_number (uint8_t serial_number[6])
 Writes the serial number to the baos module to configure.
 
moduleConfig_API error_t mc_write_fdsk (uint8_t fdsk[MC_FDSK_LEN])
 Writes the FDSK (Factory Default Setup Key) to the baos module to configure.
 
moduleConfig_API error_t mc_read_fdsk_lock (bool_t *status)
 Reads the FDSK lock status.
 
moduleConfig_API error_t mc_lock_fdsk (const uint8_t fdsk[MC_FDSK_LEN])
 After call this command (with the current valid FDSK) the FDSK could no more changed.
 
moduleConfig_API error_t mc_read_config (mc_t *module_config)
 Reads the whole configuration (manufacturer id, manufacturer data, order info, hardware type, serial number, BUT NOT writeonly fdsk!) from a baos module.
 
moduleConfig_API error_t mc_write_config (mc_t module_config, uint32_t *authorize_key)
 Writes the whole basic configuration (manufacturer id, manufacturer data, order info, hardware type, serial number, fdsk) and the new authorize key to the baos module to configure.
 
moduleConfig_API error_t mc_build_knx_qr_string_human (const uint8_t serial_number[6], const uint8_t fdsk[MC_FDSK_LEN], char qr[41+1])
 Builds the humand readable QR string of the KNX device certificate Returns 41 character string (crc4 appended, base32 encoded and separated in 6 blocks a 6 character by '-' delimiter).
 
moduleConfig_API error_t mc_extract_knx_qr_string_human (const char *qr, uint8_t serial_number[6], uint8_t fdsk[MC_FDSK_LEN])
 Extracts the KNX serial number and FDSK from the humand readable QR string of the KNX device certificate.
 
moduleConfig_API error_t mc_encode_svg_string (const char *qr, char *svg_string, uint32_t *length)
 Takes a humand readable QR string (41 character e.g.
 
moduleConfig_API error_t mc_encode_ascii_string (const char *qr, char *ascii_string, uint32_t *length)
 Takes a humand readable QR string (41 character e.g.
 

Detailed Description

Typedef Documentation

◆ mc_t

typedef struct mc_t mc_t

Structure holding the baos module configuration.

The manufacturer id must be a 2 bytes array The manufacturer data must be a 4 bytes array The order_info must be a 10 bytes array The hardware_type must be a 6 bytes array The serial_number must be a 6 bytes array The fdsk must be a 16 bytes array (only for devices with security support)

Function Documentation

◆ mc_build_knx_qr_string_human()

moduleConfig_API error_t mc_build_knx_qr_string_human ( const uint8_t  serial_number[6],
const uint8_t  fdsk[MC_FDSK_LEN],
char  qr[41+1] 
)

Builds the humand readable QR string of the KNX device certificate Returns 41 character string (crc4 appended, base32 encoded and separated in 6 blocks a 6 character by '-' delimiter).

e.g. AABB2X-AEXA6W-IDZCID-T2FDBV-BNJNXE-7RO3RX

Parameters
[in]serial_numberthe serial number array (6 bytes)
[in]fdskthe FDSK (factory default setup key) (16 bytes)
[out]qrthe humand readable QR string of the KNX device certificate (as null terminated string)
Returns
KDRIVE_ERROR_NONE if successful or the error code if an error was raised

◆ mc_clear_auth_key()

moduleConfig_API error_t mc_clear_auth_key ( )

Clears the authorize key to be used when writing properties to the baos module to configure.

Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_encode_ascii_string()

moduleConfig_API error_t mc_encode_ascii_string ( const char *  qr,
char *  ascii_string,
uint32_t *  length 
)

Takes a humand readable QR string (41 character e.g.

AABB2X-AEXA6W-IDZCID-T2FDBV-BNJNXE-7RO3RX) and encodes it into a Version 2 QR-Code with ECC-M (25x25 modules) returns the QR code as ascii string where the black parts are represented with fill character.

Parameters
[in]qrthe humand readable QR string of the KNX device certificate (as null terminated string)
[out]ascii_stringthe QR code as svg string
[in,out]lengththe length of the ascii_string data buffer (in bytes) (in) and the length of the ascii_string data buffer (in bytes) (out)
Returns
KDRIVE_ERROR_NONE if successful or the error code if an error was raised

◆ mc_encode_svg_string()

moduleConfig_API error_t mc_encode_svg_string ( const char *  qr,
char *  svg_string,
uint32_t *  length 
)

Takes a humand readable QR string (41 character e.g.

AABB2X-AEXA6W-IDZCID-T2FDBV-BNJNXE-7RO3RX) and encodes it into a Version 2 QR-Code with ECC-M (25x25 modules) returns the QR code as svg string

Parameters
[in]qrthe humand readable QR string of the KNX device certificate (as null terminated string)
[out]svg_stringthe QR code as svg string
[in,out]lengththe length of the svg_string data buffer (in bytes) (in) and the length of the svg_string data buffer (in bytes) (out)
Returns
KDRIVE_ERROR_NONE if successful or the error code if an error was raised

◆ mc_extract_knx_qr_string_human()

moduleConfig_API error_t mc_extract_knx_qr_string_human ( const char *  qr,
uint8_t  serial_number[6],
uint8_t  fdsk[MC_FDSK_LEN] 
)

Extracts the KNX serial number and FDSK from the humand readable QR string of the KNX device certificate.

The QR string is a 41 character string (crc4 appended, base32 encoded and separated in 6 blocks a 6 character by '-' delimiter). e.g. AABB2X-AEXA6W-IDZCID-T2FDBV-BNJNXE-7RO3RX

Parameters
[in]qrthe humand readable QR string of the KNX device certificate (as null terminated string)
[out]serial_numberthe serial number array (6 bytes)
[out]fdskthe FDSK (factory default setup key) (16 bytes)
Returns
KDRIVE_ERROR_NONE if successful or the error code if an error was raised

◆ mc_get_ind_addr()

moduleConfig_API error_t mc_get_ind_addr ( uint16_t *  ind_addr)

Gets the individual address of the baos module to configure.

Parameters
[out]ind_addrthe individual address of the module
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_lock_fdsk()

moduleConfig_API error_t mc_lock_fdsk ( const uint8_t  fdsk[MC_FDSK_LEN])

After call this command (with the current valid FDSK) the FDSK could no more changed.

The value buffer must exist (should be pre-allocated by the user) and it's size should be equal to or greater than the property value (16 bytes) to be written. NOTE: Be careful! This command cannot be undone!

Parameters
[in]fdskthe current valid FDSK
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_read_config()

moduleConfig_API error_t mc_read_config ( mc_t module_config)

Reads the whole configuration (manufacturer id, manufacturer data, order info, hardware type, serial number, BUT NOT writeonly fdsk!) from a baos module.

Use a module config struct with a buffer for every part. When exist, the value buffers size should be equal to or greater than the property value of the part. If not exist, the value read will be skipped.

Parameters
[in]module_configthe module configuration struct read from baos module
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_read_fdsk_lock()

moduleConfig_API error_t mc_read_fdsk_lock ( bool_t *  status)

Reads the FDSK lock status.

Status: 0x00 Write is possible 0x01 FDSK write is nor more possible

Parameters
[out]statusthe FDSK lock status
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_read_hardware_type()

moduleConfig_API error_t mc_read_hardware_type ( uint8_t  hardware_type[6])

Reads the hardware type from a baos module.

The value buffer must exist (should be pre-allocated by the user) and it's size should be equal to or greater than the property value (6 bytes) to be read.

Parameters
[out]hardware_typethe hardware type read from baos module
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_read_manufacturer_data()

moduleConfig_API error_t mc_read_manufacturer_data ( uint8_t  manufacturer_data[4])

Reads the manufacturer data from a baos module.

The value buffer must exist (should be pre-allocated by the user) and it's size should be equal to or greater than the property value (4 bytes) to be read.

Parameters
[out]manufacturer_datathe manufacturer data read from baos module
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_read_manufacturer_id()

moduleConfig_API error_t mc_read_manufacturer_id ( uint8_t  manufacturer_id[2])

Reads the manufacturer id from a baos module.

The value buffer must exist (should be pre-allocated by the user) and it's size should be equal to or greater than the property value (2 bytes) to be read. The max size of the buffer must be passed in as value length. value_length will be updated to correspond to the length of the value read.

Parameters
[out]manufacturer_idthe manufacturer id read from baos module
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_read_order_info()

moduleConfig_API error_t mc_read_order_info ( uint8_t  order_info[10])

Reads the order info from a baos module.

The value buffer must exist (should be pre-allocated by the user) and it's size should be equal to or greater than the property value (10 bytes) to be read.

Parameters
[out]order_infothe order info read from baos module
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_read_serial_number()

moduleConfig_API error_t mc_read_serial_number ( uint8_t  serial_number[6])

Reads the serial number from a baos module.

The value buffer must exist (should be pre-allocated by the user) and it's size should be equal to or greater than the property value (6 bytes) to be read.

Parameters
[out]serial_numberthe serial number read from baos module
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_remove_sp()

moduleConfig_API error_t mc_remove_sp ( )

Remove the used service port from the ModuleConfiguration.

This should be the last function called when working with the module configuration library.

Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_set_auth_key()

moduleConfig_API error_t mc_set_auth_key ( const uint32_t  authorize_key)

Sets the used authorize key of the baos module to configure.

Parameters
[in]authorize_keythe authorize key to use
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_set_ind_addr()

moduleConfig_API error_t mc_set_ind_addr ( uint16_t  ind_addr)

Sets the individual address of the baos module to configure.

Parameters
[in]ind_addrthe individual address of the module
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_set_sp()

moduleConfig_API error_t mc_set_sp ( int32_t  sp)

Sets the service port for the ModuleConfiguration.

This should be the first function called when working with the module configuration library. When finished, call mc_remove_sp.

Parameters
[in]spthe service port descriptor
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_write_auth_key()

moduleConfig_API error_t mc_write_auth_key ( const uint32_t  authorize_key)

Writes a new authorize key to the baos module to configure.

Parameters
[in]authorize_keythe authorize key to write
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_write_config()

moduleConfig_API error_t mc_write_config ( mc_t  module_config,
uint32_t *  authorize_key 
)

Writes the whole basic configuration (manufacturer id, manufacturer data, order info, hardware type, serial number, fdsk) and the new authorize key to the baos module to configure.

Use a module config struct with a buffer for every item. When exist, the value buffers size should be equal to the property value of the part. If item pointer equals NULL, the value write will be skipped.

Parameters
[in]module_configthe module configuration struct write to the baos module
[in]authorize_keythe new authorize key write to the baos module
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_write_fdsk()

moduleConfig_API error_t mc_write_fdsk ( uint8_t  fdsk[MC_FDSK_LEN])

Writes the FDSK (Factory Default Setup Key) to the baos module to configure.

The value buffer must exist (should be pre-allocated by the user) and it's size should be equal to or greater than the property value (16 bytes) to be written.

Parameters
[in]fdskthe new FDSK to write
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_write_hardware_type()

moduleConfig_API error_t mc_write_hardware_type ( uint8_t  hardware_type[6])

Writes the hardware type to the baos module to configure.

The value buffer must exist (should be pre-allocated by the user) and it's size should be equal to or greater than the3 property value (6 bytes) to be written.

Parameters
[in]hardware_typethe hardware type array to write
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_write_manufacturer_data()

moduleConfig_API error_t mc_write_manufacturer_data ( uint8_t  manufacturer_data[4])

Writes the manufacturer data to the baos module to configure.

The value buffer must exist (should be pre-allocated by the user) and it's size should be equal to or greater than the property value (4 bytes) to be written.

Parameters
[in]manufacturer_datathe manufacturer data array to write
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_write_manufacturer_id()

moduleConfig_API error_t mc_write_manufacturer_id ( uint8_t  manufacturer_id[2])

Writes the manufacturer id to the baos module to configure.

The value buffer must exist (should be pre-allocated by the user) and it's size should be equal to or greater than the property value (2 bytes) to be written.

Parameters
[in]manufacturer_idthe manufacturer id array to write
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_write_order_info()

moduleConfig_API error_t mc_write_order_info ( uint8_t  order_info[10])

Writes the order info to the baos module to configure.

The value buffer must exist (should be pre-allocated by the user) and it's size should be equal to or greater than the property value (10 bytes) to be written.

Parameters
[in]order_infothe order info array to write
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised

◆ mc_write_serial_number()

moduleConfig_API error_t mc_write_serial_number ( uint8_t  serial_number[6])

Writes the serial number to the baos module to configure.

The value buffer must exist (should be pre-allocated by the user) and it's size should be equal to or greater than the property value (6 bytes) to be written.

Parameters
[in]serial_numberthe serial number array to write
Returns
KDRIVE_ERROR_NONE if the service was successful or the error code if an error was raised