mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-09 04:21:36 +08:00
uavcan: add UAVCAN_SUB_LOG param to enable/disable uavcan::protocol::debug::LogMessage subscription handling
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user