set_owner_details returns an error code not 0 or 1

This commit is contained in:
joran2738
2023-11-25 15:16:09 +01:00
parent 9bec13a217
commit a73080b1fc
2 changed files with 8 additions and 8 deletions

View File

@@ -59,7 +59,7 @@ void main(void){
LOG_WARN(TAG,"error initializing udp connection, trying again in 500ms"); LOG_WARN(TAG,"error initializing udp connection, trying again in 500ms");
HAL_Delay(500); HAL_Delay(500);
if(udp_broadcast_connection_init() != ERR_OK){ if(udp_broadcast_connection_init() != ERR_OK){
LOG_WARN(TAG,"error initializing udp connection, check warnings from udp_broadcast_init() or udp_broadcast_connection_init()"); LOG_WARN(TAG,"error initializing udp connection, check warnings from udp_broadcast_init() or udp_broadcast_connection_init()");
} }
connected: connected:
@@ -82,9 +82,9 @@ THe 'udp_broadcast_set_owner_details(const char* , const char*)' function does 2
void main(void){ void main(void){
... ...
if (!udp_broadcast_set_owner_details("Joran", "Van Nieuwenhoven")){ if (udp_broadcast_set_owner_details("Joran", "Van Nieuwenhoven") != ERR_OK){
... ...
} }
... ...
} }
``` ```
@@ -106,11 +106,11 @@ void main(void){
char surname[20]; char surname[20];
char reply[120]; char reply[120];
strncp(name,udp_broadcast_get_owner_details_name(),sizeof(name)); strncp(name, udp_broadcast_get_owner_details_name(), sizeof(name) - 1);
strncp(surname,udp_broadcast_get_owner_details_surname(),sizeof(surname)); strncp(surname, udp_broadcast_get_owner_details_surname(), sizeof(surname) - 1);
strncp(reply,udp_broadcast_get_owner_details_reply(),sizeof(reply)); strncp(reply, udp_broadcast_get_owner_details_reply(), sizeof(reply) - 1);
... ...
} }
``` ```

View File

@@ -146,7 +146,7 @@ int main(void)
} }
connected: connected:
if (udp_broadcast_set_owner_details("Joran", "Van Nieuwenhoven")){ if (udp_broadcast_set_owner_details("Joran", "Van Nieuwenhoven") != ERR_OK){
LOG_WARN(TAG,"error setting owner's details"); LOG_WARN(TAG,"error setting owner's details");
} }