From 199d3b6a04399a0fa890f0dd7ac00e362ba25f75 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Tue, 18 Jun 2024 18:56:14 +0800 Subject: [PATCH] update --- .settings/language.settings.xml | 4 ++-- usrc/service/extern_if_service.c | 10 +++++----- usrc/service/report_generator_service.c | 14 +++++++++++++- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index 5d25771..536d667 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/usrc/service/extern_if_service.c b/usrc/service/extern_if_service.c index 58e6fc5..9d53c2d 100644 --- a/usrc/service/extern_if_service.c +++ b/usrc/service/extern_if_service.c @@ -70,11 +70,11 @@ static void create_and_send_timecode(struct sockaddr_in client, uint32_t timecod * @param len */ static void udp_on_packet(udp_t *server, struct sockaddr_in *client, uint8_t *data, uint16_t len) { - // ZLOGI(TAG, "udp_on_packet %d:", len); - // for (int i = 0; i < len; i++) { - // printf("%02x ", data[i]); - // } - // printf("\n"); + ZLOGI(TAG, "udp_on_packet %d:", len); + for (int i = 0; i < len; i++) { + printf("%02x ", data[i]); + } + printf("\n"); /** * @brief diff --git a/usrc/service/report_generator_service.c b/usrc/service/report_generator_service.c index c591fce..a72dc99 100644 --- a/usrc/service/report_generator_service.c +++ b/usrc/service/report_generator_service.c @@ -48,11 +48,16 @@ static bool _create_and_send_timecode(uint32_t timecode0, uint32_t timecode1, ui static void create_and_send_timecode(uint32_t timecode0, uint32_t timecode1, uint32_t frameNum) { static uint32_t exception1_times = 0; static uint32_t exception2_times = 0; + static uint32_t exception3_times = 0; static uint32_t restart_times = 0; static uint32_t lasttxtime = 0; static int32_t last_two_packet_diff = 0; static bool connected = false; + static uint32_t last_tc0; + static uint32_t last_tc1; + static uint32_t last_frameNum; + uint32_t tx_begin_time = 0; uint32_t tx_end_time = 0; int32_t two_packet_diff = 0; @@ -88,11 +93,18 @@ static void create_and_send_timecode(uint32_t timecode0, uint32_t timecode1, uin exception2_times++; } - ZLOGI(TAG, "now:%d %d senddiff:%d e1:%d e2:%d", tx_begin_time, two_packet_diff, send_diff_time, exception1_times, exception2_times); + if (last_tc0 == timecode0 && last_tc1 == timecode1 && last_frameNum == frameNum) { + exception3_times++; + } + + ZLOGI(TAG, "now:%d %d senddiff:%d e1:%d e2:%d e3:%d", tx_begin_time, two_packet_diff, send_diff_time, exception1_times, exception2_times, exception3_times); // lasttxtime = tx_begin_time; last_two_packet_diff = two_packet_diff; + last_tc0 = timecode0; + last_tc1 = timecode1; + last_frameNum = frameNum; } // if () m_last_diff_time = starttime - m_last_tx_time;