diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a118c206..48852230 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,9 +6,9 @@ // also: need to run obcpp with sudo or add tuas user to dialout group with // `sudo usermod -aG dialout tuas && newgrp && bash` // "runArgs": ["--device=/dev/ttyACM0"], - "runArgs": [ - "--network=host" - ], + // "runArgs": [ + // "--network=host" + // ], "customizations": { "vscode": { diff --git a/protos b/protos index abe95730..c5841043 160000 --- a/protos +++ b/protos @@ -1 +1 @@ -Subproject commit abe95730634b146f39fb5127ee96bac511e9cbd5 +Subproject commit c5841043ba805c065997232b5a6ae281873d9969 diff --git a/src/network/gcs.cpp b/src/network/gcs.cpp index 956ac1d6..970c7c3c 100644 --- a/src/network/gcs.cpp +++ b/src/network/gcs.cpp @@ -48,6 +48,10 @@ GCSServer::~GCSServer() { } void GCSServer::_bindHandlers() { + this->server.Get("/", [](const httplib::Request& request, httplib::Response& response) { + response.status = 200; + response.set_content("Fort-nite", "text/plain"); + }); BIND_HANDLER(Get, connections); BIND_HANDLER(Get, tick); BIND_HANDLER(Get, mission); diff --git a/src/network/gcs_routes.cpp b/src/network/gcs_routes.cpp index 6c3f78b7..d2b29ad3 100644 --- a/src/network/gcs_routes.cpp +++ b/src/network/gcs_routes.cpp @@ -39,8 +39,26 @@ using namespace std::chrono_literals; DEF_GCS_HANDLE(Get, connections) { LOG_REQUEST("GET", "/connections"); - auto lost_airdrop_conns = state->getAirdrop()->getLostConnections(3s); - auto mav_conn = state->getMav()->get_conn_status(); + std::list> lost_airdrop_conns; + if (state->getAirdrop() == nullptr) { + lost_airdrop_conns.push_back({BottleDropIndex::A, 99999ms}); + lost_airdrop_conns.push_back({BottleDropIndex::B, 99999ms}); + lost_airdrop_conns.push_back({BottleDropIndex::C, 99999ms}); + lost_airdrop_conns.push_back({BottleDropIndex::D, 99999ms}); + lost_airdrop_conns.push_back({BottleDropIndex::E, 99999ms}); + } else { + lost_airdrop_conns = state->getAirdrop()->getLostConnections(3s); + } + + mavsdk::Telemetry::RcStatus mav_conn; + + if (state->getMav() == nullptr) { + mav_conn.is_available = false; + mav_conn.signal_strength_percent = 0.1; + } else { + mav_conn = state->getMav()->get_conn_status(); + } + // TODO: query the camera status bool camera_good = false;