mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 22:53:33 +08:00
Cleaned up UAVCAN ioctl codes
This commit is contained in:
committed by
Lorenz Meier
parent
bf6dff3e99
commit
a268845f1d
@@ -1115,7 +1115,7 @@ UavcanNode::ioctl(file *filp, int cmd, unsigned long arg)
|
||||
break;
|
||||
|
||||
|
||||
case UAVCANIOC_HARDPOINT_SET: {
|
||||
case UAVCAN_IOCS_HARDPOINT_SET: {
|
||||
const auto &hp_cmd = *reinterpret_cast<uavcan::equipment::hardpoint::Command *>(arg);
|
||||
_hardpoint_controller.set_command(hp_cmd.hardpoint_id, hp_cmd.command);
|
||||
}
|
||||
|
||||
@@ -73,10 +73,6 @@
|
||||
// we add two to allow for actuator_direct and busevent
|
||||
#define UAVCAN_NUM_POLL_FDS (NUM_ACTUATOR_CONTROL_GROUPS_UAVCAN+2)
|
||||
|
||||
// IOCTL control codes
|
||||
static constexpr unsigned UAVCANIOCBASE = 0x7800;
|
||||
static constexpr unsigned UAVCANIOC_HARDPOINT_SET = _PX4_IOC(UAVCANIOCBASE, 0x10);
|
||||
|
||||
/**
|
||||
* A UAVCAN node.
|
||||
*/
|
||||
|
||||
@@ -65,7 +65,18 @@
|
||||
// ioctl interface
|
||||
#define _UAVCAN_IOC(_n) (_IOC(_UAVCAN_IOCBASE, _n))
|
||||
#define _UAVCAN_IOCBASE (0x4000) // IOCTL base for module UAVCAN
|
||||
#define UAVCAN_IOCG_NODEID_INPROGRESS _UAVCAN_IOC(1) // query if node identification is in progress
|
||||
/*
|
||||
* Query if node identification is in progress. Returns:
|
||||
* EINVAL - not applicable in the current operating mode
|
||||
* ETIME - network discovery complete
|
||||
* OK (0) - network discovery in progress
|
||||
*/
|
||||
#define UAVCAN_IOCG_NODEID_INPROGRESS _UAVCAN_IOC(1)
|
||||
/*
|
||||
* Set hardpoint command. Accepts a pointer to uavcan::equipment::hardpoint::Command; returns nothing.
|
||||
* The pointer may be invalidated once the call returns.
|
||||
*/
|
||||
#define UAVCAN_IOCS_HARDPOINT_SET _UAVCAN_IOC(10)
|
||||
|
||||
// public prototypes
|
||||
extern "C" __EXPORT int uavcan_main(int argc, char *argv[]);
|
||||
|
||||
Reference in New Issue
Block a user