Skip to content

Commit

Permalink
fixes comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsracz committed Nov 15, 2020
1 parent c57b098 commit 6b8fba2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/openlcb/AliasAllocator.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public:
virtual ~AliasAllocator();

/** @return the Node ID for the interface. */
NodeID if_id()
NodeID if_node_id()
{
return if_id_;
}
Expand Down
7 changes: 5 additions & 2 deletions src/openlcb/BulkAliasAllocator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class BulkAliasAllocator : public CallableFlow<BulkAliasRequest>
{
}

/// 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();
Expand All @@ -74,7 +76,7 @@ class BulkAliasAllocator : public CallableFlow<BulkAliasRequest>
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);
Expand All @@ -90,10 +92,11 @@ class BulkAliasAllocator : public CallableFlow<BulkAliasRequest>
/// 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.
Expand Down

0 comments on commit 6b8fba2

Please sign in to comment.