uavcan: add UAVCAN_SUB_LOG param to enable/disable uavcan::protocol::debug::LogMessage subscription handling

This commit is contained in:
Daniel Agar
2022-06-30 10:56:48 -04:00
parent f16ea921c2
commit f716224c45
2 changed files with 24 additions and 6 deletions
+12 -6
View File
@@ -508,6 +508,18 @@ UavcanNode::init(uavcan::NodeID node_id, UAVCAN_DRIVER::BusEvent &bus_events)
fill_node_info();
// log message subscription
int32_t uavcan_sub_log = 1;
param_get(param_find("UAVCAN_SUB_LOG"), &uavcan_sub_log);
if (uavcan_sub_log != 0) {
ret = _log_message_controller.init();
if (ret < 0) {
return ret;
}
}
ret = _beep_controller.init();
if (ret < 0) {
@@ -533,12 +545,6 @@ UavcanNode::init(uavcan::NodeID node_id, UAVCAN_DRIVER::BusEvent &bus_events)
return ret;
}
ret = _log_message_controller.init();
if (ret < 0) {
return ret;
}
ret = _rgbled_controller.init();
if (ret < 0) {
+12
View File
@@ -307,6 +307,18 @@ PARAM_DEFINE_INT32(UAVCAN_SUB_ICE, 0);
*/
PARAM_DEFINE_INT32(UAVCAN_SUB_IMU, 0);
/**
* subscription log message
*
* Enable UAVCAN log message subscription.
* uavcan::protocol::debug::LogMessage
*
* @boolean
* @reboot_required true
* @group UAVCAN
*/
PARAM_DEFINE_INT32(UAVCAN_SUB_LOG, 1);
/**
* subscription magnetometer
*