mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 16:43:34 +08:00
move subsystem_info entirely into commander and remove from uORB
* HealthFlags: define bitfield using 1<<X Co-authored-by: Matthias Grob <maetugr@gmail.com>
This commit is contained in:
co-authored by
Matthias Grob
parent
ea3d202370
commit
945c17bc3f
@@ -359,8 +359,6 @@ void IridiumSBD::main_loop(int argc, char *argv[])
|
||||
break;
|
||||
}
|
||||
|
||||
publish_subsystem_status();
|
||||
|
||||
if (_new_state != _state) {
|
||||
VERBOSE_INFO("SWITCHING STATE FROM %s TO %s", satcom_state_string[_state], satcom_state_string[_new_state]);
|
||||
_state = _new_state;
|
||||
@@ -1116,31 +1114,13 @@ void IridiumSBD::publish_iridium_status()
|
||||
}
|
||||
}
|
||||
|
||||
void IridiumSBD::publish_subsystem_status()
|
||||
{
|
||||
const bool present = true;
|
||||
const bool enabled = true;
|
||||
const bool ok = _status.last_heartbeat > 0; // maybe at some point here an additional check should be made
|
||||
|
||||
if ((_info.present != present) || (_info.enabled != enabled) || (_info.ok != ok)) {
|
||||
_info.timestamp = hrt_absolute_time();
|
||||
_info.subsystem_type = subsystem_info_s::SUBSYSTEM_TYPE_SATCOM;
|
||||
_info.present = present;
|
||||
_info.enabled = enabled;
|
||||
_info.ok = ok;
|
||||
|
||||
_subsystem_pub.publish(_info);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int IridiumSBD::open_first(struct file *filep)
|
||||
int IridiumSBD::open_first(struct file *filep)
|
||||
{
|
||||
_cdev_used = true;
|
||||
return CDev::open_first(filep);
|
||||
}
|
||||
|
||||
int IridiumSBD::close_last(struct file *filep)
|
||||
int IridiumSBD::close_last(struct file *filep)
|
||||
{
|
||||
_cdev_used = false;
|
||||
return CDev::close_last(filep);
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
|
||||
#include <uORB/Publication.hpp>
|
||||
#include <uORB/topics/iridiumsbd_status.h>
|
||||
#include <uORB/topics/subsystem_info.h>
|
||||
|
||||
typedef enum {
|
||||
SATCOM_OK = 0,
|
||||
@@ -255,9 +254,7 @@ private:
|
||||
*/
|
||||
pollevent_t poll_state(struct file *filp);
|
||||
|
||||
void publish_iridium_status(void);
|
||||
|
||||
void publish_subsystem_status();
|
||||
void publish_iridium_status();
|
||||
|
||||
/**
|
||||
* Notification of the first open of CDev.
|
||||
@@ -305,7 +302,6 @@ private:
|
||||
uint16_t _packet_length = 0;
|
||||
|
||||
uORB::Publication<iridiumsbd_status_s> _iridiumsbd_status_pub{ORB_ID(iridiumsbd_status)};
|
||||
uORB::PublicationQueued<subsystem_info_s> _subsystem_pub{ORB_ID(subsystem_info)};
|
||||
|
||||
bool _test_pending = false;
|
||||
char _test_command[32];
|
||||
@@ -342,6 +338,5 @@ private:
|
||||
|
||||
bool _verbose = false;
|
||||
|
||||
iridiumsbd_status_s _status = {};
|
||||
subsystem_info_s _info = {};
|
||||
iridiumsbd_status_s _status{};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user