From 6b8fba2f1b4adf40ee14e0283caf241bc27492a8 Mon Sep 17 00:00:00 2001 From: Balazs Racz Date: Sun, 15 Nov 2020 14:31:18 +0100 Subject: [PATCH] fixes comments. --- src/openlcb/AliasAllocator.hxx | 2 +- src/openlcb/BulkAliasAllocator.cxx | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/openlcb/AliasAllocator.hxx b/src/openlcb/AliasAllocator.hxx index b79edb797..4abf9d5ff 100644 --- a/src/openlcb/AliasAllocator.hxx +++ b/src/openlcb/AliasAllocator.hxx @@ -112,7 +112,7 @@ public: virtual ~AliasAllocator(); /** @return the Node ID for the interface. */ - NodeID if_id() + NodeID if_node_id() { return if_id_; } diff --git a/src/openlcb/BulkAliasAllocator.cxx b/src/openlcb/BulkAliasAllocator.cxx index 093894f15..d4767f418 100644 --- a/src/openlcb/BulkAliasAllocator.cxx +++ b/src/openlcb/BulkAliasAllocator.cxx @@ -50,6 +50,8 @@ class BulkAliasAllocator : public CallableFlow { } + /// Start of flow when a request arrives to allocate many aliases. Resets + /// the internal state and goes on to start the allocation process. Action entry() override { startTime_ = os_get_time_monotonic(); @@ -74,7 +76,7 @@ class BulkAliasAllocator : public CallableFlow for (unsigned i = 0; i < needed; ++i) { NodeAlias next_alias = if_can()->alias_allocator()->get_new_seed(); - auto if_id = if_can()->alias_allocator()->if_id(); + auto if_id = if_can()->alias_allocator()->if_node_id(); send_can_frame(next_alias, (if_id >> 36) & 0xfff, 7); send_can_frame(next_alias, (if_id >> 24) & 0xfff, 6); send_can_frame(next_alias, (if_id >> 12) & 0xfff, 5); @@ -90,10 +92,11 @@ class BulkAliasAllocator : public CallableFlow /// Adds the timestamps when the CID requests were sent out. Action stamp_time() { + auto ctime = relative_time(); for (unsigned i = nextToStampTime_; i < pendingAliasesByTime_.size(); ++i) { - pendingAliasesByTime_[i].cidTime_ = relative_time(); + pendingAliasesByTime_[i].cidTime_ = ctime; } nextToStampTime_ = pendingAliasesByTime_.size(); // Go back to sending more CID frames as needed.