mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 00:03:34 +08:00
mavlink: address review comments
This commit is contained in:
@@ -71,13 +71,17 @@ public:
|
||||
}
|
||||
private:
|
||||
uORB::Subscription _armed_sub{ORB_ID(actuator_armed)};
|
||||
param_t _param_com_flight_uuid;
|
||||
|
||||
/* do not allow top copying this class */
|
||||
MavlinkStreamFlightInformation(MavlinkStreamFlightInformation &) = delete;
|
||||
MavlinkStreamFlightInformation &operator = (const MavlinkStreamFlightInformation &) = delete;
|
||||
protected:
|
||||
explicit MavlinkStreamFlightInformation(Mavlink *mavlink) : MavlinkStream(mavlink)
|
||||
{}
|
||||
{
|
||||
|
||||
_param_com_flight_uuid = param_find("COM_FLIGHT_UUID");
|
||||
}
|
||||
|
||||
bool send(const hrt_abstime t) override
|
||||
{
|
||||
@@ -85,9 +89,8 @@ protected:
|
||||
bool ret = _armed_sub.copy(&actuator_armed);
|
||||
|
||||
if (ret && actuator_armed.timestamp != 0) {
|
||||
const param_t param_com_flight_uuid = param_find("COM_FLIGHT_UUID");
|
||||
int32_t flight_uuid;
|
||||
param_get(param_com_flight_uuid, &flight_uuid);
|
||||
param_get(_param_com_flight_uuid, &flight_uuid);
|
||||
|
||||
mavlink_flight_information_t flight_info{};
|
||||
flight_info.flight_uuid = static_cast<uint64_t>(flight_uuid);
|
||||
|
||||
@@ -80,11 +80,11 @@ public:
|
||||
bool request_message(float param2, float param3, float param4,
|
||||
float param5, float param6, float param7) override
|
||||
{
|
||||
storage_id = (int)roundf(param2);
|
||||
_storage_id = (int)roundf(param2);
|
||||
return send(hrt_absolute_time());
|
||||
}
|
||||
private:
|
||||
int storage_id = 0;
|
||||
int _storage_id = 0;
|
||||
|
||||
/* do not allow top copying this class */
|
||||
MavlinkStreamStorageInformation(MavlinkStreamStorageInformation &) = delete;
|
||||
@@ -100,7 +100,7 @@ protected:
|
||||
mavlink_storage_information_t storage_info{};
|
||||
const char *microsd_dir = PX4_STORAGEDIR;
|
||||
|
||||
if (storage_id == 0 || storage_id == 1) { // request is for all or the first storage
|
||||
if (_storage_id == 0 || _storage_id == 1) { // request is for all or the first storage
|
||||
storage_info.storage_id = 1;
|
||||
|
||||
struct statfs statfs_buf;
|
||||
|
||||
Reference in New Issue
Block a user