Clean up interfaces towards uORB

Proxy all calls to the DeviceNode through Manager;
- This hides the DeviceNode from publishers and subscribers
- Manager can be made an interface class between user and kernel spaces in protected build
- This doesn't increase code size or harm the performance on flat build

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
Jukka Laitinen
2021-11-24 09:11:45 +01:00
committed by Beat Küng
parent 99d3b2a4e4
commit 0b9505453d
8 changed files with 121 additions and 57 deletions
@@ -69,7 +69,7 @@ public:
bool registerCallback()
{
if (!_registered) {
if (_subscription.get_node() && _subscription.get_node()->register_callback(this)) {
if (_subscription.get_node() && Manager::register_callback(_subscription.get_node(), this)) {
// registered
_registered = true;
@@ -79,7 +79,7 @@ public:
// try to register callback again
if (_subscription.subscribe()) {
if (_subscription.get_node() && _subscription.get_node()->register_callback(this)) {
if (_subscription.get_node() && Manager::register_callback(_subscription.get_node(), this)) {
_registered = true;
}
}
@@ -94,7 +94,7 @@ public:
void unregisterCallback()
{
if (_subscription.get_node()) {
_subscription.get_node()->unregister_callback(this);
Manager::unregister_callback(_subscription.get_node(), this);
}
_registered = false;
@@ -164,7 +164,7 @@ public:
{
// schedule immediately if updated (queue depth or subscription interval)
if ((_required_updates == 0)
|| (_subscription.get_node()->updates_available(_subscription.get_last_generation()) >= _required_updates)) {
|| (Manager::updates_available(_subscription.get_node(), _subscription.get_last_generation()) >= _required_updates)) {
if (updated()) {
_work_item->ScheduleNow();
}