mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-07 01:41:36 +08:00
Dynamic node ID servers - configurable priority
This commit is contained in:
+1
-2
@@ -239,12 +239,11 @@ public:
|
|||||||
|
|
||||||
int init(const TransferPriority priority)
|
int init(const TransferPriority priority)
|
||||||
{
|
{
|
||||||
int res = allocation_pub_.init();
|
int res = allocation_pub_.init(priority);
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
{
|
{
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
allocation_pub_.setPriority(priority);
|
|
||||||
allocation_pub_.setTxTimeout(MonotonicDuration::fromMSec(1000 /* TODO FIXME ALLOCATION RANDOMIZATION */));
|
allocation_pub_.setTxTimeout(MonotonicDuration::fromMSec(1000 /* TODO FIXME ALLOCATION RANDOMIZATION */));
|
||||||
|
|
||||||
res = allocation_sub_.start(AllocationCallback(this, &AllocationRequestManager::handleAllocation));
|
res = allocation_sub_.start(AllocationCallback(this, &AllocationRequestManager::handleAllocation));
|
||||||
|
|||||||
+1
-2
@@ -258,12 +258,11 @@ public:
|
|||||||
/*
|
/*
|
||||||
* Initializing pub/sub and timer
|
* Initializing pub/sub and timer
|
||||||
*/
|
*/
|
||||||
int res = discovery_pub_.init();
|
int res = discovery_pub_.init(priority);
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
{
|
{
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
discovery_pub_.setPriority(priority);
|
|
||||||
|
|
||||||
res = discovery_sub_.start(DiscoveryCallback(this, &ClusterManager::handleDiscovery));
|
res = discovery_sub_.start(DiscoveryCallback(this, &ClusterManager::handleDiscovery));
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
|
|||||||
@@ -766,7 +766,7 @@ public:
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = append_entries_client_.init();
|
res = append_entries_client_.init(priority);
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
{
|
{
|
||||||
return res;
|
return res;
|
||||||
@@ -774,7 +774,7 @@ public:
|
|||||||
append_entries_client_.setCallback(AppendEntriesResponseCallback(this,
|
append_entries_client_.setCallback(AppendEntriesResponseCallback(this,
|
||||||
&RaftCore::handleAppendEntriesResponse));
|
&RaftCore::handleAppendEntriesResponse));
|
||||||
|
|
||||||
res = request_vote_client_.init();
|
res = request_vote_client_.init(priority);
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
{
|
{
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@@ -311,9 +311,7 @@ public:
|
|||||||
|
|
||||||
int init(const TransferPriority priority)
|
int init(const TransferPriority priority)
|
||||||
{
|
{
|
||||||
// TODO FIXME set priority
|
int res = get_node_info_client_.init(priority);
|
||||||
(void)priority;
|
|
||||||
int res = get_node_info_client_.init();
|
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
{
|
{
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
Reference in New Issue
Block a user