logger: re-use subscribed topic id's, only set them once on first use

Will be necessary when using multiple backends in parallel.
This commit is contained in:
Beat Küng
2016-10-19 13:13:47 +02:00
committed by Lorenz Meier
parent 12ded377d1
commit 7a60c1296e
2 changed files with 10 additions and 6 deletions
+5 -1
View File
@@ -75,6 +75,10 @@ struct LoggerSubscription {
for (int i = 1; i < ORB_MULTI_MAX_INSTANCES; i++) {
fd[i] = -1;
}
for (int i = 0; i < ORB_MULTI_MAX_INSTANCES; i++) {
msg_ids[i] = (uint16_t) - 1;
}
}
};
@@ -232,7 +236,7 @@ private:
uint32_t _log_interval;
param_t _log_utc_offset;
orb_advert_t _mavlink_log_pub = nullptr;
uint16_t _next_topic_id; ///< id of next subscribed topic
uint16_t _next_topic_id = 0; ///< id of next subscribed ulog topic
char *_replay_file_name = nullptr;
};