solving reviews pt3

This commit is contained in:
joran2738
2023-11-24 22:38:04 +01:00
parent 4d3ae0c140
commit 82d7972728
3 changed files with 72 additions and 76 deletions

View File

@@ -19,29 +19,17 @@
#include "lcd_api.h"
// 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"
#define GOD_SURNAME "get_owner_details_surname"
#define SOD_REPLY "set_owner_details_reply"
#define GOD_REPLY "get_owner_details_reply"
#define SOD_MAC "set_owner_details_mac"
#define SOD "set_owner_details"
#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 question from UDP client
#define FUNC_LEN 7
#define MAX_COLON_COMMA_COUNT 4
#define UDP_BROADCAST_MAX_DATA_SIZE 63 // Define the maximum expected data size
#define UDP_BROADCAST_UDP_QUESTION1 "Where are you?v1.0" // Expected question from UDP client
#define UDP_BROADCAST_FUNC_LEN 7
#define UDP_BROADCAST_MAX_COLON_COMMA_COUNT 4
// Defines used by owner details
#define MAX_NAME_SIZE 20
#define MAX_REPLY_SIZE 120
#define MAX_MAC_ADDR_LEN 18
#define MAX_EXTRA_REPLY_CHARS 27
#define UDP_BROADCAST_MAX_NAME_SIZE 21 // Code automatically leaves 1 char for '\0' (actual length = length - 1)
#define UDP_BROADCAST_MAX_REPLY_SIZE 120 // Code automatically leaves 1 char for '\0' (actual length = length - 1)
#define UDP_BROADCAST_MAX_MAC_ADDR_LEN 19
#define UDP_BROADCAST_MAX_EXTRA_REPLY_CHARS 27
/**
@@ -51,10 +39,10 @@
*/
typedef struct {
char name[MAX_NAME_SIZE];
char surname[MAX_NAME_SIZE];
char name[UDP_BROADCAST_MAX_NAME_SIZE];
char surname[UDP_BROADCAST_MAX_NAME_SIZE];
uint8_t mac_address[6];
char reply[MAX_REPLY_SIZE];
char reply[UDP_BROADCAST_MAX_REPLY_SIZE];
} owner_details_t;
// The following functions are used for owner details (those that must be available in main)