2023-09-02 02:21:36 -03:00
|
|
|
#include "GCS_config.h"
|
|
|
|
|
|
|
|
#if HAL_GCS_ENABLED
|
|
|
|
|
2017-07-02 19:58:45 -03:00
|
|
|
#include "GCS.h"
|
2019-04-04 07:49:44 -03:00
|
|
|
#include <AP_Common/AP_FWVersion.h>
|
2017-07-02 19:58:45 -03:00
|
|
|
|
2020-09-24 12:17:58 -03:00
|
|
|
#define THISFIRMWARE "GCSDummy V3.1.4-dev"
|
|
|
|
|
|
|
|
#define FW_MAJOR 3
|
|
|
|
#define FW_MINOR 1
|
|
|
|
#define FW_PATCH 4
|
|
|
|
#define FW_TYPE FIRMWARE_VERSION_TYPE_DEV
|
|
|
|
|
2017-07-02 19:58:45 -03:00
|
|
|
/*
|
|
|
|
* GCS backend used for many examples and tools
|
|
|
|
*/
|
|
|
|
class GCS_MAVLINK_Dummy : public GCS_MAVLINK
|
|
|
|
{
|
2018-12-10 03:56:32 -04:00
|
|
|
public:
|
|
|
|
|
|
|
|
using GCS_MAVLINK::GCS_MAVLINK;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2017-07-02 19:58:45 -03:00
|
|
|
uint32_t telem_delay() const override { return 0; }
|
2019-04-16 01:13:17 -03:00
|
|
|
bool try_send_message(enum ap_message id) override { return true; }
|
2023-06-01 20:24:02 -03:00
|
|
|
uint8_t sysid_my_gcs() const override { return 1; }
|
2017-07-08 06:09:06 -03:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2018-03-22 05:49:33 -03:00
|
|
|
// dummy information:
|
|
|
|
MAV_MODE base_mode() const override { return (MAV_MODE)MAV_MODE_FLAG_CUSTOM_MODE_ENABLED; }
|
2019-11-24 17:24:44 -04:00
|
|
|
MAV_STATE vehicle_system_status() const override { return MAV_STATE_CALIBRATING; }
|
2018-03-22 05:49:33 -03:00
|
|
|
|
2018-05-04 21:07:59 -03:00
|
|
|
void send_nav_controller_output() const override {};
|
2019-02-28 19:24:13 -04:00
|
|
|
void send_pid_tuning() override {};
|
2024-11-09 07:45:20 -04:00
|
|
|
uint8_t send_available_mode(uint8_t index) const override { return 0; }
|
2017-07-02 19:58:45 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* a GCS singleton used for many example sketches and tools
|
|
|
|
*/
|
|
|
|
|
|
|
|
extern const AP_HAL::HAL& hal;
|
|
|
|
|
|
|
|
class GCS_Dummy : public GCS
|
|
|
|
{
|
2018-12-10 03:56:32 -04:00
|
|
|
public:
|
|
|
|
|
|
|
|
using GCS::GCS;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2020-02-11 21:01:17 -04:00
|
|
|
uint8_t sysid_this_mav() const override { return 1; }
|
|
|
|
|
2018-12-10 03:56:32 -04:00
|
|
|
GCS_MAVLINK_Dummy *new_gcs_mavlink_backend(GCS_MAVLINK_Parameters ¶ms,
|
|
|
|
AP_HAL::UARTDriver &uart) override {
|
2024-05-26 22:24:15 -03:00
|
|
|
return NEW_NOTHROW GCS_MAVLINK_Dummy(params, uart);
|
2018-12-10 03:56:32 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2022-12-13 21:14:18 -04:00
|
|
|
// the following define expands to a pair of methods to retrieve a
|
|
|
|
// pointer to an object of the correct subclass for the link at
|
|
|
|
// offset ofs. These are of the form:
|
|
|
|
// GCS_MAVLINK_XXXX *chan(const uint8_t ofs) override;
|
|
|
|
// const GCS_MAVLINK_XXXX *chan(const uint8_t ofs) override const;
|
|
|
|
GCS_MAVLINK_CHAN_METHOD_DEFINITIONS(GCS_MAVLINK_Dummy);
|
2017-07-02 19:58:45 -03:00
|
|
|
|
2020-11-08 23:51:13 -04:00
|
|
|
void send_textv(MAV_SEVERITY severity, const char *fmt, va_list arg_list, uint8_t dest_bitmask) override;
|
2019-02-13 20:39:32 -04:00
|
|
|
|
2019-02-12 07:54:24 -04:00
|
|
|
MAV_TYPE frame_type() const override { return MAV_TYPE_FIXED_WING; }
|
|
|
|
uint32_t custom_mode() const override { return 3; } // magic number
|
2017-07-02 19:58:45 -03:00
|
|
|
};
|
2023-09-02 02:21:36 -03:00
|
|
|
|
|
|
|
#endif // HAL_GCS_ENABLED
|