summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEthan Stewart <estewart@iol.unh.edu>2017-09-08 13:05:59 -0400
committerEthan Stewart <estewart@iol.unh.edu>2017-09-08 13:05:59 -0400
commita3d75c5ce57f025459bbaa4ed3df045c3664dcd9 (patch)
tree49e8d23368e8bf28c06fc5c620c346e06c8adc80
parent0ba75f985bc863fdb1a509dded872de7a6fdedf9 (diff)
downloadOpen-AVB-a3d75c5ce57f025459bbaa4ed3df045c3664dcd9.tar.gz
listen for announces on init and linkup
-rw-r--r--daemons/gptp/common/common_port.cpp5
-rw-r--r--daemons/gptp/common/ether_port.cpp3
2 files changed, 5 insertions, 3 deletions
diff --git a/daemons/gptp/common/common_port.cpp b/daemons/gptp/common/common_port.cpp
index cf1c51af..ae13cf18 100644
--- a/daemons/gptp/common/common_port.cpp
+++ b/daemons/gptp/common/common_port.cpp
@@ -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
diff --git a/daemons/gptp/common/ether_port.cpp b/daemons/gptp/common/ether_port.cpp
index 024531cc..2325fb99 100644
--- a/daemons/gptp/common/ether_port.cpp
+++ b/daemons/gptp/common/ether_port.cpp
@@ -408,7 +408,8 @@ bool EtherPort::_processEvent( Event e )
} else if( getPortState() == PTP_MASTER ) {
becomeMaster( true );
} else {
- startAnnounce();
+ clock->addEventTimerLocked(this, ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES,
+ ANNOUNCE_RECEIPT_TIMEOUT_MULTIPLIER * pow(2.0, getAnnounceInterval()) * 1000000000.0);
}
if (automotive_profile) {