Line data Source code
1 : #include "GCS_config.h" 2 : 3 : #if HAL_GCS_ENABLED 4 : 5 : #include "GCS.h" 6 : #include <AP_Common/AP_FWVersion.h> 7 : 8 : #define THISFIRMWARE "GCSDummy V3.1.4-dev" 9 : 10 : #define FW_MAJOR 3 11 : #define FW_MINOR 1 12 : #define FW_PATCH 4 13 : #define FW_TYPE FIRMWARE_VERSION_TYPE_DEV 14 : 15 : /* 16 : * GCS backend used for many examples and tools 17 : */ 18 : class GCS_MAVLINK_Dummy : public GCS_MAVLINK 19 : { 20 : public: 21 : 22 : using GCS_MAVLINK::GCS_MAVLINK; 23 : 24 : private: 25 : 26 0 : bool try_send_message(enum ap_message id) override { return true; } 27 : 28 : protected: 29 : 30 : // dummy information: 31 0 : uint8_t base_mode() const override { return (uint8_t)MAV_MODE_FLAG_CUSTOM_MODE_ENABLED; } 32 0 : MAV_STATE vehicle_system_status() const override { return MAV_STATE_CALIBRATING; } 33 : 34 0 : void send_nav_controller_output() const override {}; 35 0 : void send_pid_tuning() override {}; 36 0 : uint8_t send_available_mode(uint8_t index) const override { return 0; } 37 : }; 38 : 39 : /* 40 : * a GCS singleton used for many example sketches and tools 41 : */ 42 : 43 : extern const AP_HAL::HAL& hal; 44 : 45 : class GCS_Dummy : public GCS 46 : { 47 : public: 48 : 49 : using GCS::GCS; 50 : 51 : protected: 52 : 53 0 : GCS_MAVLINK_Dummy *new_gcs_mavlink_backend(AP_HAL::UARTDriver &uart) override { 54 0 : return NEW_NOTHROW GCS_MAVLINK_Dummy(uart); 55 : } 56 : 57 : private: 58 : // the following define expands to a pair of methods to retrieve a 59 : // pointer to an object of the correct subclass for the link at 60 : // offset ofs. These are of the form: 61 : // GCS_MAVLINK_XXXX *chan(const uint8_t ofs) override; 62 : // const GCS_MAVLINK_XXXX *chan(const uint8_t ofs) override const; 63 480 : GCS_MAVLINK_CHAN_METHOD_DEFINITIONS(GCS_MAVLINK_Dummy); 64 : 65 : void send_textv(MAV_SEVERITY severity, const char *fmt, va_list arg_list, mavlink_channel_mask_t dest_bitmask) override; 66 : 67 0 : MAV_TYPE frame_type() const override { return MAV_TYPE_FIXED_WING; } 68 0 : uint32_t custom_mode() const override { return 3; } // magic number 69 : }; 70 : 71 : #endif // HAL_GCS_ENABLED