there can only be one

there's only one owner struct needed, thus adding a static one in the c file is better than having the main file to initialize one and pass it on again and again,.
some code wasn't needed anymore and some had to change
This commit is contained in:
joran2738
2023-11-13 21:14:40 +01:00
parent 4a4a35848d
commit 6739c7c6bf
3 changed files with 79 additions and 95 deletions

View File

@@ -128,13 +128,13 @@ int main(void)
llfs_init();
// Initialize the UDP broadcast service
owner_details_t owner;
udp_broadcast_init();
if(!udp_broadcast_set_owner_details(&owner, "Joran", "Van Nieuwenhoven")){
if (udp_broadcast_init() != ERR_OK && udp_broadcast_connection_init() != ERR_OK){
LOG_WARN(TAG,"error initializing udp connection");
}
if (!udp_broadcast_set_owner_details("Joran", "Van Nieuwenhoven")){
LOG_WARN(TAG,"error setting owner's details");
}
LOG_DEBUG(TAG,"%s",udp_broadcast_get_owner_details_reply(&owner));
LOG_DEBUG(TAG,"%s",udp_broadcast_get_owner_details_reply());
/* USER CODE END 2 */
/* Infinite loop */