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
|
|
|
|
2018-06-13 07:29:52 -03:00
|
|
|
const AP_FWVersion AP_FWVersion::fwver
|
2017-08-18 20:07:42 -03:00
|
|
|
{
|
|
|
|
major: 3,
|
|
|
|
minor: 1,
|
|
|
|
patch: 4,
|
|
|
|
fw_type: FIRMWARE_VERSION_TYPE_DEV,
|
2017-11-26 21:18:54 -04:00
|
|
|
fw_string: "Dummy GCS",
|
|
|
|
fw_hash_str: "",
|
2019-06-13 23:36:21 -03:00
|
|
|
middleware_name: "",
|
2017-11-26 21:18:54 -04:00
|
|
|
middleware_hash_str: "",
|
2019-06-13 23:36:21 -03:00
|
|
|
os_name: "",
|
2017-11-26 21:18:54 -04:00
|
|
|
os_hash_str: "",
|
|
|
|
os_sw_version: 0
|
2017-08-18 20:07:42 -03:00
|
|
|
};
|
|
|
|
|
2018-05-20 23:18:57 -03:00
|
|
|
const struct GCS_MAVLINK::stream_entries GCS_MAVLINK::all_stream_entries[] {};
|
|
|
|
|
2017-07-02 19:58:45 -03:00
|
|
|
/*
|
|
|
|
* GCS backend used for many examples and tools
|
|
|
|
*/
|
|
|
|
class GCS_MAVLINK_Dummy : public GCS_MAVLINK
|
|
|
|
{
|
|
|
|
uint32_t telem_delay() const override { return 0; }
|
2019-07-11 05:31:45 -03:00
|
|
|
void handleMessage(const mavlink_message_t &msg) override {}
|
2019-04-16 01:13:17 -03:00
|
|
|
bool try_send_message(enum ap_message id) override { return true; }
|
2017-07-02 19:58:45 -03:00
|
|
|
bool handle_guided_request(AP_Mission::Mission_Command &cmd) override { return true; }
|
|
|
|
void handle_change_alt_request(AP_Mission::Mission_Command &cmd) override {}
|
2017-07-08 06:09:06 -03:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2017-07-12 04:21:15 -03:00
|
|
|
uint8_t sysid_my_gcs() const override { return 1; }
|
2017-08-11 02:52:09 -03:00
|
|
|
bool set_mode(uint8_t mode) override { return false; };
|
2017-07-08 06:09:06 -03:00
|
|
|
|
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; }
|
|
|
|
MAV_STATE system_status() const override { return MAV_STATE_CALIBRATING; }
|
|
|
|
|
2018-07-05 21:56:06 -03:00
|
|
|
bool set_home_to_current_location(bool lock) override { return false; }
|
|
|
|
bool set_home(const Location& loc, bool lock) override { return false; }
|
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 {};
|
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
|
|
|
|
{
|
|
|
|
GCS_MAVLINK_Dummy dummy_backend;
|
|
|
|
uint8_t num_gcs() const override { return 1; }
|
2017-07-08 04:58:51 -03:00
|
|
|
GCS_MAVLINK_Dummy &chan(const uint8_t ofs) override { return dummy_backend; }
|
|
|
|
const GCS_MAVLINK_Dummy &chan(const uint8_t ofs) const override { return dummy_backend; };
|
2017-07-02 19:58:45 -03:00
|
|
|
|
2019-04-16 01:13:17 -03:00
|
|
|
void send_statustext(MAV_SEVERITY severity, uint8_t dest_bitmask, const char *text) override { hal.console->printf("TOGCS: %s\n", text); }
|
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
|
|
|
};
|