From 8b1b03d5abe558f75663c836570ee2505cf8547c Mon Sep 17 00:00:00 2001 From: Filip Dimitrijevic Date: Thu, 9 May 2024 16:09:49 +0200 Subject: [PATCH] updated classes UML --- uml/classes_NTP.puml | 113 +++++++++++++++++++++++++++++++------------ 1 file changed, 81 insertions(+), 32 deletions(-) diff --git a/uml/classes_NTP.puml b/uml/classes_NTP.puml index 3bf6fea..6d61f27 100644 --- a/uml/classes_NTP.puml +++ b/uml/classes_NTP.puml @@ -1,44 +1,93 @@ -@startuml uml -class main.c { - + main() +@startuml +skinparam linetype ortho + +' Classes definition +class NTPTask { + + void vStartNTPClientTasks_SingleTasks(uint16_t, UBaseType_t) + + static void vNTPTaskSendUsingStandardInterface(void*) } -class utilityFunctions.c { - + struct p* mobilize(ipaddr, ipaddr, int, int, int, int) - + void clear(struct p*, int) + +class NTP_main_utility { + + struct ntp_p* mobilize(uint32_t, uint32_t, int, int, int, int) + + struct ntp_p* find_assoc(struct ntp_r*) + digest md5(int) - + tstamp get_time() + + void FreeRTOS_ntohl_array_32(uint32_t*, size_t) + + void create_ntp_r(struct ntp_r*, ntp_packet*, tstamp) + + struct ntp_r* recv_packet() + + void translate_ntp_x_to_ntp_packet(ntp_x*, ntp_packet*) + + void xmit_packet(struct ntp_x*) + void step_time(double) + void adjust_time(double) } -class networkCommunication.c { - + void receive(struct r*) - + struct p* find_assoc(struct r*) - + void packet(struct p*, struct r*) - + void clock_filter(struct p*, double, double, double) - + void fast_xmit(struct r*, int, int) - + struct r* recv_packet() - + void xmit_packet(struct x*) + +class NTP_TDMG { + + void assoc_table_init(Assoc_table*, uint32_t*) + + int assoc_table_add(Assoc_table*, uint32_t, char, tstamp) + + void assoc_table_update(ntp_p*) + + double sqrt(double) + + int64_t subtract_uint64_t(uint64_t, uint64_t) + + int64_t add_int64_t(int64_t, int64_t) + + void settime(tstamp) + + tstamp gettime(int) + + void printTimestamp(tstamp, const char*) + + void uint64_to_str(uint64_t, char*) + + void FreeRTOS_printf_wrapper(const char*, uint64_t) + + void double_to_str(double, char*, int) + + void FreeRTOS_printf_wrapper_double(const char*, double) + + void print_uint64_as_32_parts(uint64_t) } -class systemProcesses.c { + +class NTP_peer { + + double log2d(int) + + void packet(struct ntp_p*, struct ntp_r*) + + void clock_filter(struct ntp_p*, double, double, double) + + int fit(struct ntp_p*) + + void clear(struct ntp_p*) + + void fast_xmit(struct ntp_r*, int, int) + + int access(struct ntp_r*) + + void receive(struct ntp_r*) +} + +class NTP_poll { + + void poll(struct ntp_p*) + + void poll_update(struct ntp_p*, int) +} + +class NTP_system_process { + + int compare_ntp_m(const void*, const void*) + void clock_select() - + double root_dist(struct p*) - + int accept(struct p*) - + void clock_update(struct p*) + + double root_dist(struct ntp_p*) + + int accept(struct ntp_p*) + + void clock_update(struct ntp_p*) + void clock_combine() } -class pollManager.c { - + void poll(struct p*) - + void poll_update(struct p*, int) - + void peer_xmit(struct p*) -} -class timeManagement.c { - + int local_clock(struct p*, double) - + void rstclock(int, double, double) + + class NTP_vfo { + + local_clock(struct ntp_p*, double) + + void rstclock(int, offset, double) + void clock_adjust() } -main.c ..> utilityFunctions.c : <> -utilityFunctions.c ..> networkCommunication.c : <> -utilityFunctions.c ..> systemProcesses.c : <> -utilityFunctions.c ..> pollManager.c : <> -systemProcesses.c ..> timeManagement.c : <> + +' Relationships +NTPTask -left-> NTP_main_utility +NTPTask -down-> NTP_peer +NTPTask -left-> NTP_vfo + +NTP_main_utility -left-> NTP_peer +NTP_main_utility -left-> NTP_TDMG.c + +NTP_TDMG -down-> NTP_main_utility + +NTP_poll -right-> NTP_peer + +NTP_peer -left-> NTP_TDMG +NTP_peer -left-> NTP_poll +NTP_peer -left-> NTP_system_process +NTP_peer -right-> NTP_main_utility + +NTP_system_process -down-> NTP_vfo +NTP_system_process -down-> NTP_TDMG +NTP_system_process -down-> NTP_peer + +NTP_vfo -left-> NTP_main_utility @enduml \ No newline at end of file