Skip to content

Commit

Permalink
Revert "AP_UAVCAN: CAN Node status Log" OV3-955
Browse files Browse the repository at this point in the history
This reverts commit 60be55a.
  • Loading branch information
Lokesh-Carbonix authored and Lokesh Ramina committed Sep 29, 2023
1 parent 7c2fa9f commit 33bb7d8
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 39 deletions.
2 changes: 1 addition & 1 deletion libraries/AP_UAVCAN/AP_UAVCAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const AP_Param::GroupInfo AP_UAVCAN::var_info[] = {
// @Param: OPTION
// @DisplayName: UAVCAN options
// @Description: Option flags
// @Bitmask: 0:ClearDNADatabase,1:IgnoreDNANodeConflicts,2:EnableCanfd,3:LogNodeStatus
// @Bitmask: 0:ClearDNADatabase,1:IgnoreDNANodeConflicts
// @User: Advanced
AP_GROUPINFO("OPTION", 5, AP_UAVCAN, _options, 0),

Expand Down
1 change: 0 additions & 1 deletion libraries/AP_UAVCAN/AP_UAVCAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ class AP_UAVCAN : public AP_CANDriver, public AP_ESC_Telem_Backend {
enum class Options : uint16_t {
DNA_CLEAR_DATABASE = (1U<<0),
DNA_IGNORE_DUPLICATE_NODE = (1U<<1),
LOG_NODE_STATUS = (1U<<3),
};

// check if a option is set
Expand Down
33 changes: 0 additions & 33 deletions libraries/AP_UAVCAN/AP_UAVCAN_DNA_Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,16 +484,6 @@ void AP_UAVCAN_DNA_Server::handleNodeStatus(uint8_t node_id, const NodeStatusCb
return;
}
WITH_SEMAPHORE(sem);

//to calculate the delta b/w handlenode status pkt
uint32_t now = AP_HAL::native_millis();

if (_ap_uavcan->option_is_set(AP_UAVCAN::Options::LOG_NODE_STATUS)) {
log_NodeStatus(node_id, cb.msg->uptime_sec, cb.msg->health, cb.msg->mode , now - last_can_init_delta_ms[node_id]);
}

last_can_init_delta_ms[node_id] = now;

if (!isNodeIDVerified(node_id)) {
//immediately begin verification of the node_id
for (uint8_t i = 0; i < HAL_MAX_CAN_PROTOCOL_DRIVERS; i++) {
Expand Down Expand Up @@ -590,29 +580,6 @@ void AP_UAVCAN_DNA_Server::handleNodeInfo(uint8_t node_id, uint8_t unique_id[],
}
}

/*
optionally log NodeStatus packets
*/
void AP_UAVCAN_DNA_Server::log_NodeStatus(uint8_t node_id, uint32_t uptime_sec, uint8_t healthy, uint8_t mode, uint32_t delta)
{
if (node_id > MAX_NODE_ID) {
return;
}

// @LoggerMessage: CANH
// @Description: CAN Health Status
// @Field: TimeUS: Time since system startup
// @Field: NodeId: Node ID
// @Field: Healthy: zero when node healthy
// @Field: UpTime: time since boot in seconds
AP::logger().WriteStreaming("CANH",
"TimeUS," "NodeID," "Healthy," "UpTime," "delta", // labels
"s" "#" "-" "-" "-", // units
"F" "-" "-" "-" "-", // multipliers
"Q" "B" "B" "I" "I", // types
AP_HAL::micros64(), node_id, healthy, uptime_sec, delta);
}

//Trampoline call for handleNodeInfo member call
void trampoline_handleNodeInfo(const uavcan::ServiceCallResult<uavcan::protocol::GetNodeInfo>& resp)
{
Expand Down
4 changes: 0 additions & 4 deletions libraries/AP_UAVCAN/AP_UAVCAN_DNA_Server.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ class AP_UAVCAN_DNA_Server

//Run through the list of seen node ids for verification
void verify_nodes(AP_UAVCAN *ap_uavcan);

// Log NodeInfo
void log_NodeStatus(uint8_t node_id, uint32_t uptime_sec, uint8_t healthy, uint8_t mode, uint32_t delta);
uint32_t last_can_init_delta_ms[126];
};

namespace AP
Expand Down

0 comments on commit 33bb7d8

Please sign in to comment.