Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/Tools/AP_Periph/GCS_MAVLink.cpp
Views: 1798
/*1This program is free software: you can redistribute it and/or modify2it under the terms of the GNU General Public License as published by3the Free Software Foundation, either version 3 of the License, or4(at your option) any later version.56This program is distributed in the hope that it will be useful,7but WITHOUT ANY WARRANTY; without even the implied warranty of8MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9GNU General Public License for more details.1011You should have received a copy of the GNU General Public License12along with this program. If not, see <http://www.gnu.org/licenses/>.13*/1415#include "GCS_MAVLink.h"16#include <AP_HAL/AP_HAL_Boards.h>17#include "AP_Periph.h"18#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS19#include <hal.h>20#endif2122#if HAL_GCS_ENABLED2324static const ap_message STREAM_RAW_SENSORS_msgs[] = {25MSG_RAW_IMU26};27static const ap_message STREAM_EXTENDED_STATUS_msgs[] = {28MSG_SYS_STATUS,29MSG_POWER_STATUS,30#if HAL_WITH_MCU_MONITORING31MSG_MCU_STATUS,32#endif33MSG_MEMINFO,34#if AP_GPS_GPS_RAW_INT_SENDING_ENABLED35MSG_GPS_RAW,36#endif37#if AP_GPS_GPS_RTK_SENDING_ENABLED38MSG_GPS_RTK,39#endif40};4142static const ap_message STREAM_POSITION_msgs[] = {43#if AP_AHRS_ENABLED44MSG_LOCATION,45MSG_LOCAL_POSITION46#endif47};4849static const ap_message STREAM_PARAMS_msgs[] = {50MSG_NEXT_PARAM51};5253const struct GCS_MAVLINK::stream_entries GCS_MAVLINK::all_stream_entries[] = {54MAV_STREAM_ENTRY(STREAM_RAW_SENSORS),55MAV_STREAM_ENTRY(STREAM_POSITION),56MAV_STREAM_ENTRY(STREAM_EXTENDED_STATUS),57MAV_STREAM_ENTRY(STREAM_PARAMS),58MAV_STREAM_TERMINATOR // must have this at end of stream_entries59};6061const struct AP_Param::GroupInfo GCS_MAVLINK_Parameters::var_info[] = {62AP_GROUPEND63};6465uint8_t GCS_MAVLINK_Periph::sysid_my_gcs() const66{67return periph.g.sysid_this_mav;68}6970uint8_t GCS_Periph::sysid_this_mav() const71{72return periph.g.sysid_this_mav;73}7475MAV_RESULT GCS_MAVLINK_Periph::handle_preflight_reboot(const mavlink_command_int_t &packet, const mavlink_message_t &msg)76{77hal.scheduler->delay(10);78periph.prepare_reboot();79#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS80NVIC_SystemReset();81#elif CONFIG_HAL_BOARD == HAL_BOARD_SITL82HAL_SITL::actually_reboot();83#endif84}8586#endif // #if HAL_GCS_ENABLED878889