mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-09 07:41:36 +08:00
drivers/rc_input: command line bind use vehicle_command
This commit is contained in:
@@ -37,10 +37,6 @@
|
||||
|
||||
using namespace time_literals;
|
||||
|
||||
#if defined(SPEKTRUM_POWER)
|
||||
static bool bind_spektrum(int arg = DSMX8_BIND_PULSES);
|
||||
#endif /* SPEKTRUM_POWER */
|
||||
|
||||
constexpr char const *RCInput::RC_SCAN_STRING[];
|
||||
|
||||
RCInput::RCInput(const char *device) :
|
||||
@@ -606,7 +602,7 @@ void RCInput::Run()
|
||||
}
|
||||
|
||||
#if defined(SPEKTRUM_POWER)
|
||||
bool bind_spektrum(int arg)
|
||||
bool RCInput::bind_spektrum(int arg) const
|
||||
{
|
||||
int ret = PX4_ERROR;
|
||||
|
||||
@@ -652,8 +648,11 @@ int RCInput::custom_command(int argc, char *argv[])
|
||||
const char *verb = argv[0];
|
||||
|
||||
if (!strcmp(verb, "bind")) {
|
||||
// TODO: publish vehicle_command
|
||||
bind_spektrum();
|
||||
uORB::PublicationQueued<vehicle_command_s> vehicle_command_pub{ORB_ID(vehicle_command)};
|
||||
vehicle_command_s vcmd{};
|
||||
vcmd.command = vehicle_command_s::VEHICLE_CMD_START_RX_PAIR;
|
||||
vcmd.timestamp = hrt_absolute_time();
|
||||
vehicle_command_pub.publish(vcmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user