summaryrefslogtreecommitdiff
path: root/daemons/gptp/common/common_port.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'daemons/gptp/common/common_port.cpp')
-rw-r--r--daemons/gptp/common/common_port.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/daemons/gptp/common/common_port.cpp b/daemons/gptp/common/common_port.cpp
index 512c579b..d8ba54f6 100644
--- a/daemons/gptp/common/common_port.cpp
+++ b/daemons/gptp/common/common_port.cpp
@@ -311,7 +311,7 @@ void CommonPort::stopSyncReceiptTimer( void )
void CommonPort::startSyncIntervalTimer
( long long unsigned int waitTime )
{
- syncIntervalTimerLock->lock();
+ if( syncIntervalTimerLock->trylock() == oslock_fail ) return;
clock->deleteEventTimerLocked(this, SYNC_INTERVAL_TIMEOUT_EXPIRES);
clock->addEventTimerLocked
(this, SYNC_INTERVAL_TIMEOUT_EXPIRES, waitTime);
@@ -550,7 +550,7 @@ bool CommonPort::processEvent( Event e )
// If port has been configured as master or slave, run media
// specific configuration. If it hasn't been configured
- // start announce message time
+ // start listening for announce messages
if( clock->getPriority1() == 255 ||
port_state == PTP_SLAVE )
{
@@ -562,7 +562,8 @@ bool CommonPort::processEvent( Event e )
}
else
{
- startAnnounce();
+ clock->addEventTimerLocked(this, ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES,
+ ANNOUNCE_RECEIPT_TIMEOUT_MULTIPLIER * pow(2.0, getAnnounceInterval()) * 1000000000.0);
}
// Do any media specific initialization
@@ -597,13 +598,9 @@ bool CommonPort::processEvent( Event e )
case ANNOUNCE_INTERVAL_TIMEOUT_EXPIRES:
GPTP_LOG_DEBUG("ANNOUNCE_INTERVAL_TIMEOUT_EXPIRES occured");
- if( !asCapable )
- {
- ret = true;
- break;
- }
// Send an announce message
+ if ( asCapable)
{
PTPMessageAnnounce *annc =
new PTPMessageAnnounce(this);