Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
528ca931
Commit
528ca931
authored
8 years ago
by
Beat Küng
Browse files
Options
Downloads
Patches
Plain Diff
logger: only add data message to the log if orb_copy succeeds, when adding a new instance
parent
df53fb0f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/modules/logger/logger.cpp
+6
-3
6 additions, 3 deletions
src/modules/logger/logger.cpp
src/modules/uORB/uORBManager.hpp
+2
-1
2 additions, 1 deletion
src/modules/uORB/uORBManager.hpp
with
8 additions
and
4 deletions
src/modules/logger/logger.cpp
+
6
−
3
View file @
528ca931
...
...
@@ -441,7 +441,7 @@ bool Logger::copy_if_updated_multi(LoggerSubscription &sub, int multi_instance,
if
(
OK
==
orb_exists
(
sub
.
metadata
,
multi_instance
))
{
handle
=
orb_subscribe_multi
(
sub
.
metadata
,
multi_instance
);
//PX4_INFO("subscribed to instance %d of topic %s", multi_instance,
topic
->o_name);
//PX4_INFO("subscribed to instance %d of topic %s", multi_instance,
sub.metadata
->o_name);
/* copy first data */
if
(
handle
>=
0
)
{
...
...
@@ -454,8 +454,11 @@ bool Logger::copy_if_updated_multi(LoggerSubscription &sub, int multi_instance,
orb_set_interval
(
handle
,
interval
);
}
orb_copy
(
sub
.
metadata
,
handle
,
buffer
);
updated
=
true
;
/* It can happen that orb_exists returns true, even if there is no publisher (but another subscriber).
* We catch this here, because orb_copy will fail in this case. */
if
(
orb_copy
(
sub
.
metadata
,
handle
,
buffer
)
==
PX4_OK
)
{
updated
=
true
;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/modules/uORB/uORBManager.hpp
+
2
−
1
View file @
528ca931
...
...
@@ -295,7 +295,8 @@ public:
int
orb_stat
(
int
handle
,
uint64_t
*
time
)
;
/**
* Check if a topic has already been created.
* Check if a topic has already been created (a publisher or a subscriber exists with
* the given instance).
*
* @param meta ORB topic metadata.
* @param instance ORB instance
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment