uavcan_main: replace std::array with a C array

Sadly, we cannot use std::array on NuttX
This commit is contained in:
Beat Küng
2017-01-03 13:25:33 +01:00
parent 59ca22ee6d
commit 2880bb185f
+3 -4
View File
@@ -45,7 +45,6 @@
#include <cstdlib>
#include <cstring>
#include <array>
#include <fcntl.h>
#include <systemlib/err.h>
#include <systemlib/systemlib.h>
@@ -1258,13 +1257,13 @@ UavcanNode::print_info()
// Printing all nodes that are online
std::printf("Online nodes (Node ID, Health, Mode):\n");
_node_status_monitor.forEachNode([](uavcan::NodeID nid, uavcan::NodeStatusMonitor::NodeStatus ns) {
static constexpr std::array<const char*, 4> HEALTH = {
static constexpr const char* HEALTH[] = {
"OK", "WARN", "ERR", "CRIT"
};
static constexpr std::array<const char*, 8> MODES = {
static constexpr const char* MODES[] = {
"OPERAT", "INIT", "MAINT", "SW_UPD", "?", "?", "?", "OFFLN"
};
std::printf("\t% 3d %-10s %-10s\n", int(nid.get()), HEALTH.at(ns.health), MODES.at(ns.mode));
std::printf("\t% 3d %-10s %-10s\n", int(nid.get()), HEALTH[ns.health], MODES[ns.mode]);
});
(void)pthread_mutex_unlock(&_node_mutex);