mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-09 05:20:35 +08:00
orb_exists: change semantics from (is published or subscribed) to (is published)
Existing users of orb_exists: - logger (dynamic subscribe to multi-instances) - mavlink (orb subscription) - sdlog2 - preflightcheck (check for home_position) - wait_for_topic shell command (it's not used) - orb_group_count() (sensors: dynamic sensor addition) All use-cases benefit from the changed semantics: they are really only interested if there is a publisher, not another subscriber.
This commit is contained in:
@@ -170,6 +170,10 @@ uORB::DeviceNode::open(device::file_t *filp)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (FILE_FLAGS(filp) == 0) {
|
||||
return CDev::open(filp);
|
||||
}
|
||||
|
||||
/* can only be pub or sub, not both */
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -405,6 +409,11 @@ uORB::DeviceNode::ioctl(device::file_t *filp, int cmd, unsigned long arg)
|
||||
|
||||
return OK;
|
||||
|
||||
case ORBIOCISPUBLISHED:
|
||||
*(unsigned long *)arg = _published;
|
||||
|
||||
return OK;
|
||||
|
||||
default:
|
||||
/* give it to the superclass */
|
||||
return CDev::ioctl(filp, cmd, arg);
|
||||
|
||||
Reference in New Issue
Block a user