mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 20:53:34 +08:00
uavcan_v1: Don't re-subscribe to fixed port ID subscribers
This commit is contained in:
committed by
Daniel Agar
parent
a99b657f03
commit
ab46b8026c
@@ -60,6 +60,11 @@ void SubscriptionManager::subscribe()
|
|||||||
_getinfo_rsp.subscribe();
|
_getinfo_rsp.subscribe();
|
||||||
_access_rsp.subscribe();
|
_access_rsp.subscribe();
|
||||||
|
|
||||||
|
updateDynamicSubscriptions();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SubscriptionManager::updateDynamicSubscriptions()
|
||||||
|
{
|
||||||
for (auto &sub : _uavcan_subs) {
|
for (auto &sub : _uavcan_subs) {
|
||||||
if (sub.instance == NULL) {
|
if (sub.instance == NULL) {
|
||||||
param_t param_handle = param_find(sub.px4_name);
|
param_t param_handle = param_find(sub.px4_name);
|
||||||
@@ -124,5 +129,5 @@ void SubscriptionManager::updateParams()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for any newly-enabled subscriptions
|
// Check for any newly-enabled subscriptions
|
||||||
subscribe();
|
updateDynamicSubscriptions();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ public:
|
|||||||
void updateParams();
|
void updateParams();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void updateDynamicSubscriptions();
|
||||||
|
|
||||||
CanardInstance &_canard_instance;
|
CanardInstance &_canard_instance;
|
||||||
UavcanParamManager &_param_manager;
|
UavcanParamManager &_param_manager;
|
||||||
UavcanDynamicPortSubscriber *_dynsubscribers {NULL};
|
UavcanDynamicPortSubscriber *_dynsubscribers {NULL};
|
||||||
|
|||||||
Reference in New Issue
Block a user