From 1331e0aec90f5a648371eee1a3a1117669485a11 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Tue, 9 Feb 2021 15:56:03 +0100 Subject: Extended the API to calculate jitter - ndpi_jitter_init() - ndpi_jitter_free() - ndpi_jitter_add_value() --- example/ndpiReader.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'example/ndpiReader.c') diff --git a/example/ndpiReader.c b/example/ndpiReader.c index f837a5c29..a2caeaad9 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -3765,6 +3765,25 @@ void hwUnitTest() { /* *********************************************** */ +void jitterUnitTest() { + struct ndpi_jitter_struct jitter; + float v[] = { 10, 14, 8, 25, 16, 22, 14, 35, 15, 27, 218, 40, 28, 40, 25, 65 }; + u_int i, num = sizeof(v) / sizeof(float); + u_int num_learning_points = 4; + u_int8_t trace = 0; + + assert(ndpi_jitter_init(&jitter, num_learning_points) == 0); + + for(i=0; i