diff --git a/project/Core/Inc/UDP_broadcast.h b/project/Core/Inc/UDP_broadcast.h index 7584abc..8b24ff6 100644 --- a/project/Core/Inc/UDP_broadcast.h +++ b/project/Core/Inc/UDP_broadcast.h @@ -13,7 +13,7 @@ #include #include "lwip/netif.h" #include "lwip.h" -#define LOGGER_LEVEL_ALL +#define LOGGER_LEVEL_INFO #include "log.h" typedef struct { char name[20]; diff --git a/project/Core/Src/UDP_broadcast.c b/project/Core/Src/UDP_broadcast.c index 70b29e3..18b4ec9 100644 --- a/project/Core/Src/UDP_broadcast.c +++ b/project/Core/Src/UDP_broadcast.c @@ -7,6 +7,7 @@ //| #include "UDP_broadcast.h" +static const char *TAG = "UDP_broadcast"; /** * @fn void set_owner_details_mac(owner_details_t*) @@ -36,7 +37,7 @@ static void set_owner_details_mac(owner_details_t* owner){ uint8_t set_owner_details_name(owner_details_t *owner, char *name){ if(name != NULL){ - LOG_DEBUG("set_owner_details_name","set: %s",name); + LOG_DEBUG(TAG,"set: %s",name); strncpy(owner->name,name,sizeof(owner->name)); return 1; } @@ -56,7 +57,7 @@ uint8_t set_owner_details_name(owner_details_t *owner, char *name){ */ uint8_t set_owner_details_surname(owner_details_t* owner, char* surname){ if(surname != NULL){ - LOG_DEBUG("set_owner_details_surname","set: %s",surname); + LOG_DEBUG(TAG,"set: %s",surname); strncpy(owner->surname,surname,sizeof(owner->surname)); return 1; } @@ -76,7 +77,7 @@ uint8_t set_owner_details_surname(owner_details_t* owner, char* surname){ static uint8_t set_owner_details_reply(owner_details_t *owner, char *reply){ if(reply != NULL){ - LOG_DEBUG("set_owner_details_reply","set: %s",reply); + LOG_DEBUG(TAG,"set: %s",reply); strncpy(owner->reply,reply,sizeof(owner->reply)); return 1; } @@ -178,7 +179,7 @@ char* get_owner_details_surname(owner_details_t* owner){ */ char* get_owner_details_reply(owner_details_t *owner){ - LOG_DEBUG("get_owner_details_reply","getting reply"); + LOG_DEBUG(TAG,"getting reply"); char err_reply[20] = "no reply yet"; if(owner->reply == NULL){ strncpy(owner->reply,err_reply,sizeof(owner->reply)); diff --git a/project/Core/Src/main.c b/project/Core/Src/main.c index f98c628..959aedd 100644 --- a/project/Core/Src/main.c +++ b/project/Core/Src/main.c @@ -111,16 +111,16 @@ int main(void) MX_QUADSPI_Init(); /* USER CODE BEGIN 2 */ owner_details_t owner; - LOG_DEBUG("main1","\nhelloworld"); - LOG_DEBUG("main2","%s",get_owner_details_reply(&owner)); + LOG_DEBUG(TAG,"\nhelloworld"); + LOG_DEBUG(TAG,"%s",get_owner_details_reply(&owner)); if(!set_owner_details(&owner, "joran", "vn")){ - LOG_DEBUG("main3","error");; + LOG_DEBUG(TAG,"error");; } - LOG_DEBUG("main4","%s",get_owner_details_reply(&owner)); + LOG_DEBUG(TAG,"%s",get_owner_details_reply(&owner)); if(!set_owner_details(&owner, "joran", "Van Nieuwenhoven")){ - LOG_DEBUG("main5","error"); + LOG_DEBUG(TAG,"error"); } - LOG_DEBUG("main6","%s",get_owner_details_reply(&owner)); + LOG_DEBUG(TAG,"%s",get_owner_details_reply(&owner)); /* USER CODE END 2 */ /* Infinite loop */