solving reviews pt2

This commit is contained in:
joran2738
2023-11-22 22:21:07 +01:00
parent 30a93425c9
commit 0ff34a233e
3 changed files with 42 additions and 30 deletions

View File

@@ -19,7 +19,7 @@
#include "lcd_api.h"
// Defines used by owner details error handler
// Defines used by owner details
#define SOD_NAME "set_owner_details_name"
#define GOD_NAME "get_owner_details_name"
#define SOD_SURNAME "set_owner_details_surname"
@@ -40,6 +40,8 @@
#define MAX_NAME_SIZE 20
#define MAX_REPLY_SIZE 120
#define MAX_MAX_ADDR_LEN 18
#define MAX_EXTRA_REPLY_CHARS 27
/**
@@ -58,21 +60,21 @@ typedef struct {
// The following functions are used for owner details (those that must be available in main)
/**
* @fn uint8_t udp_broadcast_set_owner_details(owner_details_t*, const char*, const char*)
* @brief set_owner_details() is the interface that can be used in other files
* @fn err_t udp_broadcast_set_owner_details(const char*, const char*)
* @brief udp_broadcast_set_owner_details() is the interface that can be used in other files
* to set the owner's details
*
* @param[in] name string containing the new owner's name
* @param[in] surname string containing the new owner's surname
* @return setting owner details error
* - 1: no error occured, details were set
* - 0: an error occured, all or some details weren't set
* @return lwIP error code.
* - ERR_OK. Successful. No error occurred.
* - ERR_ARG. one or both arguments are NULL pointers
*/
uint8_t udp_broadcast_set_owner_details(const char*, const char*);
err_t udp_broadcast_set_owner_details(const char*, const char*);
/**
* @fn char udp_broadcast_get_owner_details_name*(void)
* @brief get_owner_details_name() can be used to get the current owner's name
* @brief udp_broadcast_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()
@@ -81,7 +83,7 @@ char* udp_broadcast_get_owner_details_name(void);
/**
* @fn char udp_broadcast_get_owner_details_surname*(void)
* @brief get_owner_details_surname() can be used to get the current owner's surname
* @brief udp_broadcast_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()
@@ -90,13 +92,15 @@ char* udp_broadcast_get_owner_details_surname(void);
/**
* @fn char udp_broadcast_get_owner_details_reply*(void)
* @brief get_owner_details_reply() can be used to get the current UDP reply
* @brief udp_broadcast_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(void);
// Initialization functions
/**
* @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()
@@ -106,12 +110,13 @@ char* udp_broadcast_get_owner_details_reply(void);
* @return lwIP error code.
* - ERR_OK. Successful. No error occurred.
* - ERR_USE. The specified ipaddr and port are already bound to by another UDP PCB.
* - ERR_MEM. udp pcb couldn't be created
*
* - ERR_ARG. one or both arguments of udp_broadcast_set_owner_details() are NULL pointers
*/
err_t udp_broadcast_init(uint16_t x_pos, uint16_t y_pos);
// The following functions are used for UDP (those that must be available in main)
/**
* @fn err_t udp_broadcast_connection_init()
* @brief udp_broadcast_connection_init() initializes the UDP connection so that it listens for all traffic on
@@ -121,6 +126,7 @@ err_t udp_broadcast_init(uint16_t x_pos, uint16_t y_pos);
* @return lwIP error code.
* - ERR_OK. Successful. No error occurred.
* - ERR_USE. The specified ipaddr and port are already bound to by another UDP PCB.
* - ERR_MEM. udp pcb couldn't be created
*/
err_t udp_broadcast_connection_init(void);