From 287623ab484e2bb7dfb03da97f3ceb23bb3ae0c2 Mon Sep 17 00:00:00 2001 From: daijoubu Date: Tue, 17 Feb 2026 20:14:47 -0800 Subject: [PATCH 1/2] Adding live data to NodeStatus message. --- src/main/drivers/dronecan/dronecan.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/drivers/dronecan/dronecan.c b/src/main/drivers/dronecan/dronecan.c index bdbc72c501e..757268e7b6d 100644 --- a/src/main/drivers/dronecan/dronecan.c +++ b/src/main/drivers/dronecan/dronecan.c @@ -5,6 +5,7 @@ #include #include "fc/settings.h" #include "build/version.h" +#include "sensors/diagnostics.h" #if defined(USE_DRONECAN) #include "io/gps.h" @@ -213,7 +214,12 @@ void send_NodeStatus(void) { // LOG_DEBUG(CAN, "Sending Node Status"); node_status.uptime_sec = millis() / 1000UL; - node_status.health = UAVCAN_PROTOCOL_NODESTATUS_HEALTH_OK; + if(isHardwareHealthy()){ + node_status.health = UAVCAN_PROTOCOL_NODESTATUS_HEALTH_OK; + } + else { + node_status.health = UAVCAN_PROTOCOL_NODESTATUS_HEALTH_CRITICAL; + } node_status.mode = UAVCAN_PROTOCOL_NODESTATUS_MODE_OPERATIONAL; node_status.sub_mode = 0; From 4bc5536749a4ebdc94e35f111256403a586054f2 Mon Sep 17 00:00:00 2001 From: daijoubu Date: Tue, 17 Feb 2026 20:34:20 -0800 Subject: [PATCH 2/2] Updated the vcs code with github hash. Put the arming flags in the vendor specific code in Node Status. --- src/main/drivers/dronecan/dronecan.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/drivers/dronecan/dronecan.c b/src/main/drivers/dronecan/dronecan.c index 757268e7b6d..6e2316379fa 100644 --- a/src/main/drivers/dronecan/dronecan.c +++ b/src/main/drivers/dronecan/dronecan.c @@ -3,9 +3,11 @@ #include "common/time.h" #include "drivers/time.h" #include +#include #include "fc/settings.h" #include "build/version.h" #include "sensors/diagnostics.h" +#include "fc/runtime_config.h" #if defined(USE_DRONECAN) #include "io/gps.h" @@ -178,7 +180,7 @@ void handle_GetNodeInfo(CanardInstance *ins, CanardRxTransfer *transfer) { pkt.software_version.major = FC_VERSION_MAJOR; pkt.software_version.minor = FC_VERSION_MINOR; pkt.software_version.optional_field_flags = FC_VERSION_PATCH_LEVEL; - pkt.software_version.vcs_commit = 0; // shortGitRevision; // need to convert string to integer put git hash in here + pkt.software_version.vcs_commit = strtoul(shortGitRevision, NULL, 16); // need to convert string to integer put git hash in here // should fill in hardware version pkt.hardware_version.major = 1; @@ -220,11 +222,12 @@ void send_NodeStatus(void) { else { node_status.health = UAVCAN_PROTOCOL_NODESTATUS_HEALTH_CRITICAL; } - node_status.mode = UAVCAN_PROTOCOL_NODESTATUS_MODE_OPERATIONAL; - node_status.sub_mode = 0; + + node_status.mode = UAVCAN_PROTOCOL_NODESTATUS_MODE_OPERATIONAL; // Indicates that node is able to communicate over CAN, not that it is in flight. + node_status.sub_mode = 0; // Not currently used in dronecan // put whatever you like in here for display in GUI - node_status.vendor_specific_status_code = 1234; + node_status.vendor_specific_status_code = armingFlags; uint32_t len = uavcan_protocol_NodeStatus_encode(&node_status, buffer);