BaosModuleConfig SDK 2.2.1
module_config_api.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2002-2021 WEINZIERL ENGINEERING GmbH
3 // All rights reserved.
4 //
5 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
6 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
7 // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
8 // SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY,
9 // WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
10 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
11 //
12 
13 #ifndef __MODULE_CONFIG_API_H__
14 #define __MODULE_CONFIG_API_H__
15 
16 #include "module_config_config.h"
17 
42 #ifdef __cplusplus
43 extern "C"
44 {
45 #endif
46 
47 /*******************************
48 ** Defines
49 ********************************/
50 
51 #define MC_FDSK_LEN (16)
52 #define MC_AUTH_KEY_OEM_PROD_LEN (16)
55 /*******************************
56 ** Structures
57 ********************************/
58 
69 typedef struct mc_t
70 {
71  uint8_t* manufacturer_id;
72  uint8_t* manufacturer_data;
73  uint8_t* order_info;
74  uint8_t* hardware_type;
75  uint8_t* serial_number;
76  uint8_t* fdsk;
78 } mc_t;
79 
80 /*******************************
81 ** Functions
82 ********************************/
83 
93 moduleConfig_API error_t mc_set_sp(int32_t sp);
94 
104 
112 moduleConfig_API error_t mc_set_ind_addr(uint16_t ind_addr);
113 
121 moduleConfig_API error_t mc_get_ind_addr(uint16_t* ind_addr);
122 
130 moduleConfig_API error_t mc_set_auth_key(const uint32_t authorize_key);
131 
140 
148 moduleConfig_API error_t mc_write_auth_key(const uint32_t authorize_key);
149 
156 
164 moduleConfig_API error_t mc_set_auth_key_oem_prod(const uint8_t authorize_key_oem_prod[MC_AUTH_KEY_OEM_PROD_LEN]);
165 
174 
182 moduleConfig_API error_t mc_write_auth_key_oem_prod(const uint8_t authorize_key_oem_prod[MC_AUTH_KEY_OEM_PROD_LEN]);
183 
195 moduleConfig_API error_t mc_read_manufacturer_id(uint8_t manufacturer_id[2]);
196 
207 moduleConfig_API error_t mc_write_manufacturer_id(uint8_t manufacturer_id[2]);
208 
218 moduleConfig_API error_t mc_read_manufacturer_data(uint8_t manufacturer_data[4]);
219 
230 moduleConfig_API error_t mc_write_manufacturer_data(uint8_t manufacturer_data[4]);
231 
241 moduleConfig_API error_t mc_read_order_info(uint8_t order_info[10]);
242 
253 moduleConfig_API error_t mc_write_order_info(uint8_t order_info[10]);
254 
264 moduleConfig_API error_t mc_read_hardware_type(uint8_t hardware_type[6]);
265 
276 moduleConfig_API error_t mc_write_hardware_type(uint8_t hardware_type[6]);
277 
287 moduleConfig_API error_t mc_read_serial_number(uint8_t serial_number[6]);
288 
299 moduleConfig_API error_t mc_write_serial_number(uint8_t serial_number[6]);
300 
311 
321 moduleConfig_API error_t mc_read_fdsk_lock(bool_t* status);
322 
333 moduleConfig_API error_t mc_lock_fdsk(const uint8_t fdsk[MC_FDSK_LEN]);
334 
347 moduleConfig_API error_t mc_read_config(mc_t* module_config);
348 
362 moduleConfig_API error_t mc_write_config(mc_t module_config, uint32_t* authorize_key);
363 
380  uint8_t authorize_key_oem_prod[MC_AUTH_KEY_OEM_PROD_LEN]);
381 
393 moduleConfig_API error_t mc_build_knx_qr_string_human(const uint8_t serial_number[6], const uint8_t fdsk[MC_FDSK_LEN],
394  char qr[41 + 1]);
395 
407 moduleConfig_API error_t mc_extract_knx_qr_string_human(const char* qr, uint8_t serial_number[6], uint8_t fdsk[MC_FDSK_LEN]);
408 
421 moduleConfig_API error_t mc_encode_svg_string(const char* qr, char* svg_string, uint32_t* length);
422 
435 moduleConfig_API error_t mc_encode_ascii_string(const char* qr, char* ascii_string, uint32_t* length);
436 
437 
438 #ifdef __cplusplus
439 }
440 #endif
441 
442 #endif /* __MODULE_CONFIG_API_H__ */
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_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_write_config(mc_t module_config, uint32_t *authorize_key)
Writes the whole basic configuration (manufacturer id, manufacturer data, order info,...
moduleConfig_API error_t mc_write_auth_key_oem_prod(const uint8_t authorize_key_oem_prod[MC_AUTH_KEY_OEM_PROD_LEN])
Writes a new OEM production authorize key to the baos module to configure.
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_write_serial_number(uint8_t serial_number[6])
Writes the serial number 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_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_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_encode_ascii_string(const char *qr, char *ascii_string, uint32_t *length)
Takes a humand readable QR string (41 character e.g.
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_config(mc_t *module_config)
Reads the whole configuration (manufacturer id, manufacturer data, order info, hardware type,...
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_set_sp(int32_t sp)
Sets the service port for the ModuleConfiguration.
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_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 ...
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_get_ind_addr(uint16_t *ind_addr)
Gets the individual address 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.
struct mc_t mc_t
Structure holding the baos module configuration.
moduleConfig_API error_t mc_read_fdsk_lock(bool_t *status)
Reads the FDSK lock status.
moduleConfig_API error_t mc_set_auth_key_oem_prod(const uint8_t authorize_key_oem_prod[MC_AUTH_KEY_OEM_PROD_LEN])
Sets the used OEM production authorize key of the baos module to configure.
moduleConfig_API error_t mc_write_config_oem_prod(mc_t module_config, uint8_t authorize_key_oem_prod[MC_AUTH_KEY_OEM_PROD_LEN])
Writes the whole basic configuration (manufacturer id, manufacturer data, order info,...
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_set_ind_addr(uint16_t ind_addr)
Sets the individual address of the baos module to configure.
moduleConfig_API error_t mc_clear_auth_key_oem_prod()
Clears the OEM production authorize key to be used when writing properties to the baos module to conf...
moduleConfig_API error_t mc_remove_sp()
Remove the used service port from the ModuleConfiguration.
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_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 certific...
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 bool_t mc_is_oem_prod_supported()
Checks if the baos module Supports the individualization with OEM production properties.
#define MC_FDSK_LEN
The Length of a factory default setup key (FDSK)
Definition: module_config_api.h:51
#define MC_AUTH_KEY_OEM_PROD_LEN
The length of the OEM production authorize key.
Definition: module_config_api.h:52
#define moduleConfig_API
Definition: module_config_config.h:41
Structure holding the baos module configuration.
Definition: module_config_api.h:70
uint8_t * order_info
manufacturer specific order information
Definition: module_config_api.h:73
uint8_t * hardware_type
an identifier for the device hardware
Definition: module_config_api.h:74
uint8_t * fdsk
the KNX Serial Number of the device
Definition: module_config_api.h:76
uint8_t * manufacturer_id
the KNX ID of the manufacturer
Definition: module_config_api.h:71
uint8_t * serial_number
the KNX Serial Number of the device
Definition: module_config_api.h:75
uint8_t * manufacturer_data
freely usable data by the manufacturer
Definition: module_config_api.h:72