correcting reviews

sorry if i missed something, being ill and reviewing code doesn't really go well together
This commit is contained in:
joran2738
2023-11-22 15:04:55 +01:00
parent f22f376b77
commit 30a93425c9
3 changed files with 135 additions and 119 deletions

View File

@@ -15,8 +15,6 @@
#include <string.h>
#include "lwip.h"
#include "lwip/netif.h"
#define LOGGER_LEVEL_INFO
#include "log.h"
#include "udp.h"
#include "lcd_api.h"
@@ -33,8 +31,16 @@
#define F_REPLY "format_reply"
// Defines used by UDP callback
#define MAX_DATA_SIZE 63 // Define the maximum expected data size
#define UDP_QUESTION1 "Where are you?v1.0" // Expected request from UDP client
#define MAX_DATA_SIZE 63 // Define the maximum expected data size
#define UDP_QUESTION1 "Where are you?v1.0" // Expected question from UDP client
#define FUNC_LEN 7
#define MAX_COLON_COMMA_COUNT 4
// Defines used by owner details
#define MAX_NAME_SIZE 20
#define MAX_REPLY_SIZE 120
/**
* @struct owner_details_t
@@ -43,10 +49,10 @@
*/
typedef struct {
char name[20];
char surname[20];
char name[MAX_NAME_SIZE];
char surname[MAX_NAME_SIZE];
uint8_t mac_address[6];
char reply[120];
char reply[MAX_REPLY_SIZE];
} owner_details_t;
// The following functions are used for owner details (those that must be available in main)
@@ -65,34 +71,34 @@ typedef struct {
uint8_t udp_broadcast_set_owner_details(const char*, const char*);
/**
* @fn char udp_broadcast_get_owner_details_name*(owner_details_t)
* @fn char udp_broadcast_get_owner_details_name*(void)
* @brief get_owner_details_name() can be used to get the current owner's name
*
* @return name of owner
* this name is set by @see udp_broadcast_set_owner_details_name()
*/
char* udp_broadcast_get_owner_details_name();
char* udp_broadcast_get_owner_details_name(void);
/**
* @fn char udp_broadcast_get_owner_details_surname*(const owner_details_t)
* @fn char udp_broadcast_get_owner_details_surname*(void)
* @brief get_owner_details_surname() can be used to get the current owner's surname
*
* @return surname of owner
* this name is set by @see udp_broadcast_set_owner_details_surname()
*/
char* udp_broadcast_get_owner_details_surname();
char* udp_broadcast_get_owner_details_surname(void);
/**
* @fn char udp_broadcast_get_owner_details_reply*()
* @fn char udp_broadcast_get_owner_details_reply*(void)
* @brief get_owner_details_reply() can be used to get the current UDP reply
*
* @return reply for UDP broadcast
* this reply is formatted by @see format_reply()
*/
char* udp_broadcast_get_owner_details_reply();
char* udp_broadcast_get_owner_details_reply(void);
/**
* @fn err_t udp_broadcast_init()
* @fn err_t udp_broadcast_init(uint16_t x_pos, uint16_t y_pos)
* @brief udp_broadcast_init() initializes the owner's variables and calls upon @see udp_broadcast_connection_init()
*
* @param[in] x_pos : uint16_t that sets the x coordinate the owner's name will be written on the LCD
@@ -117,6 +123,6 @@ err_t udp_broadcast_init(uint16_t x_pos, uint16_t y_pos);
* - ERR_USE. The specified ipaddr and port are already bound to by another UDP PCB.
*/
err_t udp_broadcast_connection_init();
err_t udp_broadcast_connection_init(void);
#endif /* INC_UDP_BROADCAST_H_ */