Skip to content

Commit

Permalink
3.0.0.8 - Fixed timestamp check settings and wraparound on 1 second
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Smith committed Jan 20, 2023
1 parent 885250f commit 93eb20b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gr-CyberRadio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
set(VERSION_MAJOR 3)
set(VERSION_API 0)
set(VERSION_ABI 0)
set(VERSION_PATCH 7)
set(VERSION_PATCH 8)

cmake_policy(SET CMP0011 NEW)

Expand Down
24 changes: 18 additions & 6 deletions gr-CyberRadio/lib/vita_udp_rx_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ std::map<int, float> ndr358_551_ddc_map = {
};

std::map<int, int> ndr358_551_timestamp_diffs = {
{40, 2000} , {39, 4000} , {38, 8000} , {37, 8000} , {36, 16000},
{35, 16000}, {34, 16000}, {33, 32000}, {32, 32000}
{40, 2048} , {39, 4096} , {38, 8192} , {37, 8192} , {36, 16384},
{35, 16384}, {34, 16384}, {33, 32768}, {32, 32768}
};

void raise_error(std::string tag, int sock)
Expand Down Expand Up @@ -425,13 +425,25 @@ namespace gr {
d_frac_last_timestamp = fractionalTs;
} else {
uint32_t expected_diff = ndr358_551_timestamp_diffs.at(__ddc_filter);
if ( (fractionalTs - d_frac_last_timestamp) != expected_diff )
// wrapping at 1second.
uint32_t diff = 0;
if ( fractionalTs < d_frac_last_timestamp )
{
//d_logger->warn("frac = {}", fractionalTs);
// diff = (max - last) + current
//d_logger->warn("({} - {}) + {}", 256000000ull,d_frac_last_timestamp,fractionalTs);
diff = (256000000ull - d_frac_last_timestamp) + fractionalTs;
}
else {
diff = fractionalTs - d_frac_last_timestamp;
}
if ( diff != expected_diff )
{
txStatusMsg();
std::cout
<< "gr::CyberRadio::vita_udp_rx_impl: packet loss detected: expected "
<< expected_diff << ", received " << (fractionalTs - d_frac_last_timestamp) << std::endl;
d_logger->warn("gr::CyberRadio::vita_udp_rx_impl: packet loss detected: expected {}, recieved {}",
expected_diff, diff);
}
d_frac_last_timestamp = fractionalTs;
}
}

Expand Down

0 comments on commit 93eb20b

Please sign in to comment.