summaryrefslogtreecommitdiff
path: root/lib/avtp_pipeline
diff options
context:
space:
mode:
authorMarcin Miklas <marcin.miklas@harman.com>2016-09-13 10:23:15 +0200
committerMarcin Miklas <marcin.miklas@harman.com>2016-09-13 10:27:21 +0200
commit4dd0dc3f40ac3bc2e47e699f4a85adcd09e88396 (patch)
treee16fc2bd9c61af0cf6d61ae5cb1d3619e8cafae0 /lib/avtp_pipeline
parentfd04d96ac0e8003f566fa50f9ad52dbd208d4503 (diff)
downloadOpen-AVB-4dd0dc3f40ac3bc2e47e699f4a85adcd09e88396.tar.gz
avtp_pipeline: echo intf using fixed timestamp settings.
Diffstat (limited to 'lib/avtp_pipeline')
-rwxr-xr-xlib/avtp_pipeline/intf_echo/openavb_intf_echo.c43
1 files changed, 32 insertions, 11 deletions
diff --git a/lib/avtp_pipeline/intf_echo/openavb_intf_echo.c b/lib/avtp_pipeline/intf_echo/openavb_intf_echo.c
index 34870f9f..bee8aef3 100755
--- a/lib/avtp_pipeline/intf_echo/openavb_intf_echo.c
+++ b/lib/avtp_pipeline/intf_echo/openavb_intf_echo.c
@@ -77,9 +77,10 @@ typedef struct {
/////////////
// When increment is enable this is the counter
U32 Counter;
-#if IGB_LAUNCHTIME_ENABLED
+
+ bool fixedTimestampEnabled;
+ U32 tsIncrement;
avtp_time_t walltime;
-#endif
} pvt_data_t;
@@ -171,10 +172,9 @@ void openavbIntfEchoTxInitCB(media_q_t *pMediaQ)
}
pPvtData->Counter = 0;
-#if IGB_LAUNCHTIME_ENABLED
- openavbAvtpTimeSetToWallTime(&pPvtData->walltime);
- AVB_LOG_INFO(__func__);
-#endif
+
+ if (pPvtData->fixedTimestampEnabled)
+ openavbAvtpTimeSetToWallTime(&pPvtData->walltime);
}
AVB_TRACE_EXIT(AVB_TRACE_INTF);
@@ -216,12 +216,12 @@ bool openavbIntfEchoTxCB(media_q_t *pMediaQ)
printf("%s\n\r", (char *)pMediaQItem->pPubData);
}
-#if IGB_LAUNCHTIME_ENABLED
- openavbAvtpTimeAddUSec(&pPvtData->walltime, 125);
+ if (pPvtData->fixedTimestampEnabled) {
+ openavbAvtpTimeAddUSec(&pPvtData->walltime, pPvtData->tsIncrement);
*pMediaQItem->pAvtpTime = pPvtData->walltime;
-#else
- openavbAvtpTimeSetToWallTime(pMediaQItem->pAvtpTime);
-#endif
+ } else {
+ openavbAvtpTimeSetToWallTime(pMediaQItem->pAvtpTime);
+ }
openavbMediaQHeadPush(pMediaQ);
AVB_TRACE_EXIT(AVB_TRACE_INTF_DETAIL);
return TRUE;
@@ -323,6 +323,25 @@ void openavbIntfEchoGenEndCB(media_q_t *pMediaQ)
AVB_TRACE_EXIT(AVB_TRACE_INTF);
}
+void openavbIntfEchoEnableFixedTimestamp(media_q_t *pMediaQ, bool enabled, U32 transmitInterval, U32 batchFactor)
+{
+ AVB_TRACE_ENTRY(AVB_TRACE_INTF);
+ if (pMediaQ && pMediaQ->pPvtIntfInfo) {
+ pvt_data_t *pPvtData = (pvt_data_t *)pMediaQ->pPvtIntfInfo;
+
+ pPvtData->fixedTimestampEnabled = enabled;
+ if (pPvtData->fixedTimestampEnabled) {
+ pPvtData->tsIncrement = NANOSECONDS_PER_SECOND/transmitInterval;
+ }
+
+ if (batchFactor != 1) {
+ AVB_LOGF_WARNING("batchFactor of %d ignored (must be 1)", batchFactor);
+ }
+ }
+
+ AVB_TRACE_EXIT(AVB_TRACE_INTF);
+}
+
// Main initialization entry point into the interface module
extern bool DLL_EXPORT openavbIntfEchoInitialize(media_q_t *pMediaQ, openavb_intf_cb_t *pIntfCB)
{
@@ -346,6 +365,7 @@ extern bool DLL_EXPORT openavbIntfEchoInitialize(media_q_t *pMediaQ, openavb_int
pIntfCB->intf_rx_cb = openavbIntfEchoRxCB;
pIntfCB->intf_end_cb = openavbIntfEchoEndCB;
pIntfCB->intf_gen_end_cb = openavbIntfEchoGenEndCB;
+ pIntfCB->intf_enable_fixed_timestamp = openavbIntfEchoEnableFixedTimestamp;
pPvtData->pEchoString = NULL;
pPvtData->echoStringRepeat = 1;
@@ -354,6 +374,7 @@ extern bool DLL_EXPORT openavbIntfEchoInitialize(media_q_t *pMediaQ, openavb_int
pPvtData->txLocalEcho = FALSE;
pPvtData->noNewline = FALSE;
pPvtData->ignoreTimestamp = FALSE;
+ pPvtData->fixedTimestampEnabled = FALSE;
}
AVB_TRACE_EXIT(AVB_TRACE_INTF);