mavlink: use send() instead of using reset flag

I think we can just directly use send() and don't need to use the
workaround of resetting the send flag to trigger one send.

Also, we don't need to override it if we don't need to check any params.
This commit is contained in:
Julian Oes 2020-05-28 14:12:04 +02:00
parent b54c44bd37
commit afafc541d8
4 changed files with 1 additions and 18 deletions

View File

@ -99,8 +99,7 @@ public:
virtual bool request_message(float param2 = 0.0, float param3 = 0.0, float param4 = 0.0,
float param5 = 0.0, float param6 = 0.0, float param7 = 0.0)
{
reset_last_sent();
return true;
return send(hrt_absolute_time());
}
/**

View File

@ -36,11 +36,6 @@ public:
return MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES;
}
bool request_message(float param2, float param3, float param4,
float param5, float param6, float param7) override
{
return send(hrt_absolute_time());
}
private:
/* do not allow top copying this class */
MavlinkStreamAutopilotVersion(MavlinkStreamAutopilotVersion &) = delete;

View File

@ -37,12 +37,6 @@ public:
{
return MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES;
}
bool request_message(float param2, float param3, float param4,
float param5, float param6, float param7) override
{
return send(hrt_absolute_time());
}
private:
uORB::Subscription _armed_sub{ORB_ID(actuator_armed)};

View File

@ -36,11 +36,6 @@ public:
return MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES;
}
bool request_message(float param2, float param3, float param4,
float param5, float param6, float param7) override
{
return send(hrt_absolute_time());
}
private:
/* do not allow top copying this class */
MavlinkStreamProtocolVersion(MavlinkStreamProtocolVersion &) = delete;