INode class. Publisher, Subscriber, ServiceServer, ServiceClient now accept INode in constructor instead of the bunch of independent params. Self NodeID now being configured via setNodeID() method instead of constructor param

This commit is contained in:
Pavel Kirienko
2014-03-14 19:54:27 +04:00
parent 15cbf96378
commit 613efa49b9
22 changed files with 211 additions and 181 deletions
+4 -4
View File
@@ -21,7 +21,7 @@ void DeadlineHandler::startWithDeadline(MonotonicTime deadline)
void DeadlineHandler::startWithDelay(MonotonicDuration delay)
{
startWithDeadline(scheduler_.getMonotonicTimestamp() + delay);
startWithDeadline(scheduler_.getMonotonicTime() + delay);
}
void DeadlineHandler::stop()
@@ -80,7 +80,7 @@ bool DeadlineScheduler::doesExist(const DeadlineHandler* mdh) const
return false;
}
MonotonicTime DeadlineScheduler::pollAndGetMonotonicTimestamp(ISystemClock& sysclock)
MonotonicTime DeadlineScheduler::pollAndGetMonotonicTime(ISystemClock& sysclock)
{
while (true)
{
@@ -117,7 +117,7 @@ MonotonicTime DeadlineScheduler::getEarliestDeadline() const
MonotonicTime Scheduler::computeDispatcherSpinDeadline(MonotonicTime spin_deadline) const
{
const MonotonicTime earliest = std::min(deadline_scheduler_.getEarliestDeadline(), spin_deadline);
const MonotonicTime ts = getMonotonicTimestamp();
const MonotonicTime ts = getMonotonicTime();
if (earliest > ts)
{
if (ts - earliest > deadline_resolution_)
@@ -148,7 +148,7 @@ int Scheduler::spin(MonotonicTime deadline)
if (retval < 0)
break;
const MonotonicTime ts = deadline_scheduler_.pollAndGetMonotonicTimestamp(getSystemClock());
const MonotonicTime ts = deadline_scheduler_.pollAndGetMonotonicTime(getSystemClock());
pollCleanup(ts, retval);
if (ts >= deadline)
break;
+2 -2
View File
@@ -8,7 +8,7 @@
namespace uavcan
{
void Timer::handleDeadline(MonotonicTime current_timestamp)
void Timer::handleDeadline(MonotonicTime current)
{
assert(!isRunning());
@@ -18,7 +18,7 @@ void Timer::handleDeadline(MonotonicTime current_timestamp)
startWithDeadline(scheduled_time + period_);
// Application can re-register the timer with different params, it's OK
handleTimerEvent(TimerEvent(scheduled_time, current_timestamp));
handleTimerEvent(TimerEvent(scheduled_time, current));
}
void Timer::startOneShotWithDeadline(MonotonicTime deadline)