2024-05-29 09:08 AM
For your information
Sizeof is used in place of strlen and my coordinator receive a \0x00 at the end of the string !!
when i generate code with MX generation tools, in function : in red old code in green new code
void APP_ZIGBEE_ConfigBasicServer(void)
{
static struct ZbZclBasicServerDefaults stBasicServerDefaults;
/* Initialize Basic Server Cluster 'defaults' information */
memset( &stBasicServerDefaults, 0x00, sizeof(stBasicServerDefaults) );
stBasicServerDefaults.mfr_name[0] = sizeof strlen( APP_ZIGBEE_MFR_NAME );
memcpy( &stBasicServerDefaults.mfr_name[1], APP_ZIGBEE_MFR_NAME, sizeof( APP_ZIGBEE_MFR_NAME ) );
stBasicServerDefaults.model_name[0] = sizeof strlen( APP_ZIGBEE_CHIP_NAME );
memcpy( &stBasicServerDefaults.model_name[1], APP_ZIGBEE_CHIP_NAME, sizeof( APP_ZIGBEE_CHIP_NAME ) );
stBasicServerDefaults.date_code[0] = sizeof strlen( APP_ZIGBEE_APP_DATE_CODE );
memcpy( &stBasicServerDefaults.date_code[1], APP_ZIGBEE_APP_DATE_CODE, sizeof( APP_ZIGBEE_APP_DATE_CODE ) );
stBasicServerDefaults.sw_build_id[0] = sizeof strlen( APP_ZIGBEE_APP_BUILD_ID );
memcpy( &stBasicServerDefaults.sw_build_id[1], APP_ZIGBEE_APP_BUILD_ID, sizeof( APP_ZIGBEE_APP_BUILD_ID ) );
2024-05-29 09:57 AM
Hello @Romaszewski
Can you share your .ioc file so we can reproduce this behavior.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-05-29 10:09 AM
2024-05-29 11:02 AM
I'm not able to reproduce that issue. Could you give more details and the steps to reproduce this issue.
Merci Beaucoup d'avance.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-05-30 02:38 AM
I explain better
when i generate the project with .ioc file.
in app-zigbee.c i have :
but sizeof is not good because it is the size of string with \0 terminator, in mfr_name[0] i must have 18 and not 19 for "stmicroelectronics" the good function is strlen.
After my correction next, my coordinator (zigbee2mqtt) run :
thank for correcting
2024-06-06 02:24 AM
Do you have a procedure to inform the team of development of MX tools for this error ?
2024-06-12 07:56 AM
Hello @Romaszewski
I've raised this internally for more investigation (under internal ticket number 184049).
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.