diff --git a/src/modules/uavcan/uavcan_main.cpp b/src/modules/uavcan/uavcan_main.cpp index 3552e24753..f81557a547 100644 --- a/src/modules/uavcan/uavcan_main.cpp +++ b/src/modules/uavcan/uavcan_main.cpp @@ -1383,15 +1383,18 @@ int uavcan_main(int argc, char *argv[]) // Sanity check - weed out negative values, check against maximums if (hardpoint_id >= 0 && - hardpoint_id < 9 && + hardpoint_id < 256 && command >= 0 && - command < 11) { + command < 65536) { inst->hardpoint_controller_set((uint8_t) hardpoint_id, (uint16_t) command); } else { errx(1, "Are you nuts?"); } } + else { + errx(1, "Are you nuts?"); + } } if (!std::strcmp(argv[1], "stop")) { if (fw) { diff --git a/src/modules/uavcan/uavcan_main.hpp b/src/modules/uavcan/uavcan_main.hpp index f3377f7db3..45ed9dedeb 100644 --- a/src/modules/uavcan/uavcan_main.hpp +++ b/src/modules/uavcan/uavcan_main.hpp @@ -123,13 +123,15 @@ public: void subscribe(); - int teardown(); - int arm_actuators(bool arm); + int teardown(); + int arm_actuators(bool arm); void print_info(); void shrink(); + void hardpoint_controller_set(uint8_t hardpoint_id, uint16_t command); + static UavcanNode *instance() { return _instance; } static int getHardwareVersion(uavcan::protocol::HardwareVersion &hwver); int fw_server(eServerAction action); @@ -140,7 +142,7 @@ public: int get_param(int remote_node_id, const char *name); int reset_node(int remote_node_id); - void hardpoint_controller_set(uint8_t hardpoint_id, uint16_t command); + private: void fill_node_info();