mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-01 11:30:36 +08:00
NodeInfoRetriever basic test
This commit is contained in:
@@ -172,6 +172,8 @@ private:
|
||||
if (!TimerBase::isRunning())
|
||||
{
|
||||
TimerBase::startPeriodic(getTimerPollInterval());
|
||||
UAVCAN_TRACE("NodeInfoRetriever", "Timer started, interval %ld ms",
|
||||
static_cast<long>(getTimerPollInterval().toMSec()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,6 +232,7 @@ private:
|
||||
if (!requests_needed)
|
||||
{
|
||||
TimerBase::stop();
|
||||
UAVCAN_TRACE("NodeInfoRetriever", "Timer stopped");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -398,6 +401,18 @@ public:
|
||||
{
|
||||
max_concurrent_requests_ = max(static_cast<uint8_t>(1), num);
|
||||
}
|
||||
|
||||
/**
|
||||
* These methods are needed mostly for testing.
|
||||
*/
|
||||
bool isRetrievingInProgress() const { return TimerBase::isRunning(); }
|
||||
|
||||
uint8_t getNumPendingRequests() const
|
||||
{
|
||||
const unsigned num = get_node_info_client_.getNumPendingCalls();
|
||||
UAVCAN_ASSERT(num <= 0xFF);
|
||||
return static_cast<uint8_t>(num);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user