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:
Beat Küng
2017-10-16 14:44:29 +02:00
committed by Lorenz Meier
parent d83073f016
commit 2f2c0440c4
4 changed files with 37 additions and 6 deletions
+9
View File
@@ -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);