GCS_MAVLink: move initialisation of serial and gcs to AP_Vehicle

This commit is contained in:
Peter Barker 2020-02-12 12:01:17 +11:00 committed by Andrew Tridgell
parent 2ede027635
commit 727c12c388
4 changed files with 11 additions and 0 deletions

View File

@ -33,6 +33,11 @@ const MAV_MISSION_TYPE GCS_MAVLINK::supported_mission_types[] = {
MAV_MISSION_TYPE_FENCE,
};
void GCS::init()
{
mavlink_system.sysid = sysid_this_mav();
}
/*
send a text message to all GCS
*/

View File

@ -870,6 +870,7 @@ public:
return 200;
}
void init();
void setup_console();
void setup_uarts();
@ -908,6 +909,8 @@ public:
protected:
virtual uint8_t sysid_this_mav() const = 0;
virtual GCS_MAVLINK *new_gcs_mavlink_backend(GCS_MAVLINK_Parameters &params,
AP_HAL::UARTDriver &uart) = 0;

View File

@ -64,6 +64,8 @@ public:
protected:
uint8_t sysid_this_mav() const override { return 1; }
GCS_MAVLINK_Dummy *new_gcs_mavlink_backend(GCS_MAVLINK_Parameters &params,
AP_HAL::UARTDriver &uart) override {
return new GCS_MAVLINK_Dummy(params, uart);

View File

@ -28,6 +28,7 @@ static MAVLink_routing routing;
void setup(void)
{
hal.console->printf("routing test startup...");
gcs().init();
gcs().setup_console();
}