From 59fdea8ee5cbfc4b65c6db7cab804719f0f37ca9 Mon Sep 17 00:00:00 2001 From: "pienk@planet.nl" Date: Mon, 20 May 2013 21:41:16 +0000 Subject: [PATCH] [Mavlink] Added battery status and mode menus. Synced mavlink library with official repository. --- .../include/ardupilotmega/ardupilotmega.h | 150 - .../include/ardupilotmega/mavlink.h | 27 - .../ardupilotmega/mavlink_msg_ap_adc.h | 254 -- .../mavlink_msg_digicam_configure.h | 364 -- .../mavlink_msg_digicam_control.h | 342 -- .../mavlink_msg_fence_fetch_point.h | 188 - .../ardupilotmega/mavlink_msg_fence_point.h | 254 -- .../ardupilotmega/mavlink_msg_fence_status.h | 210 - .../mavlink_msg_fenced_fetch_point.h | 144 - .../ardupilotmega/mavlink_msg_fenced_point.h | 210 - .../ardupilotmega/mavlink_msg_meminfo.h | 166 - .../mavlink_msg_mount_configure.h | 254 -- .../ardupilotmega/mavlink_msg_mount_control.h | 254 -- .../ardupilotmega/mavlink_msg_mount_status.h | 232 -- .../mavlink_msg_sensor_offsets.h | 386 -- .../mavlink_msg_set_mag_offsets.h | 232 -- .../include/ardupilotmega/testsuite.h | 690 --- .../include/ardupilotmega/version.h | 12 - src/GCS_MAVLink/include/checksum.h | 89 - src/GCS_MAVLink/include/common/common.h | 159 - src/GCS_MAVLink/include/common/mavlink.h | 27 - .../include/common/mavlink_msg_action.h | 188 - .../include/common/mavlink_msg_action_ack.h | 166 - .../include/common/mavlink_msg_attitude.h | 276 -- .../include/common/mavlink_msg_auth_key.h | 144 - .../include/common/mavlink_msg_boot.h | 144 - .../mavlink_msg_change_operator_control.h | 204 - .../mavlink_msg_change_operator_control_ack.h | 188 - .../include/common/mavlink_msg_command.h | 298 -- .../include/common/mavlink_msg_command_ack.h | 166 - .../common/mavlink_msg_control_status.h | 298 -- .../include/common/mavlink_msg_debug.h | 166 - .../include/common/mavlink_msg_debug_vect.h | 226 - .../common/mavlink_msg_global_position.h | 276 -- .../common/mavlink_msg_global_position_int.h | 254 -- .../common/mavlink_msg_gps_local_origin_set.h | 188 - .../include/common/mavlink_msg_gps_raw.h | 320 -- .../include/common/mavlink_msg_gps_raw_int.h | 320 -- .../mavlink_msg_gps_set_global_origin.h | 232 -- .../include/common/mavlink_msg_gps_status.h | 252 -- .../include/common/mavlink_msg_heartbeat.h | 185 - .../include/common/mavlink_msg_hil_controls.h | 276 -- .../include/common/mavlink_msg_hil_state.h | 474 --- .../common/mavlink_msg_local_position.h | 276 -- .../mavlink_msg_local_position_setpoint.h | 210 - .../mavlink_msg_local_position_setpoint_set.h | 254 -- .../common/mavlink_msg_manual_control.h | 320 -- .../common/mavlink_msg_named_value_float.h | 160 - .../common/mavlink_msg_named_value_int.h | 160 - .../mavlink_msg_nav_controller_output.h | 298 -- .../mavlink_msg_object_detection_event.h | 270 -- .../include/common/mavlink_msg_optical_flow.h | 254 -- .../common/mavlink_msg_param_request_list.h | 166 - .../common/mavlink_msg_param_request_read.h | 204 - .../include/common/mavlink_msg_param_set.h | 204 - .../include/common/mavlink_msg_param_value.h | 204 - .../include/common/mavlink_msg_ping.h | 210 - .../common/mavlink_msg_position_target.h | 210 - .../include/common/mavlink_msg_raw_imu.h | 342 -- .../include/common/mavlink_msg_raw_pressure.h | 232 -- .../common/mavlink_msg_rc_channels_override.h | 342 -- .../common/mavlink_msg_rc_channels_raw.h | 320 -- .../common/mavlink_msg_rc_channels_scaled.h | 320 -- .../common/mavlink_msg_request_data_stream.h | 232 -- ...msg_roll_pitch_yaw_speed_thrust_setpoint.h | 232 -- ...vlink_msg_roll_pitch_yaw_thrust_setpoint.h | 232 -- .../common/mavlink_msg_safety_allowed_area.h | 276 -- .../mavlink_msg_safety_set_allowed_area.h | 320 -- .../include/common/mavlink_msg_scaled_imu.h | 342 -- .../common/mavlink_msg_scaled_pressure.h | 210 - .../common/mavlink_msg_servo_output_raw.h | 298 -- .../include/common/mavlink_msg_set_altitude.h | 166 - .../include/common/mavlink_msg_set_mode.h | 166 - .../include/common/mavlink_msg_set_nav_mode.h | 166 - ...link_msg_set_roll_pitch_yaw_speed_thrust.h | 254 -- .../mavlink_msg_set_roll_pitch_yaw_thrust.h | 254 -- .../common/mavlink_msg_state_correction.h | 320 -- .../include/common/mavlink_msg_statustext.h | 160 - .../include/common/mavlink_msg_sys_status.h | 276 -- .../include/common/mavlink_msg_system_time.h | 144 - .../common/mavlink_msg_system_time_utc.h | 166 - .../include/common/mavlink_msg_vfr_hud.h | 254 -- .../include/common/mavlink_msg_waypoint.h | 430 -- .../include/common/mavlink_msg_waypoint_ack.h | 188 - .../common/mavlink_msg_waypoint_clear_all.h | 166 - .../common/mavlink_msg_waypoint_count.h | 188 - .../common/mavlink_msg_waypoint_current.h | 144 - .../common/mavlink_msg_waypoint_reached.h | 144 - .../common/mavlink_msg_waypoint_request.h | 188 - .../mavlink_msg_waypoint_request_list.h | 166 - .../common/mavlink_msg_waypoint_set_current.h | 188 - src/GCS_MAVLink/include/common/testsuite.h | 3700 ----------------- src/GCS_MAVLink/include/common/version.h | 12 - src/GCS_MAVLink/include/mavlink_helpers.h | 488 --- src/GCS_MAVLink/include/mavlink_types.h | 298 -- src/GCS_MAVLink/include/protocol.h | 319 -- .../ardupilotmega/mavlink_msg_ahrs.h | 43 +- .../ardupilotmega/mavlink_msg_ap_adc.h | 43 +- .../ardupilotmega/mavlink_msg_data16.h | 43 +- .../ardupilotmega/mavlink_msg_data32.h | 43 +- .../ardupilotmega/mavlink_msg_data64.h | 43 +- .../ardupilotmega/mavlink_msg_data96.h | 43 +- .../mavlink_msg_digicam_configure.h | 43 +- .../mavlink_msg_digicam_control.h | 43 +- .../mavlink_msg_fence_fetch_point.h | 43 +- .../ardupilotmega/mavlink_msg_fence_point.h | 43 +- .../ardupilotmega/mavlink_msg_fence_status.h | 43 +- .../ardupilotmega/mavlink_msg_hwstatus.h | 43 +- .../ardupilotmega/mavlink_msg_limits_status.h | 43 +- .../ardupilotmega/mavlink_msg_meminfo.h | 43 +- .../mavlink_msg_mount_configure.h | 43 +- .../ardupilotmega/mavlink_msg_mount_control.h | 43 +- .../ardupilotmega/mavlink_msg_mount_status.h | 43 +- .../ardupilotmega/mavlink_msg_radio.h | 43 +- .../ardupilotmega/mavlink_msg_rangefinder.h | 43 +- .../mavlink_msg_sensor_offsets.h | 43 +- .../mavlink_msg_set_mag_offsets.h | 43 +- .../ardupilotmega/mavlink_msg_simstate.h | 43 +- .../ardupilotmega/mavlink_msg_wind.h | 43 +- .../include_v1.0/ardupilotmega/version.h | 2 +- src/GCS_MAVLink/include_v1.0/common/common.h | 3 +- .../common/mavlink_msg_attitude.h | 43 +- .../common/mavlink_msg_attitude_quaternion.h | 43 +- .../common/mavlink_msg_auth_key.h | 43 +- .../common/mavlink_msg_battery_status.h | 43 +- .../mavlink_msg_change_operator_control.h | 43 +- .../mavlink_msg_change_operator_control_ack.h | 43 +- .../common/mavlink_msg_command_ack.h | 43 +- .../common/mavlink_msg_command_long.h | 43 +- .../common/mavlink_msg_data_stream.h | 43 +- .../include_v1.0/common/mavlink_msg_debug.h | 43 +- .../common/mavlink_msg_debug_vect.h | 43 +- .../mavlink_msg_file_transfer_dir_list.h | 43 +- .../common/mavlink_msg_file_transfer_res.h | 43 +- .../common/mavlink_msg_file_transfer_start.h | 43 +- .../common/mavlink_msg_global_position_int.h | 43 +- ...mavlink_msg_global_position_setpoint_int.h | 73 +- ...link_msg_global_vision_position_estimate.h | 43 +- .../common/mavlink_msg_gps_global_origin.h | 73 +- .../common/mavlink_msg_gps_raw_int.h | 73 +- .../common/mavlink_msg_gps_status.h | 43 +- .../common/mavlink_msg_heartbeat.h | 43 +- .../common/mavlink_msg_highres_imu.h | 43 +- .../common/mavlink_msg_hil_controls.h | 43 +- .../common/mavlink_msg_hil_rc_inputs_raw.h | 43 +- .../common/mavlink_msg_hil_state.h | 43 +- .../common/mavlink_msg_local_position_ned.h | 43 +- ..._local_position_ned_system_global_offset.h | 43 +- .../mavlink_msg_local_position_setpoint.h | 43 +- .../common/mavlink_msg_manual_control.h | 43 +- .../common/mavlink_msg_manual_setpoint.h | 43 +- .../common/mavlink_msg_memory_vect.h | 43 +- .../common/mavlink_msg_mission_ack.h | 43 +- .../common/mavlink_msg_mission_clear_all.h | 43 +- .../common/mavlink_msg_mission_count.h | 43 +- .../common/mavlink_msg_mission_current.h | 43 +- .../common/mavlink_msg_mission_item.h | 43 +- .../common/mavlink_msg_mission_item_reached.h | 43 +- .../common/mavlink_msg_mission_request.h | 43 +- .../common/mavlink_msg_mission_request_list.h | 43 +- ...mavlink_msg_mission_request_partial_list.h | 43 +- .../common/mavlink_msg_mission_set_current.h | 43 +- .../mavlink_msg_mission_write_partial_list.h | 43 +- .../common/mavlink_msg_named_value_float.h | 43 +- .../common/mavlink_msg_named_value_int.h | 43 +- .../mavlink_msg_nav_controller_output.h | 43 +- .../common/mavlink_msg_omnidirectional_flow.h | 43 +- .../common/mavlink_msg_optical_flow.h | 43 +- .../common/mavlink_msg_param_request_list.h | 43 +- .../common/mavlink_msg_param_request_read.h | 43 +- .../common/mavlink_msg_param_set.h | 43 +- .../common/mavlink_msg_param_value.h | 43 +- .../include_v1.0/common/mavlink_msg_ping.h | 43 +- .../include_v1.0/common/mavlink_msg_raw_imu.h | 43 +- .../common/mavlink_msg_raw_pressure.h | 43 +- .../common/mavlink_msg_rc_channels_override.h | 43 +- .../common/mavlink_msg_rc_channels_raw.h | 43 +- .../common/mavlink_msg_rc_channels_scaled.h | 43 +- .../common/mavlink_msg_request_data_stream.h | 43 +- ...msg_roll_pitch_yaw_rates_thrust_setpoint.h | 43 +- ...msg_roll_pitch_yaw_speed_thrust_setpoint.h | 43 +- ...vlink_msg_roll_pitch_yaw_thrust_setpoint.h | 43 +- .../common/mavlink_msg_safety_allowed_area.h | 43 +- .../mavlink_msg_safety_set_allowed_area.h | 43 +- .../common/mavlink_msg_scaled_imu.h | 43 +- .../common/mavlink_msg_scaled_pressure.h | 43 +- .../common/mavlink_msg_servo_output_raw.h | 43 +- ...ink_msg_set_global_position_setpoint_int.h | 73 +- .../mavlink_msg_set_gps_global_origin.h | 73 +- .../mavlink_msg_set_local_position_setpoint.h | 43 +- .../common/mavlink_msg_set_mode.h | 43 +- .../mavlink_msg_set_quad_motors_setpoint.h | 43 +- ...set_quad_swarm_led_roll_pitch_yaw_thrust.h | 43 +- ...msg_set_quad_swarm_roll_pitch_yaw_thrust.h | 43 +- ...link_msg_set_roll_pitch_yaw_speed_thrust.h | 43 +- .../mavlink_msg_set_roll_pitch_yaw_thrust.h | 43 +- .../common/mavlink_msg_setpoint_6dof.h | 43 +- .../common/mavlink_msg_setpoint_8dof.h | 43 +- .../common/mavlink_msg_state_correction.h | 43 +- .../common/mavlink_msg_statustext.h | 43 +- .../common/mavlink_msg_sys_status.h | 43 +- .../common/mavlink_msg_system_time.h | 43 +- .../include_v1.0/common/mavlink_msg_vfr_hud.h | 43 +- .../mavlink_msg_vicon_position_estimate.h | 43 +- .../mavlink_msg_vision_position_estimate.h | 43 +- .../mavlink_msg_vision_speed_estimate.h | 43 +- src/GCS_MAVLink/include_v1.0/common/version.h | 2 +- .../include_v1.0/mavlink_helpers.h | 2 +- src/GCS_MAVLink/include_v1.0/mavlink_types.h | 3 + src/GCS_MAVLink/include_v1.0/protocol.h | 2 + .../message_definitions/ardupilotmega.xml | 229 - .../message_definitions/common.xml | 941 ----- .../message_definitions/common_slugs.xml | 227 - .../mavlink_standard_proposal.xml | 275 -- .../message_definitions/minimal.xml | 13 - .../message_definitions/pixhawk.xml | 227 - src/GCS_MAVLink/message_definitions/slugs.xml | 144 - .../message_definitions/slugs_ap.xml | 152 - src/GCS_MAVLink/message_definitions/test.xml | 31 - .../message_definitions/ualberta.xml | 54 - .../message_definitions_v1.0/autoquad.xml | 103 + .../message_definitions_v1.0/common.xml | 33 +- src/gui/view_mavlink.cpp | 146 +- src/gui/view_mavlink.h | 6 + src/serial.cpp | 2 +- src/telemetry/mavlink.cpp | 35 +- src/telemetry/mavlink.h | 49 +- 227 files changed, 3774 insertions(+), 29629 deletions(-) delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/ardupilotmega.h delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/mavlink.h delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_ap_adc.h delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_digicam_configure.h delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_digicam_control.h delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_fetch_point.h delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_point.h delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_status.h delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fenced_fetch_point.h delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fenced_point.h delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_meminfo.h delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_configure.h delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_control.h delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_status.h delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_sensor_offsets.h delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_set_mag_offsets.h delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/testsuite.h delete mode 100644 src/GCS_MAVLink/include/ardupilotmega/version.h delete mode 100644 src/GCS_MAVLink/include/checksum.h delete mode 100644 src/GCS_MAVLink/include/common/common.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_action.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_action_ack.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_attitude.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_auth_key.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_boot.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_change_operator_control.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_change_operator_control_ack.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_command.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_command_ack.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_control_status.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_debug.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_debug_vect.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_global_position.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_global_position_int.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_gps_local_origin_set.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_gps_raw.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_gps_raw_int.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_gps_set_global_origin.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_gps_status.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_heartbeat.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_hil_controls.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_hil_state.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_local_position.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_local_position_setpoint.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_local_position_setpoint_set.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_manual_control.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_named_value_float.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_named_value_int.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_nav_controller_output.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_object_detection_event.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_optical_flow.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_param_request_list.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_param_request_read.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_param_set.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_param_value.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_ping.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_position_target.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_raw_imu.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_raw_pressure.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_rc_channels_override.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_rc_channels_raw.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_rc_channels_scaled.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_request_data_stream.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_safety_allowed_area.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_safety_set_allowed_area.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_scaled_imu.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_scaled_pressure.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_servo_output_raw.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_set_altitude.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_set_mode.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_set_nav_mode.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_set_roll_pitch_yaw_thrust.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_state_correction.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_statustext.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_sys_status.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_system_time.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_system_time_utc.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_vfr_hud.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_waypoint.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_waypoint_ack.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_waypoint_clear_all.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_waypoint_count.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_waypoint_current.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_waypoint_reached.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_waypoint_request.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_waypoint_request_list.h delete mode 100644 src/GCS_MAVLink/include/common/mavlink_msg_waypoint_set_current.h delete mode 100644 src/GCS_MAVLink/include/common/testsuite.h delete mode 100644 src/GCS_MAVLink/include/common/version.h delete mode 100644 src/GCS_MAVLink/include/mavlink_helpers.h delete mode 100644 src/GCS_MAVLink/include/mavlink_types.h delete mode 100644 src/GCS_MAVLink/include/protocol.h delete mode 100644 src/GCS_MAVLink/message_definitions/ardupilotmega.xml delete mode 100644 src/GCS_MAVLink/message_definitions/common.xml delete mode 100644 src/GCS_MAVLink/message_definitions/common_slugs.xml delete mode 100644 src/GCS_MAVLink/message_definitions/mavlink_standard_proposal.xml delete mode 100644 src/GCS_MAVLink/message_definitions/minimal.xml delete mode 100644 src/GCS_MAVLink/message_definitions/pixhawk.xml delete mode 100644 src/GCS_MAVLink/message_definitions/slugs.xml delete mode 100644 src/GCS_MAVLink/message_definitions/slugs_ap.xml delete mode 100644 src/GCS_MAVLink/message_definitions/test.xml delete mode 100644 src/GCS_MAVLink/message_definitions/ualberta.xml create mode 100644 src/GCS_MAVLink/message_definitions_v1.0/autoquad.xml diff --git a/src/GCS_MAVLink/include/ardupilotmega/ardupilotmega.h b/src/GCS_MAVLink/include/ardupilotmega/ardupilotmega.h deleted file mode 100644 index 9192bacf0..000000000 --- a/src/GCS_MAVLink/include/ardupilotmega/ardupilotmega.h +++ /dev/null @@ -1,150 +0,0 @@ -/** @file - * @brief MAVLink comm protocol generated from ardupilotmega.xml - * @see http://qgroundcontrol.org/mavlink/ - */ -#ifndef ARDUPILOTMEGA_H -#define ARDUPILOTMEGA_H - -#ifdef __cplusplus -extern "C" { -#endif - -// MESSAGE LENGTHS AND CRCS - -#ifndef MAVLINK_MESSAGE_LENGTHS -#define MAVLINK_MESSAGE_LENGTHS {3, 4, 8, 14, 8, 28, 3, 32, 0, 2, 3, 2, 2, 0, 0, 0, 0, 0, 0, 0, 19, 2, 23, 21, 0, 37, 26, 101, 26, 16, 32, 32, 37, 32, 11, 17, 17, 16, 18, 36, 4, 4, 2, 2, 4, 2, 2, 3, 14, 12, 18, 16, 8, 27, 25, 18, 18, 24, 24, 0, 0, 0, 26, 16, 36, 5, 6, 56, 26, 21, 18, 0, 0, 18, 20, 20, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 8, 4, 12, 15, 13, 6, 15, 14, 0, 12, 3, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 14, 14, 51, 5} -#endif - -#ifndef MAVLINK_MESSAGE_CRCS -#define MAVLINK_MESSAGE_CRCS {72, 39, 190, 92, 191, 217, 104, 119, 0, 219, 60, 186, 10, 0, 0, 0, 0, 0, 0, 0, 89, 159, 162, 121, 0, 149, 222, 110, 179, 136, 66, 126, 185, 147, 112, 252, 162, 215, 229, 128, 9, 106, 101, 213, 4, 229, 21, 214, 215, 14, 206, 50, 157, 126, 108, 213, 95, 5, 127, 0, 0, 0, 57, 126, 130, 119, 193, 191, 236, 158, 143, 0, 0, 104, 123, 131, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 143, 29, 208, 188, 118, 242, 19, 97, 233, 0, 18, 68, 136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 178, 224, 60, 106, 7} -#endif - -#ifndef MAVLINK_MESSAGE_INFO -#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_BOOT, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_SYSTEM_TIME_UTC, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {NULL}, MAVLINK_MESSAGE_INFO_ACTION_ACK, MAVLINK_MESSAGE_INFO_ACTION, MAVLINK_MESSAGE_INFO_SET_MODE, MAVLINK_MESSAGE_INFO_SET_NAV_MODE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, {NULL}, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_LOCAL_POSITION, MAVLINK_MESSAGE_INFO_GPS_RAW, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_WAYPOINT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST, MAVLINK_MESSAGE_INFO_WAYPOINT_SET_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST_LIST, MAVLINK_MESSAGE_INFO_WAYPOINT_COUNT, MAVLINK_MESSAGE_INFO_WAYPOINT_CLEAR_ALL, MAVLINK_MESSAGE_INFO_WAYPOINT_REACHED, MAVLINK_MESSAGE_INFO_WAYPOINT_ACK, MAVLINK_MESSAGE_INFO_GPS_SET_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_LOCAL_ORIGIN_SET, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT_SET, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_CONTROL_STATUS, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, MAVLINK_MESSAGE_INFO_POSITION_TARGET, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, MAVLINK_MESSAGE_INFO_SET_ALTITUDE, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_OBJECT_DETECTION_EVENT, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS, MAVLINK_MESSAGE_INFO_SET_MAG_OFFSETS, MAVLINK_MESSAGE_INFO_MEMINFO, MAVLINK_MESSAGE_INFO_AP_ADC, MAVLINK_MESSAGE_INFO_DIGICAM_CONFIGURE, MAVLINK_MESSAGE_INFO_DIGICAM_CONTROL, MAVLINK_MESSAGE_INFO_MOUNT_CONFIGURE, MAVLINK_MESSAGE_INFO_MOUNT_CONTROL, MAVLINK_MESSAGE_INFO_MOUNT_STATUS, {NULL}, MAVLINK_MESSAGE_INFO_FENCE_POINT, MAVLINK_MESSAGE_INFO_FENCE_FETCH_POINT, MAVLINK_MESSAGE_INFO_FENCE_STATUS, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG} -#endif - -#include "../protocol.h" - -#define MAVLINK_ENABLED_ARDUPILOTMEGA - -#include "../common/common.h" - -// MAVLINK VERSION - -#ifndef MAVLINK_VERSION -#define MAVLINK_VERSION 2 -#endif - -#if (MAVLINK_VERSION == 0) -#undef MAVLINK_VERSION -#define MAVLINK_VERSION 2 -#endif - -// ENUM DEFINITIONS - - -/** @brief Enumeration of possible mount operation modes */ -#ifndef HAVE_ENUM_MAV_MOUNT_MODE -#define HAVE_ENUM_MAV_MOUNT_MODE -enum MAV_MOUNT_MODE -{ - MAV_MOUNT_MODE_RETRACT=0, /* Load and keep safe position (Roll,Pitch,Yaw) from EEPROM and stop stabilization | */ - MAV_MOUNT_MODE_NEUTRAL=1, /* Load and keep neutral position (Roll,Pitch,Yaw) from EEPROM. | */ - MAV_MOUNT_MODE_MAVLINK_TARGETING=2, /* Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization | */ - MAV_MOUNT_MODE_RC_TARGETING=3, /* Load neutral position and start RC Roll,Pitch,Yaw control with stabilization | */ - MAV_MOUNT_MODE_GPS_POINT=4, /* Load neutral position and start to point to Lat,Lon,Alt | */ - MAV_MOUNT_MODE_ENUM_END=5, /* | */ -}; -#endif - -/** @brief */ -#ifndef HAVE_ENUM_MAV_CMD -#define HAVE_ENUM_MAV_CMD -enum MAV_CMD -{ - MAV_CMD_NAV_WAYPOINT=16, /* Navigate to waypoint. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at waypoint for rotary wing)| Acceptance radius in meters (if the sphere with this radius is hit, the waypoint counts as reached)| 0 to pass through the WP, if > 0 radius in meters to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.| Desired yaw angle at waypoint (rotary wing)| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_LOITER_UNLIM=17, /* Loiter around this waypoint an unlimited amount of time |Empty| Empty| Radius around waypoint, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_LOITER_TURNS=18, /* Loiter around this waypoint for X turns |Turns| Empty| Radius around waypoint, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_LOITER_TIME=19, /* Loiter around this waypoint for X seconds |Seconds (decimal)| Empty| Radius around waypoint, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_RETURN_TO_LAUNCH=20, /* Return to launch location |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_NAV_LAND=21, /* Land at location |Empty| Empty| Empty| Desired yaw angle.| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_TAKEOFF=22, /* Takeoff from ground / hand |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Empty| Yaw angle (if magnetometer present), ignored without magnetometer| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_ROI=80, /* Sets the region of interest (ROI) for a sensor set or the - vehicle itself. This can then be used by the vehicles control - system to control the vehicle attitude and the attitude of various - sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| Waypoint index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ - MAV_CMD_NAV_PATHPLANNING=81, /* Control autonomous path planning on the MAV. |0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning| 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid| Empty| Yaw angle at goal, in compass degrees, [0..360]| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ - MAV_CMD_NAV_LAST=95, /* NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_CONDITION_DELAY=112, /* Delay mission state machine. |Delay in seconds (decimal)| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_CONDITION_CHANGE_ALT=113, /* Ascend/descend at rate. Delay mission state machine until desired altitude reached. |Descent / Ascend rate (m/s)| Empty| Empty| Empty| Empty| Empty| Finish Altitude| */ - MAV_CMD_CONDITION_DISTANCE=114, /* Delay mission state machine until within desired distance of next NAV point. |Distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_CONDITION_YAW=115, /* Reach a certain target angle. |target angle: [0-360], 0 is north| speed during yaw change:[deg per second]| direction: negative: counter clockwise, positive: clockwise [-1,1]| relative offset or absolute angle: [ 1,0]| Empty| Empty| Empty| */ - MAV_CMD_CONDITION_LAST=159, /* NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_SET_MODE=176, /* Set system mode. |Mode, as defined by ENUM MAV_MODE| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_JUMP=177, /* Jump to the desired command in the mission list. Repeat this action only the specified number of times |Sequence number| Repeat count| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_CHANGE_SPEED=178, /* Change speed and/or throttle set points. |Speed type (0=Airspeed, 1=Ground Speed)| Speed (m/s, -1 indicates no change)| Throttle ( Percent, -1 indicates no change)| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_SET_HOME=179, /* Changes the home location either to the current location or a specified location. |Use current (1=use current location, 0=use specified location)| Empty| Empty| Empty| Latitude| Longitude| Altitude| */ - MAV_CMD_DO_SET_PARAMETER=180, /* Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. |Parameter number| Parameter value| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_SET_RELAY=181, /* Set a relay to a condition. |Relay number| Setting (1=on, 0=off, others possible depending on system hardware)| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_REPEAT_RELAY=182, /* Cycle a relay on and off for a desired number of cyles with a desired period. |Relay number| Cycle count| Cycle time (seconds, decimal)| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_SET_SERVO=183, /* Set a servo to a desired PWM value. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_REPEAT_SERVO=184, /* Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Cycle count| Cycle time (seconds)| Empty| Empty| Empty| */ - MAV_CMD_DO_CONTROL_VIDEO=200, /* Control onboard camera capturing. |Camera ID (-1 for all)| Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw| Transmission mode: 0: video stream, >0: single images every n seconds (decimal)| Recording: 0: disabled, 1: enabled compressed, 2: enabled raw| Empty| Empty| Empty| */ - MAV_CMD_DO_SET_ROI=201, /* Sets the region of interest (ROI) for a sensor set or the - vehicle itself. This can then be used by the vehicles control - system to control the vehicle attitude and the attitude of various - devices such as cameras. - |Region of interest mode. (see MAV_ROI enum)| Waypoint index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple cameras etc.)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ - MAV_CMD_DO_DIGICAM_CONFIGURE=202, /* Mission command to configure an on-board camera controller system. |Modes: P, TV, AV, M, Etc| Shutter speed: Divisor number for one second| Aperture: F stop number| ISO number e.g. 80, 100, 200, Etc| Exposure type enumerator| Command Identity| Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)| */ - MAV_CMD_DO_DIGICAM_CONTROL=203, /* Mission command to control an on-board camera controller system. |Session control e.g. show/hide lens| Zoom's absolute position| Zooming step value to offset zoom from the current position| Focus Locking, Unlocking or Re-locking| Shooting Command| Command Identity| Empty| */ - MAV_CMD_DO_MOUNT_CONFIGURE=204, /* Mission command to configure a camera or antenna mount |Mount operation mode (see MAV_MOUNT_MODE enum)| stabilize roll? (1 = yes, 0 = no)| stabilize pitch? (1 = yes, 0 = no)| stabilize yaw? (1 = yes, 0 = no)| Empty| Empty| Empty| */ - MAV_CMD_DO_MOUNT_CONTROL=205, /* Mission command to control a camera or antenna mount |pitch(deg*100) or lat, depending on mount mode.| roll(deg*100) or lon depending on mount mode| yaw(deg*100) or alt (in cm) depending on mount mode| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_LAST=240, /* NOP - This command is only used to mark the upper limit of the DO commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_PREFLIGHT_CALIBRATION=241, /* Trigger calibration. This command will be only accepted if in pre-flight mode. |Gyro calibration: 0: no, 1: yes| Magnetometer calibration: 0: no, 1: yes| Ground pressure: 0: no, 1: yes| Radio calibration: 0: no, 1: yes| Empty| Empty| Empty| */ - MAV_CMD_PREFLIGHT_STORAGE=245, /* Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. |Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM| Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM| Reserved| Reserved| Empty| Empty| Empty| */ - MAV_CMD_ENUM_END=246, /* | */ -}; -#endif - -/** @brief */ -#ifndef HAVE_ENUM_FENCE_ACTION -#define HAVE_ENUM_FENCE_ACTION -enum FENCE_ACTION -{ - FENCE_ACTION_NONE=0, /* Disable fenced mode | */ - FENCE_ACTION_GUIDED=1, /* Switched to guided mode to return point (fence point 0) | */ - FENCE_ACTION_ENUM_END=2, /* | */ -}; -#endif - -/** @brief */ -#ifndef HAVE_ENUM_FENCE_BREACH -#define HAVE_ENUM_FENCE_BREACH -enum FENCE_BREACH -{ - FENCE_BREACH_NONE=0, /* No last fence breach | */ - FENCE_BREACH_MINALT=1, /* Breached minimum altitude | */ - FENCE_BREACH_MAXALT=2, /* Breached minimum altitude | */ - FENCE_BREACH_BOUNDARY=3, /* Breached fence boundary | */ - FENCE_BREACH_ENUM_END=4, /* | */ -}; -#endif - -// MESSAGE DEFINITIONS -#include "./mavlink_msg_sensor_offsets.h" -#include "./mavlink_msg_set_mag_offsets.h" -#include "./mavlink_msg_meminfo.h" -#include "./mavlink_msg_ap_adc.h" -#include "./mavlink_msg_digicam_configure.h" -#include "./mavlink_msg_digicam_control.h" -#include "./mavlink_msg_mount_configure.h" -#include "./mavlink_msg_mount_control.h" -#include "./mavlink_msg_mount_status.h" -#include "./mavlink_msg_fence_point.h" -#include "./mavlink_msg_fence_fetch_point.h" -#include "./mavlink_msg_fence_status.h" - -#ifdef __cplusplus -} -#endif // __cplusplus -#endif // ARDUPILOTMEGA_H diff --git a/src/GCS_MAVLink/include/ardupilotmega/mavlink.h b/src/GCS_MAVLink/include/ardupilotmega/mavlink.h deleted file mode 100644 index 72e0248d9..000000000 --- a/src/GCS_MAVLink/include/ardupilotmega/mavlink.h +++ /dev/null @@ -1,27 +0,0 @@ -/** @file - * @brief MAVLink comm protocol built from ardupilotmega.xml - * @see http://pixhawk.ethz.ch/software/mavlink - */ -#ifndef MAVLINK_H -#define MAVLINK_H - -#ifndef MAVLINK_STX -#define MAVLINK_STX 85 -#endif - -#ifndef MAVLINK_ENDIAN -#define MAVLINK_ENDIAN MAVLINK_BIG_ENDIAN -#endif - -#ifndef MAVLINK_ALIGNED_FIELDS -#define MAVLINK_ALIGNED_FIELDS 0 -#endif - -#ifndef MAVLINK_CRC_EXTRA -#define MAVLINK_CRC_EXTRA 0 -#endif - -#include "version.h" -#include "ardupilotmega.h" - -#endif // MAVLINK_H diff --git a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_ap_adc.h b/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_ap_adc.h deleted file mode 100644 index d42edb15d..000000000 --- a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_ap_adc.h +++ /dev/null @@ -1,254 +0,0 @@ -// MESSAGE AP_ADC PACKING - -#define MAVLINK_MSG_ID_AP_ADC 153 - -typedef struct __mavlink_ap_adc_t -{ - uint16_t adc1; ///< ADC output 1 - uint16_t adc2; ///< ADC output 2 - uint16_t adc3; ///< ADC output 3 - uint16_t adc4; ///< ADC output 4 - uint16_t adc5; ///< ADC output 5 - uint16_t adc6; ///< ADC output 6 -} mavlink_ap_adc_t; - -#define MAVLINK_MSG_ID_AP_ADC_LEN 12 -#define MAVLINK_MSG_ID_153_LEN 12 - - - -#define MAVLINK_MESSAGE_INFO_AP_ADC { \ - "AP_ADC", \ - 6, \ - { { "adc1", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_ap_adc_t, adc1) }, \ - { "adc2", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_ap_adc_t, adc2) }, \ - { "adc3", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_ap_adc_t, adc3) }, \ - { "adc4", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_ap_adc_t, adc4) }, \ - { "adc5", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_ap_adc_t, adc5) }, \ - { "adc6", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_ap_adc_t, adc6) }, \ - } \ -} - - -/** - * @brief Pack a ap_adc message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param adc1 ADC output 1 - * @param adc2 ADC output 2 - * @param adc3 ADC output 3 - * @param adc4 ADC output 4 - * @param adc5 ADC output 5 - * @param adc6 ADC output 6 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_ap_adc_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint16_t adc1, uint16_t adc2, uint16_t adc3, uint16_t adc4, uint16_t adc5, uint16_t adc6) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; - _mav_put_uint16_t(buf, 0, adc1); - _mav_put_uint16_t(buf, 2, adc2); - _mav_put_uint16_t(buf, 4, adc3); - _mav_put_uint16_t(buf, 6, adc4); - _mav_put_uint16_t(buf, 8, adc5); - _mav_put_uint16_t(buf, 10, adc6); - - memcpy(_MAV_PAYLOAD(msg), buf, 12); -#else - mavlink_ap_adc_t packet; - packet.adc1 = adc1; - packet.adc2 = adc2; - packet.adc3 = adc3; - packet.adc4 = adc4; - packet.adc5 = adc5; - packet.adc6 = adc6; - - memcpy(_MAV_PAYLOAD(msg), &packet, 12); -#endif - - msg->msgid = MAVLINK_MSG_ID_AP_ADC; - return mavlink_finalize_message(msg, system_id, component_id, 12); -} - -/** - * @brief Pack a ap_adc message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param adc1 ADC output 1 - * @param adc2 ADC output 2 - * @param adc3 ADC output 3 - * @param adc4 ADC output 4 - * @param adc5 ADC output 5 - * @param adc6 ADC output 6 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_ap_adc_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint16_t adc1,uint16_t adc2,uint16_t adc3,uint16_t adc4,uint16_t adc5,uint16_t adc6) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; - _mav_put_uint16_t(buf, 0, adc1); - _mav_put_uint16_t(buf, 2, adc2); - _mav_put_uint16_t(buf, 4, adc3); - _mav_put_uint16_t(buf, 6, adc4); - _mav_put_uint16_t(buf, 8, adc5); - _mav_put_uint16_t(buf, 10, adc6); - - memcpy(_MAV_PAYLOAD(msg), buf, 12); -#else - mavlink_ap_adc_t packet; - packet.adc1 = adc1; - packet.adc2 = adc2; - packet.adc3 = adc3; - packet.adc4 = adc4; - packet.adc5 = adc5; - packet.adc6 = adc6; - - memcpy(_MAV_PAYLOAD(msg), &packet, 12); -#endif - - msg->msgid = MAVLINK_MSG_ID_AP_ADC; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12); -} - -/** - * @brief Encode a ap_adc struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param ap_adc C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_ap_adc_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ap_adc_t* ap_adc) -{ - return mavlink_msg_ap_adc_pack(system_id, component_id, msg, ap_adc->adc1, ap_adc->adc2, ap_adc->adc3, ap_adc->adc4, ap_adc->adc5, ap_adc->adc6); -} - -/** - * @brief Send a ap_adc message - * @param chan MAVLink channel to send the message - * - * @param adc1 ADC output 1 - * @param adc2 ADC output 2 - * @param adc3 ADC output 3 - * @param adc4 ADC output 4 - * @param adc5 ADC output 5 - * @param adc6 ADC output 6 - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_ap_adc_send(mavlink_channel_t chan, uint16_t adc1, uint16_t adc2, uint16_t adc3, uint16_t adc4, uint16_t adc5, uint16_t adc6) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; - _mav_put_uint16_t(buf, 0, adc1); - _mav_put_uint16_t(buf, 2, adc2); - _mav_put_uint16_t(buf, 4, adc3); - _mav_put_uint16_t(buf, 6, adc4); - _mav_put_uint16_t(buf, 8, adc5); - _mav_put_uint16_t(buf, 10, adc6); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AP_ADC, buf, 12); -#else - mavlink_ap_adc_t packet; - packet.adc1 = adc1; - packet.adc2 = adc2; - packet.adc3 = adc3; - packet.adc4 = adc4; - packet.adc5 = adc5; - packet.adc6 = adc6; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AP_ADC, (const char *)&packet, 12); -#endif -} - -#endif - -// MESSAGE AP_ADC UNPACKING - - -/** - * @brief Get field adc1 from ap_adc message - * - * @return ADC output 1 - */ -static inline uint16_t mavlink_msg_ap_adc_get_adc1(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 0); -} - -/** - * @brief Get field adc2 from ap_adc message - * - * @return ADC output 2 - */ -static inline uint16_t mavlink_msg_ap_adc_get_adc2(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 2); -} - -/** - * @brief Get field adc3 from ap_adc message - * - * @return ADC output 3 - */ -static inline uint16_t mavlink_msg_ap_adc_get_adc3(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 4); -} - -/** - * @brief Get field adc4 from ap_adc message - * - * @return ADC output 4 - */ -static inline uint16_t mavlink_msg_ap_adc_get_adc4(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 6); -} - -/** - * @brief Get field adc5 from ap_adc message - * - * @return ADC output 5 - */ -static inline uint16_t mavlink_msg_ap_adc_get_adc5(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 8); -} - -/** - * @brief Get field adc6 from ap_adc message - * - * @return ADC output 6 - */ -static inline uint16_t mavlink_msg_ap_adc_get_adc6(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 10); -} - -/** - * @brief Decode a ap_adc message into a struct - * - * @param msg The message to decode - * @param ap_adc C-struct to decode the message contents into - */ -static inline void mavlink_msg_ap_adc_decode(const mavlink_message_t* msg, mavlink_ap_adc_t* ap_adc) -{ -#if MAVLINK_NEED_BYTE_SWAP - ap_adc->adc1 = mavlink_msg_ap_adc_get_adc1(msg); - ap_adc->adc2 = mavlink_msg_ap_adc_get_adc2(msg); - ap_adc->adc3 = mavlink_msg_ap_adc_get_adc3(msg); - ap_adc->adc4 = mavlink_msg_ap_adc_get_adc4(msg); - ap_adc->adc5 = mavlink_msg_ap_adc_get_adc5(msg); - ap_adc->adc6 = mavlink_msg_ap_adc_get_adc6(msg); -#else - memcpy(ap_adc, _MAV_PAYLOAD(msg), 12); -#endif -} diff --git a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_digicam_configure.h b/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_digicam_configure.h deleted file mode 100644 index 92263b86a..000000000 --- a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_digicam_configure.h +++ /dev/null @@ -1,364 +0,0 @@ -// MESSAGE DIGICAM_CONFIGURE PACKING - -#define MAVLINK_MSG_ID_DIGICAM_CONFIGURE 154 - -typedef struct __mavlink_digicam_configure_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - uint8_t mode; ///< Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) - uint16_t shutter_speed; ///< Divisor number //e.g. 1000 means 1/1000 (0 means ignore) - uint8_t aperture; ///< F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) - uint8_t iso; ///< ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) - uint8_t exposure_type; ///< Exposure type enumeration from 1 to N (0 means ignore) - uint8_t command_id; ///< Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once - uint8_t engine_cut_off; ///< Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) - uint8_t extra_param; ///< Extra parameters enumeration (0 means ignore) - float extra_value; ///< Correspondent value to given extra_param -} mavlink_digicam_configure_t; - -#define MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN 15 -#define MAVLINK_MSG_ID_154_LEN 15 - - - -#define MAVLINK_MESSAGE_INFO_DIGICAM_CONFIGURE { \ - "DIGICAM_CONFIGURE", \ - 11, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_digicam_configure_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_digicam_configure_t, target_component) }, \ - { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_digicam_configure_t, mode) }, \ - { "shutter_speed", NULL, MAVLINK_TYPE_UINT16_T, 0, 3, offsetof(mavlink_digicam_configure_t, shutter_speed) }, \ - { "aperture", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_digicam_configure_t, aperture) }, \ - { "iso", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_digicam_configure_t, iso) }, \ - { "exposure_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_digicam_configure_t, exposure_type) }, \ - { "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_digicam_configure_t, command_id) }, \ - { "engine_cut_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_digicam_configure_t, engine_cut_off) }, \ - { "extra_param", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_digicam_configure_t, extra_param) }, \ - { "extra_value", NULL, MAVLINK_TYPE_FLOAT, 0, 11, offsetof(mavlink_digicam_configure_t, extra_value) }, \ - } \ -} - - -/** - * @brief Pack a digicam_configure message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param mode Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) - * @param shutter_speed Divisor number //e.g. 1000 means 1/1000 (0 means ignore) - * @param aperture F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) - * @param iso ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) - * @param exposure_type Exposure type enumeration from 1 to N (0 means ignore) - * @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once - * @param engine_cut_off Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) - * @param extra_param Extra parameters enumeration (0 means ignore) - * @param extra_value Correspondent value to given extra_param - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_digicam_configure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint8_t mode, uint16_t shutter_speed, uint8_t aperture, uint8_t iso, uint8_t exposure_type, uint8_t command_id, uint8_t engine_cut_off, uint8_t extra_param, float extra_value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, mode); - _mav_put_uint16_t(buf, 3, shutter_speed); - _mav_put_uint8_t(buf, 5, aperture); - _mav_put_uint8_t(buf, 6, iso); - _mav_put_uint8_t(buf, 7, exposure_type); - _mav_put_uint8_t(buf, 8, command_id); - _mav_put_uint8_t(buf, 9, engine_cut_off); - _mav_put_uint8_t(buf, 10, extra_param); - _mav_put_float(buf, 11, extra_value); - - memcpy(_MAV_PAYLOAD(msg), buf, 15); -#else - mavlink_digicam_configure_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.mode = mode; - packet.shutter_speed = shutter_speed; - packet.aperture = aperture; - packet.iso = iso; - packet.exposure_type = exposure_type; - packet.command_id = command_id; - packet.engine_cut_off = engine_cut_off; - packet.extra_param = extra_param; - packet.extra_value = extra_value; - - memcpy(_MAV_PAYLOAD(msg), &packet, 15); -#endif - - msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE; - return mavlink_finalize_message(msg, system_id, component_id, 15); -} - -/** - * @brief Pack a digicam_configure message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param mode Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) - * @param shutter_speed Divisor number //e.g. 1000 means 1/1000 (0 means ignore) - * @param aperture F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) - * @param iso ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) - * @param exposure_type Exposure type enumeration from 1 to N (0 means ignore) - * @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once - * @param engine_cut_off Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) - * @param extra_param Extra parameters enumeration (0 means ignore) - * @param extra_value Correspondent value to given extra_param - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_digicam_configure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint8_t mode,uint16_t shutter_speed,uint8_t aperture,uint8_t iso,uint8_t exposure_type,uint8_t command_id,uint8_t engine_cut_off,uint8_t extra_param,float extra_value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, mode); - _mav_put_uint16_t(buf, 3, shutter_speed); - _mav_put_uint8_t(buf, 5, aperture); - _mav_put_uint8_t(buf, 6, iso); - _mav_put_uint8_t(buf, 7, exposure_type); - _mav_put_uint8_t(buf, 8, command_id); - _mav_put_uint8_t(buf, 9, engine_cut_off); - _mav_put_uint8_t(buf, 10, extra_param); - _mav_put_float(buf, 11, extra_value); - - memcpy(_MAV_PAYLOAD(msg), buf, 15); -#else - mavlink_digicam_configure_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.mode = mode; - packet.shutter_speed = shutter_speed; - packet.aperture = aperture; - packet.iso = iso; - packet.exposure_type = exposure_type; - packet.command_id = command_id; - packet.engine_cut_off = engine_cut_off; - packet.extra_param = extra_param; - packet.extra_value = extra_value; - - memcpy(_MAV_PAYLOAD(msg), &packet, 15); -#endif - - msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 15); -} - -/** - * @brief Encode a digicam_configure struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param digicam_configure C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_digicam_configure_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_digicam_configure_t* digicam_configure) -{ - return mavlink_msg_digicam_configure_pack(system_id, component_id, msg, digicam_configure->target_system, digicam_configure->target_component, digicam_configure->mode, digicam_configure->shutter_speed, digicam_configure->aperture, digicam_configure->iso, digicam_configure->exposure_type, digicam_configure->command_id, digicam_configure->engine_cut_off, digicam_configure->extra_param, digicam_configure->extra_value); -} - -/** - * @brief Send a digicam_configure message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param mode Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) - * @param shutter_speed Divisor number //e.g. 1000 means 1/1000 (0 means ignore) - * @param aperture F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) - * @param iso ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) - * @param exposure_type Exposure type enumeration from 1 to N (0 means ignore) - * @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once - * @param engine_cut_off Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) - * @param extra_param Extra parameters enumeration (0 means ignore) - * @param extra_value Correspondent value to given extra_param - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_digicam_configure_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mode, uint16_t shutter_speed, uint8_t aperture, uint8_t iso, uint8_t exposure_type, uint8_t command_id, uint8_t engine_cut_off, uint8_t extra_param, float extra_value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, mode); - _mav_put_uint16_t(buf, 3, shutter_speed); - _mav_put_uint8_t(buf, 5, aperture); - _mav_put_uint8_t(buf, 6, iso); - _mav_put_uint8_t(buf, 7, exposure_type); - _mav_put_uint8_t(buf, 8, command_id); - _mav_put_uint8_t(buf, 9, engine_cut_off); - _mav_put_uint8_t(buf, 10, extra_param); - _mav_put_float(buf, 11, extra_value); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, buf, 15); -#else - mavlink_digicam_configure_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.mode = mode; - packet.shutter_speed = shutter_speed; - packet.aperture = aperture; - packet.iso = iso; - packet.exposure_type = exposure_type; - packet.command_id = command_id; - packet.engine_cut_off = engine_cut_off; - packet.extra_param = extra_param; - packet.extra_value = extra_value; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, (const char *)&packet, 15); -#endif -} - -#endif - -// MESSAGE DIGICAM_CONFIGURE UNPACKING - - -/** - * @brief Get field target_system from digicam_configure message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_digicam_configure_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from digicam_configure message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_digicam_configure_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field mode from digicam_configure message - * - * @return Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) - */ -static inline uint8_t mavlink_msg_digicam_configure_get_mode(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Get field shutter_speed from digicam_configure message - * - * @return Divisor number //e.g. 1000 means 1/1000 (0 means ignore) - */ -static inline uint16_t mavlink_msg_digicam_configure_get_shutter_speed(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 3); -} - -/** - * @brief Get field aperture from digicam_configure message - * - * @return F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) - */ -static inline uint8_t mavlink_msg_digicam_configure_get_aperture(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 5); -} - -/** - * @brief Get field iso from digicam_configure message - * - * @return ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) - */ -static inline uint8_t mavlink_msg_digicam_configure_get_iso(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 6); -} - -/** - * @brief Get field exposure_type from digicam_configure message - * - * @return Exposure type enumeration from 1 to N (0 means ignore) - */ -static inline uint8_t mavlink_msg_digicam_configure_get_exposure_type(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 7); -} - -/** - * @brief Get field command_id from digicam_configure message - * - * @return Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once - */ -static inline uint8_t mavlink_msg_digicam_configure_get_command_id(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 8); -} - -/** - * @brief Get field engine_cut_off from digicam_configure message - * - * @return Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) - */ -static inline uint8_t mavlink_msg_digicam_configure_get_engine_cut_off(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 9); -} - -/** - * @brief Get field extra_param from digicam_configure message - * - * @return Extra parameters enumeration (0 means ignore) - */ -static inline uint8_t mavlink_msg_digicam_configure_get_extra_param(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 10); -} - -/** - * @brief Get field extra_value from digicam_configure message - * - * @return Correspondent value to given extra_param - */ -static inline float mavlink_msg_digicam_configure_get_extra_value(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 11); -} - -/** - * @brief Decode a digicam_configure message into a struct - * - * @param msg The message to decode - * @param digicam_configure C-struct to decode the message contents into - */ -static inline void mavlink_msg_digicam_configure_decode(const mavlink_message_t* msg, mavlink_digicam_configure_t* digicam_configure) -{ -#if MAVLINK_NEED_BYTE_SWAP - digicam_configure->target_system = mavlink_msg_digicam_configure_get_target_system(msg); - digicam_configure->target_component = mavlink_msg_digicam_configure_get_target_component(msg); - digicam_configure->mode = mavlink_msg_digicam_configure_get_mode(msg); - digicam_configure->shutter_speed = mavlink_msg_digicam_configure_get_shutter_speed(msg); - digicam_configure->aperture = mavlink_msg_digicam_configure_get_aperture(msg); - digicam_configure->iso = mavlink_msg_digicam_configure_get_iso(msg); - digicam_configure->exposure_type = mavlink_msg_digicam_configure_get_exposure_type(msg); - digicam_configure->command_id = mavlink_msg_digicam_configure_get_command_id(msg); - digicam_configure->engine_cut_off = mavlink_msg_digicam_configure_get_engine_cut_off(msg); - digicam_configure->extra_param = mavlink_msg_digicam_configure_get_extra_param(msg); - digicam_configure->extra_value = mavlink_msg_digicam_configure_get_extra_value(msg); -#else - memcpy(digicam_configure, _MAV_PAYLOAD(msg), 15); -#endif -} diff --git a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_digicam_control.h b/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_digicam_control.h deleted file mode 100644 index ee7d68124..000000000 --- a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_digicam_control.h +++ /dev/null @@ -1,342 +0,0 @@ -// MESSAGE DIGICAM_CONTROL PACKING - -#define MAVLINK_MSG_ID_DIGICAM_CONTROL 155 - -typedef struct __mavlink_digicam_control_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - uint8_t session; ///< 0: stop, 1: start or keep it up //Session control e.g. show/hide lens - uint8_t zoom_pos; ///< 1 to N //Zoom's absolute position (0 means ignore) - int8_t zoom_step; ///< -100 to 100 //Zooming step value to offset zoom from the current position - uint8_t focus_lock; ///< 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus - uint8_t shot; ///< 0: ignore, 1: shot or start filming - uint8_t command_id; ///< Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once - uint8_t extra_param; ///< Extra parameters enumeration (0 means ignore) - float extra_value; ///< Correspondent value to given extra_param -} mavlink_digicam_control_t; - -#define MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN 13 -#define MAVLINK_MSG_ID_155_LEN 13 - - - -#define MAVLINK_MESSAGE_INFO_DIGICAM_CONTROL { \ - "DIGICAM_CONTROL", \ - 10, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_digicam_control_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_digicam_control_t, target_component) }, \ - { "session", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_digicam_control_t, session) }, \ - { "zoom_pos", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_digicam_control_t, zoom_pos) }, \ - { "zoom_step", NULL, MAVLINK_TYPE_INT8_T, 0, 4, offsetof(mavlink_digicam_control_t, zoom_step) }, \ - { "focus_lock", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_digicam_control_t, focus_lock) }, \ - { "shot", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_digicam_control_t, shot) }, \ - { "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_digicam_control_t, command_id) }, \ - { "extra_param", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_digicam_control_t, extra_param) }, \ - { "extra_value", NULL, MAVLINK_TYPE_FLOAT, 0, 9, offsetof(mavlink_digicam_control_t, extra_value) }, \ - } \ -} - - -/** - * @brief Pack a digicam_control message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens - * @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore) - * @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position - * @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus - * @param shot 0: ignore, 1: shot or start filming - * @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once - * @param extra_param Extra parameters enumeration (0 means ignore) - * @param extra_value Correspondent value to given extra_param - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_digicam_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint8_t session, uint8_t zoom_pos, int8_t zoom_step, uint8_t focus_lock, uint8_t shot, uint8_t command_id, uint8_t extra_param, float extra_value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[13]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, session); - _mav_put_uint8_t(buf, 3, zoom_pos); - _mav_put_int8_t(buf, 4, zoom_step); - _mav_put_uint8_t(buf, 5, focus_lock); - _mav_put_uint8_t(buf, 6, shot); - _mav_put_uint8_t(buf, 7, command_id); - _mav_put_uint8_t(buf, 8, extra_param); - _mav_put_float(buf, 9, extra_value); - - memcpy(_MAV_PAYLOAD(msg), buf, 13); -#else - mavlink_digicam_control_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.session = session; - packet.zoom_pos = zoom_pos; - packet.zoom_step = zoom_step; - packet.focus_lock = focus_lock; - packet.shot = shot; - packet.command_id = command_id; - packet.extra_param = extra_param; - packet.extra_value = extra_value; - - memcpy(_MAV_PAYLOAD(msg), &packet, 13); -#endif - - msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL; - return mavlink_finalize_message(msg, system_id, component_id, 13); -} - -/** - * @brief Pack a digicam_control message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens - * @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore) - * @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position - * @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus - * @param shot 0: ignore, 1: shot or start filming - * @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once - * @param extra_param Extra parameters enumeration (0 means ignore) - * @param extra_value Correspondent value to given extra_param - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_digicam_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint8_t session,uint8_t zoom_pos,int8_t zoom_step,uint8_t focus_lock,uint8_t shot,uint8_t command_id,uint8_t extra_param,float extra_value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[13]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, session); - _mav_put_uint8_t(buf, 3, zoom_pos); - _mav_put_int8_t(buf, 4, zoom_step); - _mav_put_uint8_t(buf, 5, focus_lock); - _mav_put_uint8_t(buf, 6, shot); - _mav_put_uint8_t(buf, 7, command_id); - _mav_put_uint8_t(buf, 8, extra_param); - _mav_put_float(buf, 9, extra_value); - - memcpy(_MAV_PAYLOAD(msg), buf, 13); -#else - mavlink_digicam_control_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.session = session; - packet.zoom_pos = zoom_pos; - packet.zoom_step = zoom_step; - packet.focus_lock = focus_lock; - packet.shot = shot; - packet.command_id = command_id; - packet.extra_param = extra_param; - packet.extra_value = extra_value; - - memcpy(_MAV_PAYLOAD(msg), &packet, 13); -#endif - - msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 13); -} - -/** - * @brief Encode a digicam_control struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param digicam_control C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_digicam_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_digicam_control_t* digicam_control) -{ - return mavlink_msg_digicam_control_pack(system_id, component_id, msg, digicam_control->target_system, digicam_control->target_component, digicam_control->session, digicam_control->zoom_pos, digicam_control->zoom_step, digicam_control->focus_lock, digicam_control->shot, digicam_control->command_id, digicam_control->extra_param, digicam_control->extra_value); -} - -/** - * @brief Send a digicam_control message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens - * @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore) - * @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position - * @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus - * @param shot 0: ignore, 1: shot or start filming - * @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once - * @param extra_param Extra parameters enumeration (0 means ignore) - * @param extra_value Correspondent value to given extra_param - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_digicam_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t session, uint8_t zoom_pos, int8_t zoom_step, uint8_t focus_lock, uint8_t shot, uint8_t command_id, uint8_t extra_param, float extra_value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[13]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, session); - _mav_put_uint8_t(buf, 3, zoom_pos); - _mav_put_int8_t(buf, 4, zoom_step); - _mav_put_uint8_t(buf, 5, focus_lock); - _mav_put_uint8_t(buf, 6, shot); - _mav_put_uint8_t(buf, 7, command_id); - _mav_put_uint8_t(buf, 8, extra_param); - _mav_put_float(buf, 9, extra_value); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, buf, 13); -#else - mavlink_digicam_control_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.session = session; - packet.zoom_pos = zoom_pos; - packet.zoom_step = zoom_step; - packet.focus_lock = focus_lock; - packet.shot = shot; - packet.command_id = command_id; - packet.extra_param = extra_param; - packet.extra_value = extra_value; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, (const char *)&packet, 13); -#endif -} - -#endif - -// MESSAGE DIGICAM_CONTROL UNPACKING - - -/** - * @brief Get field target_system from digicam_control message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_digicam_control_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from digicam_control message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_digicam_control_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field session from digicam_control message - * - * @return 0: stop, 1: start or keep it up //Session control e.g. show/hide lens - */ -static inline uint8_t mavlink_msg_digicam_control_get_session(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Get field zoom_pos from digicam_control message - * - * @return 1 to N //Zoom's absolute position (0 means ignore) - */ -static inline uint8_t mavlink_msg_digicam_control_get_zoom_pos(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 3); -} - -/** - * @brief Get field zoom_step from digicam_control message - * - * @return -100 to 100 //Zooming step value to offset zoom from the current position - */ -static inline int8_t mavlink_msg_digicam_control_get_zoom_step(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int8_t(msg, 4); -} - -/** - * @brief Get field focus_lock from digicam_control message - * - * @return 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus - */ -static inline uint8_t mavlink_msg_digicam_control_get_focus_lock(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 5); -} - -/** - * @brief Get field shot from digicam_control message - * - * @return 0: ignore, 1: shot or start filming - */ -static inline uint8_t mavlink_msg_digicam_control_get_shot(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 6); -} - -/** - * @brief Get field command_id from digicam_control message - * - * @return Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once - */ -static inline uint8_t mavlink_msg_digicam_control_get_command_id(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 7); -} - -/** - * @brief Get field extra_param from digicam_control message - * - * @return Extra parameters enumeration (0 means ignore) - */ -static inline uint8_t mavlink_msg_digicam_control_get_extra_param(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 8); -} - -/** - * @brief Get field extra_value from digicam_control message - * - * @return Correspondent value to given extra_param - */ -static inline float mavlink_msg_digicam_control_get_extra_value(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 9); -} - -/** - * @brief Decode a digicam_control message into a struct - * - * @param msg The message to decode - * @param digicam_control C-struct to decode the message contents into - */ -static inline void mavlink_msg_digicam_control_decode(const mavlink_message_t* msg, mavlink_digicam_control_t* digicam_control) -{ -#if MAVLINK_NEED_BYTE_SWAP - digicam_control->target_system = mavlink_msg_digicam_control_get_target_system(msg); - digicam_control->target_component = mavlink_msg_digicam_control_get_target_component(msg); - digicam_control->session = mavlink_msg_digicam_control_get_session(msg); - digicam_control->zoom_pos = mavlink_msg_digicam_control_get_zoom_pos(msg); - digicam_control->zoom_step = mavlink_msg_digicam_control_get_zoom_step(msg); - digicam_control->focus_lock = mavlink_msg_digicam_control_get_focus_lock(msg); - digicam_control->shot = mavlink_msg_digicam_control_get_shot(msg); - digicam_control->command_id = mavlink_msg_digicam_control_get_command_id(msg); - digicam_control->extra_param = mavlink_msg_digicam_control_get_extra_param(msg); - digicam_control->extra_value = mavlink_msg_digicam_control_get_extra_value(msg); -#else - memcpy(digicam_control, _MAV_PAYLOAD(msg), 13); -#endif -} diff --git a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_fetch_point.h b/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_fetch_point.h deleted file mode 100644 index fb2a9831a..000000000 --- a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_fetch_point.h +++ /dev/null @@ -1,188 +0,0 @@ -// MESSAGE FENCE_FETCH_POINT PACKING - -#define MAVLINK_MSG_ID_FENCE_FETCH_POINT 161 - -typedef struct __mavlink_fence_fetch_point_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - uint8_t idx; ///< point index (first point is 1, 0 is for return point) -} mavlink_fence_fetch_point_t; - -#define MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN 3 -#define MAVLINK_MSG_ID_161_LEN 3 - - - -#define MAVLINK_MESSAGE_INFO_FENCE_FETCH_POINT { \ - "FENCE_FETCH_POINT", \ - 3, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fence_fetch_point_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_fence_fetch_point_t, target_component) }, \ - { "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_fence_fetch_point_t, idx) }, \ - } \ -} - - -/** - * @brief Pack a fence_fetch_point message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param idx point index (first point is 1, 0 is for return point) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fence_fetch_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint8_t idx) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, idx); - - memcpy(_MAV_PAYLOAD(msg), buf, 3); -#else - mavlink_fence_fetch_point_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.idx = idx; - - memcpy(_MAV_PAYLOAD(msg), &packet, 3); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT; - return mavlink_finalize_message(msg, system_id, component_id, 3); -} - -/** - * @brief Pack a fence_fetch_point message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param idx point index (first point is 1, 0 is for return point) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fence_fetch_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint8_t idx) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, idx); - - memcpy(_MAV_PAYLOAD(msg), buf, 3); -#else - mavlink_fence_fetch_point_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.idx = idx; - - memcpy(_MAV_PAYLOAD(msg), &packet, 3); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3); -} - -/** - * @brief Encode a fence_fetch_point struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param fence_fetch_point C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_fence_fetch_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fence_fetch_point_t* fence_fetch_point) -{ - return mavlink_msg_fence_fetch_point_pack(system_id, component_id, msg, fence_fetch_point->target_system, fence_fetch_point->target_component, fence_fetch_point->idx); -} - -/** - * @brief Send a fence_fetch_point message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param idx point index (first point is 1, 0 is for return point) - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_fence_fetch_point_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, idx); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, buf, 3); -#else - mavlink_fence_fetch_point_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.idx = idx; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, (const char *)&packet, 3); -#endif -} - -#endif - -// MESSAGE FENCE_FETCH_POINT UNPACKING - - -/** - * @brief Get field target_system from fence_fetch_point message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_fence_fetch_point_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from fence_fetch_point message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_fence_fetch_point_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field idx from fence_fetch_point message - * - * @return point index (first point is 1, 0 is for return point) - */ -static inline uint8_t mavlink_msg_fence_fetch_point_get_idx(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Decode a fence_fetch_point message into a struct - * - * @param msg The message to decode - * @param fence_fetch_point C-struct to decode the message contents into - */ -static inline void mavlink_msg_fence_fetch_point_decode(const mavlink_message_t* msg, mavlink_fence_fetch_point_t* fence_fetch_point) -{ -#if MAVLINK_NEED_BYTE_SWAP - fence_fetch_point->target_system = mavlink_msg_fence_fetch_point_get_target_system(msg); - fence_fetch_point->target_component = mavlink_msg_fence_fetch_point_get_target_component(msg); - fence_fetch_point->idx = mavlink_msg_fence_fetch_point_get_idx(msg); -#else - memcpy(fence_fetch_point, _MAV_PAYLOAD(msg), 3); -#endif -} diff --git a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_point.h b/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_point.h deleted file mode 100644 index 35d41de41..000000000 --- a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_point.h +++ /dev/null @@ -1,254 +0,0 @@ -// MESSAGE FENCE_POINT PACKING - -#define MAVLINK_MSG_ID_FENCE_POINT 160 - -typedef struct __mavlink_fence_point_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - uint8_t idx; ///< point index (first point is 1, 0 is for return point) - uint8_t count; ///< total number of points (for sanity checking) - float lat; ///< Latitude of point - float lng; ///< Longitude of point -} mavlink_fence_point_t; - -#define MAVLINK_MSG_ID_FENCE_POINT_LEN 12 -#define MAVLINK_MSG_ID_160_LEN 12 - - - -#define MAVLINK_MESSAGE_INFO_FENCE_POINT { \ - "FENCE_POINT", \ - 6, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fence_point_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_fence_point_t, target_component) }, \ - { "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_fence_point_t, idx) }, \ - { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_fence_point_t, count) }, \ - { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_fence_point_t, lat) }, \ - { "lng", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_fence_point_t, lng) }, \ - } \ -} - - -/** - * @brief Pack a fence_point message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param idx point index (first point is 1, 0 is for return point) - * @param count total number of points (for sanity checking) - * @param lat Latitude of point - * @param lng Longitude of point - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fence_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, float lat, float lng) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, idx); - _mav_put_uint8_t(buf, 3, count); - _mav_put_float(buf, 4, lat); - _mav_put_float(buf, 8, lng); - - memcpy(_MAV_PAYLOAD(msg), buf, 12); -#else - mavlink_fence_point_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.idx = idx; - packet.count = count; - packet.lat = lat; - packet.lng = lng; - - memcpy(_MAV_PAYLOAD(msg), &packet, 12); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCE_POINT; - return mavlink_finalize_message(msg, system_id, component_id, 12); -} - -/** - * @brief Pack a fence_point message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param idx point index (first point is 1, 0 is for return point) - * @param count total number of points (for sanity checking) - * @param lat Latitude of point - * @param lng Longitude of point - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fence_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint8_t idx,uint8_t count,float lat,float lng) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, idx); - _mav_put_uint8_t(buf, 3, count); - _mav_put_float(buf, 4, lat); - _mav_put_float(buf, 8, lng); - - memcpy(_MAV_PAYLOAD(msg), buf, 12); -#else - mavlink_fence_point_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.idx = idx; - packet.count = count; - packet.lat = lat; - packet.lng = lng; - - memcpy(_MAV_PAYLOAD(msg), &packet, 12); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCE_POINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12); -} - -/** - * @brief Encode a fence_point struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param fence_point C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_fence_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fence_point_t* fence_point) -{ - return mavlink_msg_fence_point_pack(system_id, component_id, msg, fence_point->target_system, fence_point->target_component, fence_point->idx, fence_point->count, fence_point->lat, fence_point->lng); -} - -/** - * @brief Send a fence_point message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param idx point index (first point is 1, 0 is for return point) - * @param count total number of points (for sanity checking) - * @param lat Latitude of point - * @param lng Longitude of point - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_fence_point_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, float lat, float lng) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, idx); - _mav_put_uint8_t(buf, 3, count); - _mav_put_float(buf, 4, lat); - _mav_put_float(buf, 8, lng); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, buf, 12); -#else - mavlink_fence_point_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.idx = idx; - packet.count = count; - packet.lat = lat; - packet.lng = lng; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, (const char *)&packet, 12); -#endif -} - -#endif - -// MESSAGE FENCE_POINT UNPACKING - - -/** - * @brief Get field target_system from fence_point message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_fence_point_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from fence_point message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_fence_point_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field idx from fence_point message - * - * @return point index (first point is 1, 0 is for return point) - */ -static inline uint8_t mavlink_msg_fence_point_get_idx(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Get field count from fence_point message - * - * @return total number of points (for sanity checking) - */ -static inline uint8_t mavlink_msg_fence_point_get_count(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 3); -} - -/** - * @brief Get field lat from fence_point message - * - * @return Latitude of point - */ -static inline float mavlink_msg_fence_point_get_lat(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Get field lng from fence_point message - * - * @return Longitude of point - */ -static inline float mavlink_msg_fence_point_get_lng(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Decode a fence_point message into a struct - * - * @param msg The message to decode - * @param fence_point C-struct to decode the message contents into - */ -static inline void mavlink_msg_fence_point_decode(const mavlink_message_t* msg, mavlink_fence_point_t* fence_point) -{ -#if MAVLINK_NEED_BYTE_SWAP - fence_point->target_system = mavlink_msg_fence_point_get_target_system(msg); - fence_point->target_component = mavlink_msg_fence_point_get_target_component(msg); - fence_point->idx = mavlink_msg_fence_point_get_idx(msg); - fence_point->count = mavlink_msg_fence_point_get_count(msg); - fence_point->lat = mavlink_msg_fence_point_get_lat(msg); - fence_point->lng = mavlink_msg_fence_point_get_lng(msg); -#else - memcpy(fence_point, _MAV_PAYLOAD(msg), 12); -#endif -} diff --git a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_status.h b/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_status.h deleted file mode 100644 index cb7230111..000000000 --- a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_status.h +++ /dev/null @@ -1,210 +0,0 @@ -// MESSAGE FENCE_STATUS PACKING - -#define MAVLINK_MSG_ID_FENCE_STATUS 162 - -typedef struct __mavlink_fence_status_t -{ - uint8_t breach_status; ///< 0 if currently inside fence, 1 if outside - uint16_t breach_count; ///< number of fence breaches - uint8_t breach_type; ///< last breach type (see FENCE_BREACH_* enum) - uint32_t breach_time; ///< time of last breach in milliseconds since boot -} mavlink_fence_status_t; - -#define MAVLINK_MSG_ID_FENCE_STATUS_LEN 8 -#define MAVLINK_MSG_ID_162_LEN 8 - - - -#define MAVLINK_MESSAGE_INFO_FENCE_STATUS { \ - "FENCE_STATUS", \ - 4, \ - { { "breach_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fence_status_t, breach_status) }, \ - { "breach_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 1, offsetof(mavlink_fence_status_t, breach_count) }, \ - { "breach_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_fence_status_t, breach_type) }, \ - { "breach_time", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_fence_status_t, breach_time) }, \ - } \ -} - - -/** - * @brief Pack a fence_status message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param breach_status 0 if currently inside fence, 1 if outside - * @param breach_count number of fence breaches - * @param breach_type last breach type (see FENCE_BREACH_* enum) - * @param breach_time time of last breach in milliseconds since boot - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fence_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint8_t(buf, 0, breach_status); - _mav_put_uint16_t(buf, 1, breach_count); - _mav_put_uint8_t(buf, 3, breach_type); - _mav_put_uint32_t(buf, 4, breach_time); - - memcpy(_MAV_PAYLOAD(msg), buf, 8); -#else - mavlink_fence_status_t packet; - packet.breach_status = breach_status; - packet.breach_count = breach_count; - packet.breach_type = breach_type; - packet.breach_time = breach_time; - - memcpy(_MAV_PAYLOAD(msg), &packet, 8); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS; - return mavlink_finalize_message(msg, system_id, component_id, 8); -} - -/** - * @brief Pack a fence_status message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param breach_status 0 if currently inside fence, 1 if outside - * @param breach_count number of fence breaches - * @param breach_type last breach type (see FENCE_BREACH_* enum) - * @param breach_time time of last breach in milliseconds since boot - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fence_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t breach_status,uint16_t breach_count,uint8_t breach_type,uint32_t breach_time) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint8_t(buf, 0, breach_status); - _mav_put_uint16_t(buf, 1, breach_count); - _mav_put_uint8_t(buf, 3, breach_type); - _mav_put_uint32_t(buf, 4, breach_time); - - memcpy(_MAV_PAYLOAD(msg), buf, 8); -#else - mavlink_fence_status_t packet; - packet.breach_status = breach_status; - packet.breach_count = breach_count; - packet.breach_type = breach_type; - packet.breach_time = breach_time; - - memcpy(_MAV_PAYLOAD(msg), &packet, 8); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8); -} - -/** - * @brief Encode a fence_status struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param fence_status C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_fence_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fence_status_t* fence_status) -{ - return mavlink_msg_fence_status_pack(system_id, component_id, msg, fence_status->breach_status, fence_status->breach_count, fence_status->breach_type, fence_status->breach_time); -} - -/** - * @brief Send a fence_status message - * @param chan MAVLink channel to send the message - * - * @param breach_status 0 if currently inside fence, 1 if outside - * @param breach_count number of fence breaches - * @param breach_type last breach type (see FENCE_BREACH_* enum) - * @param breach_time time of last breach in milliseconds since boot - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_fence_status_send(mavlink_channel_t chan, uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint8_t(buf, 0, breach_status); - _mav_put_uint16_t(buf, 1, breach_count); - _mav_put_uint8_t(buf, 3, breach_type); - _mav_put_uint32_t(buf, 4, breach_time); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, buf, 8); -#else - mavlink_fence_status_t packet; - packet.breach_status = breach_status; - packet.breach_count = breach_count; - packet.breach_type = breach_type; - packet.breach_time = breach_time; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, (const char *)&packet, 8); -#endif -} - -#endif - -// MESSAGE FENCE_STATUS UNPACKING - - -/** - * @brief Get field breach_status from fence_status message - * - * @return 0 if currently inside fence, 1 if outside - */ -static inline uint8_t mavlink_msg_fence_status_get_breach_status(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field breach_count from fence_status message - * - * @return number of fence breaches - */ -static inline uint16_t mavlink_msg_fence_status_get_breach_count(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 1); -} - -/** - * @brief Get field breach_type from fence_status message - * - * @return last breach type (see FENCE_BREACH_* enum) - */ -static inline uint8_t mavlink_msg_fence_status_get_breach_type(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 3); -} - -/** - * @brief Get field breach_time from fence_status message - * - * @return time of last breach in milliseconds since boot - */ -static inline uint32_t mavlink_msg_fence_status_get_breach_time(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint32_t(msg, 4); -} - -/** - * @brief Decode a fence_status message into a struct - * - * @param msg The message to decode - * @param fence_status C-struct to decode the message contents into - */ -static inline void mavlink_msg_fence_status_decode(const mavlink_message_t* msg, mavlink_fence_status_t* fence_status) -{ -#if MAVLINK_NEED_BYTE_SWAP - fence_status->breach_status = mavlink_msg_fence_status_get_breach_status(msg); - fence_status->breach_count = mavlink_msg_fence_status_get_breach_count(msg); - fence_status->breach_type = mavlink_msg_fence_status_get_breach_type(msg); - fence_status->breach_time = mavlink_msg_fence_status_get_breach_time(msg); -#else - memcpy(fence_status, _MAV_PAYLOAD(msg), 8); -#endif -} diff --git a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fenced_fetch_point.h b/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fenced_fetch_point.h deleted file mode 100644 index 7ae650c71..000000000 --- a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fenced_fetch_point.h +++ /dev/null @@ -1,144 +0,0 @@ -// MESSAGE FENCED_FETCH_POINT PACKING - -#define MAVLINK_MSG_ID_FENCED_FETCH_POINT 161 - -typedef struct __mavlink_fenced_fetch_point_t -{ - uint8_t idx; ///< point index (first point is 1, 0 is for return point) -} mavlink_fenced_fetch_point_t; - -#define MAVLINK_MSG_ID_FENCED_FETCH_POINT_LEN 1 -#define MAVLINK_MSG_ID_161_LEN 1 - - - -#define MAVLINK_MESSAGE_INFO_FENCED_FETCH_POINT { \ - "FENCED_FETCH_POINT", \ - 1, \ - { { "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fenced_fetch_point_t, idx) }, \ - } \ -} - - -/** - * @brief Pack a fenced_fetch_point message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param idx point index (first point is 1, 0 is for return point) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fenced_fetch_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t idx) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[1]; - _mav_put_uint8_t(buf, 0, idx); - - memcpy(_MAV_PAYLOAD(msg), buf, 1); -#else - mavlink_fenced_fetch_point_t packet; - packet.idx = idx; - - memcpy(_MAV_PAYLOAD(msg), &packet, 1); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCED_FETCH_POINT; - return mavlink_finalize_message(msg, system_id, component_id, 1); -} - -/** - * @brief Pack a fenced_fetch_point message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param idx point index (first point is 1, 0 is for return point) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fenced_fetch_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t idx) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[1]; - _mav_put_uint8_t(buf, 0, idx); - - memcpy(_MAV_PAYLOAD(msg), buf, 1); -#else - mavlink_fenced_fetch_point_t packet; - packet.idx = idx; - - memcpy(_MAV_PAYLOAD(msg), &packet, 1); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCED_FETCH_POINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 1); -} - -/** - * @brief Encode a fenced_fetch_point struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param fenced_fetch_point C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_fenced_fetch_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fenced_fetch_point_t* fenced_fetch_point) -{ - return mavlink_msg_fenced_fetch_point_pack(system_id, component_id, msg, fenced_fetch_point->idx); -} - -/** - * @brief Send a fenced_fetch_point message - * @param chan MAVLink channel to send the message - * - * @param idx point index (first point is 1, 0 is for return point) - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_fenced_fetch_point_send(mavlink_channel_t chan, uint8_t idx) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[1]; - _mav_put_uint8_t(buf, 0, idx); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCED_FETCH_POINT, buf, 1); -#else - mavlink_fenced_fetch_point_t packet; - packet.idx = idx; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCED_FETCH_POINT, (const char *)&packet, 1); -#endif -} - -#endif - -// MESSAGE FENCED_FETCH_POINT UNPACKING - - -/** - * @brief Get field idx from fenced_fetch_point message - * - * @return point index (first point is 1, 0 is for return point) - */ -static inline uint8_t mavlink_msg_fenced_fetch_point_get_idx(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Decode a fenced_fetch_point message into a struct - * - * @param msg The message to decode - * @param fenced_fetch_point C-struct to decode the message contents into - */ -static inline void mavlink_msg_fenced_fetch_point_decode(const mavlink_message_t* msg, mavlink_fenced_fetch_point_t* fenced_fetch_point) -{ -#if MAVLINK_NEED_BYTE_SWAP - fenced_fetch_point->idx = mavlink_msg_fenced_fetch_point_get_idx(msg); -#else - memcpy(fenced_fetch_point, _MAV_PAYLOAD(msg), 1); -#endif -} diff --git a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fenced_point.h b/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fenced_point.h deleted file mode 100644 index 9b849b776..000000000 --- a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fenced_point.h +++ /dev/null @@ -1,210 +0,0 @@ -// MESSAGE FENCED_POINT PACKING - -#define MAVLINK_MSG_ID_FENCED_POINT 160 - -typedef struct __mavlink_fenced_point_t -{ - uint8_t idx; ///< point index (first point is 1, 0 is for return point) - uint8_t count; ///< total number of points (for sanity checking) - float lat; ///< Latitude of point - float lng; ///< Longitude of point -} mavlink_fenced_point_t; - -#define MAVLINK_MSG_ID_FENCED_POINT_LEN 10 -#define MAVLINK_MSG_ID_160_LEN 10 - - - -#define MAVLINK_MESSAGE_INFO_FENCED_POINT { \ - "FENCED_POINT", \ - 4, \ - { { "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fenced_point_t, idx) }, \ - { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_fenced_point_t, count) }, \ - { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 2, offsetof(mavlink_fenced_point_t, lat) }, \ - { "lng", NULL, MAVLINK_TYPE_FLOAT, 0, 6, offsetof(mavlink_fenced_point_t, lng) }, \ - } \ -} - - -/** - * @brief Pack a fenced_point message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param idx point index (first point is 1, 0 is for return point) - * @param count total number of points (for sanity checking) - * @param lat Latitude of point - * @param lng Longitude of point - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fenced_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t idx, uint8_t count, float lat, float lng) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[10]; - _mav_put_uint8_t(buf, 0, idx); - _mav_put_uint8_t(buf, 1, count); - _mav_put_float(buf, 2, lat); - _mav_put_float(buf, 6, lng); - - memcpy(_MAV_PAYLOAD(msg), buf, 10); -#else - mavlink_fenced_point_t packet; - packet.idx = idx; - packet.count = count; - packet.lat = lat; - packet.lng = lng; - - memcpy(_MAV_PAYLOAD(msg), &packet, 10); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCED_POINT; - return mavlink_finalize_message(msg, system_id, component_id, 10); -} - -/** - * @brief Pack a fenced_point message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param idx point index (first point is 1, 0 is for return point) - * @param count total number of points (for sanity checking) - * @param lat Latitude of point - * @param lng Longitude of point - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fenced_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t idx,uint8_t count,float lat,float lng) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[10]; - _mav_put_uint8_t(buf, 0, idx); - _mav_put_uint8_t(buf, 1, count); - _mav_put_float(buf, 2, lat); - _mav_put_float(buf, 6, lng); - - memcpy(_MAV_PAYLOAD(msg), buf, 10); -#else - mavlink_fenced_point_t packet; - packet.idx = idx; - packet.count = count; - packet.lat = lat; - packet.lng = lng; - - memcpy(_MAV_PAYLOAD(msg), &packet, 10); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCED_POINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 10); -} - -/** - * @brief Encode a fenced_point struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param fenced_point C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_fenced_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fenced_point_t* fenced_point) -{ - return mavlink_msg_fenced_point_pack(system_id, component_id, msg, fenced_point->idx, fenced_point->count, fenced_point->lat, fenced_point->lng); -} - -/** - * @brief Send a fenced_point message - * @param chan MAVLink channel to send the message - * - * @param idx point index (first point is 1, 0 is for return point) - * @param count total number of points (for sanity checking) - * @param lat Latitude of point - * @param lng Longitude of point - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_fenced_point_send(mavlink_channel_t chan, uint8_t idx, uint8_t count, float lat, float lng) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[10]; - _mav_put_uint8_t(buf, 0, idx); - _mav_put_uint8_t(buf, 1, count); - _mav_put_float(buf, 2, lat); - _mav_put_float(buf, 6, lng); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCED_POINT, buf, 10); -#else - mavlink_fenced_point_t packet; - packet.idx = idx; - packet.count = count; - packet.lat = lat; - packet.lng = lng; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCED_POINT, (const char *)&packet, 10); -#endif -} - -#endif - -// MESSAGE FENCED_POINT UNPACKING - - -/** - * @brief Get field idx from fenced_point message - * - * @return point index (first point is 1, 0 is for return point) - */ -static inline uint8_t mavlink_msg_fenced_point_get_idx(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field count from fenced_point message - * - * @return total number of points (for sanity checking) - */ -static inline uint8_t mavlink_msg_fenced_point_get_count(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field lat from fenced_point message - * - * @return Latitude of point - */ -static inline float mavlink_msg_fenced_point_get_lat(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 2); -} - -/** - * @brief Get field lng from fenced_point message - * - * @return Longitude of point - */ -static inline float mavlink_msg_fenced_point_get_lng(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 6); -} - -/** - * @brief Decode a fenced_point message into a struct - * - * @param msg The message to decode - * @param fenced_point C-struct to decode the message contents into - */ -static inline void mavlink_msg_fenced_point_decode(const mavlink_message_t* msg, mavlink_fenced_point_t* fenced_point) -{ -#if MAVLINK_NEED_BYTE_SWAP - fenced_point->idx = mavlink_msg_fenced_point_get_idx(msg); - fenced_point->count = mavlink_msg_fenced_point_get_count(msg); - fenced_point->lat = mavlink_msg_fenced_point_get_lat(msg); - fenced_point->lng = mavlink_msg_fenced_point_get_lng(msg); -#else - memcpy(fenced_point, _MAV_PAYLOAD(msg), 10); -#endif -} diff --git a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_meminfo.h b/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_meminfo.h deleted file mode 100644 index b131967df..000000000 --- a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_meminfo.h +++ /dev/null @@ -1,166 +0,0 @@ -// MESSAGE MEMINFO PACKING - -#define MAVLINK_MSG_ID_MEMINFO 152 - -typedef struct __mavlink_meminfo_t -{ - uint16_t brkval; ///< heap top - uint16_t freemem; ///< free memory -} mavlink_meminfo_t; - -#define MAVLINK_MSG_ID_MEMINFO_LEN 4 -#define MAVLINK_MSG_ID_152_LEN 4 - - - -#define MAVLINK_MESSAGE_INFO_MEMINFO { \ - "MEMINFO", \ - 2, \ - { { "brkval", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_meminfo_t, brkval) }, \ - { "freemem", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_meminfo_t, freemem) }, \ - } \ -} - - -/** - * @brief Pack a meminfo message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param brkval heap top - * @param freemem free memory - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_meminfo_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint16_t brkval, uint16_t freemem) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint16_t(buf, 0, brkval); - _mav_put_uint16_t(buf, 2, freemem); - - memcpy(_MAV_PAYLOAD(msg), buf, 4); -#else - mavlink_meminfo_t packet; - packet.brkval = brkval; - packet.freemem = freemem; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_MEMINFO; - return mavlink_finalize_message(msg, system_id, component_id, 4); -} - -/** - * @brief Pack a meminfo message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param brkval heap top - * @param freemem free memory - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_meminfo_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint16_t brkval,uint16_t freemem) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint16_t(buf, 0, brkval); - _mav_put_uint16_t(buf, 2, freemem); - - memcpy(_MAV_PAYLOAD(msg), buf, 4); -#else - mavlink_meminfo_t packet; - packet.brkval = brkval; - packet.freemem = freemem; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_MEMINFO; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4); -} - -/** - * @brief Encode a meminfo struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param meminfo C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_meminfo_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_meminfo_t* meminfo) -{ - return mavlink_msg_meminfo_pack(system_id, component_id, msg, meminfo->brkval, meminfo->freemem); -} - -/** - * @brief Send a meminfo message - * @param chan MAVLink channel to send the message - * - * @param brkval heap top - * @param freemem free memory - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_meminfo_send(mavlink_channel_t chan, uint16_t brkval, uint16_t freemem) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint16_t(buf, 0, brkval); - _mav_put_uint16_t(buf, 2, freemem); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, buf, 4); -#else - mavlink_meminfo_t packet; - packet.brkval = brkval; - packet.freemem = freemem; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, (const char *)&packet, 4); -#endif -} - -#endif - -// MESSAGE MEMINFO UNPACKING - - -/** - * @brief Get field brkval from meminfo message - * - * @return heap top - */ -static inline uint16_t mavlink_msg_meminfo_get_brkval(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 0); -} - -/** - * @brief Get field freemem from meminfo message - * - * @return free memory - */ -static inline uint16_t mavlink_msg_meminfo_get_freemem(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 2); -} - -/** - * @brief Decode a meminfo message into a struct - * - * @param msg The message to decode - * @param meminfo C-struct to decode the message contents into - */ -static inline void mavlink_msg_meminfo_decode(const mavlink_message_t* msg, mavlink_meminfo_t* meminfo) -{ -#if MAVLINK_NEED_BYTE_SWAP - meminfo->brkval = mavlink_msg_meminfo_get_brkval(msg); - meminfo->freemem = mavlink_msg_meminfo_get_freemem(msg); -#else - memcpy(meminfo, _MAV_PAYLOAD(msg), 4); -#endif -} diff --git a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_configure.h b/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_configure.h deleted file mode 100644 index f2c73d301..000000000 --- a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_configure.h +++ /dev/null @@ -1,254 +0,0 @@ -// MESSAGE MOUNT_CONFIGURE PACKING - -#define MAVLINK_MSG_ID_MOUNT_CONFIGURE 156 - -typedef struct __mavlink_mount_configure_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - uint8_t mount_mode; ///< mount operating mode (see MAV_MOUNT_MODE enum) - uint8_t stab_roll; ///< (1 = yes, 0 = no) - uint8_t stab_pitch; ///< (1 = yes, 0 = no) - uint8_t stab_yaw; ///< (1 = yes, 0 = no) -} mavlink_mount_configure_t; - -#define MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN 6 -#define MAVLINK_MSG_ID_156_LEN 6 - - - -#define MAVLINK_MESSAGE_INFO_MOUNT_CONFIGURE { \ - "MOUNT_CONFIGURE", \ - 6, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mount_configure_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mount_configure_t, target_component) }, \ - { "mount_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mount_configure_t, mount_mode) }, \ - { "stab_roll", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mount_configure_t, stab_roll) }, \ - { "stab_pitch", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mount_configure_t, stab_pitch) }, \ - { "stab_yaw", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mount_configure_t, stab_yaw) }, \ - } \ -} - - -/** - * @brief Pack a mount_configure message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum) - * @param stab_roll (1 = yes, 0 = no) - * @param stab_pitch (1 = yes, 0 = no) - * @param stab_yaw (1 = yes, 0 = no) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_mount_configure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint8_t mount_mode, uint8_t stab_roll, uint8_t stab_pitch, uint8_t stab_yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, mount_mode); - _mav_put_uint8_t(buf, 3, stab_roll); - _mav_put_uint8_t(buf, 4, stab_pitch); - _mav_put_uint8_t(buf, 5, stab_yaw); - - memcpy(_MAV_PAYLOAD(msg), buf, 6); -#else - mavlink_mount_configure_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.mount_mode = mount_mode; - packet.stab_roll = stab_roll; - packet.stab_pitch = stab_pitch; - packet.stab_yaw = stab_yaw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 6); -#endif - - msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; - return mavlink_finalize_message(msg, system_id, component_id, 6); -} - -/** - * @brief Pack a mount_configure message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum) - * @param stab_roll (1 = yes, 0 = no) - * @param stab_pitch (1 = yes, 0 = no) - * @param stab_yaw (1 = yes, 0 = no) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_mount_configure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint8_t mount_mode,uint8_t stab_roll,uint8_t stab_pitch,uint8_t stab_yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, mount_mode); - _mav_put_uint8_t(buf, 3, stab_roll); - _mav_put_uint8_t(buf, 4, stab_pitch); - _mav_put_uint8_t(buf, 5, stab_yaw); - - memcpy(_MAV_PAYLOAD(msg), buf, 6); -#else - mavlink_mount_configure_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.mount_mode = mount_mode; - packet.stab_roll = stab_roll; - packet.stab_pitch = stab_pitch; - packet.stab_yaw = stab_yaw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 6); -#endif - - msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 6); -} - -/** - * @brief Encode a mount_configure struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param mount_configure C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_mount_configure_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mount_configure_t* mount_configure) -{ - return mavlink_msg_mount_configure_pack(system_id, component_id, msg, mount_configure->target_system, mount_configure->target_component, mount_configure->mount_mode, mount_configure->stab_roll, mount_configure->stab_pitch, mount_configure->stab_yaw); -} - -/** - * @brief Send a mount_configure message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum) - * @param stab_roll (1 = yes, 0 = no) - * @param stab_pitch (1 = yes, 0 = no) - * @param stab_yaw (1 = yes, 0 = no) - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_mount_configure_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mount_mode, uint8_t stab_roll, uint8_t stab_pitch, uint8_t stab_yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, mount_mode); - _mav_put_uint8_t(buf, 3, stab_roll); - _mav_put_uint8_t(buf, 4, stab_pitch); - _mav_put_uint8_t(buf, 5, stab_yaw); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, buf, 6); -#else - mavlink_mount_configure_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.mount_mode = mount_mode; - packet.stab_roll = stab_roll; - packet.stab_pitch = stab_pitch; - packet.stab_yaw = stab_yaw; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, (const char *)&packet, 6); -#endif -} - -#endif - -// MESSAGE MOUNT_CONFIGURE UNPACKING - - -/** - * @brief Get field target_system from mount_configure message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_mount_configure_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from mount_configure message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_mount_configure_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field mount_mode from mount_configure message - * - * @return mount operating mode (see MAV_MOUNT_MODE enum) - */ -static inline uint8_t mavlink_msg_mount_configure_get_mount_mode(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Get field stab_roll from mount_configure message - * - * @return (1 = yes, 0 = no) - */ -static inline uint8_t mavlink_msg_mount_configure_get_stab_roll(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 3); -} - -/** - * @brief Get field stab_pitch from mount_configure message - * - * @return (1 = yes, 0 = no) - */ -static inline uint8_t mavlink_msg_mount_configure_get_stab_pitch(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 4); -} - -/** - * @brief Get field stab_yaw from mount_configure message - * - * @return (1 = yes, 0 = no) - */ -static inline uint8_t mavlink_msg_mount_configure_get_stab_yaw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 5); -} - -/** - * @brief Decode a mount_configure message into a struct - * - * @param msg The message to decode - * @param mount_configure C-struct to decode the message contents into - */ -static inline void mavlink_msg_mount_configure_decode(const mavlink_message_t* msg, mavlink_mount_configure_t* mount_configure) -{ -#if MAVLINK_NEED_BYTE_SWAP - mount_configure->target_system = mavlink_msg_mount_configure_get_target_system(msg); - mount_configure->target_component = mavlink_msg_mount_configure_get_target_component(msg); - mount_configure->mount_mode = mavlink_msg_mount_configure_get_mount_mode(msg); - mount_configure->stab_roll = mavlink_msg_mount_configure_get_stab_roll(msg); - mount_configure->stab_pitch = mavlink_msg_mount_configure_get_stab_pitch(msg); - mount_configure->stab_yaw = mavlink_msg_mount_configure_get_stab_yaw(msg); -#else - memcpy(mount_configure, _MAV_PAYLOAD(msg), 6); -#endif -} diff --git a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_control.h b/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_control.h deleted file mode 100644 index 5f1d13eb8..000000000 --- a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_control.h +++ /dev/null @@ -1,254 +0,0 @@ -// MESSAGE MOUNT_CONTROL PACKING - -#define MAVLINK_MSG_ID_MOUNT_CONTROL 157 - -typedef struct __mavlink_mount_control_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - int32_t input_a; ///< pitch(deg*100) or lat, depending on mount mode - int32_t input_b; ///< roll(deg*100) or lon depending on mount mode - int32_t input_c; ///< yaw(deg*100) or alt (in cm) depending on mount mode - uint8_t save_position; ///< if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) -} mavlink_mount_control_t; - -#define MAVLINK_MSG_ID_MOUNT_CONTROL_LEN 15 -#define MAVLINK_MSG_ID_157_LEN 15 - - - -#define MAVLINK_MESSAGE_INFO_MOUNT_CONTROL { \ - "MOUNT_CONTROL", \ - 6, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mount_control_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mount_control_t, target_component) }, \ - { "input_a", NULL, MAVLINK_TYPE_INT32_T, 0, 2, offsetof(mavlink_mount_control_t, input_a) }, \ - { "input_b", NULL, MAVLINK_TYPE_INT32_T, 0, 6, offsetof(mavlink_mount_control_t, input_b) }, \ - { "input_c", NULL, MAVLINK_TYPE_INT32_T, 0, 10, offsetof(mavlink_mount_control_t, input_c) }, \ - { "save_position", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_mount_control_t, save_position) }, \ - } \ -} - - -/** - * @brief Pack a mount_control message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param input_a pitch(deg*100) or lat, depending on mount mode - * @param input_b roll(deg*100) or lon depending on mount mode - * @param input_c yaw(deg*100) or alt (in cm) depending on mount mode - * @param save_position if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_mount_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, int32_t input_a, int32_t input_b, int32_t input_c, uint8_t save_position) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_int32_t(buf, 2, input_a); - _mav_put_int32_t(buf, 6, input_b); - _mav_put_int32_t(buf, 10, input_c); - _mav_put_uint8_t(buf, 14, save_position); - - memcpy(_MAV_PAYLOAD(msg), buf, 15); -#else - mavlink_mount_control_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.input_a = input_a; - packet.input_b = input_b; - packet.input_c = input_c; - packet.save_position = save_position; - - memcpy(_MAV_PAYLOAD(msg), &packet, 15); -#endif - - msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; - return mavlink_finalize_message(msg, system_id, component_id, 15); -} - -/** - * @brief Pack a mount_control message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param input_a pitch(deg*100) or lat, depending on mount mode - * @param input_b roll(deg*100) or lon depending on mount mode - * @param input_c yaw(deg*100) or alt (in cm) depending on mount mode - * @param save_position if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_mount_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,int32_t input_a,int32_t input_b,int32_t input_c,uint8_t save_position) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_int32_t(buf, 2, input_a); - _mav_put_int32_t(buf, 6, input_b); - _mav_put_int32_t(buf, 10, input_c); - _mav_put_uint8_t(buf, 14, save_position); - - memcpy(_MAV_PAYLOAD(msg), buf, 15); -#else - mavlink_mount_control_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.input_a = input_a; - packet.input_b = input_b; - packet.input_c = input_c; - packet.save_position = save_position; - - memcpy(_MAV_PAYLOAD(msg), &packet, 15); -#endif - - msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 15); -} - -/** - * @brief Encode a mount_control struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param mount_control C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_mount_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mount_control_t* mount_control) -{ - return mavlink_msg_mount_control_pack(system_id, component_id, msg, mount_control->target_system, mount_control->target_component, mount_control->input_a, mount_control->input_b, mount_control->input_c, mount_control->save_position); -} - -/** - * @brief Send a mount_control message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param input_a pitch(deg*100) or lat, depending on mount mode - * @param input_b roll(deg*100) or lon depending on mount mode - * @param input_c yaw(deg*100) or alt (in cm) depending on mount mode - * @param save_position if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_mount_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int32_t input_a, int32_t input_b, int32_t input_c, uint8_t save_position) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_int32_t(buf, 2, input_a); - _mav_put_int32_t(buf, 6, input_b); - _mav_put_int32_t(buf, 10, input_c); - _mav_put_uint8_t(buf, 14, save_position); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONTROL, buf, 15); -#else - mavlink_mount_control_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.input_a = input_a; - packet.input_b = input_b; - packet.input_c = input_c; - packet.save_position = save_position; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONTROL, (const char *)&packet, 15); -#endif -} - -#endif - -// MESSAGE MOUNT_CONTROL UNPACKING - - -/** - * @brief Get field target_system from mount_control message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_mount_control_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from mount_control message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_mount_control_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field input_a from mount_control message - * - * @return pitch(deg*100) or lat, depending on mount mode - */ -static inline int32_t mavlink_msg_mount_control_get_input_a(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 2); -} - -/** - * @brief Get field input_b from mount_control message - * - * @return roll(deg*100) or lon depending on mount mode - */ -static inline int32_t mavlink_msg_mount_control_get_input_b(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 6); -} - -/** - * @brief Get field input_c from mount_control message - * - * @return yaw(deg*100) or alt (in cm) depending on mount mode - */ -static inline int32_t mavlink_msg_mount_control_get_input_c(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 10); -} - -/** - * @brief Get field save_position from mount_control message - * - * @return if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) - */ -static inline uint8_t mavlink_msg_mount_control_get_save_position(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 14); -} - -/** - * @brief Decode a mount_control message into a struct - * - * @param msg The message to decode - * @param mount_control C-struct to decode the message contents into - */ -static inline void mavlink_msg_mount_control_decode(const mavlink_message_t* msg, mavlink_mount_control_t* mount_control) -{ -#if MAVLINK_NEED_BYTE_SWAP - mount_control->target_system = mavlink_msg_mount_control_get_target_system(msg); - mount_control->target_component = mavlink_msg_mount_control_get_target_component(msg); - mount_control->input_a = mavlink_msg_mount_control_get_input_a(msg); - mount_control->input_b = mavlink_msg_mount_control_get_input_b(msg); - mount_control->input_c = mavlink_msg_mount_control_get_input_c(msg); - mount_control->save_position = mavlink_msg_mount_control_get_save_position(msg); -#else - memcpy(mount_control, _MAV_PAYLOAD(msg), 15); -#endif -} diff --git a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_status.h b/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_status.h deleted file mode 100644 index 04bddae28..000000000 --- a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_status.h +++ /dev/null @@ -1,232 +0,0 @@ -// MESSAGE MOUNT_STATUS PACKING - -#define MAVLINK_MSG_ID_MOUNT_STATUS 158 - -typedef struct __mavlink_mount_status_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - int32_t pointing_a; ///< pitch(deg*100) or lat, depending on mount mode - int32_t pointing_b; ///< roll(deg*100) or lon depending on mount mode - int32_t pointing_c; ///< yaw(deg*100) or alt (in cm) depending on mount mode -} mavlink_mount_status_t; - -#define MAVLINK_MSG_ID_MOUNT_STATUS_LEN 14 -#define MAVLINK_MSG_ID_158_LEN 14 - - - -#define MAVLINK_MESSAGE_INFO_MOUNT_STATUS { \ - "MOUNT_STATUS", \ - 5, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mount_status_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mount_status_t, target_component) }, \ - { "pointing_a", NULL, MAVLINK_TYPE_INT32_T, 0, 2, offsetof(mavlink_mount_status_t, pointing_a) }, \ - { "pointing_b", NULL, MAVLINK_TYPE_INT32_T, 0, 6, offsetof(mavlink_mount_status_t, pointing_b) }, \ - { "pointing_c", NULL, MAVLINK_TYPE_INT32_T, 0, 10, offsetof(mavlink_mount_status_t, pointing_c) }, \ - } \ -} - - -/** - * @brief Pack a mount_status message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param pointing_a pitch(deg*100) or lat, depending on mount mode - * @param pointing_b roll(deg*100) or lon depending on mount mode - * @param pointing_c yaw(deg*100) or alt (in cm) depending on mount mode - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_mount_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, int32_t pointing_a, int32_t pointing_b, int32_t pointing_c) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_int32_t(buf, 2, pointing_a); - _mav_put_int32_t(buf, 6, pointing_b); - _mav_put_int32_t(buf, 10, pointing_c); - - memcpy(_MAV_PAYLOAD(msg), buf, 14); -#else - mavlink_mount_status_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.pointing_a = pointing_a; - packet.pointing_b = pointing_b; - packet.pointing_c = pointing_c; - - memcpy(_MAV_PAYLOAD(msg), &packet, 14); -#endif - - msg->msgid = MAVLINK_MSG_ID_MOUNT_STATUS; - return mavlink_finalize_message(msg, system_id, component_id, 14); -} - -/** - * @brief Pack a mount_status message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param pointing_a pitch(deg*100) or lat, depending on mount mode - * @param pointing_b roll(deg*100) or lon depending on mount mode - * @param pointing_c yaw(deg*100) or alt (in cm) depending on mount mode - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_mount_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,int32_t pointing_a,int32_t pointing_b,int32_t pointing_c) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_int32_t(buf, 2, pointing_a); - _mav_put_int32_t(buf, 6, pointing_b); - _mav_put_int32_t(buf, 10, pointing_c); - - memcpy(_MAV_PAYLOAD(msg), buf, 14); -#else - mavlink_mount_status_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.pointing_a = pointing_a; - packet.pointing_b = pointing_b; - packet.pointing_c = pointing_c; - - memcpy(_MAV_PAYLOAD(msg), &packet, 14); -#endif - - msg->msgid = MAVLINK_MSG_ID_MOUNT_STATUS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 14); -} - -/** - * @brief Encode a mount_status struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param mount_status C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_mount_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mount_status_t* mount_status) -{ - return mavlink_msg_mount_status_pack(system_id, component_id, msg, mount_status->target_system, mount_status->target_component, mount_status->pointing_a, mount_status->pointing_b, mount_status->pointing_c); -} - -/** - * @brief Send a mount_status message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param pointing_a pitch(deg*100) or lat, depending on mount mode - * @param pointing_b roll(deg*100) or lon depending on mount mode - * @param pointing_c yaw(deg*100) or alt (in cm) depending on mount mode - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_mount_status_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int32_t pointing_a, int32_t pointing_b, int32_t pointing_c) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_int32_t(buf, 2, pointing_a); - _mav_put_int32_t(buf, 6, pointing_b); - _mav_put_int32_t(buf, 10, pointing_c); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_STATUS, buf, 14); -#else - mavlink_mount_status_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.pointing_a = pointing_a; - packet.pointing_b = pointing_b; - packet.pointing_c = pointing_c; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_STATUS, (const char *)&packet, 14); -#endif -} - -#endif - -// MESSAGE MOUNT_STATUS UNPACKING - - -/** - * @brief Get field target_system from mount_status message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_mount_status_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from mount_status message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_mount_status_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field pointing_a from mount_status message - * - * @return pitch(deg*100) or lat, depending on mount mode - */ -static inline int32_t mavlink_msg_mount_status_get_pointing_a(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 2); -} - -/** - * @brief Get field pointing_b from mount_status message - * - * @return roll(deg*100) or lon depending on mount mode - */ -static inline int32_t mavlink_msg_mount_status_get_pointing_b(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 6); -} - -/** - * @brief Get field pointing_c from mount_status message - * - * @return yaw(deg*100) or alt (in cm) depending on mount mode - */ -static inline int32_t mavlink_msg_mount_status_get_pointing_c(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 10); -} - -/** - * @brief Decode a mount_status message into a struct - * - * @param msg The message to decode - * @param mount_status C-struct to decode the message contents into - */ -static inline void mavlink_msg_mount_status_decode(const mavlink_message_t* msg, mavlink_mount_status_t* mount_status) -{ -#if MAVLINK_NEED_BYTE_SWAP - mount_status->target_system = mavlink_msg_mount_status_get_target_system(msg); - mount_status->target_component = mavlink_msg_mount_status_get_target_component(msg); - mount_status->pointing_a = mavlink_msg_mount_status_get_pointing_a(msg); - mount_status->pointing_b = mavlink_msg_mount_status_get_pointing_b(msg); - mount_status->pointing_c = mavlink_msg_mount_status_get_pointing_c(msg); -#else - memcpy(mount_status, _MAV_PAYLOAD(msg), 14); -#endif -} diff --git a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_sensor_offsets.h b/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_sensor_offsets.h deleted file mode 100644 index 216211a8f..000000000 --- a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_sensor_offsets.h +++ /dev/null @@ -1,386 +0,0 @@ -// MESSAGE SENSOR_OFFSETS PACKING - -#define MAVLINK_MSG_ID_SENSOR_OFFSETS 150 - -typedef struct __mavlink_sensor_offsets_t -{ - int16_t mag_ofs_x; ///< magnetometer X offset - int16_t mag_ofs_y; ///< magnetometer Y offset - int16_t mag_ofs_z; ///< magnetometer Z offset - float mag_declination; ///< magnetic declination (radians) - int32_t raw_press; ///< raw pressure from barometer - int32_t raw_temp; ///< raw temperature from barometer - float gyro_cal_x; ///< gyro X calibration - float gyro_cal_y; ///< gyro Y calibration - float gyro_cal_z; ///< gyro Z calibration - float accel_cal_x; ///< accel X calibration - float accel_cal_y; ///< accel Y calibration - float accel_cal_z; ///< accel Z calibration -} mavlink_sensor_offsets_t; - -#define MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN 42 -#define MAVLINK_MSG_ID_150_LEN 42 - - - -#define MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS { \ - "SENSOR_OFFSETS", \ - 12, \ - { { "mag_ofs_x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_sensor_offsets_t, mag_ofs_x) }, \ - { "mag_ofs_y", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_sensor_offsets_t, mag_ofs_y) }, \ - { "mag_ofs_z", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_sensor_offsets_t, mag_ofs_z) }, \ - { "mag_declination", NULL, MAVLINK_TYPE_FLOAT, 0, 6, offsetof(mavlink_sensor_offsets_t, mag_declination) }, \ - { "raw_press", NULL, MAVLINK_TYPE_INT32_T, 0, 10, offsetof(mavlink_sensor_offsets_t, raw_press) }, \ - { "raw_temp", NULL, MAVLINK_TYPE_INT32_T, 0, 14, offsetof(mavlink_sensor_offsets_t, raw_temp) }, \ - { "gyro_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 18, offsetof(mavlink_sensor_offsets_t, gyro_cal_x) }, \ - { "gyro_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 22, offsetof(mavlink_sensor_offsets_t, gyro_cal_y) }, \ - { "gyro_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 26, offsetof(mavlink_sensor_offsets_t, gyro_cal_z) }, \ - { "accel_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 30, offsetof(mavlink_sensor_offsets_t, accel_cal_x) }, \ - { "accel_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 34, offsetof(mavlink_sensor_offsets_t, accel_cal_y) }, \ - { "accel_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 38, offsetof(mavlink_sensor_offsets_t, accel_cal_z) }, \ - } \ -} - - -/** - * @brief Pack a sensor_offsets message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param mag_ofs_x magnetometer X offset - * @param mag_ofs_y magnetometer Y offset - * @param mag_ofs_z magnetometer Z offset - * @param mag_declination magnetic declination (radians) - * @param raw_press raw pressure from barometer - * @param raw_temp raw temperature from barometer - * @param gyro_cal_x gyro X calibration - * @param gyro_cal_y gyro Y calibration - * @param gyro_cal_z gyro Z calibration - * @param accel_cal_x accel X calibration - * @param accel_cal_y accel Y calibration - * @param accel_cal_z accel Z calibration - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_sensor_offsets_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z, float mag_declination, int32_t raw_press, int32_t raw_temp, float gyro_cal_x, float gyro_cal_y, float gyro_cal_z, float accel_cal_x, float accel_cal_y, float accel_cal_z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[42]; - _mav_put_int16_t(buf, 0, mag_ofs_x); - _mav_put_int16_t(buf, 2, mag_ofs_y); - _mav_put_int16_t(buf, 4, mag_ofs_z); - _mav_put_float(buf, 6, mag_declination); - _mav_put_int32_t(buf, 10, raw_press); - _mav_put_int32_t(buf, 14, raw_temp); - _mav_put_float(buf, 18, gyro_cal_x); - _mav_put_float(buf, 22, gyro_cal_y); - _mav_put_float(buf, 26, gyro_cal_z); - _mav_put_float(buf, 30, accel_cal_x); - _mav_put_float(buf, 34, accel_cal_y); - _mav_put_float(buf, 38, accel_cal_z); - - memcpy(_MAV_PAYLOAD(msg), buf, 42); -#else - mavlink_sensor_offsets_t packet; - packet.mag_ofs_x = mag_ofs_x; - packet.mag_ofs_y = mag_ofs_y; - packet.mag_ofs_z = mag_ofs_z; - packet.mag_declination = mag_declination; - packet.raw_press = raw_press; - packet.raw_temp = raw_temp; - packet.gyro_cal_x = gyro_cal_x; - packet.gyro_cal_y = gyro_cal_y; - packet.gyro_cal_z = gyro_cal_z; - packet.accel_cal_x = accel_cal_x; - packet.accel_cal_y = accel_cal_y; - packet.accel_cal_z = accel_cal_z; - - memcpy(_MAV_PAYLOAD(msg), &packet, 42); -#endif - - msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; - return mavlink_finalize_message(msg, system_id, component_id, 42); -} - -/** - * @brief Pack a sensor_offsets message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param mag_ofs_x magnetometer X offset - * @param mag_ofs_y magnetometer Y offset - * @param mag_ofs_z magnetometer Z offset - * @param mag_declination magnetic declination (radians) - * @param raw_press raw pressure from barometer - * @param raw_temp raw temperature from barometer - * @param gyro_cal_x gyro X calibration - * @param gyro_cal_y gyro Y calibration - * @param gyro_cal_z gyro Z calibration - * @param accel_cal_x accel X calibration - * @param accel_cal_y accel Y calibration - * @param accel_cal_z accel Z calibration - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_sensor_offsets_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - int16_t mag_ofs_x,int16_t mag_ofs_y,int16_t mag_ofs_z,float mag_declination,int32_t raw_press,int32_t raw_temp,float gyro_cal_x,float gyro_cal_y,float gyro_cal_z,float accel_cal_x,float accel_cal_y,float accel_cal_z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[42]; - _mav_put_int16_t(buf, 0, mag_ofs_x); - _mav_put_int16_t(buf, 2, mag_ofs_y); - _mav_put_int16_t(buf, 4, mag_ofs_z); - _mav_put_float(buf, 6, mag_declination); - _mav_put_int32_t(buf, 10, raw_press); - _mav_put_int32_t(buf, 14, raw_temp); - _mav_put_float(buf, 18, gyro_cal_x); - _mav_put_float(buf, 22, gyro_cal_y); - _mav_put_float(buf, 26, gyro_cal_z); - _mav_put_float(buf, 30, accel_cal_x); - _mav_put_float(buf, 34, accel_cal_y); - _mav_put_float(buf, 38, accel_cal_z); - - memcpy(_MAV_PAYLOAD(msg), buf, 42); -#else - mavlink_sensor_offsets_t packet; - packet.mag_ofs_x = mag_ofs_x; - packet.mag_ofs_y = mag_ofs_y; - packet.mag_ofs_z = mag_ofs_z; - packet.mag_declination = mag_declination; - packet.raw_press = raw_press; - packet.raw_temp = raw_temp; - packet.gyro_cal_x = gyro_cal_x; - packet.gyro_cal_y = gyro_cal_y; - packet.gyro_cal_z = gyro_cal_z; - packet.accel_cal_x = accel_cal_x; - packet.accel_cal_y = accel_cal_y; - packet.accel_cal_z = accel_cal_z; - - memcpy(_MAV_PAYLOAD(msg), &packet, 42); -#endif - - msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 42); -} - -/** - * @brief Encode a sensor_offsets struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param sensor_offsets C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_sensor_offsets_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_sensor_offsets_t* sensor_offsets) -{ - return mavlink_msg_sensor_offsets_pack(system_id, component_id, msg, sensor_offsets->mag_ofs_x, sensor_offsets->mag_ofs_y, sensor_offsets->mag_ofs_z, sensor_offsets->mag_declination, sensor_offsets->raw_press, sensor_offsets->raw_temp, sensor_offsets->gyro_cal_x, sensor_offsets->gyro_cal_y, sensor_offsets->gyro_cal_z, sensor_offsets->accel_cal_x, sensor_offsets->accel_cal_y, sensor_offsets->accel_cal_z); -} - -/** - * @brief Send a sensor_offsets message - * @param chan MAVLink channel to send the message - * - * @param mag_ofs_x magnetometer X offset - * @param mag_ofs_y magnetometer Y offset - * @param mag_ofs_z magnetometer Z offset - * @param mag_declination magnetic declination (radians) - * @param raw_press raw pressure from barometer - * @param raw_temp raw temperature from barometer - * @param gyro_cal_x gyro X calibration - * @param gyro_cal_y gyro Y calibration - * @param gyro_cal_z gyro Z calibration - * @param accel_cal_x accel X calibration - * @param accel_cal_y accel Y calibration - * @param accel_cal_z accel Z calibration - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_sensor_offsets_send(mavlink_channel_t chan, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z, float mag_declination, int32_t raw_press, int32_t raw_temp, float gyro_cal_x, float gyro_cal_y, float gyro_cal_z, float accel_cal_x, float accel_cal_y, float accel_cal_z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[42]; - _mav_put_int16_t(buf, 0, mag_ofs_x); - _mav_put_int16_t(buf, 2, mag_ofs_y); - _mav_put_int16_t(buf, 4, mag_ofs_z); - _mav_put_float(buf, 6, mag_declination); - _mav_put_int32_t(buf, 10, raw_press); - _mav_put_int32_t(buf, 14, raw_temp); - _mav_put_float(buf, 18, gyro_cal_x); - _mav_put_float(buf, 22, gyro_cal_y); - _mav_put_float(buf, 26, gyro_cal_z); - _mav_put_float(buf, 30, accel_cal_x); - _mav_put_float(buf, 34, accel_cal_y); - _mav_put_float(buf, 38, accel_cal_z); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, buf, 42); -#else - mavlink_sensor_offsets_t packet; - packet.mag_ofs_x = mag_ofs_x; - packet.mag_ofs_y = mag_ofs_y; - packet.mag_ofs_z = mag_ofs_z; - packet.mag_declination = mag_declination; - packet.raw_press = raw_press; - packet.raw_temp = raw_temp; - packet.gyro_cal_x = gyro_cal_x; - packet.gyro_cal_y = gyro_cal_y; - packet.gyro_cal_z = gyro_cal_z; - packet.accel_cal_x = accel_cal_x; - packet.accel_cal_y = accel_cal_y; - packet.accel_cal_z = accel_cal_z; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, (const char *)&packet, 42); -#endif -} - -#endif - -// MESSAGE SENSOR_OFFSETS UNPACKING - - -/** - * @brief Get field mag_ofs_x from sensor_offsets message - * - * @return magnetometer X offset - */ -static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 0); -} - -/** - * @brief Get field mag_ofs_y from sensor_offsets message - * - * @return magnetometer Y offset - */ -static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 2); -} - -/** - * @brief Get field mag_ofs_z from sensor_offsets message - * - * @return magnetometer Z offset - */ -static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 4); -} - -/** - * @brief Get field mag_declination from sensor_offsets message - * - * @return magnetic declination (radians) - */ -static inline float mavlink_msg_sensor_offsets_get_mag_declination(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 6); -} - -/** - * @brief Get field raw_press from sensor_offsets message - * - * @return raw pressure from barometer - */ -static inline int32_t mavlink_msg_sensor_offsets_get_raw_press(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 10); -} - -/** - * @brief Get field raw_temp from sensor_offsets message - * - * @return raw temperature from barometer - */ -static inline int32_t mavlink_msg_sensor_offsets_get_raw_temp(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 14); -} - -/** - * @brief Get field gyro_cal_x from sensor_offsets message - * - * @return gyro X calibration - */ -static inline float mavlink_msg_sensor_offsets_get_gyro_cal_x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 18); -} - -/** - * @brief Get field gyro_cal_y from sensor_offsets message - * - * @return gyro Y calibration - */ -static inline float mavlink_msg_sensor_offsets_get_gyro_cal_y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 22); -} - -/** - * @brief Get field gyro_cal_z from sensor_offsets message - * - * @return gyro Z calibration - */ -static inline float mavlink_msg_sensor_offsets_get_gyro_cal_z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 26); -} - -/** - * @brief Get field accel_cal_x from sensor_offsets message - * - * @return accel X calibration - */ -static inline float mavlink_msg_sensor_offsets_get_accel_cal_x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 30); -} - -/** - * @brief Get field accel_cal_y from sensor_offsets message - * - * @return accel Y calibration - */ -static inline float mavlink_msg_sensor_offsets_get_accel_cal_y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 34); -} - -/** - * @brief Get field accel_cal_z from sensor_offsets message - * - * @return accel Z calibration - */ -static inline float mavlink_msg_sensor_offsets_get_accel_cal_z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 38); -} - -/** - * @brief Decode a sensor_offsets message into a struct - * - * @param msg The message to decode - * @param sensor_offsets C-struct to decode the message contents into - */ -static inline void mavlink_msg_sensor_offsets_decode(const mavlink_message_t* msg, mavlink_sensor_offsets_t* sensor_offsets) -{ -#if MAVLINK_NEED_BYTE_SWAP - sensor_offsets->mag_ofs_x = mavlink_msg_sensor_offsets_get_mag_ofs_x(msg); - sensor_offsets->mag_ofs_y = mavlink_msg_sensor_offsets_get_mag_ofs_y(msg); - sensor_offsets->mag_ofs_z = mavlink_msg_sensor_offsets_get_mag_ofs_z(msg); - sensor_offsets->mag_declination = mavlink_msg_sensor_offsets_get_mag_declination(msg); - sensor_offsets->raw_press = mavlink_msg_sensor_offsets_get_raw_press(msg); - sensor_offsets->raw_temp = mavlink_msg_sensor_offsets_get_raw_temp(msg); - sensor_offsets->gyro_cal_x = mavlink_msg_sensor_offsets_get_gyro_cal_x(msg); - sensor_offsets->gyro_cal_y = mavlink_msg_sensor_offsets_get_gyro_cal_y(msg); - sensor_offsets->gyro_cal_z = mavlink_msg_sensor_offsets_get_gyro_cal_z(msg); - sensor_offsets->accel_cal_x = mavlink_msg_sensor_offsets_get_accel_cal_x(msg); - sensor_offsets->accel_cal_y = mavlink_msg_sensor_offsets_get_accel_cal_y(msg); - sensor_offsets->accel_cal_z = mavlink_msg_sensor_offsets_get_accel_cal_z(msg); -#else - memcpy(sensor_offsets, _MAV_PAYLOAD(msg), 42); -#endif -} diff --git a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_set_mag_offsets.h b/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_set_mag_offsets.h deleted file mode 100644 index 6243b440a..000000000 --- a/src/GCS_MAVLink/include/ardupilotmega/mavlink_msg_set_mag_offsets.h +++ /dev/null @@ -1,232 +0,0 @@ -// MESSAGE SET_MAG_OFFSETS PACKING - -#define MAVLINK_MSG_ID_SET_MAG_OFFSETS 151 - -typedef struct __mavlink_set_mag_offsets_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - int16_t mag_ofs_x; ///< magnetometer X offset - int16_t mag_ofs_y; ///< magnetometer Y offset - int16_t mag_ofs_z; ///< magnetometer Z offset -} mavlink_set_mag_offsets_t; - -#define MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN 8 -#define MAVLINK_MSG_ID_151_LEN 8 - - - -#define MAVLINK_MESSAGE_INFO_SET_MAG_OFFSETS { \ - "SET_MAG_OFFSETS", \ - 5, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_set_mag_offsets_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_set_mag_offsets_t, target_component) }, \ - { "mag_ofs_x", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_set_mag_offsets_t, mag_ofs_x) }, \ - { "mag_ofs_y", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_set_mag_offsets_t, mag_ofs_y) }, \ - { "mag_ofs_z", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_set_mag_offsets_t, mag_ofs_z) }, \ - } \ -} - - -/** - * @brief Pack a set_mag_offsets message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param mag_ofs_x magnetometer X offset - * @param mag_ofs_y magnetometer Y offset - * @param mag_ofs_z magnetometer Z offset - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_set_mag_offsets_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_int16_t(buf, 2, mag_ofs_x); - _mav_put_int16_t(buf, 4, mag_ofs_y); - _mav_put_int16_t(buf, 6, mag_ofs_z); - - memcpy(_MAV_PAYLOAD(msg), buf, 8); -#else - mavlink_set_mag_offsets_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.mag_ofs_x = mag_ofs_x; - packet.mag_ofs_y = mag_ofs_y; - packet.mag_ofs_z = mag_ofs_z; - - memcpy(_MAV_PAYLOAD(msg), &packet, 8); -#endif - - msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; - return mavlink_finalize_message(msg, system_id, component_id, 8); -} - -/** - * @brief Pack a set_mag_offsets message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param mag_ofs_x magnetometer X offset - * @param mag_ofs_y magnetometer Y offset - * @param mag_ofs_z magnetometer Z offset - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_set_mag_offsets_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,int16_t mag_ofs_x,int16_t mag_ofs_y,int16_t mag_ofs_z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_int16_t(buf, 2, mag_ofs_x); - _mav_put_int16_t(buf, 4, mag_ofs_y); - _mav_put_int16_t(buf, 6, mag_ofs_z); - - memcpy(_MAV_PAYLOAD(msg), buf, 8); -#else - mavlink_set_mag_offsets_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.mag_ofs_x = mag_ofs_x; - packet.mag_ofs_y = mag_ofs_y; - packet.mag_ofs_z = mag_ofs_z; - - memcpy(_MAV_PAYLOAD(msg), &packet, 8); -#endif - - msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8); -} - -/** - * @brief Encode a set_mag_offsets struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param set_mag_offsets C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_set_mag_offsets_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_mag_offsets_t* set_mag_offsets) -{ - return mavlink_msg_set_mag_offsets_pack(system_id, component_id, msg, set_mag_offsets->target_system, set_mag_offsets->target_component, set_mag_offsets->mag_ofs_x, set_mag_offsets->mag_ofs_y, set_mag_offsets->mag_ofs_z); -} - -/** - * @brief Send a set_mag_offsets message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param mag_ofs_x magnetometer X offset - * @param mag_ofs_y magnetometer Y offset - * @param mag_ofs_z magnetometer Z offset - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_set_mag_offsets_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_int16_t(buf, 2, mag_ofs_x); - _mav_put_int16_t(buf, 4, mag_ofs_y); - _mav_put_int16_t(buf, 6, mag_ofs_z); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS, buf, 8); -#else - mavlink_set_mag_offsets_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.mag_ofs_x = mag_ofs_x; - packet.mag_ofs_y = mag_ofs_y; - packet.mag_ofs_z = mag_ofs_z; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS, (const char *)&packet, 8); -#endif -} - -#endif - -// MESSAGE SET_MAG_OFFSETS UNPACKING - - -/** - * @brief Get field target_system from set_mag_offsets message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_set_mag_offsets_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from set_mag_offsets message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_set_mag_offsets_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field mag_ofs_x from set_mag_offsets message - * - * @return magnetometer X offset - */ -static inline int16_t mavlink_msg_set_mag_offsets_get_mag_ofs_x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 2); -} - -/** - * @brief Get field mag_ofs_y from set_mag_offsets message - * - * @return magnetometer Y offset - */ -static inline int16_t mavlink_msg_set_mag_offsets_get_mag_ofs_y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 4); -} - -/** - * @brief Get field mag_ofs_z from set_mag_offsets message - * - * @return magnetometer Z offset - */ -static inline int16_t mavlink_msg_set_mag_offsets_get_mag_ofs_z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 6); -} - -/** - * @brief Decode a set_mag_offsets message into a struct - * - * @param msg The message to decode - * @param set_mag_offsets C-struct to decode the message contents into - */ -static inline void mavlink_msg_set_mag_offsets_decode(const mavlink_message_t* msg, mavlink_set_mag_offsets_t* set_mag_offsets) -{ -#if MAVLINK_NEED_BYTE_SWAP - set_mag_offsets->target_system = mavlink_msg_set_mag_offsets_get_target_system(msg); - set_mag_offsets->target_component = mavlink_msg_set_mag_offsets_get_target_component(msg); - set_mag_offsets->mag_ofs_x = mavlink_msg_set_mag_offsets_get_mag_ofs_x(msg); - set_mag_offsets->mag_ofs_y = mavlink_msg_set_mag_offsets_get_mag_ofs_y(msg); - set_mag_offsets->mag_ofs_z = mavlink_msg_set_mag_offsets_get_mag_ofs_z(msg); -#else - memcpy(set_mag_offsets, _MAV_PAYLOAD(msg), 8); -#endif -} diff --git a/src/GCS_MAVLink/include/ardupilotmega/testsuite.h b/src/GCS_MAVLink/include/ardupilotmega/testsuite.h deleted file mode 100644 index 7e91d71da..000000000 --- a/src/GCS_MAVLink/include/ardupilotmega/testsuite.h +++ /dev/null @@ -1,690 +0,0 @@ -/** @file - * @brief MAVLink comm protocol testsuite generated from ardupilotmega.xml - * @see http://qgroundcontrol.org/mavlink/ - */ -#ifndef ARDUPILOTMEGA_TESTSUITE_H -#define ARDUPILOTMEGA_TESTSUITE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef MAVLINK_TEST_ALL -#define MAVLINK_TEST_ALL -static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg); -static void mavlink_test_ardupilotmega(uint8_t, uint8_t, mavlink_message_t *last_msg); - -static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_test_common(system_id, component_id, last_msg); - mavlink_test_ardupilotmega(system_id, component_id, last_msg); -} -#endif - -#include "../common/testsuite.h" - - -static void mavlink_test_sensor_offsets(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_message_t msg; - uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; - uint16_t i; - mavlink_sensor_offsets_t packet_in = { - 17235, - 17339, - 17443, - 59.0, - 963497984, - 963498192, - 143.0, - 171.0, - 199.0, - 227.0, - 255.0, - 283.0, - }; - mavlink_sensor_offsets_t packet1, packet2; - memset(&packet1, 0, sizeof(packet1)); - packet1.mag_ofs_x = packet_in.mag_ofs_x; - packet1.mag_ofs_y = packet_in.mag_ofs_y; - packet1.mag_ofs_z = packet_in.mag_ofs_z; - packet1.mag_declination = packet_in.mag_declination; - packet1.raw_press = packet_in.raw_press; - packet1.raw_temp = packet_in.raw_temp; - packet1.gyro_cal_x = packet_in.gyro_cal_x; - packet1.gyro_cal_y = packet_in.gyro_cal_y; - packet1.gyro_cal_z = packet_in.gyro_cal_z; - packet1.accel_cal_x = packet_in.accel_cal_x; - packet1.accel_cal_y = packet_in.accel_cal_y; - packet1.accel_cal_z = packet_in.accel_cal_z; - - - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_sensor_offsets_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_sensor_offsets_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_sensor_offsets_pack(system_id, component_id, &msg , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z , packet1.mag_declination , packet1.raw_press , packet1.raw_temp , packet1.gyro_cal_x , packet1.gyro_cal_y , packet1.gyro_cal_z , packet1.accel_cal_x , packet1.accel_cal_y , packet1.accel_cal_z ); - mavlink_msg_sensor_offsets_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_sensor_offsets_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z , packet1.mag_declination , packet1.raw_press , packet1.raw_temp , packet1.gyro_cal_x , packet1.gyro_cal_y , packet1.gyro_cal_z , packet1.accel_cal_x , packet1.accel_cal_y , packet1.accel_cal_z ); - mavlink_msg_sensor_offsets_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_to_send_buffer(buffer, &msg); - for (i=0; i>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4); -} - -/** - * @brief Initiliaze the buffer for the X.25 CRC - * - * @param crcAccum the 16 bit X.25 CRC - */ -static inline void crc_init(uint16_t* crcAccum) -{ - *crcAccum = X25_INIT_CRC; -} - - -/** - * @brief Calculates the X.25 checksum on a byte buffer - * - * @param pBuffer buffer containing the byte array to hash - * @param length length of the byte array - * @return the checksum over the buffer bytes - **/ -static inline uint16_t crc_calculate(uint8_t* pBuffer, uint16_t length) -{ - uint16_t crcTmp; - crc_init(&crcTmp); - while (length--) { - crc_accumulate(*pBuffer++, &crcTmp); - } - return crcTmp; -} - -/** - * @brief Accumulate the X.25 CRC by adding an array of bytes - * - * The checksum function adds the hash of one char at a time to the - * 16 bit checksum (uint16_t). - * - * @param data new bytes to hash - * @param crcAccum the already accumulated checksum - **/ -static inline void crc_accumulate_buffer(uint16_t *crcAccum, const char *pBuffer, uint8_t length) -{ - const uint8_t *p = (const uint8_t *)pBuffer; - while (length--) { - crc_accumulate(*p++, crcAccum); - } -} - - - - -#endif /* _CHECKSUM_H_ */ - -#ifdef __cplusplus -} -#endif diff --git a/src/GCS_MAVLink/include/common/common.h b/src/GCS_MAVLink/include/common/common.h deleted file mode 100644 index d61e06153..000000000 --- a/src/GCS_MAVLink/include/common/common.h +++ /dev/null @@ -1,159 +0,0 @@ -/** @file - * @brief MAVLink comm protocol generated from common.xml - * @see http://qgroundcontrol.org/mavlink/ - */ -#ifndef COMMON_H -#define COMMON_H - -#ifdef __cplusplus -extern "C" { -#endif - -// MESSAGE LENGTHS AND CRCS - -#ifndef MAVLINK_MESSAGE_LENGTHS -#define MAVLINK_MESSAGE_LENGTHS {3, 4, 8, 14, 8, 28, 3, 32, 0, 2, 3, 2, 2, 0, 0, 0, 0, 0, 0, 0, 19, 2, 23, 21, 0, 37, 26, 101, 26, 16, 32, 32, 37, 32, 11, 17, 17, 16, 18, 36, 4, 4, 2, 2, 4, 2, 2, 3, 14, 12, 18, 16, 8, 27, 25, 18, 18, 24, 24, 0, 0, 0, 26, 16, 36, 5, 6, 56, 26, 21, 18, 0, 0, 18, 20, 20, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 14, 14, 51, 5} -#endif - -#ifndef MAVLINK_MESSAGE_CRCS -#define MAVLINK_MESSAGE_CRCS {72, 39, 190, 92, 191, 217, 104, 119, 0, 219, 60, 186, 10, 0, 0, 0, 0, 0, 0, 0, 89, 159, 162, 121, 0, 149, 222, 110, 179, 136, 66, 126, 185, 147, 112, 252, 162, 215, 229, 128, 9, 106, 101, 213, 4, 229, 21, 214, 215, 14, 206, 50, 157, 126, 108, 213, 95, 5, 127, 0, 0, 0, 57, 126, 130, 119, 193, 191, 236, 158, 143, 0, 0, 104, 123, 131, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 178, 224, 60, 106, 7} -#endif - -#ifndef MAVLINK_MESSAGE_INFO -#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_BOOT, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_SYSTEM_TIME_UTC, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {NULL}, MAVLINK_MESSAGE_INFO_ACTION_ACK, MAVLINK_MESSAGE_INFO_ACTION, MAVLINK_MESSAGE_INFO_SET_MODE, MAVLINK_MESSAGE_INFO_SET_NAV_MODE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, {NULL}, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_LOCAL_POSITION, MAVLINK_MESSAGE_INFO_GPS_RAW, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_WAYPOINT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST, MAVLINK_MESSAGE_INFO_WAYPOINT_SET_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST_LIST, MAVLINK_MESSAGE_INFO_WAYPOINT_COUNT, MAVLINK_MESSAGE_INFO_WAYPOINT_CLEAR_ALL, MAVLINK_MESSAGE_INFO_WAYPOINT_REACHED, MAVLINK_MESSAGE_INFO_WAYPOINT_ACK, MAVLINK_MESSAGE_INFO_GPS_SET_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_LOCAL_ORIGIN_SET, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT_SET, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_CONTROL_STATUS, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, MAVLINK_MESSAGE_INFO_POSITION_TARGET, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, MAVLINK_MESSAGE_INFO_SET_ALTITUDE, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_OBJECT_DETECTION_EVENT, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG} -#endif - -#include "../protocol.h" - -#define MAVLINK_ENABLED_COMMON - - - -// MAVLINK VERSION - -#ifndef MAVLINK_VERSION -#define MAVLINK_VERSION 2 -#endif - -#if (MAVLINK_VERSION == 0) -#undef MAVLINK_VERSION -#define MAVLINK_VERSION 2 -#endif - -// ENUM DEFINITIONS - - -/** @brief Data stream IDs. A data stream is not a fixed set of messages, but rather a - recommendation to the autopilot software. Individual autopilots may or may not obey - the recommended messages. - */ -#ifndef HAVE_ENUM_MAV_DATA_STREAM -#define HAVE_ENUM_MAV_DATA_STREAM -enum MAV_DATA_STREAM -{ - MAV_DATA_STREAM_ALL=0, /* Enable all data streams | */ - MAV_DATA_STREAM_RAW_SENSORS=1, /* Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. | */ - MAV_DATA_STREAM_EXTENDED_STATUS=2, /* Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS | */ - MAV_DATA_STREAM_RC_CHANNELS=3, /* Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW | */ - MAV_DATA_STREAM_RAW_CONTROLLER=4, /* Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT. | */ - MAV_DATA_STREAM_POSITION=6, /* Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages. | */ - MAV_DATA_STREAM_EXTRA1=10, /* Dependent on the autopilot | */ - MAV_DATA_STREAM_EXTRA2=11, /* Dependent on the autopilot | */ - MAV_DATA_STREAM_EXTRA3=12, /* Dependent on the autopilot | */ - MAV_DATA_STREAM_ENUM_END=13, /* | */ -}; -#endif - -/** @brief The ROI (region of interest) for the vehicle. This can be - be used by the vehicle for camera/vehicle attitude alignment (see - MAV_CMD_NAV_ROI). - */ -#ifndef HAVE_ENUM_MAV_ROI -#define HAVE_ENUM_MAV_ROI -enum MAV_ROI -{ - MAV_ROI_NONE=0, /* No region of interest. | */ - MAV_ROI_WPNEXT=1, /* Point toward next waypoint. | */ - MAV_ROI_WPINDEX=2, /* Point toward given waypoint. | */ - MAV_ROI_LOCATION=3, /* Point toward fixed location. | */ - MAV_ROI_TARGET=4, /* Point toward of given id. | */ - MAV_ROI_ENUM_END=5, /* | */ -}; -#endif - -// MESSAGE DEFINITIONS -#include "./mavlink_msg_heartbeat.h" -#include "./mavlink_msg_boot.h" -#include "./mavlink_msg_system_time.h" -#include "./mavlink_msg_ping.h" -#include "./mavlink_msg_system_time_utc.h" -#include "./mavlink_msg_change_operator_control.h" -#include "./mavlink_msg_change_operator_control_ack.h" -#include "./mavlink_msg_auth_key.h" -#include "./mavlink_msg_action_ack.h" -#include "./mavlink_msg_action.h" -#include "./mavlink_msg_set_mode.h" -#include "./mavlink_msg_set_nav_mode.h" -#include "./mavlink_msg_param_request_read.h" -#include "./mavlink_msg_param_request_list.h" -#include "./mavlink_msg_param_value.h" -#include "./mavlink_msg_param_set.h" -#include "./mavlink_msg_gps_raw_int.h" -#include "./mavlink_msg_scaled_imu.h" -#include "./mavlink_msg_gps_status.h" -#include "./mavlink_msg_raw_imu.h" -#include "./mavlink_msg_raw_pressure.h" -#include "./mavlink_msg_scaled_pressure.h" -#include "./mavlink_msg_attitude.h" -#include "./mavlink_msg_local_position.h" -#include "./mavlink_msg_global_position.h" -#include "./mavlink_msg_gps_raw.h" -#include "./mavlink_msg_sys_status.h" -#include "./mavlink_msg_rc_channels_raw.h" -#include "./mavlink_msg_rc_channels_scaled.h" -#include "./mavlink_msg_servo_output_raw.h" -#include "./mavlink_msg_waypoint.h" -#include "./mavlink_msg_waypoint_request.h" -#include "./mavlink_msg_waypoint_set_current.h" -#include "./mavlink_msg_waypoint_current.h" -#include "./mavlink_msg_waypoint_request_list.h" -#include "./mavlink_msg_waypoint_count.h" -#include "./mavlink_msg_waypoint_clear_all.h" -#include "./mavlink_msg_waypoint_reached.h" -#include "./mavlink_msg_waypoint_ack.h" -#include "./mavlink_msg_gps_set_global_origin.h" -#include "./mavlink_msg_gps_local_origin_set.h" -#include "./mavlink_msg_local_position_setpoint_set.h" -#include "./mavlink_msg_local_position_setpoint.h" -#include "./mavlink_msg_control_status.h" -#include "./mavlink_msg_safety_set_allowed_area.h" -#include "./mavlink_msg_safety_allowed_area.h" -#include "./mavlink_msg_set_roll_pitch_yaw_thrust.h" -#include "./mavlink_msg_set_roll_pitch_yaw_speed_thrust.h" -#include "./mavlink_msg_roll_pitch_yaw_thrust_setpoint.h" -#include "./mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h" -#include "./mavlink_msg_nav_controller_output.h" -#include "./mavlink_msg_position_target.h" -#include "./mavlink_msg_state_correction.h" -#include "./mavlink_msg_set_altitude.h" -#include "./mavlink_msg_request_data_stream.h" -#include "./mavlink_msg_hil_state.h" -#include "./mavlink_msg_hil_controls.h" -#include "./mavlink_msg_manual_control.h" -#include "./mavlink_msg_rc_channels_override.h" -#include "./mavlink_msg_global_position_int.h" -#include "./mavlink_msg_vfr_hud.h" -#include "./mavlink_msg_command.h" -#include "./mavlink_msg_command_ack.h" -#include "./mavlink_msg_optical_flow.h" -#include "./mavlink_msg_object_detection_event.h" -#include "./mavlink_msg_debug_vect.h" -#include "./mavlink_msg_named_value_float.h" -#include "./mavlink_msg_named_value_int.h" -#include "./mavlink_msg_statustext.h" -#include "./mavlink_msg_debug.h" - -#ifdef __cplusplus -} -#endif // __cplusplus -#endif // COMMON_H diff --git a/src/GCS_MAVLink/include/common/mavlink.h b/src/GCS_MAVLink/include/common/mavlink.h deleted file mode 100644 index 02ff5bd39..000000000 --- a/src/GCS_MAVLink/include/common/mavlink.h +++ /dev/null @@ -1,27 +0,0 @@ -/** @file - * @brief MAVLink comm protocol built from common.xml - * @see http://pixhawk.ethz.ch/software/mavlink - */ -#ifndef MAVLINK_H -#define MAVLINK_H - -#ifndef MAVLINK_STX -#define MAVLINK_STX 85 -#endif - -#ifndef MAVLINK_ENDIAN -#define MAVLINK_ENDIAN MAVLINK_BIG_ENDIAN -#endif - -#ifndef MAVLINK_ALIGNED_FIELDS -#define MAVLINK_ALIGNED_FIELDS 0 -#endif - -#ifndef MAVLINK_CRC_EXTRA -#define MAVLINK_CRC_EXTRA 0 -#endif - -#include "version.h" -#include "common.h" - -#endif // MAVLINK_H diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_action.h b/src/GCS_MAVLink/include/common/mavlink_msg_action.h deleted file mode 100644 index a92f3e005..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_action.h +++ /dev/null @@ -1,188 +0,0 @@ -// MESSAGE ACTION PACKING - -#define MAVLINK_MSG_ID_ACTION 10 - -typedef struct __mavlink_action_t -{ - uint8_t target; ///< The system executing the action - uint8_t target_component; ///< The component executing the action - uint8_t action; ///< The action id -} mavlink_action_t; - -#define MAVLINK_MSG_ID_ACTION_LEN 3 -#define MAVLINK_MSG_ID_10_LEN 3 - - - -#define MAVLINK_MESSAGE_INFO_ACTION { \ - "ACTION", \ - 3, \ - { { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_action_t, target) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_action_t, target_component) }, \ - { "action", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_action_t, action) }, \ - } \ -} - - -/** - * @brief Pack a action message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target The system executing the action - * @param target_component The component executing the action - * @param action The action id - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_action_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target, uint8_t target_component, uint8_t action) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, action); - - memcpy(_MAV_PAYLOAD(msg), buf, 3); -#else - mavlink_action_t packet; - packet.target = target; - packet.target_component = target_component; - packet.action = action; - - memcpy(_MAV_PAYLOAD(msg), &packet, 3); -#endif - - msg->msgid = MAVLINK_MSG_ID_ACTION; - return mavlink_finalize_message(msg, system_id, component_id, 3); -} - -/** - * @brief Pack a action message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target The system executing the action - * @param target_component The component executing the action - * @param action The action id - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_action_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target,uint8_t target_component,uint8_t action) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, action); - - memcpy(_MAV_PAYLOAD(msg), buf, 3); -#else - mavlink_action_t packet; - packet.target = target; - packet.target_component = target_component; - packet.action = action; - - memcpy(_MAV_PAYLOAD(msg), &packet, 3); -#endif - - msg->msgid = MAVLINK_MSG_ID_ACTION; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3); -} - -/** - * @brief Encode a action struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param action C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_action_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_action_t* action) -{ - return mavlink_msg_action_pack(system_id, component_id, msg, action->target, action->target_component, action->action); -} - -/** - * @brief Send a action message - * @param chan MAVLink channel to send the message - * - * @param target The system executing the action - * @param target_component The component executing the action - * @param action The action id - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_action_send(mavlink_channel_t chan, uint8_t target, uint8_t target_component, uint8_t action) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, action); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTION, buf, 3); -#else - mavlink_action_t packet; - packet.target = target; - packet.target_component = target_component; - packet.action = action; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTION, (const char *)&packet, 3); -#endif -} - -#endif - -// MESSAGE ACTION UNPACKING - - -/** - * @brief Get field target from action message - * - * @return The system executing the action - */ -static inline uint8_t mavlink_msg_action_get_target(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from action message - * - * @return The component executing the action - */ -static inline uint8_t mavlink_msg_action_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field action from action message - * - * @return The action id - */ -static inline uint8_t mavlink_msg_action_get_action(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Decode a action message into a struct - * - * @param msg The message to decode - * @param action C-struct to decode the message contents into - */ -static inline void mavlink_msg_action_decode(const mavlink_message_t* msg, mavlink_action_t* action) -{ -#if MAVLINK_NEED_BYTE_SWAP - action->target = mavlink_msg_action_get_target(msg); - action->target_component = mavlink_msg_action_get_target_component(msg); - action->action = mavlink_msg_action_get_action(msg); -#else - memcpy(action, _MAV_PAYLOAD(msg), 3); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_action_ack.h b/src/GCS_MAVLink/include/common/mavlink_msg_action_ack.h deleted file mode 100644 index b7fb3256d..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_action_ack.h +++ /dev/null @@ -1,166 +0,0 @@ -// MESSAGE ACTION_ACK PACKING - -#define MAVLINK_MSG_ID_ACTION_ACK 9 - -typedef struct __mavlink_action_ack_t -{ - uint8_t action; ///< The action id - uint8_t result; ///< 0: Action DENIED, 1: Action executed -} mavlink_action_ack_t; - -#define MAVLINK_MSG_ID_ACTION_ACK_LEN 2 -#define MAVLINK_MSG_ID_9_LEN 2 - - - -#define MAVLINK_MESSAGE_INFO_ACTION_ACK { \ - "ACTION_ACK", \ - 2, \ - { { "action", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_action_ack_t, action) }, \ - { "result", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_action_ack_t, result) }, \ - } \ -} - - -/** - * @brief Pack a action_ack message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param action The action id - * @param result 0: Action DENIED, 1: Action executed - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_action_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t action, uint8_t result) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, action); - _mav_put_uint8_t(buf, 1, result); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_action_ack_t packet; - packet.action = action; - packet.result = result; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_ACTION_ACK; - return mavlink_finalize_message(msg, system_id, component_id, 2); -} - -/** - * @brief Pack a action_ack message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param action The action id - * @param result 0: Action DENIED, 1: Action executed - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_action_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t action,uint8_t result) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, action); - _mav_put_uint8_t(buf, 1, result); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_action_ack_t packet; - packet.action = action; - packet.result = result; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_ACTION_ACK; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2); -} - -/** - * @brief Encode a action_ack struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param action_ack C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_action_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_action_ack_t* action_ack) -{ - return mavlink_msg_action_ack_pack(system_id, component_id, msg, action_ack->action, action_ack->result); -} - -/** - * @brief Send a action_ack message - * @param chan MAVLink channel to send the message - * - * @param action The action id - * @param result 0: Action DENIED, 1: Action executed - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_action_ack_send(mavlink_channel_t chan, uint8_t action, uint8_t result) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, action); - _mav_put_uint8_t(buf, 1, result); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTION_ACK, buf, 2); -#else - mavlink_action_ack_t packet; - packet.action = action; - packet.result = result; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTION_ACK, (const char *)&packet, 2); -#endif -} - -#endif - -// MESSAGE ACTION_ACK UNPACKING - - -/** - * @brief Get field action from action_ack message - * - * @return The action id - */ -static inline uint8_t mavlink_msg_action_ack_get_action(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field result from action_ack message - * - * @return 0: Action DENIED, 1: Action executed - */ -static inline uint8_t mavlink_msg_action_ack_get_result(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Decode a action_ack message into a struct - * - * @param msg The message to decode - * @param action_ack C-struct to decode the message contents into - */ -static inline void mavlink_msg_action_ack_decode(const mavlink_message_t* msg, mavlink_action_ack_t* action_ack) -{ -#if MAVLINK_NEED_BYTE_SWAP - action_ack->action = mavlink_msg_action_ack_get_action(msg); - action_ack->result = mavlink_msg_action_ack_get_result(msg); -#else - memcpy(action_ack, _MAV_PAYLOAD(msg), 2); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_attitude.h b/src/GCS_MAVLink/include/common/mavlink_msg_attitude.h deleted file mode 100644 index d3e3cb3dc..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_attitude.h +++ /dev/null @@ -1,276 +0,0 @@ -// MESSAGE ATTITUDE PACKING - -#define MAVLINK_MSG_ID_ATTITUDE 30 - -typedef struct __mavlink_attitude_t -{ - uint64_t usec; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - float roll; ///< Roll angle (rad) - float pitch; ///< Pitch angle (rad) - float yaw; ///< Yaw angle (rad) - float rollspeed; ///< Roll angular speed (rad/s) - float pitchspeed; ///< Pitch angular speed (rad/s) - float yawspeed; ///< Yaw angular speed (rad/s) -} mavlink_attitude_t; - -#define MAVLINK_MSG_ID_ATTITUDE_LEN 32 -#define MAVLINK_MSG_ID_30_LEN 32 - - - -#define MAVLINK_MESSAGE_INFO_ATTITUDE { \ - "ATTITUDE", \ - 7, \ - { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_attitude_t, usec) }, \ - { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_t, roll) }, \ - { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_t, pitch) }, \ - { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_t, yaw) }, \ - { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_t, rollspeed) }, \ - { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_t, pitchspeed) }, \ - { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_t, yawspeed) }, \ - } \ -} - - -/** - * @brief Pack a attitude message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param roll Roll angle (rad) - * @param pitch Pitch angle (rad) - * @param yaw Yaw angle (rad) - * @param rollspeed Roll angular speed (rad/s) - * @param pitchspeed Pitch angular speed (rad/s) - * @param yawspeed Yaw angular speed (rad/s) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, roll); - _mav_put_float(buf, 12, pitch); - _mav_put_float(buf, 16, yaw); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); - - memcpy(_MAV_PAYLOAD(msg), buf, 32); -#else - mavlink_attitude_t packet; - packet.usec = usec; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; - - memcpy(_MAV_PAYLOAD(msg), &packet, 32); -#endif - - msg->msgid = MAVLINK_MSG_ID_ATTITUDE; - return mavlink_finalize_message(msg, system_id, component_id, 32); -} - -/** - * @brief Pack a attitude message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param roll Roll angle (rad) - * @param pitch Pitch angle (rad) - * @param yaw Yaw angle (rad) - * @param rollspeed Roll angular speed (rad/s) - * @param pitchspeed Pitch angular speed (rad/s) - * @param yawspeed Yaw angular speed (rad/s) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t usec,float roll,float pitch,float yaw,float rollspeed,float pitchspeed,float yawspeed) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, roll); - _mav_put_float(buf, 12, pitch); - _mav_put_float(buf, 16, yaw); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); - - memcpy(_MAV_PAYLOAD(msg), buf, 32); -#else - mavlink_attitude_t packet; - packet.usec = usec; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; - - memcpy(_MAV_PAYLOAD(msg), &packet, 32); -#endif - - msg->msgid = MAVLINK_MSG_ID_ATTITUDE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32); -} - -/** - * @brief Encode a attitude struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param attitude C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_attitude_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_t* attitude) -{ - return mavlink_msg_attitude_pack(system_id, component_id, msg, attitude->usec, attitude->roll, attitude->pitch, attitude->yaw, attitude->rollspeed, attitude->pitchspeed, attitude->yawspeed); -} - -/** - * @brief Send a attitude message - * @param chan MAVLink channel to send the message - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param roll Roll angle (rad) - * @param pitch Pitch angle (rad) - * @param yaw Yaw angle (rad) - * @param rollspeed Roll angular speed (rad/s) - * @param pitchspeed Pitch angular speed (rad/s) - * @param yawspeed Yaw angular speed (rad/s) - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_attitude_send(mavlink_channel_t chan, uint64_t usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, roll); - _mav_put_float(buf, 12, pitch); - _mav_put_float(buf, 16, yaw); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, buf, 32); -#else - mavlink_attitude_t packet; - packet.usec = usec; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)&packet, 32); -#endif -} - -#endif - -// MESSAGE ATTITUDE UNPACKING - - -/** - * @brief Get field usec from attitude message - * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) - */ -static inline uint64_t mavlink_msg_attitude_get_usec(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field roll from attitude message - * - * @return Roll angle (rad) - */ -static inline float mavlink_msg_attitude_get_roll(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field pitch from attitude message - * - * @return Pitch angle (rad) - */ -static inline float mavlink_msg_attitude_get_pitch(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field yaw from attitude message - * - * @return Yaw angle (rad) - */ -static inline float mavlink_msg_attitude_get_yaw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 16); -} - -/** - * @brief Get field rollspeed from attitude message - * - * @return Roll angular speed (rad/s) - */ -static inline float mavlink_msg_attitude_get_rollspeed(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 20); -} - -/** - * @brief Get field pitchspeed from attitude message - * - * @return Pitch angular speed (rad/s) - */ -static inline float mavlink_msg_attitude_get_pitchspeed(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 24); -} - -/** - * @brief Get field yawspeed from attitude message - * - * @return Yaw angular speed (rad/s) - */ -static inline float mavlink_msg_attitude_get_yawspeed(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 28); -} - -/** - * @brief Decode a attitude message into a struct - * - * @param msg The message to decode - * @param attitude C-struct to decode the message contents into - */ -static inline void mavlink_msg_attitude_decode(const mavlink_message_t* msg, mavlink_attitude_t* attitude) -{ -#if MAVLINK_NEED_BYTE_SWAP - attitude->usec = mavlink_msg_attitude_get_usec(msg); - attitude->roll = mavlink_msg_attitude_get_roll(msg); - attitude->pitch = mavlink_msg_attitude_get_pitch(msg); - attitude->yaw = mavlink_msg_attitude_get_yaw(msg); - attitude->rollspeed = mavlink_msg_attitude_get_rollspeed(msg); - attitude->pitchspeed = mavlink_msg_attitude_get_pitchspeed(msg); - attitude->yawspeed = mavlink_msg_attitude_get_yawspeed(msg); -#else - memcpy(attitude, _MAV_PAYLOAD(msg), 32); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_auth_key.h b/src/GCS_MAVLink/include/common/mavlink_msg_auth_key.h deleted file mode 100644 index c563fb782..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_auth_key.h +++ /dev/null @@ -1,144 +0,0 @@ -// MESSAGE AUTH_KEY PACKING - -#define MAVLINK_MSG_ID_AUTH_KEY 7 - -typedef struct __mavlink_auth_key_t -{ - char key[32]; ///< key -} mavlink_auth_key_t; - -#define MAVLINK_MSG_ID_AUTH_KEY_LEN 32 -#define MAVLINK_MSG_ID_7_LEN 32 - -#define MAVLINK_MSG_AUTH_KEY_FIELD_KEY_LEN 32 - -#define MAVLINK_MESSAGE_INFO_AUTH_KEY { \ - "AUTH_KEY", \ - 1, \ - { { "key", NULL, MAVLINK_TYPE_CHAR, 32, 0, offsetof(mavlink_auth_key_t, key) }, \ - } \ -} - - -/** - * @brief Pack a auth_key message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param key key - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_auth_key_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - const char *key) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - - _mav_put_char_array(buf, 0, key, 32); - memcpy(_MAV_PAYLOAD(msg), buf, 32); -#else - mavlink_auth_key_t packet; - - mav_array_memcpy(packet.key, key, sizeof(char)*32); - memcpy(_MAV_PAYLOAD(msg), &packet, 32); -#endif - - msg->msgid = MAVLINK_MSG_ID_AUTH_KEY; - return mavlink_finalize_message(msg, system_id, component_id, 32); -} - -/** - * @brief Pack a auth_key message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param key key - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_auth_key_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - const char *key) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - - _mav_put_char_array(buf, 0, key, 32); - memcpy(_MAV_PAYLOAD(msg), buf, 32); -#else - mavlink_auth_key_t packet; - - mav_array_memcpy(packet.key, key, sizeof(char)*32); - memcpy(_MAV_PAYLOAD(msg), &packet, 32); -#endif - - msg->msgid = MAVLINK_MSG_ID_AUTH_KEY; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32); -} - -/** - * @brief Encode a auth_key struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param auth_key C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_auth_key_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_auth_key_t* auth_key) -{ - return mavlink_msg_auth_key_pack(system_id, component_id, msg, auth_key->key); -} - -/** - * @brief Send a auth_key message - * @param chan MAVLink channel to send the message - * - * @param key key - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_auth_key_send(mavlink_channel_t chan, const char *key) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - - _mav_put_char_array(buf, 0, key, 32); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, 32); -#else - mavlink_auth_key_t packet; - - mav_array_memcpy(packet.key, key, sizeof(char)*32); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)&packet, 32); -#endif -} - -#endif - -// MESSAGE AUTH_KEY UNPACKING - - -/** - * @brief Get field key from auth_key message - * - * @return key - */ -static inline uint16_t mavlink_msg_auth_key_get_key(const mavlink_message_t* msg, char *key) -{ - return _MAV_RETURN_char_array(msg, key, 32, 0); -} - -/** - * @brief Decode a auth_key message into a struct - * - * @param msg The message to decode - * @param auth_key C-struct to decode the message contents into - */ -static inline void mavlink_msg_auth_key_decode(const mavlink_message_t* msg, mavlink_auth_key_t* auth_key) -{ -#if MAVLINK_NEED_BYTE_SWAP - mavlink_msg_auth_key_get_key(msg, auth_key->key); -#else - memcpy(auth_key, _MAV_PAYLOAD(msg), 32); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_boot.h b/src/GCS_MAVLink/include/common/mavlink_msg_boot.h deleted file mode 100644 index 7541cabef..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_boot.h +++ /dev/null @@ -1,144 +0,0 @@ -// MESSAGE BOOT PACKING - -#define MAVLINK_MSG_ID_BOOT 1 - -typedef struct __mavlink_boot_t -{ - uint32_t version; ///< The onboard software version -} mavlink_boot_t; - -#define MAVLINK_MSG_ID_BOOT_LEN 4 -#define MAVLINK_MSG_ID_1_LEN 4 - - - -#define MAVLINK_MESSAGE_INFO_BOOT { \ - "BOOT", \ - 1, \ - { { "version", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_boot_t, version) }, \ - } \ -} - - -/** - * @brief Pack a boot message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param version The onboard software version - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_boot_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t version) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint32_t(buf, 0, version); - - memcpy(_MAV_PAYLOAD(msg), buf, 4); -#else - mavlink_boot_t packet; - packet.version = version; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_BOOT; - return mavlink_finalize_message(msg, system_id, component_id, 4); -} - -/** - * @brief Pack a boot message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param version The onboard software version - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_boot_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t version) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint32_t(buf, 0, version); - - memcpy(_MAV_PAYLOAD(msg), buf, 4); -#else - mavlink_boot_t packet; - packet.version = version; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_BOOT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4); -} - -/** - * @brief Encode a boot struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param boot C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_boot_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_boot_t* boot) -{ - return mavlink_msg_boot_pack(system_id, component_id, msg, boot->version); -} - -/** - * @brief Send a boot message - * @param chan MAVLink channel to send the message - * - * @param version The onboard software version - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_boot_send(mavlink_channel_t chan, uint32_t version) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint32_t(buf, 0, version); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BOOT, buf, 4); -#else - mavlink_boot_t packet; - packet.version = version; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BOOT, (const char *)&packet, 4); -#endif -} - -#endif - -// MESSAGE BOOT UNPACKING - - -/** - * @brief Get field version from boot message - * - * @return The onboard software version - */ -static inline uint32_t mavlink_msg_boot_get_version(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint32_t(msg, 0); -} - -/** - * @brief Decode a boot message into a struct - * - * @param msg The message to decode - * @param boot C-struct to decode the message contents into - */ -static inline void mavlink_msg_boot_decode(const mavlink_message_t* msg, mavlink_boot_t* boot) -{ -#if MAVLINK_NEED_BYTE_SWAP - boot->version = mavlink_msg_boot_get_version(msg); -#else - memcpy(boot, _MAV_PAYLOAD(msg), 4); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_change_operator_control.h b/src/GCS_MAVLink/include/common/mavlink_msg_change_operator_control.h deleted file mode 100644 index 6292849bd..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_change_operator_control.h +++ /dev/null @@ -1,204 +0,0 @@ -// MESSAGE CHANGE_OPERATOR_CONTROL PACKING - -#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL 5 - -typedef struct __mavlink_change_operator_control_t -{ - uint8_t target_system; ///< System the GCS requests control for - uint8_t control_request; ///< 0: request control of this MAV, 1: Release control of this MAV - uint8_t version; ///< 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. - char passkey[25]; ///< Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" -} mavlink_change_operator_control_t; - -#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN 28 -#define MAVLINK_MSG_ID_5_LEN 28 - -#define MAVLINK_MSG_CHANGE_OPERATOR_CONTROL_FIELD_PASSKEY_LEN 25 - -#define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL { \ - "CHANGE_OPERATOR_CONTROL", \ - 4, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_t, target_system) }, \ - { "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_t, control_request) }, \ - { "version", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_t, version) }, \ - { "passkey", NULL, MAVLINK_TYPE_CHAR, 25, 3, offsetof(mavlink_change_operator_control_t, passkey) }, \ - } \ -} - - -/** - * @brief Pack a change_operator_control message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System the GCS requests control for - * @param control_request 0: request control of this MAV, 1: Release control of this MAV - * @param version 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. - * @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_change_operator_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, control_request); - _mav_put_uint8_t(buf, 2, version); - _mav_put_char_array(buf, 3, passkey, 25); - memcpy(_MAV_PAYLOAD(msg), buf, 28); -#else - mavlink_change_operator_control_t packet; - packet.target_system = target_system; - packet.control_request = control_request; - packet.version = version; - mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25); - memcpy(_MAV_PAYLOAD(msg), &packet, 28); -#endif - - msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL; - return mavlink_finalize_message(msg, system_id, component_id, 28); -} - -/** - * @brief Pack a change_operator_control message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System the GCS requests control for - * @param control_request 0: request control of this MAV, 1: Release control of this MAV - * @param version 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. - * @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_change_operator_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t control_request,uint8_t version,const char *passkey) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, control_request); - _mav_put_uint8_t(buf, 2, version); - _mav_put_char_array(buf, 3, passkey, 25); - memcpy(_MAV_PAYLOAD(msg), buf, 28); -#else - mavlink_change_operator_control_t packet; - packet.target_system = target_system; - packet.control_request = control_request; - packet.version = version; - mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25); - memcpy(_MAV_PAYLOAD(msg), &packet, 28); -#endif - - msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28); -} - -/** - * @brief Encode a change_operator_control struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param change_operator_control C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_change_operator_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_change_operator_control_t* change_operator_control) -{ - return mavlink_msg_change_operator_control_pack(system_id, component_id, msg, change_operator_control->target_system, change_operator_control->control_request, change_operator_control->version, change_operator_control->passkey); -} - -/** - * @brief Send a change_operator_control message - * @param chan MAVLink channel to send the message - * - * @param target_system System the GCS requests control for - * @param control_request 0: request control of this MAV, 1: Release control of this MAV - * @param version 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. - * @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_change_operator_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, control_request); - _mav_put_uint8_t(buf, 2, version); - _mav_put_char_array(buf, 3, passkey, 25); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, buf, 28); -#else - mavlink_change_operator_control_t packet; - packet.target_system = target_system; - packet.control_request = control_request; - packet.version = version; - mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)&packet, 28); -#endif -} - -#endif - -// MESSAGE CHANGE_OPERATOR_CONTROL UNPACKING - - -/** - * @brief Get field target_system from change_operator_control message - * - * @return System the GCS requests control for - */ -static inline uint8_t mavlink_msg_change_operator_control_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field control_request from change_operator_control message - * - * @return 0: request control of this MAV, 1: Release control of this MAV - */ -static inline uint8_t mavlink_msg_change_operator_control_get_control_request(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field version from change_operator_control message - * - * @return 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. - */ -static inline uint8_t mavlink_msg_change_operator_control_get_version(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Get field passkey from change_operator_control message - * - * @return Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" - */ -static inline uint16_t mavlink_msg_change_operator_control_get_passkey(const mavlink_message_t* msg, char *passkey) -{ - return _MAV_RETURN_char_array(msg, passkey, 25, 3); -} - -/** - * @brief Decode a change_operator_control message into a struct - * - * @param msg The message to decode - * @param change_operator_control C-struct to decode the message contents into - */ -static inline void mavlink_msg_change_operator_control_decode(const mavlink_message_t* msg, mavlink_change_operator_control_t* change_operator_control) -{ -#if MAVLINK_NEED_BYTE_SWAP - change_operator_control->target_system = mavlink_msg_change_operator_control_get_target_system(msg); - change_operator_control->control_request = mavlink_msg_change_operator_control_get_control_request(msg); - change_operator_control->version = mavlink_msg_change_operator_control_get_version(msg); - mavlink_msg_change_operator_control_get_passkey(msg, change_operator_control->passkey); -#else - memcpy(change_operator_control, _MAV_PAYLOAD(msg), 28); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_change_operator_control_ack.h b/src/GCS_MAVLink/include/common/mavlink_msg_change_operator_control_ack.h deleted file mode 100644 index a24c6f5a0..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_change_operator_control_ack.h +++ /dev/null @@ -1,188 +0,0 @@ -// MESSAGE CHANGE_OPERATOR_CONTROL_ACK PACKING - -#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK 6 - -typedef struct __mavlink_change_operator_control_ack_t -{ - uint8_t gcs_system_id; ///< ID of the GCS this message - uint8_t control_request; ///< 0: request control of this MAV, 1: Release control of this MAV - uint8_t ack; ///< 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control -} mavlink_change_operator_control_ack_t; - -#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN 3 -#define MAVLINK_MSG_ID_6_LEN 3 - - - -#define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK { \ - "CHANGE_OPERATOR_CONTROL_ACK", \ - 3, \ - { { "gcs_system_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_ack_t, gcs_system_id) }, \ - { "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_ack_t, control_request) }, \ - { "ack", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_ack_t, ack) }, \ - } \ -} - - -/** - * @brief Pack a change_operator_control_ack message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param gcs_system_id ID of the GCS this message - * @param control_request 0: request control of this MAV, 1: Release control of this MAV - * @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_change_operator_control_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t gcs_system_id, uint8_t control_request, uint8_t ack) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, gcs_system_id); - _mav_put_uint8_t(buf, 1, control_request); - _mav_put_uint8_t(buf, 2, ack); - - memcpy(_MAV_PAYLOAD(msg), buf, 3); -#else - mavlink_change_operator_control_ack_t packet; - packet.gcs_system_id = gcs_system_id; - packet.control_request = control_request; - packet.ack = ack; - - memcpy(_MAV_PAYLOAD(msg), &packet, 3); -#endif - - msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK; - return mavlink_finalize_message(msg, system_id, component_id, 3); -} - -/** - * @brief Pack a change_operator_control_ack message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param gcs_system_id ID of the GCS this message - * @param control_request 0: request control of this MAV, 1: Release control of this MAV - * @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_change_operator_control_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t gcs_system_id,uint8_t control_request,uint8_t ack) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, gcs_system_id); - _mav_put_uint8_t(buf, 1, control_request); - _mav_put_uint8_t(buf, 2, ack); - - memcpy(_MAV_PAYLOAD(msg), buf, 3); -#else - mavlink_change_operator_control_ack_t packet; - packet.gcs_system_id = gcs_system_id; - packet.control_request = control_request; - packet.ack = ack; - - memcpy(_MAV_PAYLOAD(msg), &packet, 3); -#endif - - msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3); -} - -/** - * @brief Encode a change_operator_control_ack struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param change_operator_control_ack C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_change_operator_control_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_change_operator_control_ack_t* change_operator_control_ack) -{ - return mavlink_msg_change_operator_control_ack_pack(system_id, component_id, msg, change_operator_control_ack->gcs_system_id, change_operator_control_ack->control_request, change_operator_control_ack->ack); -} - -/** - * @brief Send a change_operator_control_ack message - * @param chan MAVLink channel to send the message - * - * @param gcs_system_id ID of the GCS this message - * @param control_request 0: request control of this MAV, 1: Release control of this MAV - * @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_change_operator_control_ack_send(mavlink_channel_t chan, uint8_t gcs_system_id, uint8_t control_request, uint8_t ack) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, gcs_system_id); - _mav_put_uint8_t(buf, 1, control_request); - _mav_put_uint8_t(buf, 2, ack); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, buf, 3); -#else - mavlink_change_operator_control_ack_t packet; - packet.gcs_system_id = gcs_system_id; - packet.control_request = control_request; - packet.ack = ack; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)&packet, 3); -#endif -} - -#endif - -// MESSAGE CHANGE_OPERATOR_CONTROL_ACK UNPACKING - - -/** - * @brief Get field gcs_system_id from change_operator_control_ack message - * - * @return ID of the GCS this message - */ -static inline uint8_t mavlink_msg_change_operator_control_ack_get_gcs_system_id(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field control_request from change_operator_control_ack message - * - * @return 0: request control of this MAV, 1: Release control of this MAV - */ -static inline uint8_t mavlink_msg_change_operator_control_ack_get_control_request(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field ack from change_operator_control_ack message - * - * @return 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control - */ -static inline uint8_t mavlink_msg_change_operator_control_ack_get_ack(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Decode a change_operator_control_ack message into a struct - * - * @param msg The message to decode - * @param change_operator_control_ack C-struct to decode the message contents into - */ -static inline void mavlink_msg_change_operator_control_ack_decode(const mavlink_message_t* msg, mavlink_change_operator_control_ack_t* change_operator_control_ack) -{ -#if MAVLINK_NEED_BYTE_SWAP - change_operator_control_ack->gcs_system_id = mavlink_msg_change_operator_control_ack_get_gcs_system_id(msg); - change_operator_control_ack->control_request = mavlink_msg_change_operator_control_ack_get_control_request(msg); - change_operator_control_ack->ack = mavlink_msg_change_operator_control_ack_get_ack(msg); -#else - memcpy(change_operator_control_ack, _MAV_PAYLOAD(msg), 3); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_command.h b/src/GCS_MAVLink/include/common/mavlink_msg_command.h deleted file mode 100644 index a7221fa44..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_command.h +++ /dev/null @@ -1,298 +0,0 @@ -// MESSAGE COMMAND PACKING - -#define MAVLINK_MSG_ID_COMMAND 75 - -typedef struct __mavlink_command_t -{ - uint8_t target_system; ///< System which should execute the command - uint8_t target_component; ///< Component which should execute the command, 0 for all components - uint8_t command; ///< Command ID, as defined by MAV_CMD enum. - uint8_t confirmation; ///< 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) - float param1; ///< Parameter 1, as defined by MAV_CMD enum. - float param2; ///< Parameter 2, as defined by MAV_CMD enum. - float param3; ///< Parameter 3, as defined by MAV_CMD enum. - float param4; ///< Parameter 4, as defined by MAV_CMD enum. -} mavlink_command_t; - -#define MAVLINK_MSG_ID_COMMAND_LEN 20 -#define MAVLINK_MSG_ID_75_LEN 20 - - - -#define MAVLINK_MESSAGE_INFO_COMMAND { \ - "COMMAND", \ - 8, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_command_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_command_t, target_component) }, \ - { "command", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_command_t, command) }, \ - { "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_command_t, confirmation) }, \ - { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_t, param1) }, \ - { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_t, param2) }, \ - { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_t, param3) }, \ - { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_command_t, param4) }, \ - } \ -} - - -/** - * @brief Pack a command message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System which should execute the command - * @param target_component Component which should execute the command, 0 for all components - * @param command Command ID, as defined by MAV_CMD enum. - * @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) - * @param param1 Parameter 1, as defined by MAV_CMD enum. - * @param param2 Parameter 2, as defined by MAV_CMD enum. - * @param param3 Parameter 3, as defined by MAV_CMD enum. - * @param param4 Parameter 4, as defined by MAV_CMD enum. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_command_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint8_t command, uint8_t confirmation, float param1, float param2, float param3, float param4) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, command); - _mav_put_uint8_t(buf, 3, confirmation); - _mav_put_float(buf, 4, param1); - _mav_put_float(buf, 8, param2); - _mav_put_float(buf, 12, param3); - _mav_put_float(buf, 16, param4); - - memcpy(_MAV_PAYLOAD(msg), buf, 20); -#else - mavlink_command_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.command = command; - packet.confirmation = confirmation; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - - memcpy(_MAV_PAYLOAD(msg), &packet, 20); -#endif - - msg->msgid = MAVLINK_MSG_ID_COMMAND; - return mavlink_finalize_message(msg, system_id, component_id, 20); -} - -/** - * @brief Pack a command message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System which should execute the command - * @param target_component Component which should execute the command, 0 for all components - * @param command Command ID, as defined by MAV_CMD enum. - * @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) - * @param param1 Parameter 1, as defined by MAV_CMD enum. - * @param param2 Parameter 2, as defined by MAV_CMD enum. - * @param param3 Parameter 3, as defined by MAV_CMD enum. - * @param param4 Parameter 4, as defined by MAV_CMD enum. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_command_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint8_t command,uint8_t confirmation,float param1,float param2,float param3,float param4) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, command); - _mav_put_uint8_t(buf, 3, confirmation); - _mav_put_float(buf, 4, param1); - _mav_put_float(buf, 8, param2); - _mav_put_float(buf, 12, param3); - _mav_put_float(buf, 16, param4); - - memcpy(_MAV_PAYLOAD(msg), buf, 20); -#else - mavlink_command_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.command = command; - packet.confirmation = confirmation; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - - memcpy(_MAV_PAYLOAD(msg), &packet, 20); -#endif - - msg->msgid = MAVLINK_MSG_ID_COMMAND; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 20); -} - -/** - * @brief Encode a command struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param command C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_command_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_t* command) -{ - return mavlink_msg_command_pack(system_id, component_id, msg, command->target_system, command->target_component, command->command, command->confirmation, command->param1, command->param2, command->param3, command->param4); -} - -/** - * @brief Send a command message - * @param chan MAVLink channel to send the message - * - * @param target_system System which should execute the command - * @param target_component Component which should execute the command, 0 for all components - * @param command Command ID, as defined by MAV_CMD enum. - * @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) - * @param param1 Parameter 1, as defined by MAV_CMD enum. - * @param param2 Parameter 2, as defined by MAV_CMD enum. - * @param param3 Parameter 3, as defined by MAV_CMD enum. - * @param param4 Parameter 4, as defined by MAV_CMD enum. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_command_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t command, uint8_t confirmation, float param1, float param2, float param3, float param4) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, command); - _mav_put_uint8_t(buf, 3, confirmation); - _mav_put_float(buf, 4, param1); - _mav_put_float(buf, 8, param2); - _mav_put_float(buf, 12, param3); - _mav_put_float(buf, 16, param4); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND, buf, 20); -#else - mavlink_command_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.command = command; - packet.confirmation = confirmation; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND, (const char *)&packet, 20); -#endif -} - -#endif - -// MESSAGE COMMAND UNPACKING - - -/** - * @brief Get field target_system from command message - * - * @return System which should execute the command - */ -static inline uint8_t mavlink_msg_command_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from command message - * - * @return Component which should execute the command, 0 for all components - */ -static inline uint8_t mavlink_msg_command_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field command from command message - * - * @return Command ID, as defined by MAV_CMD enum. - */ -static inline uint8_t mavlink_msg_command_get_command(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Get field confirmation from command message - * - * @return 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) - */ -static inline uint8_t mavlink_msg_command_get_confirmation(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 3); -} - -/** - * @brief Get field param1 from command message - * - * @return Parameter 1, as defined by MAV_CMD enum. - */ -static inline float mavlink_msg_command_get_param1(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Get field param2 from command message - * - * @return Parameter 2, as defined by MAV_CMD enum. - */ -static inline float mavlink_msg_command_get_param2(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field param3 from command message - * - * @return Parameter 3, as defined by MAV_CMD enum. - */ -static inline float mavlink_msg_command_get_param3(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field param4 from command message - * - * @return Parameter 4, as defined by MAV_CMD enum. - */ -static inline float mavlink_msg_command_get_param4(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 16); -} - -/** - * @brief Decode a command message into a struct - * - * @param msg The message to decode - * @param command C-struct to decode the message contents into - */ -static inline void mavlink_msg_command_decode(const mavlink_message_t* msg, mavlink_command_t* command) -{ -#if MAVLINK_NEED_BYTE_SWAP - command->target_system = mavlink_msg_command_get_target_system(msg); - command->target_component = mavlink_msg_command_get_target_component(msg); - command->command = mavlink_msg_command_get_command(msg); - command->confirmation = mavlink_msg_command_get_confirmation(msg); - command->param1 = mavlink_msg_command_get_param1(msg); - command->param2 = mavlink_msg_command_get_param2(msg); - command->param3 = mavlink_msg_command_get_param3(msg); - command->param4 = mavlink_msg_command_get_param4(msg); -#else - memcpy(command, _MAV_PAYLOAD(msg), 20); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_command_ack.h b/src/GCS_MAVLink/include/common/mavlink_msg_command_ack.h deleted file mode 100644 index 7fc8c8623..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_command_ack.h +++ /dev/null @@ -1,166 +0,0 @@ -// MESSAGE COMMAND_ACK PACKING - -#define MAVLINK_MSG_ID_COMMAND_ACK 76 - -typedef struct __mavlink_command_ack_t -{ - float command; ///< Current airspeed in m/s - float result; ///< 1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION -} mavlink_command_ack_t; - -#define MAVLINK_MSG_ID_COMMAND_ACK_LEN 8 -#define MAVLINK_MSG_ID_76_LEN 8 - - - -#define MAVLINK_MESSAGE_INFO_COMMAND_ACK { \ - "COMMAND_ACK", \ - 2, \ - { { "command", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_ack_t, command) }, \ - { "result", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_ack_t, result) }, \ - } \ -} - - -/** - * @brief Pack a command_ack message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param command Current airspeed in m/s - * @param result 1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_command_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - float command, float result) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_float(buf, 0, command); - _mav_put_float(buf, 4, result); - - memcpy(_MAV_PAYLOAD(msg), buf, 8); -#else - mavlink_command_ack_t packet; - packet.command = command; - packet.result = result; - - memcpy(_MAV_PAYLOAD(msg), &packet, 8); -#endif - - msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK; - return mavlink_finalize_message(msg, system_id, component_id, 8); -} - -/** - * @brief Pack a command_ack message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param command Current airspeed in m/s - * @param result 1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_command_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - float command,float result) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_float(buf, 0, command); - _mav_put_float(buf, 4, result); - - memcpy(_MAV_PAYLOAD(msg), buf, 8); -#else - mavlink_command_ack_t packet; - packet.command = command; - packet.result = result; - - memcpy(_MAV_PAYLOAD(msg), &packet, 8); -#endif - - msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8); -} - -/** - * @brief Encode a command_ack struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param command_ack C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_command_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_ack_t* command_ack) -{ - return mavlink_msg_command_ack_pack(system_id, component_id, msg, command_ack->command, command_ack->result); -} - -/** - * @brief Send a command_ack message - * @param chan MAVLink channel to send the message - * - * @param command Current airspeed in m/s - * @param result 1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_command_ack_send(mavlink_channel_t chan, float command, float result) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_float(buf, 0, command); - _mav_put_float(buf, 4, result); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, 8); -#else - mavlink_command_ack_t packet; - packet.command = command; - packet.result = result; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)&packet, 8); -#endif -} - -#endif - -// MESSAGE COMMAND_ACK UNPACKING - - -/** - * @brief Get field command from command_ack message - * - * @return Current airspeed in m/s - */ -static inline float mavlink_msg_command_ack_get_command(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 0); -} - -/** - * @brief Get field result from command_ack message - * - * @return 1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION - */ -static inline float mavlink_msg_command_ack_get_result(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Decode a command_ack message into a struct - * - * @param msg The message to decode - * @param command_ack C-struct to decode the message contents into - */ -static inline void mavlink_msg_command_ack_decode(const mavlink_message_t* msg, mavlink_command_ack_t* command_ack) -{ -#if MAVLINK_NEED_BYTE_SWAP - command_ack->command = mavlink_msg_command_ack_get_command(msg); - command_ack->result = mavlink_msg_command_ack_get_result(msg); -#else - memcpy(command_ack, _MAV_PAYLOAD(msg), 8); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_control_status.h b/src/GCS_MAVLink/include/common/mavlink_msg_control_status.h deleted file mode 100644 index 617cf5ba9..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_control_status.h +++ /dev/null @@ -1,298 +0,0 @@ -// MESSAGE CONTROL_STATUS PACKING - -#define MAVLINK_MSG_ID_CONTROL_STATUS 52 - -typedef struct __mavlink_control_status_t -{ - uint8_t position_fix; ///< Position fix: 0: lost, 2: 2D position fix, 3: 3D position fix - uint8_t vision_fix; ///< Vision position fix: 0: lost, 1: 2D local position hold, 2: 2D global position fix, 3: 3D global position fix - uint8_t gps_fix; ///< GPS position fix: 0: no reception, 1: Minimum 1 satellite, but no position fix, 2: 2D position fix, 3: 3D position fix - uint8_t ahrs_health; ///< Attitude estimation health: 0: poor, 255: excellent - uint8_t control_att; ///< 0: Attitude control disabled, 1: enabled - uint8_t control_pos_xy; ///< 0: X, Y position control disabled, 1: enabled - uint8_t control_pos_z; ///< 0: Z position control disabled, 1: enabled - uint8_t control_pos_yaw; ///< 0: Yaw angle control disabled, 1: enabled -} mavlink_control_status_t; - -#define MAVLINK_MSG_ID_CONTROL_STATUS_LEN 8 -#define MAVLINK_MSG_ID_52_LEN 8 - - - -#define MAVLINK_MESSAGE_INFO_CONTROL_STATUS { \ - "CONTROL_STATUS", \ - 8, \ - { { "position_fix", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_control_status_t, position_fix) }, \ - { "vision_fix", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_control_status_t, vision_fix) }, \ - { "gps_fix", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_control_status_t, gps_fix) }, \ - { "ahrs_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_control_status_t, ahrs_health) }, \ - { "control_att", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_control_status_t, control_att) }, \ - { "control_pos_xy", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_control_status_t, control_pos_xy) }, \ - { "control_pos_z", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_control_status_t, control_pos_z) }, \ - { "control_pos_yaw", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_control_status_t, control_pos_yaw) }, \ - } \ -} - - -/** - * @brief Pack a control_status message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param position_fix Position fix: 0: lost, 2: 2D position fix, 3: 3D position fix - * @param vision_fix Vision position fix: 0: lost, 1: 2D local position hold, 2: 2D global position fix, 3: 3D global position fix - * @param gps_fix GPS position fix: 0: no reception, 1: Minimum 1 satellite, but no position fix, 2: 2D position fix, 3: 3D position fix - * @param ahrs_health Attitude estimation health: 0: poor, 255: excellent - * @param control_att 0: Attitude control disabled, 1: enabled - * @param control_pos_xy 0: X, Y position control disabled, 1: enabled - * @param control_pos_z 0: Z position control disabled, 1: enabled - * @param control_pos_yaw 0: Yaw angle control disabled, 1: enabled - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_control_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t position_fix, uint8_t vision_fix, uint8_t gps_fix, uint8_t ahrs_health, uint8_t control_att, uint8_t control_pos_xy, uint8_t control_pos_z, uint8_t control_pos_yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint8_t(buf, 0, position_fix); - _mav_put_uint8_t(buf, 1, vision_fix); - _mav_put_uint8_t(buf, 2, gps_fix); - _mav_put_uint8_t(buf, 3, ahrs_health); - _mav_put_uint8_t(buf, 4, control_att); - _mav_put_uint8_t(buf, 5, control_pos_xy); - _mav_put_uint8_t(buf, 6, control_pos_z); - _mav_put_uint8_t(buf, 7, control_pos_yaw); - - memcpy(_MAV_PAYLOAD(msg), buf, 8); -#else - mavlink_control_status_t packet; - packet.position_fix = position_fix; - packet.vision_fix = vision_fix; - packet.gps_fix = gps_fix; - packet.ahrs_health = ahrs_health; - packet.control_att = control_att; - packet.control_pos_xy = control_pos_xy; - packet.control_pos_z = control_pos_z; - packet.control_pos_yaw = control_pos_yaw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 8); -#endif - - msg->msgid = MAVLINK_MSG_ID_CONTROL_STATUS; - return mavlink_finalize_message(msg, system_id, component_id, 8); -} - -/** - * @brief Pack a control_status message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param position_fix Position fix: 0: lost, 2: 2D position fix, 3: 3D position fix - * @param vision_fix Vision position fix: 0: lost, 1: 2D local position hold, 2: 2D global position fix, 3: 3D global position fix - * @param gps_fix GPS position fix: 0: no reception, 1: Minimum 1 satellite, but no position fix, 2: 2D position fix, 3: 3D position fix - * @param ahrs_health Attitude estimation health: 0: poor, 255: excellent - * @param control_att 0: Attitude control disabled, 1: enabled - * @param control_pos_xy 0: X, Y position control disabled, 1: enabled - * @param control_pos_z 0: Z position control disabled, 1: enabled - * @param control_pos_yaw 0: Yaw angle control disabled, 1: enabled - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_control_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t position_fix,uint8_t vision_fix,uint8_t gps_fix,uint8_t ahrs_health,uint8_t control_att,uint8_t control_pos_xy,uint8_t control_pos_z,uint8_t control_pos_yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint8_t(buf, 0, position_fix); - _mav_put_uint8_t(buf, 1, vision_fix); - _mav_put_uint8_t(buf, 2, gps_fix); - _mav_put_uint8_t(buf, 3, ahrs_health); - _mav_put_uint8_t(buf, 4, control_att); - _mav_put_uint8_t(buf, 5, control_pos_xy); - _mav_put_uint8_t(buf, 6, control_pos_z); - _mav_put_uint8_t(buf, 7, control_pos_yaw); - - memcpy(_MAV_PAYLOAD(msg), buf, 8); -#else - mavlink_control_status_t packet; - packet.position_fix = position_fix; - packet.vision_fix = vision_fix; - packet.gps_fix = gps_fix; - packet.ahrs_health = ahrs_health; - packet.control_att = control_att; - packet.control_pos_xy = control_pos_xy; - packet.control_pos_z = control_pos_z; - packet.control_pos_yaw = control_pos_yaw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 8); -#endif - - msg->msgid = MAVLINK_MSG_ID_CONTROL_STATUS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8); -} - -/** - * @brief Encode a control_status struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param control_status C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_control_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_control_status_t* control_status) -{ - return mavlink_msg_control_status_pack(system_id, component_id, msg, control_status->position_fix, control_status->vision_fix, control_status->gps_fix, control_status->ahrs_health, control_status->control_att, control_status->control_pos_xy, control_status->control_pos_z, control_status->control_pos_yaw); -} - -/** - * @brief Send a control_status message - * @param chan MAVLink channel to send the message - * - * @param position_fix Position fix: 0: lost, 2: 2D position fix, 3: 3D position fix - * @param vision_fix Vision position fix: 0: lost, 1: 2D local position hold, 2: 2D global position fix, 3: 3D global position fix - * @param gps_fix GPS position fix: 0: no reception, 1: Minimum 1 satellite, but no position fix, 2: 2D position fix, 3: 3D position fix - * @param ahrs_health Attitude estimation health: 0: poor, 255: excellent - * @param control_att 0: Attitude control disabled, 1: enabled - * @param control_pos_xy 0: X, Y position control disabled, 1: enabled - * @param control_pos_z 0: Z position control disabled, 1: enabled - * @param control_pos_yaw 0: Yaw angle control disabled, 1: enabled - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_control_status_send(mavlink_channel_t chan, uint8_t position_fix, uint8_t vision_fix, uint8_t gps_fix, uint8_t ahrs_health, uint8_t control_att, uint8_t control_pos_xy, uint8_t control_pos_z, uint8_t control_pos_yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint8_t(buf, 0, position_fix); - _mav_put_uint8_t(buf, 1, vision_fix); - _mav_put_uint8_t(buf, 2, gps_fix); - _mav_put_uint8_t(buf, 3, ahrs_health); - _mav_put_uint8_t(buf, 4, control_att); - _mav_put_uint8_t(buf, 5, control_pos_xy); - _mav_put_uint8_t(buf, 6, control_pos_z); - _mav_put_uint8_t(buf, 7, control_pos_yaw); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_STATUS, buf, 8); -#else - mavlink_control_status_t packet; - packet.position_fix = position_fix; - packet.vision_fix = vision_fix; - packet.gps_fix = gps_fix; - packet.ahrs_health = ahrs_health; - packet.control_att = control_att; - packet.control_pos_xy = control_pos_xy; - packet.control_pos_z = control_pos_z; - packet.control_pos_yaw = control_pos_yaw; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_STATUS, (const char *)&packet, 8); -#endif -} - -#endif - -// MESSAGE CONTROL_STATUS UNPACKING - - -/** - * @brief Get field position_fix from control_status message - * - * @return Position fix: 0: lost, 2: 2D position fix, 3: 3D position fix - */ -static inline uint8_t mavlink_msg_control_status_get_position_fix(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field vision_fix from control_status message - * - * @return Vision position fix: 0: lost, 1: 2D local position hold, 2: 2D global position fix, 3: 3D global position fix - */ -static inline uint8_t mavlink_msg_control_status_get_vision_fix(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field gps_fix from control_status message - * - * @return GPS position fix: 0: no reception, 1: Minimum 1 satellite, but no position fix, 2: 2D position fix, 3: 3D position fix - */ -static inline uint8_t mavlink_msg_control_status_get_gps_fix(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Get field ahrs_health from control_status message - * - * @return Attitude estimation health: 0: poor, 255: excellent - */ -static inline uint8_t mavlink_msg_control_status_get_ahrs_health(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 3); -} - -/** - * @brief Get field control_att from control_status message - * - * @return 0: Attitude control disabled, 1: enabled - */ -static inline uint8_t mavlink_msg_control_status_get_control_att(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 4); -} - -/** - * @brief Get field control_pos_xy from control_status message - * - * @return 0: X, Y position control disabled, 1: enabled - */ -static inline uint8_t mavlink_msg_control_status_get_control_pos_xy(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 5); -} - -/** - * @brief Get field control_pos_z from control_status message - * - * @return 0: Z position control disabled, 1: enabled - */ -static inline uint8_t mavlink_msg_control_status_get_control_pos_z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 6); -} - -/** - * @brief Get field control_pos_yaw from control_status message - * - * @return 0: Yaw angle control disabled, 1: enabled - */ -static inline uint8_t mavlink_msg_control_status_get_control_pos_yaw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 7); -} - -/** - * @brief Decode a control_status message into a struct - * - * @param msg The message to decode - * @param control_status C-struct to decode the message contents into - */ -static inline void mavlink_msg_control_status_decode(const mavlink_message_t* msg, mavlink_control_status_t* control_status) -{ -#if MAVLINK_NEED_BYTE_SWAP - control_status->position_fix = mavlink_msg_control_status_get_position_fix(msg); - control_status->vision_fix = mavlink_msg_control_status_get_vision_fix(msg); - control_status->gps_fix = mavlink_msg_control_status_get_gps_fix(msg); - control_status->ahrs_health = mavlink_msg_control_status_get_ahrs_health(msg); - control_status->control_att = mavlink_msg_control_status_get_control_att(msg); - control_status->control_pos_xy = mavlink_msg_control_status_get_control_pos_xy(msg); - control_status->control_pos_z = mavlink_msg_control_status_get_control_pos_z(msg); - control_status->control_pos_yaw = mavlink_msg_control_status_get_control_pos_yaw(msg); -#else - memcpy(control_status, _MAV_PAYLOAD(msg), 8); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_debug.h b/src/GCS_MAVLink/include/common/mavlink_msg_debug.h deleted file mode 100644 index 1f0788a3a..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_debug.h +++ /dev/null @@ -1,166 +0,0 @@ -// MESSAGE DEBUG PACKING - -#define MAVLINK_MSG_ID_DEBUG 255 - -typedef struct __mavlink_debug_t -{ - uint8_t ind; ///< index of debug variable - float value; ///< DEBUG value -} mavlink_debug_t; - -#define MAVLINK_MSG_ID_DEBUG_LEN 5 -#define MAVLINK_MSG_ID_255_LEN 5 - - - -#define MAVLINK_MESSAGE_INFO_DEBUG { \ - "DEBUG", \ - 2, \ - { { "ind", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_debug_t, ind) }, \ - { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 1, offsetof(mavlink_debug_t, value) }, \ - } \ -} - - -/** - * @brief Pack a debug message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param ind index of debug variable - * @param value DEBUG value - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_debug_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t ind, float value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[5]; - _mav_put_uint8_t(buf, 0, ind); - _mav_put_float(buf, 1, value); - - memcpy(_MAV_PAYLOAD(msg), buf, 5); -#else - mavlink_debug_t packet; - packet.ind = ind; - packet.value = value; - - memcpy(_MAV_PAYLOAD(msg), &packet, 5); -#endif - - msg->msgid = MAVLINK_MSG_ID_DEBUG; - return mavlink_finalize_message(msg, system_id, component_id, 5); -} - -/** - * @brief Pack a debug message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param ind index of debug variable - * @param value DEBUG value - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_debug_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t ind,float value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[5]; - _mav_put_uint8_t(buf, 0, ind); - _mav_put_float(buf, 1, value); - - memcpy(_MAV_PAYLOAD(msg), buf, 5); -#else - mavlink_debug_t packet; - packet.ind = ind; - packet.value = value; - - memcpy(_MAV_PAYLOAD(msg), &packet, 5); -#endif - - msg->msgid = MAVLINK_MSG_ID_DEBUG; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 5); -} - -/** - * @brief Encode a debug struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param debug C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_debug_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_debug_t* debug) -{ - return mavlink_msg_debug_pack(system_id, component_id, msg, debug->ind, debug->value); -} - -/** - * @brief Send a debug message - * @param chan MAVLink channel to send the message - * - * @param ind index of debug variable - * @param value DEBUG value - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_debug_send(mavlink_channel_t chan, uint8_t ind, float value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[5]; - _mav_put_uint8_t(buf, 0, ind); - _mav_put_float(buf, 1, value); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, 5); -#else - mavlink_debug_t packet; - packet.ind = ind; - packet.value = value; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)&packet, 5); -#endif -} - -#endif - -// MESSAGE DEBUG UNPACKING - - -/** - * @brief Get field ind from debug message - * - * @return index of debug variable - */ -static inline uint8_t mavlink_msg_debug_get_ind(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field value from debug message - * - * @return DEBUG value - */ -static inline float mavlink_msg_debug_get_value(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 1); -} - -/** - * @brief Decode a debug message into a struct - * - * @param msg The message to decode - * @param debug C-struct to decode the message contents into - */ -static inline void mavlink_msg_debug_decode(const mavlink_message_t* msg, mavlink_debug_t* debug) -{ -#if MAVLINK_NEED_BYTE_SWAP - debug->ind = mavlink_msg_debug_get_ind(msg); - debug->value = mavlink_msg_debug_get_value(msg); -#else - memcpy(debug, _MAV_PAYLOAD(msg), 5); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_debug_vect.h b/src/GCS_MAVLink/include/common/mavlink_msg_debug_vect.h deleted file mode 100644 index 5a1a07099..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_debug_vect.h +++ /dev/null @@ -1,226 +0,0 @@ -// MESSAGE DEBUG_VECT PACKING - -#define MAVLINK_MSG_ID_DEBUG_VECT 251 - -typedef struct __mavlink_debug_vect_t -{ - char name[10]; ///< Name - uint64_t usec; ///< Timestamp - float x; ///< x - float y; ///< y - float z; ///< z -} mavlink_debug_vect_t; - -#define MAVLINK_MSG_ID_DEBUG_VECT_LEN 30 -#define MAVLINK_MSG_ID_251_LEN 30 - -#define MAVLINK_MSG_DEBUG_VECT_FIELD_NAME_LEN 10 - -#define MAVLINK_MESSAGE_INFO_DEBUG_VECT { \ - "DEBUG_VECT", \ - 5, \ - { { "name", NULL, MAVLINK_TYPE_CHAR, 10, 0, offsetof(mavlink_debug_vect_t, name) }, \ - { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 10, offsetof(mavlink_debug_vect_t, usec) }, \ - { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 18, offsetof(mavlink_debug_vect_t, x) }, \ - { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 22, offsetof(mavlink_debug_vect_t, y) }, \ - { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 26, offsetof(mavlink_debug_vect_t, z) }, \ - } \ -} - - -/** - * @brief Pack a debug_vect message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param name Name - * @param usec Timestamp - * @param x x - * @param y y - * @param z z - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - const char *name, uint64_t usec, float x, float y, float z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[30]; - _mav_put_uint64_t(buf, 10, usec); - _mav_put_float(buf, 18, x); - _mav_put_float(buf, 22, y); - _mav_put_float(buf, 26, z); - _mav_put_char_array(buf, 0, name, 10); - memcpy(_MAV_PAYLOAD(msg), buf, 30); -#else - mavlink_debug_vect_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD(msg), &packet, 30); -#endif - - msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT; - return mavlink_finalize_message(msg, system_id, component_id, 30); -} - -/** - * @brief Pack a debug_vect message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param name Name - * @param usec Timestamp - * @param x x - * @param y y - * @param z z - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - const char *name,uint64_t usec,float x,float y,float z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[30]; - _mav_put_uint64_t(buf, 10, usec); - _mav_put_float(buf, 18, x); - _mav_put_float(buf, 22, y); - _mav_put_float(buf, 26, z); - _mav_put_char_array(buf, 0, name, 10); - memcpy(_MAV_PAYLOAD(msg), buf, 30); -#else - mavlink_debug_vect_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD(msg), &packet, 30); -#endif - - msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 30); -} - -/** - * @brief Encode a debug_vect struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param debug_vect C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_debug_vect_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_debug_vect_t* debug_vect) -{ - return mavlink_msg_debug_vect_pack(system_id, component_id, msg, debug_vect->name, debug_vect->usec, debug_vect->x, debug_vect->y, debug_vect->z); -} - -/** - * @brief Send a debug_vect message - * @param chan MAVLink channel to send the message - * - * @param name Name - * @param usec Timestamp - * @param x x - * @param y y - * @param z z - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_debug_vect_send(mavlink_channel_t chan, const char *name, uint64_t usec, float x, float y, float z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[30]; - _mav_put_uint64_t(buf, 10, usec); - _mav_put_float(buf, 18, x); - _mav_put_float(buf, 22, y); - _mav_put_float(buf, 26, z); - _mav_put_char_array(buf, 0, name, 10); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, 30); -#else - mavlink_debug_vect_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - mav_array_memcpy(packet.name, name, sizeof(char)*10); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)&packet, 30); -#endif -} - -#endif - -// MESSAGE DEBUG_VECT UNPACKING - - -/** - * @brief Get field name from debug_vect message - * - * @return Name - */ -static inline uint16_t mavlink_msg_debug_vect_get_name(const mavlink_message_t* msg, char *name) -{ - return _MAV_RETURN_char_array(msg, name, 10, 0); -} - -/** - * @brief Get field usec from debug_vect message - * - * @return Timestamp - */ -static inline uint64_t mavlink_msg_debug_vect_get_usec(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 10); -} - -/** - * @brief Get field x from debug_vect message - * - * @return x - */ -static inline float mavlink_msg_debug_vect_get_x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 18); -} - -/** - * @brief Get field y from debug_vect message - * - * @return y - */ -static inline float mavlink_msg_debug_vect_get_y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 22); -} - -/** - * @brief Get field z from debug_vect message - * - * @return z - */ -static inline float mavlink_msg_debug_vect_get_z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 26); -} - -/** - * @brief Decode a debug_vect message into a struct - * - * @param msg The message to decode - * @param debug_vect C-struct to decode the message contents into - */ -static inline void mavlink_msg_debug_vect_decode(const mavlink_message_t* msg, mavlink_debug_vect_t* debug_vect) -{ -#if MAVLINK_NEED_BYTE_SWAP - mavlink_msg_debug_vect_get_name(msg, debug_vect->name); - debug_vect->usec = mavlink_msg_debug_vect_get_usec(msg); - debug_vect->x = mavlink_msg_debug_vect_get_x(msg); - debug_vect->y = mavlink_msg_debug_vect_get_y(msg); - debug_vect->z = mavlink_msg_debug_vect_get_z(msg); -#else - memcpy(debug_vect, _MAV_PAYLOAD(msg), 30); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_global_position.h b/src/GCS_MAVLink/include/common/mavlink_msg_global_position.h deleted file mode 100644 index d281646a5..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_global_position.h +++ /dev/null @@ -1,276 +0,0 @@ -// MESSAGE GLOBAL_POSITION PACKING - -#define MAVLINK_MSG_ID_GLOBAL_POSITION 33 - -typedef struct __mavlink_global_position_t -{ - uint64_t usec; ///< Timestamp (microseconds since unix epoch) - float lat; ///< Latitude, in degrees - float lon; ///< Longitude, in degrees - float alt; ///< Absolute altitude, in meters - float vx; ///< X Speed (in Latitude direction, positive: going north) - float vy; ///< Y Speed (in Longitude direction, positive: going east) - float vz; ///< Z Speed (in Altitude direction, positive: going up) -} mavlink_global_position_t; - -#define MAVLINK_MSG_ID_GLOBAL_POSITION_LEN 32 -#define MAVLINK_MSG_ID_33_LEN 32 - - - -#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION { \ - "GLOBAL_POSITION", \ - 7, \ - { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_position_t, usec) }, \ - { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_global_position_t, lat) }, \ - { "lon", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_global_position_t, lon) }, \ - { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_global_position_t, alt) }, \ - { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_global_position_t, vx) }, \ - { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_position_t, vy) }, \ - { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_position_t, vz) }, \ - } \ -} - - -/** - * @brief Pack a global_position message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param usec Timestamp (microseconds since unix epoch) - * @param lat Latitude, in degrees - * @param lon Longitude, in degrees - * @param alt Absolute altitude, in meters - * @param vx X Speed (in Latitude direction, positive: going north) - * @param vy Y Speed (in Longitude direction, positive: going east) - * @param vz Z Speed (in Altitude direction, positive: going up) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_global_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t usec, float lat, float lon, float alt, float vx, float vy, float vz) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, lat); - _mav_put_float(buf, 12, lon); - _mav_put_float(buf, 16, alt); - _mav_put_float(buf, 20, vx); - _mav_put_float(buf, 24, vy); - _mav_put_float(buf, 28, vz); - - memcpy(_MAV_PAYLOAD(msg), buf, 32); -#else - mavlink_global_position_t packet; - packet.usec = usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - - memcpy(_MAV_PAYLOAD(msg), &packet, 32); -#endif - - msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION; - return mavlink_finalize_message(msg, system_id, component_id, 32); -} - -/** - * @brief Pack a global_position message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param usec Timestamp (microseconds since unix epoch) - * @param lat Latitude, in degrees - * @param lon Longitude, in degrees - * @param alt Absolute altitude, in meters - * @param vx X Speed (in Latitude direction, positive: going north) - * @param vy Y Speed (in Longitude direction, positive: going east) - * @param vz Z Speed (in Altitude direction, positive: going up) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_global_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t usec,float lat,float lon,float alt,float vx,float vy,float vz) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, lat); - _mav_put_float(buf, 12, lon); - _mav_put_float(buf, 16, alt); - _mav_put_float(buf, 20, vx); - _mav_put_float(buf, 24, vy); - _mav_put_float(buf, 28, vz); - - memcpy(_MAV_PAYLOAD(msg), buf, 32); -#else - mavlink_global_position_t packet; - packet.usec = usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - - memcpy(_MAV_PAYLOAD(msg), &packet, 32); -#endif - - msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32); -} - -/** - * @brief Encode a global_position struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param global_position C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_global_position_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_position_t* global_position) -{ - return mavlink_msg_global_position_pack(system_id, component_id, msg, global_position->usec, global_position->lat, global_position->lon, global_position->alt, global_position->vx, global_position->vy, global_position->vz); -} - -/** - * @brief Send a global_position message - * @param chan MAVLink channel to send the message - * - * @param usec Timestamp (microseconds since unix epoch) - * @param lat Latitude, in degrees - * @param lon Longitude, in degrees - * @param alt Absolute altitude, in meters - * @param vx X Speed (in Latitude direction, positive: going north) - * @param vy Y Speed (in Longitude direction, positive: going east) - * @param vz Z Speed (in Altitude direction, positive: going up) - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_global_position_send(mavlink_channel_t chan, uint64_t usec, float lat, float lon, float alt, float vx, float vy, float vz) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, lat); - _mav_put_float(buf, 12, lon); - _mav_put_float(buf, 16, alt); - _mav_put_float(buf, 20, vx); - _mav_put_float(buf, 24, vy); - _mav_put_float(buf, 28, vz); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION, buf, 32); -#else - mavlink_global_position_t packet; - packet.usec = usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION, (const char *)&packet, 32); -#endif -} - -#endif - -// MESSAGE GLOBAL_POSITION UNPACKING - - -/** - * @brief Get field usec from global_position message - * - * @return Timestamp (microseconds since unix epoch) - */ -static inline uint64_t mavlink_msg_global_position_get_usec(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field lat from global_position message - * - * @return Latitude, in degrees - */ -static inline float mavlink_msg_global_position_get_lat(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field lon from global_position message - * - * @return Longitude, in degrees - */ -static inline float mavlink_msg_global_position_get_lon(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field alt from global_position message - * - * @return Absolute altitude, in meters - */ -static inline float mavlink_msg_global_position_get_alt(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 16); -} - -/** - * @brief Get field vx from global_position message - * - * @return X Speed (in Latitude direction, positive: going north) - */ -static inline float mavlink_msg_global_position_get_vx(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 20); -} - -/** - * @brief Get field vy from global_position message - * - * @return Y Speed (in Longitude direction, positive: going east) - */ -static inline float mavlink_msg_global_position_get_vy(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 24); -} - -/** - * @brief Get field vz from global_position message - * - * @return Z Speed (in Altitude direction, positive: going up) - */ -static inline float mavlink_msg_global_position_get_vz(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 28); -} - -/** - * @brief Decode a global_position message into a struct - * - * @param msg The message to decode - * @param global_position C-struct to decode the message contents into - */ -static inline void mavlink_msg_global_position_decode(const mavlink_message_t* msg, mavlink_global_position_t* global_position) -{ -#if MAVLINK_NEED_BYTE_SWAP - global_position->usec = mavlink_msg_global_position_get_usec(msg); - global_position->lat = mavlink_msg_global_position_get_lat(msg); - global_position->lon = mavlink_msg_global_position_get_lon(msg); - global_position->alt = mavlink_msg_global_position_get_alt(msg); - global_position->vx = mavlink_msg_global_position_get_vx(msg); - global_position->vy = mavlink_msg_global_position_get_vy(msg); - global_position->vz = mavlink_msg_global_position_get_vz(msg); -#else - memcpy(global_position, _MAV_PAYLOAD(msg), 32); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_global_position_int.h b/src/GCS_MAVLink/include/common/mavlink_msg_global_position_int.h deleted file mode 100644 index fa984daad..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_global_position_int.h +++ /dev/null @@ -1,254 +0,0 @@ -// MESSAGE GLOBAL_POSITION_INT PACKING - -#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT 73 - -typedef struct __mavlink_global_position_int_t -{ - int32_t lat; ///< Latitude, expressed as * 1E7 - int32_t lon; ///< Longitude, expressed as * 1E7 - int32_t alt; ///< Altitude in meters, expressed as * 1000 (millimeters) - int16_t vx; ///< Ground X Speed (Latitude), expressed as m/s * 100 - int16_t vy; ///< Ground Y Speed (Longitude), expressed as m/s * 100 - int16_t vz; ///< Ground Z Speed (Altitude), expressed as m/s * 100 -} mavlink_global_position_int_t; - -#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN 18 -#define MAVLINK_MSG_ID_73_LEN 18 - - - -#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT { \ - "GLOBAL_POSITION_INT", \ - 6, \ - { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_global_position_int_t, lat) }, \ - { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_global_position_int_t, lon) }, \ - { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_t, alt) }, \ - { "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_global_position_int_t, vx) }, \ - { "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_global_position_int_t, vy) }, \ - { "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_global_position_int_t, vz) }, \ - } \ -} - - -/** - * @brief Pack a global_position_int message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param lat Latitude, expressed as * 1E7 - * @param lon Longitude, expressed as * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude), expressed as m/s * 100 - * @param vy Ground Y Speed (Longitude), expressed as m/s * 100 - * @param vz Ground Z Speed (Altitude), expressed as m/s * 100 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_int32_t(buf, 0, lat); - _mav_put_int32_t(buf, 4, lon); - _mav_put_int32_t(buf, 8, alt); - _mav_put_int16_t(buf, 12, vx); - _mav_put_int16_t(buf, 14, vy); - _mav_put_int16_t(buf, 16, vz); - - memcpy(_MAV_PAYLOAD(msg), buf, 18); -#else - mavlink_global_position_int_t packet; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - - memcpy(_MAV_PAYLOAD(msg), &packet, 18); -#endif - - msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT; - return mavlink_finalize_message(msg, system_id, component_id, 18); -} - -/** - * @brief Pack a global_position_int message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param lat Latitude, expressed as * 1E7 - * @param lon Longitude, expressed as * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude), expressed as m/s * 100 - * @param vy Ground Y Speed (Longitude), expressed as m/s * 100 - * @param vz Ground Z Speed (Altitude), expressed as m/s * 100 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - int32_t lat,int32_t lon,int32_t alt,int16_t vx,int16_t vy,int16_t vz) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_int32_t(buf, 0, lat); - _mav_put_int32_t(buf, 4, lon); - _mav_put_int32_t(buf, 8, alt); - _mav_put_int16_t(buf, 12, vx); - _mav_put_int16_t(buf, 14, vy); - _mav_put_int16_t(buf, 16, vz); - - memcpy(_MAV_PAYLOAD(msg), buf, 18); -#else - mavlink_global_position_int_t packet; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - - memcpy(_MAV_PAYLOAD(msg), &packet, 18); -#endif - - msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18); -} - -/** - * @brief Encode a global_position_int struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param global_position_int C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_global_position_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_position_int_t* global_position_int) -{ - return mavlink_msg_global_position_int_pack(system_id, component_id, msg, global_position_int->lat, global_position_int->lon, global_position_int->alt, global_position_int->vx, global_position_int->vy, global_position_int->vz); -} - -/** - * @brief Send a global_position_int message - * @param chan MAVLink channel to send the message - * - * @param lat Latitude, expressed as * 1E7 - * @param lon Longitude, expressed as * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude), expressed as m/s * 100 - * @param vy Ground Y Speed (Longitude), expressed as m/s * 100 - * @param vz Ground Z Speed (Altitude), expressed as m/s * 100 - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_global_position_int_send(mavlink_channel_t chan, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_int32_t(buf, 0, lat); - _mav_put_int32_t(buf, 4, lon); - _mav_put_int32_t(buf, 8, alt); - _mav_put_int16_t(buf, 12, vx); - _mav_put_int16_t(buf, 14, vy); - _mav_put_int16_t(buf, 16, vz); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, buf, 18); -#else - mavlink_global_position_int_t packet; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)&packet, 18); -#endif -} - -#endif - -// MESSAGE GLOBAL_POSITION_INT UNPACKING - - -/** - * @brief Get field lat from global_position_int message - * - * @return Latitude, expressed as * 1E7 - */ -static inline int32_t mavlink_msg_global_position_int_get_lat(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 0); -} - -/** - * @brief Get field lon from global_position_int message - * - * @return Longitude, expressed as * 1E7 - */ -static inline int32_t mavlink_msg_global_position_int_get_lon(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 4); -} - -/** - * @brief Get field alt from global_position_int message - * - * @return Altitude in meters, expressed as * 1000 (millimeters) - */ -static inline int32_t mavlink_msg_global_position_int_get_alt(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 8); -} - -/** - * @brief Get field vx from global_position_int message - * - * @return Ground X Speed (Latitude), expressed as m/s * 100 - */ -static inline int16_t mavlink_msg_global_position_int_get_vx(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 12); -} - -/** - * @brief Get field vy from global_position_int message - * - * @return Ground Y Speed (Longitude), expressed as m/s * 100 - */ -static inline int16_t mavlink_msg_global_position_int_get_vy(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 14); -} - -/** - * @brief Get field vz from global_position_int message - * - * @return Ground Z Speed (Altitude), expressed as m/s * 100 - */ -static inline int16_t mavlink_msg_global_position_int_get_vz(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 16); -} - -/** - * @brief Decode a global_position_int message into a struct - * - * @param msg The message to decode - * @param global_position_int C-struct to decode the message contents into - */ -static inline void mavlink_msg_global_position_int_decode(const mavlink_message_t* msg, mavlink_global_position_int_t* global_position_int) -{ -#if MAVLINK_NEED_BYTE_SWAP - global_position_int->lat = mavlink_msg_global_position_int_get_lat(msg); - global_position_int->lon = mavlink_msg_global_position_int_get_lon(msg); - global_position_int->alt = mavlink_msg_global_position_int_get_alt(msg); - global_position_int->vx = mavlink_msg_global_position_int_get_vx(msg); - global_position_int->vy = mavlink_msg_global_position_int_get_vy(msg); - global_position_int->vz = mavlink_msg_global_position_int_get_vz(msg); -#else - memcpy(global_position_int, _MAV_PAYLOAD(msg), 18); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_gps_local_origin_set.h b/src/GCS_MAVLink/include/common/mavlink_msg_gps_local_origin_set.h deleted file mode 100644 index 0e011483b..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_gps_local_origin_set.h +++ /dev/null @@ -1,188 +0,0 @@ -// MESSAGE GPS_LOCAL_ORIGIN_SET PACKING - -#define MAVLINK_MSG_ID_GPS_LOCAL_ORIGIN_SET 49 - -typedef struct __mavlink_gps_local_origin_set_t -{ - int32_t latitude; ///< Latitude (WGS84), expressed as * 1E7 - int32_t longitude; ///< Longitude (WGS84), expressed as * 1E7 - int32_t altitude; ///< Altitude(WGS84), expressed as * 1000 -} mavlink_gps_local_origin_set_t; - -#define MAVLINK_MSG_ID_GPS_LOCAL_ORIGIN_SET_LEN 12 -#define MAVLINK_MSG_ID_49_LEN 12 - - - -#define MAVLINK_MESSAGE_INFO_GPS_LOCAL_ORIGIN_SET { \ - "GPS_LOCAL_ORIGIN_SET", \ - 3, \ - { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_gps_local_origin_set_t, latitude) }, \ - { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_gps_local_origin_set_t, longitude) }, \ - { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_local_origin_set_t, altitude) }, \ - } \ -} - - -/** - * @brief Pack a gps_local_origin_set message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param latitude Latitude (WGS84), expressed as * 1E7 - * @param longitude Longitude (WGS84), expressed as * 1E7 - * @param altitude Altitude(WGS84), expressed as * 1000 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_gps_local_origin_set_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - int32_t latitude, int32_t longitude, int32_t altitude) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); - - memcpy(_MAV_PAYLOAD(msg), buf, 12); -#else - mavlink_gps_local_origin_set_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - - memcpy(_MAV_PAYLOAD(msg), &packet, 12); -#endif - - msg->msgid = MAVLINK_MSG_ID_GPS_LOCAL_ORIGIN_SET; - return mavlink_finalize_message(msg, system_id, component_id, 12); -} - -/** - * @brief Pack a gps_local_origin_set message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param latitude Latitude (WGS84), expressed as * 1E7 - * @param longitude Longitude (WGS84), expressed as * 1E7 - * @param altitude Altitude(WGS84), expressed as * 1000 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_gps_local_origin_set_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - int32_t latitude,int32_t longitude,int32_t altitude) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); - - memcpy(_MAV_PAYLOAD(msg), buf, 12); -#else - mavlink_gps_local_origin_set_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - - memcpy(_MAV_PAYLOAD(msg), &packet, 12); -#endif - - msg->msgid = MAVLINK_MSG_ID_GPS_LOCAL_ORIGIN_SET; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12); -} - -/** - * @brief Encode a gps_local_origin_set struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param gps_local_origin_set C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_gps_local_origin_set_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_local_origin_set_t* gps_local_origin_set) -{ - return mavlink_msg_gps_local_origin_set_pack(system_id, component_id, msg, gps_local_origin_set->latitude, gps_local_origin_set->longitude, gps_local_origin_set->altitude); -} - -/** - * @brief Send a gps_local_origin_set message - * @param chan MAVLink channel to send the message - * - * @param latitude Latitude (WGS84), expressed as * 1E7 - * @param longitude Longitude (WGS84), expressed as * 1E7 - * @param altitude Altitude(WGS84), expressed as * 1000 - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_gps_local_origin_set_send(mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_LOCAL_ORIGIN_SET, buf, 12); -#else - mavlink_gps_local_origin_set_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_LOCAL_ORIGIN_SET, (const char *)&packet, 12); -#endif -} - -#endif - -// MESSAGE GPS_LOCAL_ORIGIN_SET UNPACKING - - -/** - * @brief Get field latitude from gps_local_origin_set message - * - * @return Latitude (WGS84), expressed as * 1E7 - */ -static inline int32_t mavlink_msg_gps_local_origin_set_get_latitude(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 0); -} - -/** - * @brief Get field longitude from gps_local_origin_set message - * - * @return Longitude (WGS84), expressed as * 1E7 - */ -static inline int32_t mavlink_msg_gps_local_origin_set_get_longitude(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 4); -} - -/** - * @brief Get field altitude from gps_local_origin_set message - * - * @return Altitude(WGS84), expressed as * 1000 - */ -static inline int32_t mavlink_msg_gps_local_origin_set_get_altitude(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 8); -} - -/** - * @brief Decode a gps_local_origin_set message into a struct - * - * @param msg The message to decode - * @param gps_local_origin_set C-struct to decode the message contents into - */ -static inline void mavlink_msg_gps_local_origin_set_decode(const mavlink_message_t* msg, mavlink_gps_local_origin_set_t* gps_local_origin_set) -{ -#if MAVLINK_NEED_BYTE_SWAP - gps_local_origin_set->latitude = mavlink_msg_gps_local_origin_set_get_latitude(msg); - gps_local_origin_set->longitude = mavlink_msg_gps_local_origin_set_get_longitude(msg); - gps_local_origin_set->altitude = mavlink_msg_gps_local_origin_set_get_altitude(msg); -#else - memcpy(gps_local_origin_set, _MAV_PAYLOAD(msg), 12); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_gps_raw.h b/src/GCS_MAVLink/include/common/mavlink_msg_gps_raw.h deleted file mode 100644 index e2e005149..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_gps_raw.h +++ /dev/null @@ -1,320 +0,0 @@ -// MESSAGE GPS_RAW PACKING - -#define MAVLINK_MSG_ID_GPS_RAW 32 - -typedef struct __mavlink_gps_raw_t -{ - uint64_t usec; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - uint8_t fix_type; ///< 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - float lat; ///< Latitude in degrees - float lon; ///< Longitude in degrees - float alt; ///< Altitude in meters - float eph; ///< GPS HDOP - float epv; ///< GPS VDOP - float v; ///< GPS ground speed - float hdg; ///< Compass heading in degrees, 0..360 degrees -} mavlink_gps_raw_t; - -#define MAVLINK_MSG_ID_GPS_RAW_LEN 37 -#define MAVLINK_MSG_ID_32_LEN 37 - - - -#define MAVLINK_MESSAGE_INFO_GPS_RAW { \ - "GPS_RAW", \ - 9, \ - { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_raw_t, usec) }, \ - { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_gps_raw_t, fix_type) }, \ - { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 9, offsetof(mavlink_gps_raw_t, lat) }, \ - { "lon", NULL, MAVLINK_TYPE_FLOAT, 0, 13, offsetof(mavlink_gps_raw_t, lon) }, \ - { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 17, offsetof(mavlink_gps_raw_t, alt) }, \ - { "eph", NULL, MAVLINK_TYPE_FLOAT, 0, 21, offsetof(mavlink_gps_raw_t, eph) }, \ - { "epv", NULL, MAVLINK_TYPE_FLOAT, 0, 25, offsetof(mavlink_gps_raw_t, epv) }, \ - { "v", NULL, MAVLINK_TYPE_FLOAT, 0, 29, offsetof(mavlink_gps_raw_t, v) }, \ - { "hdg", NULL, MAVLINK_TYPE_FLOAT, 0, 33, offsetof(mavlink_gps_raw_t, hdg) }, \ - } \ -} - - -/** - * @brief Pack a gps_raw message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - * @param lat Latitude in degrees - * @param lon Longitude in degrees - * @param alt Altitude in meters - * @param eph GPS HDOP - * @param epv GPS VDOP - * @param v GPS ground speed - * @param hdg Compass heading in degrees, 0..360 degrees - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_gps_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t usec, uint8_t fix_type, float lat, float lon, float alt, float eph, float epv, float v, float hdg) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[37]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_uint8_t(buf, 8, fix_type); - _mav_put_float(buf, 9, lat); - _mav_put_float(buf, 13, lon); - _mav_put_float(buf, 17, alt); - _mav_put_float(buf, 21, eph); - _mav_put_float(buf, 25, epv); - _mav_put_float(buf, 29, v); - _mav_put_float(buf, 33, hdg); - - memcpy(_MAV_PAYLOAD(msg), buf, 37); -#else - mavlink_gps_raw_t packet; - packet.usec = usec; - packet.fix_type = fix_type; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.eph = eph; - packet.epv = epv; - packet.v = v; - packet.hdg = hdg; - - memcpy(_MAV_PAYLOAD(msg), &packet, 37); -#endif - - msg->msgid = MAVLINK_MSG_ID_GPS_RAW; - return mavlink_finalize_message(msg, system_id, component_id, 37); -} - -/** - * @brief Pack a gps_raw message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - * @param lat Latitude in degrees - * @param lon Longitude in degrees - * @param alt Altitude in meters - * @param eph GPS HDOP - * @param epv GPS VDOP - * @param v GPS ground speed - * @param hdg Compass heading in degrees, 0..360 degrees - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_gps_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t usec,uint8_t fix_type,float lat,float lon,float alt,float eph,float epv,float v,float hdg) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[37]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_uint8_t(buf, 8, fix_type); - _mav_put_float(buf, 9, lat); - _mav_put_float(buf, 13, lon); - _mav_put_float(buf, 17, alt); - _mav_put_float(buf, 21, eph); - _mav_put_float(buf, 25, epv); - _mav_put_float(buf, 29, v); - _mav_put_float(buf, 33, hdg); - - memcpy(_MAV_PAYLOAD(msg), buf, 37); -#else - mavlink_gps_raw_t packet; - packet.usec = usec; - packet.fix_type = fix_type; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.eph = eph; - packet.epv = epv; - packet.v = v; - packet.hdg = hdg; - - memcpy(_MAV_PAYLOAD(msg), &packet, 37); -#endif - - msg->msgid = MAVLINK_MSG_ID_GPS_RAW; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 37); -} - -/** - * @brief Encode a gps_raw struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param gps_raw C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_gps_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_raw_t* gps_raw) -{ - return mavlink_msg_gps_raw_pack(system_id, component_id, msg, gps_raw->usec, gps_raw->fix_type, gps_raw->lat, gps_raw->lon, gps_raw->alt, gps_raw->eph, gps_raw->epv, gps_raw->v, gps_raw->hdg); -} - -/** - * @brief Send a gps_raw message - * @param chan MAVLink channel to send the message - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - * @param lat Latitude in degrees - * @param lon Longitude in degrees - * @param alt Altitude in meters - * @param eph GPS HDOP - * @param epv GPS VDOP - * @param v GPS ground speed - * @param hdg Compass heading in degrees, 0..360 degrees - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_gps_raw_send(mavlink_channel_t chan, uint64_t usec, uint8_t fix_type, float lat, float lon, float alt, float eph, float epv, float v, float hdg) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[37]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_uint8_t(buf, 8, fix_type); - _mav_put_float(buf, 9, lat); - _mav_put_float(buf, 13, lon); - _mav_put_float(buf, 17, alt); - _mav_put_float(buf, 21, eph); - _mav_put_float(buf, 25, epv); - _mav_put_float(buf, 29, v); - _mav_put_float(buf, 33, hdg); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW, buf, 37); -#else - mavlink_gps_raw_t packet; - packet.usec = usec; - packet.fix_type = fix_type; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.eph = eph; - packet.epv = epv; - packet.v = v; - packet.hdg = hdg; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW, (const char *)&packet, 37); -#endif -} - -#endif - -// MESSAGE GPS_RAW UNPACKING - - -/** - * @brief Get field usec from gps_raw message - * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) - */ -static inline uint64_t mavlink_msg_gps_raw_get_usec(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field fix_type from gps_raw message - * - * @return 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - */ -static inline uint8_t mavlink_msg_gps_raw_get_fix_type(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 8); -} - -/** - * @brief Get field lat from gps_raw message - * - * @return Latitude in degrees - */ -static inline float mavlink_msg_gps_raw_get_lat(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 9); -} - -/** - * @brief Get field lon from gps_raw message - * - * @return Longitude in degrees - */ -static inline float mavlink_msg_gps_raw_get_lon(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 13); -} - -/** - * @brief Get field alt from gps_raw message - * - * @return Altitude in meters - */ -static inline float mavlink_msg_gps_raw_get_alt(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 17); -} - -/** - * @brief Get field eph from gps_raw message - * - * @return GPS HDOP - */ -static inline float mavlink_msg_gps_raw_get_eph(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 21); -} - -/** - * @brief Get field epv from gps_raw message - * - * @return GPS VDOP - */ -static inline float mavlink_msg_gps_raw_get_epv(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 25); -} - -/** - * @brief Get field v from gps_raw message - * - * @return GPS ground speed - */ -static inline float mavlink_msg_gps_raw_get_v(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 29); -} - -/** - * @brief Get field hdg from gps_raw message - * - * @return Compass heading in degrees, 0..360 degrees - */ -static inline float mavlink_msg_gps_raw_get_hdg(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 33); -} - -/** - * @brief Decode a gps_raw message into a struct - * - * @param msg The message to decode - * @param gps_raw C-struct to decode the message contents into - */ -static inline void mavlink_msg_gps_raw_decode(const mavlink_message_t* msg, mavlink_gps_raw_t* gps_raw) -{ -#if MAVLINK_NEED_BYTE_SWAP - gps_raw->usec = mavlink_msg_gps_raw_get_usec(msg); - gps_raw->fix_type = mavlink_msg_gps_raw_get_fix_type(msg); - gps_raw->lat = mavlink_msg_gps_raw_get_lat(msg); - gps_raw->lon = mavlink_msg_gps_raw_get_lon(msg); - gps_raw->alt = mavlink_msg_gps_raw_get_alt(msg); - gps_raw->eph = mavlink_msg_gps_raw_get_eph(msg); - gps_raw->epv = mavlink_msg_gps_raw_get_epv(msg); - gps_raw->v = mavlink_msg_gps_raw_get_v(msg); - gps_raw->hdg = mavlink_msg_gps_raw_get_hdg(msg); -#else - memcpy(gps_raw, _MAV_PAYLOAD(msg), 37); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_gps_raw_int.h b/src/GCS_MAVLink/include/common/mavlink_msg_gps_raw_int.h deleted file mode 100644 index 5f5b59560..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_gps_raw_int.h +++ /dev/null @@ -1,320 +0,0 @@ -// MESSAGE GPS_RAW_INT PACKING - -#define MAVLINK_MSG_ID_GPS_RAW_INT 25 - -typedef struct __mavlink_gps_raw_int_t -{ - uint64_t usec; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - uint8_t fix_type; ///< 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - int32_t lat; ///< Latitude in 1E7 degrees - int32_t lon; ///< Longitude in 1E7 degrees - int32_t alt; ///< Altitude in 1E3 meters (millimeters) - float eph; ///< GPS HDOP - float epv; ///< GPS VDOP - float v; ///< GPS ground speed (m/s) - float hdg; ///< Compass heading in degrees, 0..360 degrees -} mavlink_gps_raw_int_t; - -#define MAVLINK_MSG_ID_GPS_RAW_INT_LEN 37 -#define MAVLINK_MSG_ID_25_LEN 37 - - - -#define MAVLINK_MESSAGE_INFO_GPS_RAW_INT { \ - "GPS_RAW_INT", \ - 9, \ - { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_raw_int_t, usec) }, \ - { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_gps_raw_int_t, fix_type) }, \ - { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 9, offsetof(mavlink_gps_raw_int_t, lat) }, \ - { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 13, offsetof(mavlink_gps_raw_int_t, lon) }, \ - { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 17, offsetof(mavlink_gps_raw_int_t, alt) }, \ - { "eph", NULL, MAVLINK_TYPE_FLOAT, 0, 21, offsetof(mavlink_gps_raw_int_t, eph) }, \ - { "epv", NULL, MAVLINK_TYPE_FLOAT, 0, 25, offsetof(mavlink_gps_raw_int_t, epv) }, \ - { "v", NULL, MAVLINK_TYPE_FLOAT, 0, 29, offsetof(mavlink_gps_raw_int_t, v) }, \ - { "hdg", NULL, MAVLINK_TYPE_FLOAT, 0, 33, offsetof(mavlink_gps_raw_int_t, hdg) }, \ - } \ -} - - -/** - * @brief Pack a gps_raw_int message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - * @param lat Latitude in 1E7 degrees - * @param lon Longitude in 1E7 degrees - * @param alt Altitude in 1E3 meters (millimeters) - * @param eph GPS HDOP - * @param epv GPS VDOP - * @param v GPS ground speed (m/s) - * @param hdg Compass heading in degrees, 0..360 degrees - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, float eph, float epv, float v, float hdg) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[37]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_uint8_t(buf, 8, fix_type); - _mav_put_int32_t(buf, 9, lat); - _mav_put_int32_t(buf, 13, lon); - _mav_put_int32_t(buf, 17, alt); - _mav_put_float(buf, 21, eph); - _mav_put_float(buf, 25, epv); - _mav_put_float(buf, 29, v); - _mav_put_float(buf, 33, hdg); - - memcpy(_MAV_PAYLOAD(msg), buf, 37); -#else - mavlink_gps_raw_int_t packet; - packet.usec = usec; - packet.fix_type = fix_type; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.eph = eph; - packet.epv = epv; - packet.v = v; - packet.hdg = hdg; - - memcpy(_MAV_PAYLOAD(msg), &packet, 37); -#endif - - msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT; - return mavlink_finalize_message(msg, system_id, component_id, 37); -} - -/** - * @brief Pack a gps_raw_int message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - * @param lat Latitude in 1E7 degrees - * @param lon Longitude in 1E7 degrees - * @param alt Altitude in 1E3 meters (millimeters) - * @param eph GPS HDOP - * @param epv GPS VDOP - * @param v GPS ground speed (m/s) - * @param hdg Compass heading in degrees, 0..360 degrees - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,float eph,float epv,float v,float hdg) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[37]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_uint8_t(buf, 8, fix_type); - _mav_put_int32_t(buf, 9, lat); - _mav_put_int32_t(buf, 13, lon); - _mav_put_int32_t(buf, 17, alt); - _mav_put_float(buf, 21, eph); - _mav_put_float(buf, 25, epv); - _mav_put_float(buf, 29, v); - _mav_put_float(buf, 33, hdg); - - memcpy(_MAV_PAYLOAD(msg), buf, 37); -#else - mavlink_gps_raw_int_t packet; - packet.usec = usec; - packet.fix_type = fix_type; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.eph = eph; - packet.epv = epv; - packet.v = v; - packet.hdg = hdg; - - memcpy(_MAV_PAYLOAD(msg), &packet, 37); -#endif - - msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 37); -} - -/** - * @brief Encode a gps_raw_int struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param gps_raw_int C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_gps_raw_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_raw_int_t* gps_raw_int) -{ - return mavlink_msg_gps_raw_int_pack(system_id, component_id, msg, gps_raw_int->usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->v, gps_raw_int->hdg); -} - -/** - * @brief Send a gps_raw_int message - * @param chan MAVLink channel to send the message - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - * @param lat Latitude in 1E7 degrees - * @param lon Longitude in 1E7 degrees - * @param alt Altitude in 1E3 meters (millimeters) - * @param eph GPS HDOP - * @param epv GPS VDOP - * @param v GPS ground speed (m/s) - * @param hdg Compass heading in degrees, 0..360 degrees - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_gps_raw_int_send(mavlink_channel_t chan, uint64_t usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, float eph, float epv, float v, float hdg) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[37]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_uint8_t(buf, 8, fix_type); - _mav_put_int32_t(buf, 9, lat); - _mav_put_int32_t(buf, 13, lon); - _mav_put_int32_t(buf, 17, alt); - _mav_put_float(buf, 21, eph); - _mav_put_float(buf, 25, epv); - _mav_put_float(buf, 29, v); - _mav_put_float(buf, 33, hdg); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, 37); -#else - mavlink_gps_raw_int_t packet; - packet.usec = usec; - packet.fix_type = fix_type; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.eph = eph; - packet.epv = epv; - packet.v = v; - packet.hdg = hdg; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)&packet, 37); -#endif -} - -#endif - -// MESSAGE GPS_RAW_INT UNPACKING - - -/** - * @brief Get field usec from gps_raw_int message - * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) - */ -static inline uint64_t mavlink_msg_gps_raw_int_get_usec(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field fix_type from gps_raw_int message - * - * @return 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - */ -static inline uint8_t mavlink_msg_gps_raw_int_get_fix_type(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 8); -} - -/** - * @brief Get field lat from gps_raw_int message - * - * @return Latitude in 1E7 degrees - */ -static inline int32_t mavlink_msg_gps_raw_int_get_lat(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 9); -} - -/** - * @brief Get field lon from gps_raw_int message - * - * @return Longitude in 1E7 degrees - */ -static inline int32_t mavlink_msg_gps_raw_int_get_lon(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 13); -} - -/** - * @brief Get field alt from gps_raw_int message - * - * @return Altitude in 1E3 meters (millimeters) - */ -static inline int32_t mavlink_msg_gps_raw_int_get_alt(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 17); -} - -/** - * @brief Get field eph from gps_raw_int message - * - * @return GPS HDOP - */ -static inline float mavlink_msg_gps_raw_int_get_eph(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 21); -} - -/** - * @brief Get field epv from gps_raw_int message - * - * @return GPS VDOP - */ -static inline float mavlink_msg_gps_raw_int_get_epv(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 25); -} - -/** - * @brief Get field v from gps_raw_int message - * - * @return GPS ground speed (m/s) - */ -static inline float mavlink_msg_gps_raw_int_get_v(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 29); -} - -/** - * @brief Get field hdg from gps_raw_int message - * - * @return Compass heading in degrees, 0..360 degrees - */ -static inline float mavlink_msg_gps_raw_int_get_hdg(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 33); -} - -/** - * @brief Decode a gps_raw_int message into a struct - * - * @param msg The message to decode - * @param gps_raw_int C-struct to decode the message contents into - */ -static inline void mavlink_msg_gps_raw_int_decode(const mavlink_message_t* msg, mavlink_gps_raw_int_t* gps_raw_int) -{ -#if MAVLINK_NEED_BYTE_SWAP - gps_raw_int->usec = mavlink_msg_gps_raw_int_get_usec(msg); - gps_raw_int->fix_type = mavlink_msg_gps_raw_int_get_fix_type(msg); - gps_raw_int->lat = mavlink_msg_gps_raw_int_get_lat(msg); - gps_raw_int->lon = mavlink_msg_gps_raw_int_get_lon(msg); - gps_raw_int->alt = mavlink_msg_gps_raw_int_get_alt(msg); - gps_raw_int->eph = mavlink_msg_gps_raw_int_get_eph(msg); - gps_raw_int->epv = mavlink_msg_gps_raw_int_get_epv(msg); - gps_raw_int->v = mavlink_msg_gps_raw_int_get_v(msg); - gps_raw_int->hdg = mavlink_msg_gps_raw_int_get_hdg(msg); -#else - memcpy(gps_raw_int, _MAV_PAYLOAD(msg), 37); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_gps_set_global_origin.h b/src/GCS_MAVLink/include/common/mavlink_msg_gps_set_global_origin.h deleted file mode 100644 index 664f78164..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_gps_set_global_origin.h +++ /dev/null @@ -1,232 +0,0 @@ -// MESSAGE GPS_SET_GLOBAL_ORIGIN PACKING - -#define MAVLINK_MSG_ID_GPS_SET_GLOBAL_ORIGIN 48 - -typedef struct __mavlink_gps_set_global_origin_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - int32_t latitude; ///< global position * 1E7 - int32_t longitude; ///< global position * 1E7 - int32_t altitude; ///< global position * 1000 -} mavlink_gps_set_global_origin_t; - -#define MAVLINK_MSG_ID_GPS_SET_GLOBAL_ORIGIN_LEN 14 -#define MAVLINK_MSG_ID_48_LEN 14 - - - -#define MAVLINK_MESSAGE_INFO_GPS_SET_GLOBAL_ORIGIN { \ - "GPS_SET_GLOBAL_ORIGIN", \ - 5, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_set_global_origin_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_set_global_origin_t, target_component) }, \ - { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 2, offsetof(mavlink_gps_set_global_origin_t, latitude) }, \ - { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 6, offsetof(mavlink_gps_set_global_origin_t, longitude) }, \ - { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 10, offsetof(mavlink_gps_set_global_origin_t, altitude) }, \ - } \ -} - - -/** - * @brief Pack a gps_set_global_origin message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param latitude global position * 1E7 - * @param longitude global position * 1E7 - * @param altitude global position * 1000 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_gps_set_global_origin_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, int32_t latitude, int32_t longitude, int32_t altitude) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_int32_t(buf, 2, latitude); - _mav_put_int32_t(buf, 6, longitude); - _mav_put_int32_t(buf, 10, altitude); - - memcpy(_MAV_PAYLOAD(msg), buf, 14); -#else - mavlink_gps_set_global_origin_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - - memcpy(_MAV_PAYLOAD(msg), &packet, 14); -#endif - - msg->msgid = MAVLINK_MSG_ID_GPS_SET_GLOBAL_ORIGIN; - return mavlink_finalize_message(msg, system_id, component_id, 14); -} - -/** - * @brief Pack a gps_set_global_origin message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param latitude global position * 1E7 - * @param longitude global position * 1E7 - * @param altitude global position * 1000 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_gps_set_global_origin_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,int32_t latitude,int32_t longitude,int32_t altitude) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_int32_t(buf, 2, latitude); - _mav_put_int32_t(buf, 6, longitude); - _mav_put_int32_t(buf, 10, altitude); - - memcpy(_MAV_PAYLOAD(msg), buf, 14); -#else - mavlink_gps_set_global_origin_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - - memcpy(_MAV_PAYLOAD(msg), &packet, 14); -#endif - - msg->msgid = MAVLINK_MSG_ID_GPS_SET_GLOBAL_ORIGIN; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 14); -} - -/** - * @brief Encode a gps_set_global_origin struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param gps_set_global_origin C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_gps_set_global_origin_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_set_global_origin_t* gps_set_global_origin) -{ - return mavlink_msg_gps_set_global_origin_pack(system_id, component_id, msg, gps_set_global_origin->target_system, gps_set_global_origin->target_component, gps_set_global_origin->latitude, gps_set_global_origin->longitude, gps_set_global_origin->altitude); -} - -/** - * @brief Send a gps_set_global_origin message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param latitude global position * 1E7 - * @param longitude global position * 1E7 - * @param altitude global position * 1000 - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_gps_set_global_origin_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int32_t latitude, int32_t longitude, int32_t altitude) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_int32_t(buf, 2, latitude); - _mav_put_int32_t(buf, 6, longitude); - _mav_put_int32_t(buf, 10, altitude); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_SET_GLOBAL_ORIGIN, buf, 14); -#else - mavlink_gps_set_global_origin_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_SET_GLOBAL_ORIGIN, (const char *)&packet, 14); -#endif -} - -#endif - -// MESSAGE GPS_SET_GLOBAL_ORIGIN UNPACKING - - -/** - * @brief Get field target_system from gps_set_global_origin message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_gps_set_global_origin_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from gps_set_global_origin message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_gps_set_global_origin_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field latitude from gps_set_global_origin message - * - * @return global position * 1E7 - */ -static inline int32_t mavlink_msg_gps_set_global_origin_get_latitude(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 2); -} - -/** - * @brief Get field longitude from gps_set_global_origin message - * - * @return global position * 1E7 - */ -static inline int32_t mavlink_msg_gps_set_global_origin_get_longitude(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 6); -} - -/** - * @brief Get field altitude from gps_set_global_origin message - * - * @return global position * 1000 - */ -static inline int32_t mavlink_msg_gps_set_global_origin_get_altitude(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 10); -} - -/** - * @brief Decode a gps_set_global_origin message into a struct - * - * @param msg The message to decode - * @param gps_set_global_origin C-struct to decode the message contents into - */ -static inline void mavlink_msg_gps_set_global_origin_decode(const mavlink_message_t* msg, mavlink_gps_set_global_origin_t* gps_set_global_origin) -{ -#if MAVLINK_NEED_BYTE_SWAP - gps_set_global_origin->target_system = mavlink_msg_gps_set_global_origin_get_target_system(msg); - gps_set_global_origin->target_component = mavlink_msg_gps_set_global_origin_get_target_component(msg); - gps_set_global_origin->latitude = mavlink_msg_gps_set_global_origin_get_latitude(msg); - gps_set_global_origin->longitude = mavlink_msg_gps_set_global_origin_get_longitude(msg); - gps_set_global_origin->altitude = mavlink_msg_gps_set_global_origin_get_altitude(msg); -#else - memcpy(gps_set_global_origin, _MAV_PAYLOAD(msg), 14); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_gps_status.h b/src/GCS_MAVLink/include/common/mavlink_msg_gps_status.h deleted file mode 100644 index c0ed8c1a7..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_gps_status.h +++ /dev/null @@ -1,252 +0,0 @@ -// MESSAGE GPS_STATUS PACKING - -#define MAVLINK_MSG_ID_GPS_STATUS 27 - -typedef struct __mavlink_gps_status_t -{ - uint8_t satellites_visible; ///< Number of satellites visible - int8_t satellite_prn[20]; ///< Global satellite ID - int8_t satellite_used[20]; ///< 0: Satellite not used, 1: used for localization - int8_t satellite_elevation[20]; ///< Elevation (0: right on top of receiver, 90: on the horizon) of satellite - int8_t satellite_azimuth[20]; ///< Direction of satellite, 0: 0 deg, 255: 360 deg. - int8_t satellite_snr[20]; ///< Signal to noise ratio of satellite -} mavlink_gps_status_t; - -#define MAVLINK_MSG_ID_GPS_STATUS_LEN 101 -#define MAVLINK_MSG_ID_27_LEN 101 - -#define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_PRN_LEN 20 -#define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_USED_LEN 20 -#define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_ELEVATION_LEN 20 -#define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_AZIMUTH_LEN 20 -#define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_SNR_LEN 20 - -#define MAVLINK_MESSAGE_INFO_GPS_STATUS { \ - "GPS_STATUS", \ - 6, \ - { { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_status_t, satellites_visible) }, \ - { "satellite_prn", NULL, MAVLINK_TYPE_INT8_T, 20, 1, offsetof(mavlink_gps_status_t, satellite_prn) }, \ - { "satellite_used", NULL, MAVLINK_TYPE_INT8_T, 20, 21, offsetof(mavlink_gps_status_t, satellite_used) }, \ - { "satellite_elevation", NULL, MAVLINK_TYPE_INT8_T, 20, 41, offsetof(mavlink_gps_status_t, satellite_elevation) }, \ - { "satellite_azimuth", NULL, MAVLINK_TYPE_INT8_T, 20, 61, offsetof(mavlink_gps_status_t, satellite_azimuth) }, \ - { "satellite_snr", NULL, MAVLINK_TYPE_INT8_T, 20, 81, offsetof(mavlink_gps_status_t, satellite_snr) }, \ - } \ -} - - -/** - * @brief Pack a gps_status message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param satellites_visible Number of satellites visible - * @param satellite_prn Global satellite ID - * @param satellite_used 0: Satellite not used, 1: used for localization - * @param satellite_elevation Elevation (0: right on top of receiver, 90: on the horizon) of satellite - * @param satellite_azimuth Direction of satellite, 0: 0 deg, 255: 360 deg. - * @param satellite_snr Signal to noise ratio of satellite - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_gps_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t satellites_visible, const int8_t *satellite_prn, const int8_t *satellite_used, const int8_t *satellite_elevation, const int8_t *satellite_azimuth, const int8_t *satellite_snr) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[101]; - _mav_put_uint8_t(buf, 0, satellites_visible); - _mav_put_int8_t_array(buf, 1, satellite_prn, 20); - _mav_put_int8_t_array(buf, 21, satellite_used, 20); - _mav_put_int8_t_array(buf, 41, satellite_elevation, 20); - _mav_put_int8_t_array(buf, 61, satellite_azimuth, 20); - _mav_put_int8_t_array(buf, 81, satellite_snr, 20); - memcpy(_MAV_PAYLOAD(msg), buf, 101); -#else - mavlink_gps_status_t packet; - packet.satellites_visible = satellites_visible; - mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(int8_t)*20); - mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(int8_t)*20); - mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(int8_t)*20); - mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(int8_t)*20); - mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(int8_t)*20); - memcpy(_MAV_PAYLOAD(msg), &packet, 101); -#endif - - msg->msgid = MAVLINK_MSG_ID_GPS_STATUS; - return mavlink_finalize_message(msg, system_id, component_id, 101); -} - -/** - * @brief Pack a gps_status message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param satellites_visible Number of satellites visible - * @param satellite_prn Global satellite ID - * @param satellite_used 0: Satellite not used, 1: used for localization - * @param satellite_elevation Elevation (0: right on top of receiver, 90: on the horizon) of satellite - * @param satellite_azimuth Direction of satellite, 0: 0 deg, 255: 360 deg. - * @param satellite_snr Signal to noise ratio of satellite - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_gps_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t satellites_visible,const int8_t *satellite_prn,const int8_t *satellite_used,const int8_t *satellite_elevation,const int8_t *satellite_azimuth,const int8_t *satellite_snr) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[101]; - _mav_put_uint8_t(buf, 0, satellites_visible); - _mav_put_int8_t_array(buf, 1, satellite_prn, 20); - _mav_put_int8_t_array(buf, 21, satellite_used, 20); - _mav_put_int8_t_array(buf, 41, satellite_elevation, 20); - _mav_put_int8_t_array(buf, 61, satellite_azimuth, 20); - _mav_put_int8_t_array(buf, 81, satellite_snr, 20); - memcpy(_MAV_PAYLOAD(msg), buf, 101); -#else - mavlink_gps_status_t packet; - packet.satellites_visible = satellites_visible; - mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(int8_t)*20); - mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(int8_t)*20); - mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(int8_t)*20); - mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(int8_t)*20); - mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(int8_t)*20); - memcpy(_MAV_PAYLOAD(msg), &packet, 101); -#endif - - msg->msgid = MAVLINK_MSG_ID_GPS_STATUS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 101); -} - -/** - * @brief Encode a gps_status struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param gps_status C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_gps_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_status_t* gps_status) -{ - return mavlink_msg_gps_status_pack(system_id, component_id, msg, gps_status->satellites_visible, gps_status->satellite_prn, gps_status->satellite_used, gps_status->satellite_elevation, gps_status->satellite_azimuth, gps_status->satellite_snr); -} - -/** - * @brief Send a gps_status message - * @param chan MAVLink channel to send the message - * - * @param satellites_visible Number of satellites visible - * @param satellite_prn Global satellite ID - * @param satellite_used 0: Satellite not used, 1: used for localization - * @param satellite_elevation Elevation (0: right on top of receiver, 90: on the horizon) of satellite - * @param satellite_azimuth Direction of satellite, 0: 0 deg, 255: 360 deg. - * @param satellite_snr Signal to noise ratio of satellite - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_gps_status_send(mavlink_channel_t chan, uint8_t satellites_visible, const int8_t *satellite_prn, const int8_t *satellite_used, const int8_t *satellite_elevation, const int8_t *satellite_azimuth, const int8_t *satellite_snr) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[101]; - _mav_put_uint8_t(buf, 0, satellites_visible); - _mav_put_int8_t_array(buf, 1, satellite_prn, 20); - _mav_put_int8_t_array(buf, 21, satellite_used, 20); - _mav_put_int8_t_array(buf, 41, satellite_elevation, 20); - _mav_put_int8_t_array(buf, 61, satellite_azimuth, 20); - _mav_put_int8_t_array(buf, 81, satellite_snr, 20); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, buf, 101); -#else - mavlink_gps_status_t packet; - packet.satellites_visible = satellites_visible; - mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(int8_t)*20); - mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(int8_t)*20); - mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(int8_t)*20); - mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(int8_t)*20); - mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(int8_t)*20); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)&packet, 101); -#endif -} - -#endif - -// MESSAGE GPS_STATUS UNPACKING - - -/** - * @brief Get field satellites_visible from gps_status message - * - * @return Number of satellites visible - */ -static inline uint8_t mavlink_msg_gps_status_get_satellites_visible(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field satellite_prn from gps_status message - * - * @return Global satellite ID - */ -static inline uint16_t mavlink_msg_gps_status_get_satellite_prn(const mavlink_message_t* msg, int8_t *satellite_prn) -{ - return _MAV_RETURN_int8_t_array(msg, satellite_prn, 20, 1); -} - -/** - * @brief Get field satellite_used from gps_status message - * - * @return 0: Satellite not used, 1: used for localization - */ -static inline uint16_t mavlink_msg_gps_status_get_satellite_used(const mavlink_message_t* msg, int8_t *satellite_used) -{ - return _MAV_RETURN_int8_t_array(msg, satellite_used, 20, 21); -} - -/** - * @brief Get field satellite_elevation from gps_status message - * - * @return Elevation (0: right on top of receiver, 90: on the horizon) of satellite - */ -static inline uint16_t mavlink_msg_gps_status_get_satellite_elevation(const mavlink_message_t* msg, int8_t *satellite_elevation) -{ - return _MAV_RETURN_int8_t_array(msg, satellite_elevation, 20, 41); -} - -/** - * @brief Get field satellite_azimuth from gps_status message - * - * @return Direction of satellite, 0: 0 deg, 255: 360 deg. - */ -static inline uint16_t mavlink_msg_gps_status_get_satellite_azimuth(const mavlink_message_t* msg, int8_t *satellite_azimuth) -{ - return _MAV_RETURN_int8_t_array(msg, satellite_azimuth, 20, 61); -} - -/** - * @brief Get field satellite_snr from gps_status message - * - * @return Signal to noise ratio of satellite - */ -static inline uint16_t mavlink_msg_gps_status_get_satellite_snr(const mavlink_message_t* msg, int8_t *satellite_snr) -{ - return _MAV_RETURN_int8_t_array(msg, satellite_snr, 20, 81); -} - -/** - * @brief Decode a gps_status message into a struct - * - * @param msg The message to decode - * @param gps_status C-struct to decode the message contents into - */ -static inline void mavlink_msg_gps_status_decode(const mavlink_message_t* msg, mavlink_gps_status_t* gps_status) -{ -#if MAVLINK_NEED_BYTE_SWAP - gps_status->satellites_visible = mavlink_msg_gps_status_get_satellites_visible(msg); - mavlink_msg_gps_status_get_satellite_prn(msg, gps_status->satellite_prn); - mavlink_msg_gps_status_get_satellite_used(msg, gps_status->satellite_used); - mavlink_msg_gps_status_get_satellite_elevation(msg, gps_status->satellite_elevation); - mavlink_msg_gps_status_get_satellite_azimuth(msg, gps_status->satellite_azimuth); - mavlink_msg_gps_status_get_satellite_snr(msg, gps_status->satellite_snr); -#else - memcpy(gps_status, _MAV_PAYLOAD(msg), 101); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_heartbeat.h b/src/GCS_MAVLink/include/common/mavlink_msg_heartbeat.h deleted file mode 100644 index 86bf637b1..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_heartbeat.h +++ /dev/null @@ -1,185 +0,0 @@ -// MESSAGE HEARTBEAT PACKING - -#define MAVLINK_MSG_ID_HEARTBEAT 0 - -typedef struct __mavlink_heartbeat_t -{ - uint8_t type; ///< Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - uint8_t autopilot; ///< Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM - uint8_t mavlink_version; ///< MAVLink version -} mavlink_heartbeat_t; - -#define MAVLINK_MSG_ID_HEARTBEAT_LEN 3 -#define MAVLINK_MSG_ID_0_LEN 3 - - - -#define MAVLINK_MESSAGE_INFO_HEARTBEAT { \ - "HEARTBEAT", \ - 3, \ - { { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_heartbeat_t, type) }, \ - { "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_heartbeat_t, autopilot) }, \ - { "mavlink_version", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_heartbeat_t, mavlink_version) }, \ - } \ -} - - -/** - * @brief Pack a heartbeat message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - * @param autopilot Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t type, uint8_t autopilot) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, type); - _mav_put_uint8_t(buf, 1, autopilot); - _mav_put_uint8_t(buf, 2, 2); - - memcpy(_MAV_PAYLOAD(msg), buf, 3); -#else - mavlink_heartbeat_t packet; - packet.type = type; - packet.autopilot = autopilot; - packet.mavlink_version = 2; - - memcpy(_MAV_PAYLOAD(msg), &packet, 3); -#endif - - msg->msgid = MAVLINK_MSG_ID_HEARTBEAT; - return mavlink_finalize_message(msg, system_id, component_id, 3); -} - -/** - * @brief Pack a heartbeat message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - * @param autopilot Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t type,uint8_t autopilot) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, type); - _mav_put_uint8_t(buf, 1, autopilot); - _mav_put_uint8_t(buf, 2, 2); - - memcpy(_MAV_PAYLOAD(msg), buf, 3); -#else - mavlink_heartbeat_t packet; - packet.type = type; - packet.autopilot = autopilot; - packet.mavlink_version = 2; - - memcpy(_MAV_PAYLOAD(msg), &packet, 3); -#endif - - msg->msgid = MAVLINK_MSG_ID_HEARTBEAT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3); -} - -/** - * @brief Encode a heartbeat struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param heartbeat C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_heartbeat_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_heartbeat_t* heartbeat) -{ - return mavlink_msg_heartbeat_pack(system_id, component_id, msg, heartbeat->type, heartbeat->autopilot); -} - -/** - * @brief Send a heartbeat message - * @param chan MAVLink channel to send the message - * - * @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - * @param autopilot Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_heartbeat_send(mavlink_channel_t chan, uint8_t type, uint8_t autopilot) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, type); - _mav_put_uint8_t(buf, 1, autopilot); - _mav_put_uint8_t(buf, 2, 2); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, 3); -#else - mavlink_heartbeat_t packet; - packet.type = type; - packet.autopilot = autopilot; - packet.mavlink_version = 2; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)&packet, 3); -#endif -} - -#endif - -// MESSAGE HEARTBEAT UNPACKING - - -/** - * @brief Get field type from heartbeat message - * - * @return Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - */ -static inline uint8_t mavlink_msg_heartbeat_get_type(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field autopilot from heartbeat message - * - * @return Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM - */ -static inline uint8_t mavlink_msg_heartbeat_get_autopilot(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field mavlink_version from heartbeat message - * - * @return MAVLink version - */ -static inline uint8_t mavlink_msg_heartbeat_get_mavlink_version(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Decode a heartbeat message into a struct - * - * @param msg The message to decode - * @param heartbeat C-struct to decode the message contents into - */ -static inline void mavlink_msg_heartbeat_decode(const mavlink_message_t* msg, mavlink_heartbeat_t* heartbeat) -{ -#if MAVLINK_NEED_BYTE_SWAP - heartbeat->type = mavlink_msg_heartbeat_get_type(msg); - heartbeat->autopilot = mavlink_msg_heartbeat_get_autopilot(msg); - heartbeat->mavlink_version = mavlink_msg_heartbeat_get_mavlink_version(msg); -#else - memcpy(heartbeat, _MAV_PAYLOAD(msg), 3); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_hil_controls.h b/src/GCS_MAVLink/include/common/mavlink_msg_hil_controls.h deleted file mode 100644 index 302b23d41..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_hil_controls.h +++ /dev/null @@ -1,276 +0,0 @@ -// MESSAGE HIL_CONTROLS PACKING - -#define MAVLINK_MSG_ID_HIL_CONTROLS 68 - -typedef struct __mavlink_hil_controls_t -{ - uint64_t time_us; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - float roll_ailerons; ///< Control output -3 .. 1 - float pitch_elevator; ///< Control output -1 .. 1 - float yaw_rudder; ///< Control output -1 .. 1 - float throttle; ///< Throttle 0 .. 1 - uint8_t mode; ///< System mode (MAV_MODE) - uint8_t nav_mode; ///< Navigation mode (MAV_NAV_MODE) -} mavlink_hil_controls_t; - -#define MAVLINK_MSG_ID_HIL_CONTROLS_LEN 26 -#define MAVLINK_MSG_ID_68_LEN 26 - - - -#define MAVLINK_MESSAGE_INFO_HIL_CONTROLS { \ - "HIL_CONTROLS", \ - 7, \ - { { "time_us", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_controls_t, time_us) }, \ - { "roll_ailerons", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_controls_t, roll_ailerons) }, \ - { "pitch_elevator", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_controls_t, pitch_elevator) }, \ - { "yaw_rudder", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_controls_t, yaw_rudder) }, \ - { "throttle", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_controls_t, throttle) }, \ - { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_hil_controls_t, mode) }, \ - { "nav_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_hil_controls_t, nav_mode) }, \ - } \ -} - - -/** - * @brief Pack a hil_controls message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param time_us Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param roll_ailerons Control output -3 .. 1 - * @param pitch_elevator Control output -1 .. 1 - * @param yaw_rudder Control output -1 .. 1 - * @param throttle Throttle 0 .. 1 - * @param mode System mode (MAV_MODE) - * @param nav_mode Navigation mode (MAV_NAV_MODE) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_us, float roll_ailerons, float pitch_elevator, float yaw_rudder, float throttle, uint8_t mode, uint8_t nav_mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; - _mav_put_uint64_t(buf, 0, time_us); - _mav_put_float(buf, 8, roll_ailerons); - _mav_put_float(buf, 12, pitch_elevator); - _mav_put_float(buf, 16, yaw_rudder); - _mav_put_float(buf, 20, throttle); - _mav_put_uint8_t(buf, 24, mode); - _mav_put_uint8_t(buf, 25, nav_mode); - - memcpy(_MAV_PAYLOAD(msg), buf, 26); -#else - mavlink_hil_controls_t packet; - packet.time_us = time_us; - packet.roll_ailerons = roll_ailerons; - packet.pitch_elevator = pitch_elevator; - packet.yaw_rudder = yaw_rudder; - packet.throttle = throttle; - packet.mode = mode; - packet.nav_mode = nav_mode; - - memcpy(_MAV_PAYLOAD(msg), &packet, 26); -#endif - - msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS; - return mavlink_finalize_message(msg, system_id, component_id, 26); -} - -/** - * @brief Pack a hil_controls message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param time_us Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param roll_ailerons Control output -3 .. 1 - * @param pitch_elevator Control output -1 .. 1 - * @param yaw_rudder Control output -1 .. 1 - * @param throttle Throttle 0 .. 1 - * @param mode System mode (MAV_MODE) - * @param nav_mode Navigation mode (MAV_NAV_MODE) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_hil_controls_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_us,float roll_ailerons,float pitch_elevator,float yaw_rudder,float throttle,uint8_t mode,uint8_t nav_mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; - _mav_put_uint64_t(buf, 0, time_us); - _mav_put_float(buf, 8, roll_ailerons); - _mav_put_float(buf, 12, pitch_elevator); - _mav_put_float(buf, 16, yaw_rudder); - _mav_put_float(buf, 20, throttle); - _mav_put_uint8_t(buf, 24, mode); - _mav_put_uint8_t(buf, 25, nav_mode); - - memcpy(_MAV_PAYLOAD(msg), buf, 26); -#else - mavlink_hil_controls_t packet; - packet.time_us = time_us; - packet.roll_ailerons = roll_ailerons; - packet.pitch_elevator = pitch_elevator; - packet.yaw_rudder = yaw_rudder; - packet.throttle = throttle; - packet.mode = mode; - packet.nav_mode = nav_mode; - - memcpy(_MAV_PAYLOAD(msg), &packet, 26); -#endif - - msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 26); -} - -/** - * @brief Encode a hil_controls struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param hil_controls C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_hil_controls_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_controls_t* hil_controls) -{ - return mavlink_msg_hil_controls_pack(system_id, component_id, msg, hil_controls->time_us, hil_controls->roll_ailerons, hil_controls->pitch_elevator, hil_controls->yaw_rudder, hil_controls->throttle, hil_controls->mode, hil_controls->nav_mode); -} - -/** - * @brief Send a hil_controls message - * @param chan MAVLink channel to send the message - * - * @param time_us Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param roll_ailerons Control output -3 .. 1 - * @param pitch_elevator Control output -1 .. 1 - * @param yaw_rudder Control output -1 .. 1 - * @param throttle Throttle 0 .. 1 - * @param mode System mode (MAV_MODE) - * @param nav_mode Navigation mode (MAV_NAV_MODE) - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_hil_controls_send(mavlink_channel_t chan, uint64_t time_us, float roll_ailerons, float pitch_elevator, float yaw_rudder, float throttle, uint8_t mode, uint8_t nav_mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; - _mav_put_uint64_t(buf, 0, time_us); - _mav_put_float(buf, 8, roll_ailerons); - _mav_put_float(buf, 12, pitch_elevator); - _mav_put_float(buf, 16, yaw_rudder); - _mav_put_float(buf, 20, throttle); - _mav_put_uint8_t(buf, 24, mode); - _mav_put_uint8_t(buf, 25, nav_mode); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, buf, 26); -#else - mavlink_hil_controls_t packet; - packet.time_us = time_us; - packet.roll_ailerons = roll_ailerons; - packet.pitch_elevator = pitch_elevator; - packet.yaw_rudder = yaw_rudder; - packet.throttle = throttle; - packet.mode = mode; - packet.nav_mode = nav_mode; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, (const char *)&packet, 26); -#endif -} - -#endif - -// MESSAGE HIL_CONTROLS UNPACKING - - -/** - * @brief Get field time_us from hil_controls message - * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) - */ -static inline uint64_t mavlink_msg_hil_controls_get_time_us(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field roll_ailerons from hil_controls message - * - * @return Control output -3 .. 1 - */ -static inline float mavlink_msg_hil_controls_get_roll_ailerons(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field pitch_elevator from hil_controls message - * - * @return Control output -1 .. 1 - */ -static inline float mavlink_msg_hil_controls_get_pitch_elevator(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field yaw_rudder from hil_controls message - * - * @return Control output -1 .. 1 - */ -static inline float mavlink_msg_hil_controls_get_yaw_rudder(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 16); -} - -/** - * @brief Get field throttle from hil_controls message - * - * @return Throttle 0 .. 1 - */ -static inline float mavlink_msg_hil_controls_get_throttle(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 20); -} - -/** - * @brief Get field mode from hil_controls message - * - * @return System mode (MAV_MODE) - */ -static inline uint8_t mavlink_msg_hil_controls_get_mode(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 24); -} - -/** - * @brief Get field nav_mode from hil_controls message - * - * @return Navigation mode (MAV_NAV_MODE) - */ -static inline uint8_t mavlink_msg_hil_controls_get_nav_mode(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 25); -} - -/** - * @brief Decode a hil_controls message into a struct - * - * @param msg The message to decode - * @param hil_controls C-struct to decode the message contents into - */ -static inline void mavlink_msg_hil_controls_decode(const mavlink_message_t* msg, mavlink_hil_controls_t* hil_controls) -{ -#if MAVLINK_NEED_BYTE_SWAP - hil_controls->time_us = mavlink_msg_hil_controls_get_time_us(msg); - hil_controls->roll_ailerons = mavlink_msg_hil_controls_get_roll_ailerons(msg); - hil_controls->pitch_elevator = mavlink_msg_hil_controls_get_pitch_elevator(msg); - hil_controls->yaw_rudder = mavlink_msg_hil_controls_get_yaw_rudder(msg); - hil_controls->throttle = mavlink_msg_hil_controls_get_throttle(msg); - hil_controls->mode = mavlink_msg_hil_controls_get_mode(msg); - hil_controls->nav_mode = mavlink_msg_hil_controls_get_nav_mode(msg); -#else - memcpy(hil_controls, _MAV_PAYLOAD(msg), 26); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_hil_state.h b/src/GCS_MAVLink/include/common/mavlink_msg_hil_state.h deleted file mode 100644 index 53c3a8efe..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_hil_state.h +++ /dev/null @@ -1,474 +0,0 @@ -// MESSAGE HIL_STATE PACKING - -#define MAVLINK_MSG_ID_HIL_STATE 67 - -typedef struct __mavlink_hil_state_t -{ - uint64_t usec; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - float roll; ///< Roll angle (rad) - float pitch; ///< Pitch angle (rad) - float yaw; ///< Yaw angle (rad) - float rollspeed; ///< Roll angular speed (rad/s) - float pitchspeed; ///< Pitch angular speed (rad/s) - float yawspeed; ///< Yaw angular speed (rad/s) - int32_t lat; ///< Latitude, expressed as * 1E7 - int32_t lon; ///< Longitude, expressed as * 1E7 - int32_t alt; ///< Altitude in meters, expressed as * 1000 (millimeters) - int16_t vx; ///< Ground X Speed (Latitude), expressed as m/s * 100 - int16_t vy; ///< Ground Y Speed (Longitude), expressed as m/s * 100 - int16_t vz; ///< Ground Z Speed (Altitude), expressed as m/s * 100 - int16_t xacc; ///< X acceleration (mg) - int16_t yacc; ///< Y acceleration (mg) - int16_t zacc; ///< Z acceleration (mg) -} mavlink_hil_state_t; - -#define MAVLINK_MSG_ID_HIL_STATE_LEN 56 -#define MAVLINK_MSG_ID_67_LEN 56 - - - -#define MAVLINK_MESSAGE_INFO_HIL_STATE { \ - "HIL_STATE", \ - 16, \ - { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_state_t, usec) }, \ - { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_state_t, roll) }, \ - { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_state_t, pitch) }, \ - { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_state_t, yaw) }, \ - { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_state_t, rollspeed) }, \ - { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_state_t, pitchspeed) }, \ - { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_state_t, yawspeed) }, \ - { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 32, offsetof(mavlink_hil_state_t, lat) }, \ - { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_hil_state_t, lon) }, \ - { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 40, offsetof(mavlink_hil_state_t, alt) }, \ - { "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 44, offsetof(mavlink_hil_state_t, vx) }, \ - { "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 46, offsetof(mavlink_hil_state_t, vy) }, \ - { "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 48, offsetof(mavlink_hil_state_t, vz) }, \ - { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 50, offsetof(mavlink_hil_state_t, xacc) }, \ - { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 52, offsetof(mavlink_hil_state_t, yacc) }, \ - { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 54, offsetof(mavlink_hil_state_t, zacc) }, \ - } \ -} - - -/** - * @brief Pack a hil_state message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param roll Roll angle (rad) - * @param pitch Pitch angle (rad) - * @param yaw Yaw angle (rad) - * @param rollspeed Roll angular speed (rad/s) - * @param pitchspeed Pitch angular speed (rad/s) - * @param yawspeed Yaw angular speed (rad/s) - * @param lat Latitude, expressed as * 1E7 - * @param lon Longitude, expressed as * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude), expressed as m/s * 100 - * @param vy Ground Y Speed (Longitude), expressed as m/s * 100 - * @param vz Ground Z Speed (Altitude), expressed as m/s * 100 - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, int16_t xacc, int16_t yacc, int16_t zacc) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[56]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, roll); - _mav_put_float(buf, 12, pitch); - _mav_put_float(buf, 16, yaw); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); - _mav_put_int32_t(buf, 32, lat); - _mav_put_int32_t(buf, 36, lon); - _mav_put_int32_t(buf, 40, alt); - _mav_put_int16_t(buf, 44, vx); - _mav_put_int16_t(buf, 46, vy); - _mav_put_int16_t(buf, 48, vz); - _mav_put_int16_t(buf, 50, xacc); - _mav_put_int16_t(buf, 52, yacc); - _mav_put_int16_t(buf, 54, zacc); - - memcpy(_MAV_PAYLOAD(msg), buf, 56); -#else - mavlink_hil_state_t packet; - packet.usec = usec; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - - memcpy(_MAV_PAYLOAD(msg), &packet, 56); -#endif - - msg->msgid = MAVLINK_MSG_ID_HIL_STATE; - return mavlink_finalize_message(msg, system_id, component_id, 56); -} - -/** - * @brief Pack a hil_state message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param roll Roll angle (rad) - * @param pitch Pitch angle (rad) - * @param yaw Yaw angle (rad) - * @param rollspeed Roll angular speed (rad/s) - * @param pitchspeed Pitch angular speed (rad/s) - * @param yawspeed Yaw angular speed (rad/s) - * @param lat Latitude, expressed as * 1E7 - * @param lon Longitude, expressed as * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude), expressed as m/s * 100 - * @param vy Ground Y Speed (Longitude), expressed as m/s * 100 - * @param vz Ground Z Speed (Altitude), expressed as m/s * 100 - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t usec,float roll,float pitch,float yaw,float rollspeed,float pitchspeed,float yawspeed,int32_t lat,int32_t lon,int32_t alt,int16_t vx,int16_t vy,int16_t vz,int16_t xacc,int16_t yacc,int16_t zacc) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[56]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, roll); - _mav_put_float(buf, 12, pitch); - _mav_put_float(buf, 16, yaw); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); - _mav_put_int32_t(buf, 32, lat); - _mav_put_int32_t(buf, 36, lon); - _mav_put_int32_t(buf, 40, alt); - _mav_put_int16_t(buf, 44, vx); - _mav_put_int16_t(buf, 46, vy); - _mav_put_int16_t(buf, 48, vz); - _mav_put_int16_t(buf, 50, xacc); - _mav_put_int16_t(buf, 52, yacc); - _mav_put_int16_t(buf, 54, zacc); - - memcpy(_MAV_PAYLOAD(msg), buf, 56); -#else - mavlink_hil_state_t packet; - packet.usec = usec; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - - memcpy(_MAV_PAYLOAD(msg), &packet, 56); -#endif - - msg->msgid = MAVLINK_MSG_ID_HIL_STATE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 56); -} - -/** - * @brief Encode a hil_state struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param hil_state C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_hil_state_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_state_t* hil_state) -{ - return mavlink_msg_hil_state_pack(system_id, component_id, msg, hil_state->usec, hil_state->roll, hil_state->pitch, hil_state->yaw, hil_state->rollspeed, hil_state->pitchspeed, hil_state->yawspeed, hil_state->lat, hil_state->lon, hil_state->alt, hil_state->vx, hil_state->vy, hil_state->vz, hil_state->xacc, hil_state->yacc, hil_state->zacc); -} - -/** - * @brief Send a hil_state message - * @param chan MAVLink channel to send the message - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param roll Roll angle (rad) - * @param pitch Pitch angle (rad) - * @param yaw Yaw angle (rad) - * @param rollspeed Roll angular speed (rad/s) - * @param pitchspeed Pitch angular speed (rad/s) - * @param yawspeed Yaw angular speed (rad/s) - * @param lat Latitude, expressed as * 1E7 - * @param lon Longitude, expressed as * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude), expressed as m/s * 100 - * @param vy Ground Y Speed (Longitude), expressed as m/s * 100 - * @param vz Ground Z Speed (Altitude), expressed as m/s * 100 - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_hil_state_send(mavlink_channel_t chan, uint64_t usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, int16_t xacc, int16_t yacc, int16_t zacc) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[56]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, roll); - _mav_put_float(buf, 12, pitch); - _mav_put_float(buf, 16, yaw); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); - _mav_put_int32_t(buf, 32, lat); - _mav_put_int32_t(buf, 36, lon); - _mav_put_int32_t(buf, 40, alt); - _mav_put_int16_t(buf, 44, vx); - _mav_put_int16_t(buf, 46, vy); - _mav_put_int16_t(buf, 48, vz); - _mav_put_int16_t(buf, 50, xacc); - _mav_put_int16_t(buf, 52, yacc); - _mav_put_int16_t(buf, 54, zacc); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, 56); -#else - mavlink_hil_state_t packet; - packet.usec = usec; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)&packet, 56); -#endif -} - -#endif - -// MESSAGE HIL_STATE UNPACKING - - -/** - * @brief Get field usec from hil_state message - * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) - */ -static inline uint64_t mavlink_msg_hil_state_get_usec(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field roll from hil_state message - * - * @return Roll angle (rad) - */ -static inline float mavlink_msg_hil_state_get_roll(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field pitch from hil_state message - * - * @return Pitch angle (rad) - */ -static inline float mavlink_msg_hil_state_get_pitch(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field yaw from hil_state message - * - * @return Yaw angle (rad) - */ -static inline float mavlink_msg_hil_state_get_yaw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 16); -} - -/** - * @brief Get field rollspeed from hil_state message - * - * @return Roll angular speed (rad/s) - */ -static inline float mavlink_msg_hil_state_get_rollspeed(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 20); -} - -/** - * @brief Get field pitchspeed from hil_state message - * - * @return Pitch angular speed (rad/s) - */ -static inline float mavlink_msg_hil_state_get_pitchspeed(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 24); -} - -/** - * @brief Get field yawspeed from hil_state message - * - * @return Yaw angular speed (rad/s) - */ -static inline float mavlink_msg_hil_state_get_yawspeed(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 28); -} - -/** - * @brief Get field lat from hil_state message - * - * @return Latitude, expressed as * 1E7 - */ -static inline int32_t mavlink_msg_hil_state_get_lat(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 32); -} - -/** - * @brief Get field lon from hil_state message - * - * @return Longitude, expressed as * 1E7 - */ -static inline int32_t mavlink_msg_hil_state_get_lon(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 36); -} - -/** - * @brief Get field alt from hil_state message - * - * @return Altitude in meters, expressed as * 1000 (millimeters) - */ -static inline int32_t mavlink_msg_hil_state_get_alt(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 40); -} - -/** - * @brief Get field vx from hil_state message - * - * @return Ground X Speed (Latitude), expressed as m/s * 100 - */ -static inline int16_t mavlink_msg_hil_state_get_vx(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 44); -} - -/** - * @brief Get field vy from hil_state message - * - * @return Ground Y Speed (Longitude), expressed as m/s * 100 - */ -static inline int16_t mavlink_msg_hil_state_get_vy(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 46); -} - -/** - * @brief Get field vz from hil_state message - * - * @return Ground Z Speed (Altitude), expressed as m/s * 100 - */ -static inline int16_t mavlink_msg_hil_state_get_vz(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 48); -} - -/** - * @brief Get field xacc from hil_state message - * - * @return X acceleration (mg) - */ -static inline int16_t mavlink_msg_hil_state_get_xacc(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 50); -} - -/** - * @brief Get field yacc from hil_state message - * - * @return Y acceleration (mg) - */ -static inline int16_t mavlink_msg_hil_state_get_yacc(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 52); -} - -/** - * @brief Get field zacc from hil_state message - * - * @return Z acceleration (mg) - */ -static inline int16_t mavlink_msg_hil_state_get_zacc(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 54); -} - -/** - * @brief Decode a hil_state message into a struct - * - * @param msg The message to decode - * @param hil_state C-struct to decode the message contents into - */ -static inline void mavlink_msg_hil_state_decode(const mavlink_message_t* msg, mavlink_hil_state_t* hil_state) -{ -#if MAVLINK_NEED_BYTE_SWAP - hil_state->usec = mavlink_msg_hil_state_get_usec(msg); - hil_state->roll = mavlink_msg_hil_state_get_roll(msg); - hil_state->pitch = mavlink_msg_hil_state_get_pitch(msg); - hil_state->yaw = mavlink_msg_hil_state_get_yaw(msg); - hil_state->rollspeed = mavlink_msg_hil_state_get_rollspeed(msg); - hil_state->pitchspeed = mavlink_msg_hil_state_get_pitchspeed(msg); - hil_state->yawspeed = mavlink_msg_hil_state_get_yawspeed(msg); - hil_state->lat = mavlink_msg_hil_state_get_lat(msg); - hil_state->lon = mavlink_msg_hil_state_get_lon(msg); - hil_state->alt = mavlink_msg_hil_state_get_alt(msg); - hil_state->vx = mavlink_msg_hil_state_get_vx(msg); - hil_state->vy = mavlink_msg_hil_state_get_vy(msg); - hil_state->vz = mavlink_msg_hil_state_get_vz(msg); - hil_state->xacc = mavlink_msg_hil_state_get_xacc(msg); - hil_state->yacc = mavlink_msg_hil_state_get_yacc(msg); - hil_state->zacc = mavlink_msg_hil_state_get_zacc(msg); -#else - memcpy(hil_state, _MAV_PAYLOAD(msg), 56); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_local_position.h b/src/GCS_MAVLink/include/common/mavlink_msg_local_position.h deleted file mode 100644 index fca313b8e..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_local_position.h +++ /dev/null @@ -1,276 +0,0 @@ -// MESSAGE LOCAL_POSITION PACKING - -#define MAVLINK_MSG_ID_LOCAL_POSITION 31 - -typedef struct __mavlink_local_position_t -{ - uint64_t usec; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - float x; ///< X Position - float y; ///< Y Position - float z; ///< Z Position - float vx; ///< X Speed - float vy; ///< Y Speed - float vz; ///< Z Speed -} mavlink_local_position_t; - -#define MAVLINK_MSG_ID_LOCAL_POSITION_LEN 32 -#define MAVLINK_MSG_ID_31_LEN 32 - - - -#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION { \ - "LOCAL_POSITION", \ - 7, \ - { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_local_position_t, usec) }, \ - { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_t, x) }, \ - { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_t, y) }, \ - { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_t, z) }, \ - { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_t, vx) }, \ - { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_t, vy) }, \ - { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_local_position_t, vz) }, \ - } \ -} - - -/** - * @brief Pack a local_position message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param vx X Speed - * @param vy Y Speed - * @param vz Z Speed - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_local_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t usec, float x, float y, float z, float vx, float vy, float vz) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_float(buf, 20, vx); - _mav_put_float(buf, 24, vy); - _mav_put_float(buf, 28, vz); - - memcpy(_MAV_PAYLOAD(msg), buf, 32); -#else - mavlink_local_position_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - - memcpy(_MAV_PAYLOAD(msg), &packet, 32); -#endif - - msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION; - return mavlink_finalize_message(msg, system_id, component_id, 32); -} - -/** - * @brief Pack a local_position message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param vx X Speed - * @param vy Y Speed - * @param vz Z Speed - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_local_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t usec,float x,float y,float z,float vx,float vy,float vz) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_float(buf, 20, vx); - _mav_put_float(buf, 24, vy); - _mav_put_float(buf, 28, vz); - - memcpy(_MAV_PAYLOAD(msg), buf, 32); -#else - mavlink_local_position_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - - memcpy(_MAV_PAYLOAD(msg), &packet, 32); -#endif - - msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32); -} - -/** - * @brief Encode a local_position struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param local_position C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_local_position_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_t* local_position) -{ - return mavlink_msg_local_position_pack(system_id, component_id, msg, local_position->usec, local_position->x, local_position->y, local_position->z, local_position->vx, local_position->vy, local_position->vz); -} - -/** - * @brief Send a local_position message - * @param chan MAVLink channel to send the message - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param vx X Speed - * @param vy Y Speed - * @param vz Z Speed - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_local_position_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float vx, float vy, float vz) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_float(buf, 20, vx); - _mav_put_float(buf, 24, vy); - _mav_put_float(buf, 28, vz); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION, buf, 32); -#else - mavlink_local_position_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION, (const char *)&packet, 32); -#endif -} - -#endif - -// MESSAGE LOCAL_POSITION UNPACKING - - -/** - * @brief Get field usec from local_position message - * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) - */ -static inline uint64_t mavlink_msg_local_position_get_usec(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field x from local_position message - * - * @return X Position - */ -static inline float mavlink_msg_local_position_get_x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field y from local_position message - * - * @return Y Position - */ -static inline float mavlink_msg_local_position_get_y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field z from local_position message - * - * @return Z Position - */ -static inline float mavlink_msg_local_position_get_z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 16); -} - -/** - * @brief Get field vx from local_position message - * - * @return X Speed - */ -static inline float mavlink_msg_local_position_get_vx(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 20); -} - -/** - * @brief Get field vy from local_position message - * - * @return Y Speed - */ -static inline float mavlink_msg_local_position_get_vy(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 24); -} - -/** - * @brief Get field vz from local_position message - * - * @return Z Speed - */ -static inline float mavlink_msg_local_position_get_vz(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 28); -} - -/** - * @brief Decode a local_position message into a struct - * - * @param msg The message to decode - * @param local_position C-struct to decode the message contents into - */ -static inline void mavlink_msg_local_position_decode(const mavlink_message_t* msg, mavlink_local_position_t* local_position) -{ -#if MAVLINK_NEED_BYTE_SWAP - local_position->usec = mavlink_msg_local_position_get_usec(msg); - local_position->x = mavlink_msg_local_position_get_x(msg); - local_position->y = mavlink_msg_local_position_get_y(msg); - local_position->z = mavlink_msg_local_position_get_z(msg); - local_position->vx = mavlink_msg_local_position_get_vx(msg); - local_position->vy = mavlink_msg_local_position_get_vy(msg); - local_position->vz = mavlink_msg_local_position_get_vz(msg); -#else - memcpy(local_position, _MAV_PAYLOAD(msg), 32); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_local_position_setpoint.h b/src/GCS_MAVLink/include/common/mavlink_msg_local_position_setpoint.h deleted file mode 100644 index 08c8e35eb..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_local_position_setpoint.h +++ /dev/null @@ -1,210 +0,0 @@ -// MESSAGE LOCAL_POSITION_SETPOINT PACKING - -#define MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT 51 - -typedef struct __mavlink_local_position_setpoint_t -{ - float x; ///< x position - float y; ///< y position - float z; ///< z position - float yaw; ///< Desired yaw angle -} mavlink_local_position_setpoint_t; - -#define MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN 16 -#define MAVLINK_MSG_ID_51_LEN 16 - - - -#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT { \ - "LOCAL_POSITION_SETPOINT", \ - 4, \ - { { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_local_position_setpoint_t, x) }, \ - { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_setpoint_t, y) }, \ - { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_setpoint_t, z) }, \ - { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_setpoint_t, yaw) }, \ - } \ -} - - -/** - * @brief Pack a local_position_setpoint message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param x x position - * @param y y position - * @param z z position - * @param yaw Desired yaw angle - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_local_position_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - float x, float y, float z, float yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; - _mav_put_float(buf, 0, x); - _mav_put_float(buf, 4, y); - _mav_put_float(buf, 8, z); - _mav_put_float(buf, 12, yaw); - - memcpy(_MAV_PAYLOAD(msg), buf, 16); -#else - mavlink_local_position_setpoint_t packet; - packet.x = x; - packet.y = y; - packet.z = z; - packet.yaw = yaw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 16); -#endif - - msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT; - return mavlink_finalize_message(msg, system_id, component_id, 16); -} - -/** - * @brief Pack a local_position_setpoint message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param x x position - * @param y y position - * @param z z position - * @param yaw Desired yaw angle - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_local_position_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - float x,float y,float z,float yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; - _mav_put_float(buf, 0, x); - _mav_put_float(buf, 4, y); - _mav_put_float(buf, 8, z); - _mav_put_float(buf, 12, yaw); - - memcpy(_MAV_PAYLOAD(msg), buf, 16); -#else - mavlink_local_position_setpoint_t packet; - packet.x = x; - packet.y = y; - packet.z = z; - packet.yaw = yaw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 16); -#endif - - msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 16); -} - -/** - * @brief Encode a local_position_setpoint struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param local_position_setpoint C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_local_position_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_setpoint_t* local_position_setpoint) -{ - return mavlink_msg_local_position_setpoint_pack(system_id, component_id, msg, local_position_setpoint->x, local_position_setpoint->y, local_position_setpoint->z, local_position_setpoint->yaw); -} - -/** - * @brief Send a local_position_setpoint message - * @param chan MAVLink channel to send the message - * - * @param x x position - * @param y y position - * @param z z position - * @param yaw Desired yaw angle - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_local_position_setpoint_send(mavlink_channel_t chan, float x, float y, float z, float yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; - _mav_put_float(buf, 0, x); - _mav_put_float(buf, 4, y); - _mav_put_float(buf, 8, z); - _mav_put_float(buf, 12, yaw); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT, buf, 16); -#else - mavlink_local_position_setpoint_t packet; - packet.x = x; - packet.y = y; - packet.z = z; - packet.yaw = yaw; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT, (const char *)&packet, 16); -#endif -} - -#endif - -// MESSAGE LOCAL_POSITION_SETPOINT UNPACKING - - -/** - * @brief Get field x from local_position_setpoint message - * - * @return x position - */ -static inline float mavlink_msg_local_position_setpoint_get_x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 0); -} - -/** - * @brief Get field y from local_position_setpoint message - * - * @return y position - */ -static inline float mavlink_msg_local_position_setpoint_get_y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Get field z from local_position_setpoint message - * - * @return z position - */ -static inline float mavlink_msg_local_position_setpoint_get_z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field yaw from local_position_setpoint message - * - * @return Desired yaw angle - */ -static inline float mavlink_msg_local_position_setpoint_get_yaw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Decode a local_position_setpoint message into a struct - * - * @param msg The message to decode - * @param local_position_setpoint C-struct to decode the message contents into - */ -static inline void mavlink_msg_local_position_setpoint_decode(const mavlink_message_t* msg, mavlink_local_position_setpoint_t* local_position_setpoint) -{ -#if MAVLINK_NEED_BYTE_SWAP - local_position_setpoint->x = mavlink_msg_local_position_setpoint_get_x(msg); - local_position_setpoint->y = mavlink_msg_local_position_setpoint_get_y(msg); - local_position_setpoint->z = mavlink_msg_local_position_setpoint_get_z(msg); - local_position_setpoint->yaw = mavlink_msg_local_position_setpoint_get_yaw(msg); -#else - memcpy(local_position_setpoint, _MAV_PAYLOAD(msg), 16); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_local_position_setpoint_set.h b/src/GCS_MAVLink/include/common/mavlink_msg_local_position_setpoint_set.h deleted file mode 100644 index de3aee949..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_local_position_setpoint_set.h +++ /dev/null @@ -1,254 +0,0 @@ -// MESSAGE LOCAL_POSITION_SETPOINT_SET PACKING - -#define MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET 50 - -typedef struct __mavlink_local_position_setpoint_set_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - float x; ///< x position - float y; ///< y position - float z; ///< z position - float yaw; ///< Desired yaw angle -} mavlink_local_position_setpoint_set_t; - -#define MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET_LEN 18 -#define MAVLINK_MSG_ID_50_LEN 18 - - - -#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT_SET { \ - "LOCAL_POSITION_SETPOINT_SET", \ - 6, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_local_position_setpoint_set_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_local_position_setpoint_set_t, target_component) }, \ - { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 2, offsetof(mavlink_local_position_setpoint_set_t, x) }, \ - { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 6, offsetof(mavlink_local_position_setpoint_set_t, y) }, \ - { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 10, offsetof(mavlink_local_position_setpoint_set_t, z) }, \ - { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 14, offsetof(mavlink_local_position_setpoint_set_t, yaw) }, \ - } \ -} - - -/** - * @brief Pack a local_position_setpoint_set message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param x x position - * @param y y position - * @param z z position - * @param yaw Desired yaw angle - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_local_position_setpoint_set_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, float x, float y, float z, float yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_float(buf, 2, x); - _mav_put_float(buf, 6, y); - _mav_put_float(buf, 10, z); - _mav_put_float(buf, 14, yaw); - - memcpy(_MAV_PAYLOAD(msg), buf, 18); -#else - mavlink_local_position_setpoint_set_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.x = x; - packet.y = y; - packet.z = z; - packet.yaw = yaw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 18); -#endif - - msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET; - return mavlink_finalize_message(msg, system_id, component_id, 18); -} - -/** - * @brief Pack a local_position_setpoint_set message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param x x position - * @param y y position - * @param z z position - * @param yaw Desired yaw angle - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_local_position_setpoint_set_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,float x,float y,float z,float yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_float(buf, 2, x); - _mav_put_float(buf, 6, y); - _mav_put_float(buf, 10, z); - _mav_put_float(buf, 14, yaw); - - memcpy(_MAV_PAYLOAD(msg), buf, 18); -#else - mavlink_local_position_setpoint_set_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.x = x; - packet.y = y; - packet.z = z; - packet.yaw = yaw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 18); -#endif - - msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18); -} - -/** - * @brief Encode a local_position_setpoint_set struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param local_position_setpoint_set C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_local_position_setpoint_set_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_setpoint_set_t* local_position_setpoint_set) -{ - return mavlink_msg_local_position_setpoint_set_pack(system_id, component_id, msg, local_position_setpoint_set->target_system, local_position_setpoint_set->target_component, local_position_setpoint_set->x, local_position_setpoint_set->y, local_position_setpoint_set->z, local_position_setpoint_set->yaw); -} - -/** - * @brief Send a local_position_setpoint_set message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param x x position - * @param y y position - * @param z z position - * @param yaw Desired yaw angle - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_local_position_setpoint_set_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float x, float y, float z, float yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_float(buf, 2, x); - _mav_put_float(buf, 6, y); - _mav_put_float(buf, 10, z); - _mav_put_float(buf, 14, yaw); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET, buf, 18); -#else - mavlink_local_position_setpoint_set_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.x = x; - packet.y = y; - packet.z = z; - packet.yaw = yaw; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET, (const char *)&packet, 18); -#endif -} - -#endif - -// MESSAGE LOCAL_POSITION_SETPOINT_SET UNPACKING - - -/** - * @brief Get field target_system from local_position_setpoint_set message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_local_position_setpoint_set_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from local_position_setpoint_set message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_local_position_setpoint_set_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field x from local_position_setpoint_set message - * - * @return x position - */ -static inline float mavlink_msg_local_position_setpoint_set_get_x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 2); -} - -/** - * @brief Get field y from local_position_setpoint_set message - * - * @return y position - */ -static inline float mavlink_msg_local_position_setpoint_set_get_y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 6); -} - -/** - * @brief Get field z from local_position_setpoint_set message - * - * @return z position - */ -static inline float mavlink_msg_local_position_setpoint_set_get_z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 10); -} - -/** - * @brief Get field yaw from local_position_setpoint_set message - * - * @return Desired yaw angle - */ -static inline float mavlink_msg_local_position_setpoint_set_get_yaw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 14); -} - -/** - * @brief Decode a local_position_setpoint_set message into a struct - * - * @param msg The message to decode - * @param local_position_setpoint_set C-struct to decode the message contents into - */ -static inline void mavlink_msg_local_position_setpoint_set_decode(const mavlink_message_t* msg, mavlink_local_position_setpoint_set_t* local_position_setpoint_set) -{ -#if MAVLINK_NEED_BYTE_SWAP - local_position_setpoint_set->target_system = mavlink_msg_local_position_setpoint_set_get_target_system(msg); - local_position_setpoint_set->target_component = mavlink_msg_local_position_setpoint_set_get_target_component(msg); - local_position_setpoint_set->x = mavlink_msg_local_position_setpoint_set_get_x(msg); - local_position_setpoint_set->y = mavlink_msg_local_position_setpoint_set_get_y(msg); - local_position_setpoint_set->z = mavlink_msg_local_position_setpoint_set_get_z(msg); - local_position_setpoint_set->yaw = mavlink_msg_local_position_setpoint_set_get_yaw(msg); -#else - memcpy(local_position_setpoint_set, _MAV_PAYLOAD(msg), 18); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_manual_control.h b/src/GCS_MAVLink/include/common/mavlink_msg_manual_control.h deleted file mode 100644 index 09db3d921..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_manual_control.h +++ /dev/null @@ -1,320 +0,0 @@ -// MESSAGE MANUAL_CONTROL PACKING - -#define MAVLINK_MSG_ID_MANUAL_CONTROL 69 - -typedef struct __mavlink_manual_control_t -{ - uint8_t target; ///< The system to be controlled - float roll; ///< roll - float pitch; ///< pitch - float yaw; ///< yaw - float thrust; ///< thrust - uint8_t roll_manual; ///< roll control enabled auto:0, manual:1 - uint8_t pitch_manual; ///< pitch auto:0, manual:1 - uint8_t yaw_manual; ///< yaw auto:0, manual:1 - uint8_t thrust_manual; ///< thrust auto:0, manual:1 -} mavlink_manual_control_t; - -#define MAVLINK_MSG_ID_MANUAL_CONTROL_LEN 21 -#define MAVLINK_MSG_ID_69_LEN 21 - - - -#define MAVLINK_MESSAGE_INFO_MANUAL_CONTROL { \ - "MANUAL_CONTROL", \ - 9, \ - { { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_manual_control_t, target) }, \ - { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 1, offsetof(mavlink_manual_control_t, roll) }, \ - { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 5, offsetof(mavlink_manual_control_t, pitch) }, \ - { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 9, offsetof(mavlink_manual_control_t, yaw) }, \ - { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 13, offsetof(mavlink_manual_control_t, thrust) }, \ - { "roll_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_manual_control_t, roll_manual) }, \ - { "pitch_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_manual_control_t, pitch_manual) }, \ - { "yaw_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_manual_control_t, yaw_manual) }, \ - { "thrust_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_manual_control_t, thrust_manual) }, \ - } \ -} - - -/** - * @brief Pack a manual_control message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target The system to be controlled - * @param roll roll - * @param pitch pitch - * @param yaw yaw - * @param thrust thrust - * @param roll_manual roll control enabled auto:0, manual:1 - * @param pitch_manual pitch auto:0, manual:1 - * @param yaw_manual yaw auto:0, manual:1 - * @param thrust_manual thrust auto:0, manual:1 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target, float roll, float pitch, float yaw, float thrust, uint8_t roll_manual, uint8_t pitch_manual, uint8_t yaw_manual, uint8_t thrust_manual) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[21]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_float(buf, 1, roll); - _mav_put_float(buf, 5, pitch); - _mav_put_float(buf, 9, yaw); - _mav_put_float(buf, 13, thrust); - _mav_put_uint8_t(buf, 17, roll_manual); - _mav_put_uint8_t(buf, 18, pitch_manual); - _mav_put_uint8_t(buf, 19, yaw_manual); - _mav_put_uint8_t(buf, 20, thrust_manual); - - memcpy(_MAV_PAYLOAD(msg), buf, 21); -#else - mavlink_manual_control_t packet; - packet.target = target; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.thrust = thrust; - packet.roll_manual = roll_manual; - packet.pitch_manual = pitch_manual; - packet.yaw_manual = yaw_manual; - packet.thrust_manual = thrust_manual; - - memcpy(_MAV_PAYLOAD(msg), &packet, 21); -#endif - - msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL; - return mavlink_finalize_message(msg, system_id, component_id, 21); -} - -/** - * @brief Pack a manual_control message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target The system to be controlled - * @param roll roll - * @param pitch pitch - * @param yaw yaw - * @param thrust thrust - * @param roll_manual roll control enabled auto:0, manual:1 - * @param pitch_manual pitch auto:0, manual:1 - * @param yaw_manual yaw auto:0, manual:1 - * @param thrust_manual thrust auto:0, manual:1 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_manual_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target,float roll,float pitch,float yaw,float thrust,uint8_t roll_manual,uint8_t pitch_manual,uint8_t yaw_manual,uint8_t thrust_manual) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[21]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_float(buf, 1, roll); - _mav_put_float(buf, 5, pitch); - _mav_put_float(buf, 9, yaw); - _mav_put_float(buf, 13, thrust); - _mav_put_uint8_t(buf, 17, roll_manual); - _mav_put_uint8_t(buf, 18, pitch_manual); - _mav_put_uint8_t(buf, 19, yaw_manual); - _mav_put_uint8_t(buf, 20, thrust_manual); - - memcpy(_MAV_PAYLOAD(msg), buf, 21); -#else - mavlink_manual_control_t packet; - packet.target = target; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.thrust = thrust; - packet.roll_manual = roll_manual; - packet.pitch_manual = pitch_manual; - packet.yaw_manual = yaw_manual; - packet.thrust_manual = thrust_manual; - - memcpy(_MAV_PAYLOAD(msg), &packet, 21); -#endif - - msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 21); -} - -/** - * @brief Encode a manual_control struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param manual_control C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_manual_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_manual_control_t* manual_control) -{ - return mavlink_msg_manual_control_pack(system_id, component_id, msg, manual_control->target, manual_control->roll, manual_control->pitch, manual_control->yaw, manual_control->thrust, manual_control->roll_manual, manual_control->pitch_manual, manual_control->yaw_manual, manual_control->thrust_manual); -} - -/** - * @brief Send a manual_control message - * @param chan MAVLink channel to send the message - * - * @param target The system to be controlled - * @param roll roll - * @param pitch pitch - * @param yaw yaw - * @param thrust thrust - * @param roll_manual roll control enabled auto:0, manual:1 - * @param pitch_manual pitch auto:0, manual:1 - * @param yaw_manual yaw auto:0, manual:1 - * @param thrust_manual thrust auto:0, manual:1 - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_manual_control_send(mavlink_channel_t chan, uint8_t target, float roll, float pitch, float yaw, float thrust, uint8_t roll_manual, uint8_t pitch_manual, uint8_t yaw_manual, uint8_t thrust_manual) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[21]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_float(buf, 1, roll); - _mav_put_float(buf, 5, pitch); - _mav_put_float(buf, 9, yaw); - _mav_put_float(buf, 13, thrust); - _mav_put_uint8_t(buf, 17, roll_manual); - _mav_put_uint8_t(buf, 18, pitch_manual); - _mav_put_uint8_t(buf, 19, yaw_manual); - _mav_put_uint8_t(buf, 20, thrust_manual); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, 21); -#else - mavlink_manual_control_t packet; - packet.target = target; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.thrust = thrust; - packet.roll_manual = roll_manual; - packet.pitch_manual = pitch_manual; - packet.yaw_manual = yaw_manual; - packet.thrust_manual = thrust_manual; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)&packet, 21); -#endif -} - -#endif - -// MESSAGE MANUAL_CONTROL UNPACKING - - -/** - * @brief Get field target from manual_control message - * - * @return The system to be controlled - */ -static inline uint8_t mavlink_msg_manual_control_get_target(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field roll from manual_control message - * - * @return roll - */ -static inline float mavlink_msg_manual_control_get_roll(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 1); -} - -/** - * @brief Get field pitch from manual_control message - * - * @return pitch - */ -static inline float mavlink_msg_manual_control_get_pitch(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 5); -} - -/** - * @brief Get field yaw from manual_control message - * - * @return yaw - */ -static inline float mavlink_msg_manual_control_get_yaw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 9); -} - -/** - * @brief Get field thrust from manual_control message - * - * @return thrust - */ -static inline float mavlink_msg_manual_control_get_thrust(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 13); -} - -/** - * @brief Get field roll_manual from manual_control message - * - * @return roll control enabled auto:0, manual:1 - */ -static inline uint8_t mavlink_msg_manual_control_get_roll_manual(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 17); -} - -/** - * @brief Get field pitch_manual from manual_control message - * - * @return pitch auto:0, manual:1 - */ -static inline uint8_t mavlink_msg_manual_control_get_pitch_manual(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 18); -} - -/** - * @brief Get field yaw_manual from manual_control message - * - * @return yaw auto:0, manual:1 - */ -static inline uint8_t mavlink_msg_manual_control_get_yaw_manual(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 19); -} - -/** - * @brief Get field thrust_manual from manual_control message - * - * @return thrust auto:0, manual:1 - */ -static inline uint8_t mavlink_msg_manual_control_get_thrust_manual(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 20); -} - -/** - * @brief Decode a manual_control message into a struct - * - * @param msg The message to decode - * @param manual_control C-struct to decode the message contents into - */ -static inline void mavlink_msg_manual_control_decode(const mavlink_message_t* msg, mavlink_manual_control_t* manual_control) -{ -#if MAVLINK_NEED_BYTE_SWAP - manual_control->target = mavlink_msg_manual_control_get_target(msg); - manual_control->roll = mavlink_msg_manual_control_get_roll(msg); - manual_control->pitch = mavlink_msg_manual_control_get_pitch(msg); - manual_control->yaw = mavlink_msg_manual_control_get_yaw(msg); - manual_control->thrust = mavlink_msg_manual_control_get_thrust(msg); - manual_control->roll_manual = mavlink_msg_manual_control_get_roll_manual(msg); - manual_control->pitch_manual = mavlink_msg_manual_control_get_pitch_manual(msg); - manual_control->yaw_manual = mavlink_msg_manual_control_get_yaw_manual(msg); - manual_control->thrust_manual = mavlink_msg_manual_control_get_thrust_manual(msg); -#else - memcpy(manual_control, _MAV_PAYLOAD(msg), 21); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_named_value_float.h b/src/GCS_MAVLink/include/common/mavlink_msg_named_value_float.h deleted file mode 100644 index 7b41755d2..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_named_value_float.h +++ /dev/null @@ -1,160 +0,0 @@ -// MESSAGE NAMED_VALUE_FLOAT PACKING - -#define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT 252 - -typedef struct __mavlink_named_value_float_t -{ - char name[10]; ///< Name of the debug variable - float value; ///< Floating point value -} mavlink_named_value_float_t; - -#define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN 14 -#define MAVLINK_MSG_ID_252_LEN 14 - -#define MAVLINK_MSG_NAMED_VALUE_FLOAT_FIELD_NAME_LEN 10 - -#define MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT { \ - "NAMED_VALUE_FLOAT", \ - 2, \ - { { "name", NULL, MAVLINK_TYPE_CHAR, 10, 0, offsetof(mavlink_named_value_float_t, name) }, \ - { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 10, offsetof(mavlink_named_value_float_t, value) }, \ - } \ -} - - -/** - * @brief Pack a named_value_float message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param name Name of the debug variable - * @param value Floating point value - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_named_value_float_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - const char *name, float value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _mav_put_float(buf, 10, value); - _mav_put_char_array(buf, 0, name, 10); - memcpy(_MAV_PAYLOAD(msg), buf, 14); -#else - mavlink_named_value_float_t packet; - packet.value = value; - mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD(msg), &packet, 14); -#endif - - msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; - return mavlink_finalize_message(msg, system_id, component_id, 14); -} - -/** - * @brief Pack a named_value_float message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param name Name of the debug variable - * @param value Floating point value - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_named_value_float_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - const char *name,float value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _mav_put_float(buf, 10, value); - _mav_put_char_array(buf, 0, name, 10); - memcpy(_MAV_PAYLOAD(msg), buf, 14); -#else - mavlink_named_value_float_t packet; - packet.value = value; - mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD(msg), &packet, 14); -#endif - - msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 14); -} - -/** - * @brief Encode a named_value_float struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param named_value_float C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_named_value_float_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_named_value_float_t* named_value_float) -{ - return mavlink_msg_named_value_float_pack(system_id, component_id, msg, named_value_float->name, named_value_float->value); -} - -/** - * @brief Send a named_value_float message - * @param chan MAVLink channel to send the message - * - * @param name Name of the debug variable - * @param value Floating point value - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_named_value_float_send(mavlink_channel_t chan, const char *name, float value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _mav_put_float(buf, 10, value); - _mav_put_char_array(buf, 0, name, 10); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, buf, 14); -#else - mavlink_named_value_float_t packet; - packet.value = value; - mav_array_memcpy(packet.name, name, sizeof(char)*10); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)&packet, 14); -#endif -} - -#endif - -// MESSAGE NAMED_VALUE_FLOAT UNPACKING - - -/** - * @brief Get field name from named_value_float message - * - * @return Name of the debug variable - */ -static inline uint16_t mavlink_msg_named_value_float_get_name(const mavlink_message_t* msg, char *name) -{ - return _MAV_RETURN_char_array(msg, name, 10, 0); -} - -/** - * @brief Get field value from named_value_float message - * - * @return Floating point value - */ -static inline float mavlink_msg_named_value_float_get_value(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 10); -} - -/** - * @brief Decode a named_value_float message into a struct - * - * @param msg The message to decode - * @param named_value_float C-struct to decode the message contents into - */ -static inline void mavlink_msg_named_value_float_decode(const mavlink_message_t* msg, mavlink_named_value_float_t* named_value_float) -{ -#if MAVLINK_NEED_BYTE_SWAP - mavlink_msg_named_value_float_get_name(msg, named_value_float->name); - named_value_float->value = mavlink_msg_named_value_float_get_value(msg); -#else - memcpy(named_value_float, _MAV_PAYLOAD(msg), 14); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_named_value_int.h b/src/GCS_MAVLink/include/common/mavlink_msg_named_value_int.h deleted file mode 100644 index a484e6e1f..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_named_value_int.h +++ /dev/null @@ -1,160 +0,0 @@ -// MESSAGE NAMED_VALUE_INT PACKING - -#define MAVLINK_MSG_ID_NAMED_VALUE_INT 253 - -typedef struct __mavlink_named_value_int_t -{ - char name[10]; ///< Name of the debug variable - int32_t value; ///< Signed integer value -} mavlink_named_value_int_t; - -#define MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN 14 -#define MAVLINK_MSG_ID_253_LEN 14 - -#define MAVLINK_MSG_NAMED_VALUE_INT_FIELD_NAME_LEN 10 - -#define MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT { \ - "NAMED_VALUE_INT", \ - 2, \ - { { "name", NULL, MAVLINK_TYPE_CHAR, 10, 0, offsetof(mavlink_named_value_int_t, name) }, \ - { "value", NULL, MAVLINK_TYPE_INT32_T, 0, 10, offsetof(mavlink_named_value_int_t, value) }, \ - } \ -} - - -/** - * @brief Pack a named_value_int message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param name Name of the debug variable - * @param value Signed integer value - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_named_value_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - const char *name, int32_t value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _mav_put_int32_t(buf, 10, value); - _mav_put_char_array(buf, 0, name, 10); - memcpy(_MAV_PAYLOAD(msg), buf, 14); -#else - mavlink_named_value_int_t packet; - packet.value = value; - mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD(msg), &packet, 14); -#endif - - msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT; - return mavlink_finalize_message(msg, system_id, component_id, 14); -} - -/** - * @brief Pack a named_value_int message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param name Name of the debug variable - * @param value Signed integer value - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_named_value_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - const char *name,int32_t value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _mav_put_int32_t(buf, 10, value); - _mav_put_char_array(buf, 0, name, 10); - memcpy(_MAV_PAYLOAD(msg), buf, 14); -#else - mavlink_named_value_int_t packet; - packet.value = value; - mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD(msg), &packet, 14); -#endif - - msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 14); -} - -/** - * @brief Encode a named_value_int struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param named_value_int C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_named_value_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_named_value_int_t* named_value_int) -{ - return mavlink_msg_named_value_int_pack(system_id, component_id, msg, named_value_int->name, named_value_int->value); -} - -/** - * @brief Send a named_value_int message - * @param chan MAVLink channel to send the message - * - * @param name Name of the debug variable - * @param value Signed integer value - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_named_value_int_send(mavlink_channel_t chan, const char *name, int32_t value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _mav_put_int32_t(buf, 10, value); - _mav_put_char_array(buf, 0, name, 10); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, buf, 14); -#else - mavlink_named_value_int_t packet; - packet.value = value; - mav_array_memcpy(packet.name, name, sizeof(char)*10); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)&packet, 14); -#endif -} - -#endif - -// MESSAGE NAMED_VALUE_INT UNPACKING - - -/** - * @brief Get field name from named_value_int message - * - * @return Name of the debug variable - */ -static inline uint16_t mavlink_msg_named_value_int_get_name(const mavlink_message_t* msg, char *name) -{ - return _MAV_RETURN_char_array(msg, name, 10, 0); -} - -/** - * @brief Get field value from named_value_int message - * - * @return Signed integer value - */ -static inline int32_t mavlink_msg_named_value_int_get_value(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 10); -} - -/** - * @brief Decode a named_value_int message into a struct - * - * @param msg The message to decode - * @param named_value_int C-struct to decode the message contents into - */ -static inline void mavlink_msg_named_value_int_decode(const mavlink_message_t* msg, mavlink_named_value_int_t* named_value_int) -{ -#if MAVLINK_NEED_BYTE_SWAP - mavlink_msg_named_value_int_get_name(msg, named_value_int->name); - named_value_int->value = mavlink_msg_named_value_int_get_value(msg); -#else - memcpy(named_value_int, _MAV_PAYLOAD(msg), 14); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_nav_controller_output.h b/src/GCS_MAVLink/include/common/mavlink_msg_nav_controller_output.h deleted file mode 100644 index 8322c8fab..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_nav_controller_output.h +++ /dev/null @@ -1,298 +0,0 @@ -// MESSAGE NAV_CONTROLLER_OUTPUT PACKING - -#define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT 62 - -typedef struct __mavlink_nav_controller_output_t -{ - float nav_roll; ///< Current desired roll in degrees - float nav_pitch; ///< Current desired pitch in degrees - int16_t nav_bearing; ///< Current desired heading in degrees - int16_t target_bearing; ///< Bearing to current waypoint/target in degrees - uint16_t wp_dist; ///< Distance to active waypoint in meters - float alt_error; ///< Current altitude error in meters - float aspd_error; ///< Current airspeed error in meters/second - float xtrack_error; ///< Current crosstrack error on x-y plane in meters -} mavlink_nav_controller_output_t; - -#define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN 26 -#define MAVLINK_MSG_ID_62_LEN 26 - - - -#define MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT { \ - "NAV_CONTROLLER_OUTPUT", \ - 8, \ - { { "nav_roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_nav_controller_output_t, nav_roll) }, \ - { "nav_pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_nav_controller_output_t, nav_pitch) }, \ - { "nav_bearing", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_nav_controller_output_t, nav_bearing) }, \ - { "target_bearing", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_nav_controller_output_t, target_bearing) }, \ - { "wp_dist", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_nav_controller_output_t, wp_dist) }, \ - { "alt_error", NULL, MAVLINK_TYPE_FLOAT, 0, 14, offsetof(mavlink_nav_controller_output_t, alt_error) }, \ - { "aspd_error", NULL, MAVLINK_TYPE_FLOAT, 0, 18, offsetof(mavlink_nav_controller_output_t, aspd_error) }, \ - { "xtrack_error", NULL, MAVLINK_TYPE_FLOAT, 0, 22, offsetof(mavlink_nav_controller_output_t, xtrack_error) }, \ - } \ -} - - -/** - * @brief Pack a nav_controller_output message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param nav_roll Current desired roll in degrees - * @param nav_pitch Current desired pitch in degrees - * @param nav_bearing Current desired heading in degrees - * @param target_bearing Bearing to current waypoint/target in degrees - * @param wp_dist Distance to active waypoint in meters - * @param alt_error Current altitude error in meters - * @param aspd_error Current airspeed error in meters/second - * @param xtrack_error Current crosstrack error on x-y plane in meters - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - float nav_roll, float nav_pitch, int16_t nav_bearing, int16_t target_bearing, uint16_t wp_dist, float alt_error, float aspd_error, float xtrack_error) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; - _mav_put_float(buf, 0, nav_roll); - _mav_put_float(buf, 4, nav_pitch); - _mav_put_int16_t(buf, 8, nav_bearing); - _mav_put_int16_t(buf, 10, target_bearing); - _mav_put_uint16_t(buf, 12, wp_dist); - _mav_put_float(buf, 14, alt_error); - _mav_put_float(buf, 18, aspd_error); - _mav_put_float(buf, 22, xtrack_error); - - memcpy(_MAV_PAYLOAD(msg), buf, 26); -#else - mavlink_nav_controller_output_t packet; - packet.nav_roll = nav_roll; - packet.nav_pitch = nav_pitch; - packet.nav_bearing = nav_bearing; - packet.target_bearing = target_bearing; - packet.wp_dist = wp_dist; - packet.alt_error = alt_error; - packet.aspd_error = aspd_error; - packet.xtrack_error = xtrack_error; - - memcpy(_MAV_PAYLOAD(msg), &packet, 26); -#endif - - msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT; - return mavlink_finalize_message(msg, system_id, component_id, 26); -} - -/** - * @brief Pack a nav_controller_output message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param nav_roll Current desired roll in degrees - * @param nav_pitch Current desired pitch in degrees - * @param nav_bearing Current desired heading in degrees - * @param target_bearing Bearing to current waypoint/target in degrees - * @param wp_dist Distance to active waypoint in meters - * @param alt_error Current altitude error in meters - * @param aspd_error Current airspeed error in meters/second - * @param xtrack_error Current crosstrack error on x-y plane in meters - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_nav_controller_output_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - float nav_roll,float nav_pitch,int16_t nav_bearing,int16_t target_bearing,uint16_t wp_dist,float alt_error,float aspd_error,float xtrack_error) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; - _mav_put_float(buf, 0, nav_roll); - _mav_put_float(buf, 4, nav_pitch); - _mav_put_int16_t(buf, 8, nav_bearing); - _mav_put_int16_t(buf, 10, target_bearing); - _mav_put_uint16_t(buf, 12, wp_dist); - _mav_put_float(buf, 14, alt_error); - _mav_put_float(buf, 18, aspd_error); - _mav_put_float(buf, 22, xtrack_error); - - memcpy(_MAV_PAYLOAD(msg), buf, 26); -#else - mavlink_nav_controller_output_t packet; - packet.nav_roll = nav_roll; - packet.nav_pitch = nav_pitch; - packet.nav_bearing = nav_bearing; - packet.target_bearing = target_bearing; - packet.wp_dist = wp_dist; - packet.alt_error = alt_error; - packet.aspd_error = aspd_error; - packet.xtrack_error = xtrack_error; - - memcpy(_MAV_PAYLOAD(msg), &packet, 26); -#endif - - msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 26); -} - -/** - * @brief Encode a nav_controller_output struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param nav_controller_output C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_nav_controller_output_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_nav_controller_output_t* nav_controller_output) -{ - return mavlink_msg_nav_controller_output_pack(system_id, component_id, msg, nav_controller_output->nav_roll, nav_controller_output->nav_pitch, nav_controller_output->nav_bearing, nav_controller_output->target_bearing, nav_controller_output->wp_dist, nav_controller_output->alt_error, nav_controller_output->aspd_error, nav_controller_output->xtrack_error); -} - -/** - * @brief Send a nav_controller_output message - * @param chan MAVLink channel to send the message - * - * @param nav_roll Current desired roll in degrees - * @param nav_pitch Current desired pitch in degrees - * @param nav_bearing Current desired heading in degrees - * @param target_bearing Bearing to current waypoint/target in degrees - * @param wp_dist Distance to active waypoint in meters - * @param alt_error Current altitude error in meters - * @param aspd_error Current airspeed error in meters/second - * @param xtrack_error Current crosstrack error on x-y plane in meters - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_nav_controller_output_send(mavlink_channel_t chan, float nav_roll, float nav_pitch, int16_t nav_bearing, int16_t target_bearing, uint16_t wp_dist, float alt_error, float aspd_error, float xtrack_error) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; - _mav_put_float(buf, 0, nav_roll); - _mav_put_float(buf, 4, nav_pitch); - _mav_put_int16_t(buf, 8, nav_bearing); - _mav_put_int16_t(buf, 10, target_bearing); - _mav_put_uint16_t(buf, 12, wp_dist); - _mav_put_float(buf, 14, alt_error); - _mav_put_float(buf, 18, aspd_error); - _mav_put_float(buf, 22, xtrack_error); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, buf, 26); -#else - mavlink_nav_controller_output_t packet; - packet.nav_roll = nav_roll; - packet.nav_pitch = nav_pitch; - packet.nav_bearing = nav_bearing; - packet.target_bearing = target_bearing; - packet.wp_dist = wp_dist; - packet.alt_error = alt_error; - packet.aspd_error = aspd_error; - packet.xtrack_error = xtrack_error; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, (const char *)&packet, 26); -#endif -} - -#endif - -// MESSAGE NAV_CONTROLLER_OUTPUT UNPACKING - - -/** - * @brief Get field nav_roll from nav_controller_output message - * - * @return Current desired roll in degrees - */ -static inline float mavlink_msg_nav_controller_output_get_nav_roll(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 0); -} - -/** - * @brief Get field nav_pitch from nav_controller_output message - * - * @return Current desired pitch in degrees - */ -static inline float mavlink_msg_nav_controller_output_get_nav_pitch(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Get field nav_bearing from nav_controller_output message - * - * @return Current desired heading in degrees - */ -static inline int16_t mavlink_msg_nav_controller_output_get_nav_bearing(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 8); -} - -/** - * @brief Get field target_bearing from nav_controller_output message - * - * @return Bearing to current waypoint/target in degrees - */ -static inline int16_t mavlink_msg_nav_controller_output_get_target_bearing(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 10); -} - -/** - * @brief Get field wp_dist from nav_controller_output message - * - * @return Distance to active waypoint in meters - */ -static inline uint16_t mavlink_msg_nav_controller_output_get_wp_dist(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 12); -} - -/** - * @brief Get field alt_error from nav_controller_output message - * - * @return Current altitude error in meters - */ -static inline float mavlink_msg_nav_controller_output_get_alt_error(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 14); -} - -/** - * @brief Get field aspd_error from nav_controller_output message - * - * @return Current airspeed error in meters/second - */ -static inline float mavlink_msg_nav_controller_output_get_aspd_error(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 18); -} - -/** - * @brief Get field xtrack_error from nav_controller_output message - * - * @return Current crosstrack error on x-y plane in meters - */ -static inline float mavlink_msg_nav_controller_output_get_xtrack_error(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 22); -} - -/** - * @brief Decode a nav_controller_output message into a struct - * - * @param msg The message to decode - * @param nav_controller_output C-struct to decode the message contents into - */ -static inline void mavlink_msg_nav_controller_output_decode(const mavlink_message_t* msg, mavlink_nav_controller_output_t* nav_controller_output) -{ -#if MAVLINK_NEED_BYTE_SWAP - nav_controller_output->nav_roll = mavlink_msg_nav_controller_output_get_nav_roll(msg); - nav_controller_output->nav_pitch = mavlink_msg_nav_controller_output_get_nav_pitch(msg); - nav_controller_output->nav_bearing = mavlink_msg_nav_controller_output_get_nav_bearing(msg); - nav_controller_output->target_bearing = mavlink_msg_nav_controller_output_get_target_bearing(msg); - nav_controller_output->wp_dist = mavlink_msg_nav_controller_output_get_wp_dist(msg); - nav_controller_output->alt_error = mavlink_msg_nav_controller_output_get_alt_error(msg); - nav_controller_output->aspd_error = mavlink_msg_nav_controller_output_get_aspd_error(msg); - nav_controller_output->xtrack_error = mavlink_msg_nav_controller_output_get_xtrack_error(msg); -#else - memcpy(nav_controller_output, _MAV_PAYLOAD(msg), 26); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_object_detection_event.h b/src/GCS_MAVLink/include/common/mavlink_msg_object_detection_event.h deleted file mode 100644 index fc707cb73..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_object_detection_event.h +++ /dev/null @@ -1,270 +0,0 @@ -// MESSAGE OBJECT_DETECTION_EVENT PACKING - -#define MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT 140 - -typedef struct __mavlink_object_detection_event_t -{ - uint32_t time; ///< Timestamp in milliseconds since system boot - uint16_t object_id; ///< Object ID - uint8_t type; ///< Object type: 0: image, 1: letter, 2: ground vehicle, 3: air vehicle, 4: surface vehicle, 5: sub-surface vehicle, 6: human, 7: animal - char name[20]; ///< Name of the object as defined by the detector - uint8_t quality; ///< Detection quality / confidence. 0: bad, 255: maximum confidence - float bearing; ///< Angle of the object with respect to the body frame in NED coordinates in radians. 0: front - float distance; ///< Ground distance in meters -} mavlink_object_detection_event_t; - -#define MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT_LEN 36 -#define MAVLINK_MSG_ID_140_LEN 36 - -#define MAVLINK_MSG_OBJECT_DETECTION_EVENT_FIELD_NAME_LEN 20 - -#define MAVLINK_MESSAGE_INFO_OBJECT_DETECTION_EVENT { \ - "OBJECT_DETECTION_EVENT", \ - 7, \ - { { "time", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_object_detection_event_t, time) }, \ - { "object_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_object_detection_event_t, object_id) }, \ - { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_object_detection_event_t, type) }, \ - { "name", NULL, MAVLINK_TYPE_CHAR, 20, 7, offsetof(mavlink_object_detection_event_t, name) }, \ - { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_object_detection_event_t, quality) }, \ - { "bearing", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_object_detection_event_t, bearing) }, \ - { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_object_detection_event_t, distance) }, \ - } \ -} - - -/** - * @brief Pack a object_detection_event message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param time Timestamp in milliseconds since system boot - * @param object_id Object ID - * @param type Object type: 0: image, 1: letter, 2: ground vehicle, 3: air vehicle, 4: surface vehicle, 5: sub-surface vehicle, 6: human, 7: animal - * @param name Name of the object as defined by the detector - * @param quality Detection quality / confidence. 0: bad, 255: maximum confidence - * @param bearing Angle of the object with respect to the body frame in NED coordinates in radians. 0: front - * @param distance Ground distance in meters - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_object_detection_event_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time, uint16_t object_id, uint8_t type, const char *name, uint8_t quality, float bearing, float distance) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; - _mav_put_uint32_t(buf, 0, time); - _mav_put_uint16_t(buf, 4, object_id); - _mav_put_uint8_t(buf, 6, type); - _mav_put_uint8_t(buf, 27, quality); - _mav_put_float(buf, 28, bearing); - _mav_put_float(buf, 32, distance); - _mav_put_char_array(buf, 7, name, 20); - memcpy(_MAV_PAYLOAD(msg), buf, 36); -#else - mavlink_object_detection_event_t packet; - packet.time = time; - packet.object_id = object_id; - packet.type = type; - packet.quality = quality; - packet.bearing = bearing; - packet.distance = distance; - mav_array_memcpy(packet.name, name, sizeof(char)*20); - memcpy(_MAV_PAYLOAD(msg), &packet, 36); -#endif - - msg->msgid = MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT; - return mavlink_finalize_message(msg, system_id, component_id, 36); -} - -/** - * @brief Pack a object_detection_event message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param time Timestamp in milliseconds since system boot - * @param object_id Object ID - * @param type Object type: 0: image, 1: letter, 2: ground vehicle, 3: air vehicle, 4: surface vehicle, 5: sub-surface vehicle, 6: human, 7: animal - * @param name Name of the object as defined by the detector - * @param quality Detection quality / confidence. 0: bad, 255: maximum confidence - * @param bearing Angle of the object with respect to the body frame in NED coordinates in radians. 0: front - * @param distance Ground distance in meters - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_object_detection_event_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time,uint16_t object_id,uint8_t type,const char *name,uint8_t quality,float bearing,float distance) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; - _mav_put_uint32_t(buf, 0, time); - _mav_put_uint16_t(buf, 4, object_id); - _mav_put_uint8_t(buf, 6, type); - _mav_put_uint8_t(buf, 27, quality); - _mav_put_float(buf, 28, bearing); - _mav_put_float(buf, 32, distance); - _mav_put_char_array(buf, 7, name, 20); - memcpy(_MAV_PAYLOAD(msg), buf, 36); -#else - mavlink_object_detection_event_t packet; - packet.time = time; - packet.object_id = object_id; - packet.type = type; - packet.quality = quality; - packet.bearing = bearing; - packet.distance = distance; - mav_array_memcpy(packet.name, name, sizeof(char)*20); - memcpy(_MAV_PAYLOAD(msg), &packet, 36); -#endif - - msg->msgid = MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 36); -} - -/** - * @brief Encode a object_detection_event struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param object_detection_event C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_object_detection_event_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_object_detection_event_t* object_detection_event) -{ - return mavlink_msg_object_detection_event_pack(system_id, component_id, msg, object_detection_event->time, object_detection_event->object_id, object_detection_event->type, object_detection_event->name, object_detection_event->quality, object_detection_event->bearing, object_detection_event->distance); -} - -/** - * @brief Send a object_detection_event message - * @param chan MAVLink channel to send the message - * - * @param time Timestamp in milliseconds since system boot - * @param object_id Object ID - * @param type Object type: 0: image, 1: letter, 2: ground vehicle, 3: air vehicle, 4: surface vehicle, 5: sub-surface vehicle, 6: human, 7: animal - * @param name Name of the object as defined by the detector - * @param quality Detection quality / confidence. 0: bad, 255: maximum confidence - * @param bearing Angle of the object with respect to the body frame in NED coordinates in radians. 0: front - * @param distance Ground distance in meters - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_object_detection_event_send(mavlink_channel_t chan, uint32_t time, uint16_t object_id, uint8_t type, const char *name, uint8_t quality, float bearing, float distance) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; - _mav_put_uint32_t(buf, 0, time); - _mav_put_uint16_t(buf, 4, object_id); - _mav_put_uint8_t(buf, 6, type); - _mav_put_uint8_t(buf, 27, quality); - _mav_put_float(buf, 28, bearing); - _mav_put_float(buf, 32, distance); - _mav_put_char_array(buf, 7, name, 20); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT, buf, 36); -#else - mavlink_object_detection_event_t packet; - packet.time = time; - packet.object_id = object_id; - packet.type = type; - packet.quality = quality; - packet.bearing = bearing; - packet.distance = distance; - mav_array_memcpy(packet.name, name, sizeof(char)*20); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT, (const char *)&packet, 36); -#endif -} - -#endif - -// MESSAGE OBJECT_DETECTION_EVENT UNPACKING - - -/** - * @brief Get field time from object_detection_event message - * - * @return Timestamp in milliseconds since system boot - */ -static inline uint32_t mavlink_msg_object_detection_event_get_time(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint32_t(msg, 0); -} - -/** - * @brief Get field object_id from object_detection_event message - * - * @return Object ID - */ -static inline uint16_t mavlink_msg_object_detection_event_get_object_id(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 4); -} - -/** - * @brief Get field type from object_detection_event message - * - * @return Object type: 0: image, 1: letter, 2: ground vehicle, 3: air vehicle, 4: surface vehicle, 5: sub-surface vehicle, 6: human, 7: animal - */ -static inline uint8_t mavlink_msg_object_detection_event_get_type(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 6); -} - -/** - * @brief Get field name from object_detection_event message - * - * @return Name of the object as defined by the detector - */ -static inline uint16_t mavlink_msg_object_detection_event_get_name(const mavlink_message_t* msg, char *name) -{ - return _MAV_RETURN_char_array(msg, name, 20, 7); -} - -/** - * @brief Get field quality from object_detection_event message - * - * @return Detection quality / confidence. 0: bad, 255: maximum confidence - */ -static inline uint8_t mavlink_msg_object_detection_event_get_quality(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 27); -} - -/** - * @brief Get field bearing from object_detection_event message - * - * @return Angle of the object with respect to the body frame in NED coordinates in radians. 0: front - */ -static inline float mavlink_msg_object_detection_event_get_bearing(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 28); -} - -/** - * @brief Get field distance from object_detection_event message - * - * @return Ground distance in meters - */ -static inline float mavlink_msg_object_detection_event_get_distance(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 32); -} - -/** - * @brief Decode a object_detection_event message into a struct - * - * @param msg The message to decode - * @param object_detection_event C-struct to decode the message contents into - */ -static inline void mavlink_msg_object_detection_event_decode(const mavlink_message_t* msg, mavlink_object_detection_event_t* object_detection_event) -{ -#if MAVLINK_NEED_BYTE_SWAP - object_detection_event->time = mavlink_msg_object_detection_event_get_time(msg); - object_detection_event->object_id = mavlink_msg_object_detection_event_get_object_id(msg); - object_detection_event->type = mavlink_msg_object_detection_event_get_type(msg); - mavlink_msg_object_detection_event_get_name(msg, object_detection_event->name); - object_detection_event->quality = mavlink_msg_object_detection_event_get_quality(msg); - object_detection_event->bearing = mavlink_msg_object_detection_event_get_bearing(msg); - object_detection_event->distance = mavlink_msg_object_detection_event_get_distance(msg); -#else - memcpy(object_detection_event, _MAV_PAYLOAD(msg), 36); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_optical_flow.h b/src/GCS_MAVLink/include/common/mavlink_msg_optical_flow.h deleted file mode 100644 index a4bfb18a7..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_optical_flow.h +++ /dev/null @@ -1,254 +0,0 @@ -// MESSAGE OPTICAL_FLOW PACKING - -#define MAVLINK_MSG_ID_OPTICAL_FLOW 100 - -typedef struct __mavlink_optical_flow_t -{ - uint64_t time; ///< Timestamp (UNIX) - uint8_t sensor_id; ///< Sensor ID - int16_t flow_x; ///< Flow in pixels in x-sensor direction - int16_t flow_y; ///< Flow in pixels in y-sensor direction - uint8_t quality; ///< Optical flow quality / confidence. 0: bad, 255: maximum quality - float ground_distance; ///< Ground distance in meters -} mavlink_optical_flow_t; - -#define MAVLINK_MSG_ID_OPTICAL_FLOW_LEN 18 -#define MAVLINK_MSG_ID_100_LEN 18 - - - -#define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW { \ - "OPTICAL_FLOW", \ - 6, \ - { { "time", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_t, time) }, \ - { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_optical_flow_t, sensor_id) }, \ - { "flow_x", NULL, MAVLINK_TYPE_INT16_T, 0, 9, offsetof(mavlink_optical_flow_t, flow_x) }, \ - { "flow_y", NULL, MAVLINK_TYPE_INT16_T, 0, 11, offsetof(mavlink_optical_flow_t, flow_y) }, \ - { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_optical_flow_t, quality) }, \ - { "ground_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 14, offsetof(mavlink_optical_flow_t, ground_distance) }, \ - } \ -} - - -/** - * @brief Pack a optical_flow message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param time Timestamp (UNIX) - * @param sensor_id Sensor ID - * @param flow_x Flow in pixels in x-sensor direction - * @param flow_y Flow in pixels in y-sensor direction - * @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality - * @param ground_distance Ground distance in meters - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_optical_flow_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, uint8_t quality, float ground_distance) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint64_t(buf, 0, time); - _mav_put_uint8_t(buf, 8, sensor_id); - _mav_put_int16_t(buf, 9, flow_x); - _mav_put_int16_t(buf, 11, flow_y); - _mav_put_uint8_t(buf, 13, quality); - _mav_put_float(buf, 14, ground_distance); - - memcpy(_MAV_PAYLOAD(msg), buf, 18); -#else - mavlink_optical_flow_t packet; - packet.time = time; - packet.sensor_id = sensor_id; - packet.flow_x = flow_x; - packet.flow_y = flow_y; - packet.quality = quality; - packet.ground_distance = ground_distance; - - memcpy(_MAV_PAYLOAD(msg), &packet, 18); -#endif - - msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW; - return mavlink_finalize_message(msg, system_id, component_id, 18); -} - -/** - * @brief Pack a optical_flow message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param time Timestamp (UNIX) - * @param sensor_id Sensor ID - * @param flow_x Flow in pixels in x-sensor direction - * @param flow_y Flow in pixels in y-sensor direction - * @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality - * @param ground_distance Ground distance in meters - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_optical_flow_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time,uint8_t sensor_id,int16_t flow_x,int16_t flow_y,uint8_t quality,float ground_distance) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint64_t(buf, 0, time); - _mav_put_uint8_t(buf, 8, sensor_id); - _mav_put_int16_t(buf, 9, flow_x); - _mav_put_int16_t(buf, 11, flow_y); - _mav_put_uint8_t(buf, 13, quality); - _mav_put_float(buf, 14, ground_distance); - - memcpy(_MAV_PAYLOAD(msg), buf, 18); -#else - mavlink_optical_flow_t packet; - packet.time = time; - packet.sensor_id = sensor_id; - packet.flow_x = flow_x; - packet.flow_y = flow_y; - packet.quality = quality; - packet.ground_distance = ground_distance; - - memcpy(_MAV_PAYLOAD(msg), &packet, 18); -#endif - - msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18); -} - -/** - * @brief Encode a optical_flow struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param optical_flow C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_optical_flow_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_optical_flow_t* optical_flow) -{ - return mavlink_msg_optical_flow_pack(system_id, component_id, msg, optical_flow->time, optical_flow->sensor_id, optical_flow->flow_x, optical_flow->flow_y, optical_flow->quality, optical_flow->ground_distance); -} - -/** - * @brief Send a optical_flow message - * @param chan MAVLink channel to send the message - * - * @param time Timestamp (UNIX) - * @param sensor_id Sensor ID - * @param flow_x Flow in pixels in x-sensor direction - * @param flow_y Flow in pixels in y-sensor direction - * @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality - * @param ground_distance Ground distance in meters - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_optical_flow_send(mavlink_channel_t chan, uint64_t time, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, uint8_t quality, float ground_distance) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint64_t(buf, 0, time); - _mav_put_uint8_t(buf, 8, sensor_id); - _mav_put_int16_t(buf, 9, flow_x); - _mav_put_int16_t(buf, 11, flow_y); - _mav_put_uint8_t(buf, 13, quality); - _mav_put_float(buf, 14, ground_distance); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, 18); -#else - mavlink_optical_flow_t packet; - packet.time = time; - packet.sensor_id = sensor_id; - packet.flow_x = flow_x; - packet.flow_y = flow_y; - packet.quality = quality; - packet.ground_distance = ground_distance; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)&packet, 18); -#endif -} - -#endif - -// MESSAGE OPTICAL_FLOW UNPACKING - - -/** - * @brief Get field time from optical_flow message - * - * @return Timestamp (UNIX) - */ -static inline uint64_t mavlink_msg_optical_flow_get_time(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field sensor_id from optical_flow message - * - * @return Sensor ID - */ -static inline uint8_t mavlink_msg_optical_flow_get_sensor_id(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 8); -} - -/** - * @brief Get field flow_x from optical_flow message - * - * @return Flow in pixels in x-sensor direction - */ -static inline int16_t mavlink_msg_optical_flow_get_flow_x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 9); -} - -/** - * @brief Get field flow_y from optical_flow message - * - * @return Flow in pixels in y-sensor direction - */ -static inline int16_t mavlink_msg_optical_flow_get_flow_y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 11); -} - -/** - * @brief Get field quality from optical_flow message - * - * @return Optical flow quality / confidence. 0: bad, 255: maximum quality - */ -static inline uint8_t mavlink_msg_optical_flow_get_quality(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 13); -} - -/** - * @brief Get field ground_distance from optical_flow message - * - * @return Ground distance in meters - */ -static inline float mavlink_msg_optical_flow_get_ground_distance(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 14); -} - -/** - * @brief Decode a optical_flow message into a struct - * - * @param msg The message to decode - * @param optical_flow C-struct to decode the message contents into - */ -static inline void mavlink_msg_optical_flow_decode(const mavlink_message_t* msg, mavlink_optical_flow_t* optical_flow) -{ -#if MAVLINK_NEED_BYTE_SWAP - optical_flow->time = mavlink_msg_optical_flow_get_time(msg); - optical_flow->sensor_id = mavlink_msg_optical_flow_get_sensor_id(msg); - optical_flow->flow_x = mavlink_msg_optical_flow_get_flow_x(msg); - optical_flow->flow_y = mavlink_msg_optical_flow_get_flow_y(msg); - optical_flow->quality = mavlink_msg_optical_flow_get_quality(msg); - optical_flow->ground_distance = mavlink_msg_optical_flow_get_ground_distance(msg); -#else - memcpy(optical_flow, _MAV_PAYLOAD(msg), 18); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_param_request_list.h b/src/GCS_MAVLink/include/common/mavlink_msg_param_request_list.h deleted file mode 100644 index 123ac7977..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_param_request_list.h +++ /dev/null @@ -1,166 +0,0 @@ -// MESSAGE PARAM_REQUEST_LIST PACKING - -#define MAVLINK_MSG_ID_PARAM_REQUEST_LIST 21 - -typedef struct __mavlink_param_request_list_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID -} mavlink_param_request_list_t; - -#define MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN 2 -#define MAVLINK_MSG_ID_21_LEN 2 - - - -#define MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST { \ - "PARAM_REQUEST_LIST", \ - 2, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_param_request_list_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_param_request_list_t, target_component) }, \ - } \ -} - - -/** - * @brief Pack a param_request_list message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_param_request_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_param_request_list_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST; - return mavlink_finalize_message(msg, system_id, component_id, 2); -} - -/** - * @brief Pack a param_request_list message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_param_request_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_param_request_list_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2); -} - -/** - * @brief Encode a param_request_list struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param param_request_list C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_param_request_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_param_request_list_t* param_request_list) -{ - return mavlink_msg_param_request_list_pack(system_id, component_id, msg, param_request_list->target_system, param_request_list->target_component); -} - -/** - * @brief Send a param_request_list message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_param_request_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, buf, 2); -#else - mavlink_param_request_list_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, (const char *)&packet, 2); -#endif -} - -#endif - -// MESSAGE PARAM_REQUEST_LIST UNPACKING - - -/** - * @brief Get field target_system from param_request_list message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_param_request_list_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from param_request_list message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_param_request_list_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Decode a param_request_list message into a struct - * - * @param msg The message to decode - * @param param_request_list C-struct to decode the message contents into - */ -static inline void mavlink_msg_param_request_list_decode(const mavlink_message_t* msg, mavlink_param_request_list_t* param_request_list) -{ -#if MAVLINK_NEED_BYTE_SWAP - param_request_list->target_system = mavlink_msg_param_request_list_get_target_system(msg); - param_request_list->target_component = mavlink_msg_param_request_list_get_target_component(msg); -#else - memcpy(param_request_list, _MAV_PAYLOAD(msg), 2); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_param_request_read.h b/src/GCS_MAVLink/include/common/mavlink_msg_param_request_read.h deleted file mode 100644 index d84ed5f03..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_param_request_read.h +++ /dev/null @@ -1,204 +0,0 @@ -// MESSAGE PARAM_REQUEST_READ PACKING - -#define MAVLINK_MSG_ID_PARAM_REQUEST_READ 20 - -typedef struct __mavlink_param_request_read_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - int8_t param_id[15]; ///< Onboard parameter id - int16_t param_index; ///< Parameter index. Send -1 to use the param ID field as identifier -} mavlink_param_request_read_t; - -#define MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN 19 -#define MAVLINK_MSG_ID_20_LEN 19 - -#define MAVLINK_MSG_PARAM_REQUEST_READ_FIELD_PARAM_ID_LEN 15 - -#define MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ { \ - "PARAM_REQUEST_READ", \ - 4, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_param_request_read_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_param_request_read_t, target_component) }, \ - { "param_id", NULL, MAVLINK_TYPE_INT8_T, 15, 2, offsetof(mavlink_param_request_read_t, param_id) }, \ - { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 17, offsetof(mavlink_param_request_read_t, param_index) }, \ - } \ -} - - -/** - * @brief Pack a param_request_read message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param param_id Onboard parameter id - * @param param_index Parameter index. Send -1 to use the param ID field as identifier - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_param_request_read_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, const int8_t *param_id, int16_t param_index) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[19]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_int16_t(buf, 17, param_index); - _mav_put_int8_t_array(buf, 2, param_id, 15); - memcpy(_MAV_PAYLOAD(msg), buf, 19); -#else - mavlink_param_request_read_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.param_index = param_index; - mav_array_memcpy(packet.param_id, param_id, sizeof(int8_t)*15); - memcpy(_MAV_PAYLOAD(msg), &packet, 19); -#endif - - msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; - return mavlink_finalize_message(msg, system_id, component_id, 19); -} - -/** - * @brief Pack a param_request_read message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param param_id Onboard parameter id - * @param param_index Parameter index. Send -1 to use the param ID field as identifier - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_param_request_read_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,const int8_t *param_id,int16_t param_index) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[19]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_int16_t(buf, 17, param_index); - _mav_put_int8_t_array(buf, 2, param_id, 15); - memcpy(_MAV_PAYLOAD(msg), buf, 19); -#else - mavlink_param_request_read_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.param_index = param_index; - mav_array_memcpy(packet.param_id, param_id, sizeof(int8_t)*15); - memcpy(_MAV_PAYLOAD(msg), &packet, 19); -#endif - - msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 19); -} - -/** - * @brief Encode a param_request_read struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param param_request_read C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_param_request_read_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_param_request_read_t* param_request_read) -{ - return mavlink_msg_param_request_read_pack(system_id, component_id, msg, param_request_read->target_system, param_request_read->target_component, param_request_read->param_id, param_request_read->param_index); -} - -/** - * @brief Send a param_request_read message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param param_id Onboard parameter id - * @param param_index Parameter index. Send -1 to use the param ID field as identifier - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_param_request_read_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const int8_t *param_id, int16_t param_index) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[19]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_int16_t(buf, 17, param_index); - _mav_put_int8_t_array(buf, 2, param_id, 15); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, buf, 19); -#else - mavlink_param_request_read_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.param_index = param_index; - mav_array_memcpy(packet.param_id, param_id, sizeof(int8_t)*15); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, (const char *)&packet, 19); -#endif -} - -#endif - -// MESSAGE PARAM_REQUEST_READ UNPACKING - - -/** - * @brief Get field target_system from param_request_read message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_param_request_read_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from param_request_read message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_param_request_read_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field param_id from param_request_read message - * - * @return Onboard parameter id - */ -static inline uint16_t mavlink_msg_param_request_read_get_param_id(const mavlink_message_t* msg, int8_t *param_id) -{ - return _MAV_RETURN_int8_t_array(msg, param_id, 15, 2); -} - -/** - * @brief Get field param_index from param_request_read message - * - * @return Parameter index. Send -1 to use the param ID field as identifier - */ -static inline int16_t mavlink_msg_param_request_read_get_param_index(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 17); -} - -/** - * @brief Decode a param_request_read message into a struct - * - * @param msg The message to decode - * @param param_request_read C-struct to decode the message contents into - */ -static inline void mavlink_msg_param_request_read_decode(const mavlink_message_t* msg, mavlink_param_request_read_t* param_request_read) -{ -#if MAVLINK_NEED_BYTE_SWAP - param_request_read->target_system = mavlink_msg_param_request_read_get_target_system(msg); - param_request_read->target_component = mavlink_msg_param_request_read_get_target_component(msg); - mavlink_msg_param_request_read_get_param_id(msg, param_request_read->param_id); - param_request_read->param_index = mavlink_msg_param_request_read_get_param_index(msg); -#else - memcpy(param_request_read, _MAV_PAYLOAD(msg), 19); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_param_set.h b/src/GCS_MAVLink/include/common/mavlink_msg_param_set.h deleted file mode 100644 index 2703b7076..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_param_set.h +++ /dev/null @@ -1,204 +0,0 @@ -// MESSAGE PARAM_SET PACKING - -#define MAVLINK_MSG_ID_PARAM_SET 23 - -typedef struct __mavlink_param_set_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - int8_t param_id[15]; ///< Onboard parameter id - float param_value; ///< Onboard parameter value -} mavlink_param_set_t; - -#define MAVLINK_MSG_ID_PARAM_SET_LEN 21 -#define MAVLINK_MSG_ID_23_LEN 21 - -#define MAVLINK_MSG_PARAM_SET_FIELD_PARAM_ID_LEN 15 - -#define MAVLINK_MESSAGE_INFO_PARAM_SET { \ - "PARAM_SET", \ - 4, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_param_set_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_param_set_t, target_component) }, \ - { "param_id", NULL, MAVLINK_TYPE_INT8_T, 15, 2, offsetof(mavlink_param_set_t, param_id) }, \ - { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 17, offsetof(mavlink_param_set_t, param_value) }, \ - } \ -} - - -/** - * @brief Pack a param_set message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param param_id Onboard parameter id - * @param param_value Onboard parameter value - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, const int8_t *param_id, float param_value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[21]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_float(buf, 17, param_value); - _mav_put_int8_t_array(buf, 2, param_id, 15); - memcpy(_MAV_PAYLOAD(msg), buf, 21); -#else - mavlink_param_set_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.param_value = param_value; - mav_array_memcpy(packet.param_id, param_id, sizeof(int8_t)*15); - memcpy(_MAV_PAYLOAD(msg), &packet, 21); -#endif - - msg->msgid = MAVLINK_MSG_ID_PARAM_SET; - return mavlink_finalize_message(msg, system_id, component_id, 21); -} - -/** - * @brief Pack a param_set message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param param_id Onboard parameter id - * @param param_value Onboard parameter value - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_param_set_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,const int8_t *param_id,float param_value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[21]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_float(buf, 17, param_value); - _mav_put_int8_t_array(buf, 2, param_id, 15); - memcpy(_MAV_PAYLOAD(msg), buf, 21); -#else - mavlink_param_set_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.param_value = param_value; - mav_array_memcpy(packet.param_id, param_id, sizeof(int8_t)*15); - memcpy(_MAV_PAYLOAD(msg), &packet, 21); -#endif - - msg->msgid = MAVLINK_MSG_ID_PARAM_SET; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 21); -} - -/** - * @brief Encode a param_set struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param param_set C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_param_set_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_param_set_t* param_set) -{ - return mavlink_msg_param_set_pack(system_id, component_id, msg, param_set->target_system, param_set->target_component, param_set->param_id, param_set->param_value); -} - -/** - * @brief Send a param_set message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param param_id Onboard parameter id - * @param param_value Onboard parameter value - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_param_set_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const int8_t *param_id, float param_value) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[21]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_float(buf, 17, param_value); - _mav_put_int8_t_array(buf, 2, param_id, 15); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, buf, 21); -#else - mavlink_param_set_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.param_value = param_value; - mav_array_memcpy(packet.param_id, param_id, sizeof(int8_t)*15); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, (const char *)&packet, 21); -#endif -} - -#endif - -// MESSAGE PARAM_SET UNPACKING - - -/** - * @brief Get field target_system from param_set message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_param_set_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from param_set message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_param_set_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field param_id from param_set message - * - * @return Onboard parameter id - */ -static inline uint16_t mavlink_msg_param_set_get_param_id(const mavlink_message_t* msg, int8_t *param_id) -{ - return _MAV_RETURN_int8_t_array(msg, param_id, 15, 2); -} - -/** - * @brief Get field param_value from param_set message - * - * @return Onboard parameter value - */ -static inline float mavlink_msg_param_set_get_param_value(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 17); -} - -/** - * @brief Decode a param_set message into a struct - * - * @param msg The message to decode - * @param param_set C-struct to decode the message contents into - */ -static inline void mavlink_msg_param_set_decode(const mavlink_message_t* msg, mavlink_param_set_t* param_set) -{ -#if MAVLINK_NEED_BYTE_SWAP - param_set->target_system = mavlink_msg_param_set_get_target_system(msg); - param_set->target_component = mavlink_msg_param_set_get_target_component(msg); - mavlink_msg_param_set_get_param_id(msg, param_set->param_id); - param_set->param_value = mavlink_msg_param_set_get_param_value(msg); -#else - memcpy(param_set, _MAV_PAYLOAD(msg), 21); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_param_value.h b/src/GCS_MAVLink/include/common/mavlink_msg_param_value.h deleted file mode 100644 index 1ded09476..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_param_value.h +++ /dev/null @@ -1,204 +0,0 @@ -// MESSAGE PARAM_VALUE PACKING - -#define MAVLINK_MSG_ID_PARAM_VALUE 22 - -typedef struct __mavlink_param_value_t -{ - int8_t param_id[15]; ///< Onboard parameter id - float param_value; ///< Onboard parameter value - uint16_t param_count; ///< Total number of onboard parameters - uint16_t param_index; ///< Index of this onboard parameter -} mavlink_param_value_t; - -#define MAVLINK_MSG_ID_PARAM_VALUE_LEN 23 -#define MAVLINK_MSG_ID_22_LEN 23 - -#define MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN 15 - -#define MAVLINK_MESSAGE_INFO_PARAM_VALUE { \ - "PARAM_VALUE", \ - 4, \ - { { "param_id", NULL, MAVLINK_TYPE_INT8_T, 15, 0, offsetof(mavlink_param_value_t, param_id) }, \ - { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 15, offsetof(mavlink_param_value_t, param_value) }, \ - { "param_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 19, offsetof(mavlink_param_value_t, param_count) }, \ - { "param_index", NULL, MAVLINK_TYPE_UINT16_T, 0, 21, offsetof(mavlink_param_value_t, param_index) }, \ - } \ -} - - -/** - * @brief Pack a param_value message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param param_id Onboard parameter id - * @param param_value Onboard parameter value - * @param param_count Total number of onboard parameters - * @param param_index Index of this onboard parameter - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - const int8_t *param_id, float param_value, uint16_t param_count, uint16_t param_index) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[23]; - _mav_put_float(buf, 15, param_value); - _mav_put_uint16_t(buf, 19, param_count); - _mav_put_uint16_t(buf, 21, param_index); - _mav_put_int8_t_array(buf, 0, param_id, 15); - memcpy(_MAV_PAYLOAD(msg), buf, 23); -#else - mavlink_param_value_t packet; - packet.param_value = param_value; - packet.param_count = param_count; - packet.param_index = param_index; - mav_array_memcpy(packet.param_id, param_id, sizeof(int8_t)*15); - memcpy(_MAV_PAYLOAD(msg), &packet, 23); -#endif - - msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE; - return mavlink_finalize_message(msg, system_id, component_id, 23); -} - -/** - * @brief Pack a param_value message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param param_id Onboard parameter id - * @param param_value Onboard parameter value - * @param param_count Total number of onboard parameters - * @param param_index Index of this onboard parameter - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_param_value_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - const int8_t *param_id,float param_value,uint16_t param_count,uint16_t param_index) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[23]; - _mav_put_float(buf, 15, param_value); - _mav_put_uint16_t(buf, 19, param_count); - _mav_put_uint16_t(buf, 21, param_index); - _mav_put_int8_t_array(buf, 0, param_id, 15); - memcpy(_MAV_PAYLOAD(msg), buf, 23); -#else - mavlink_param_value_t packet; - packet.param_value = param_value; - packet.param_count = param_count; - packet.param_index = param_index; - mav_array_memcpy(packet.param_id, param_id, sizeof(int8_t)*15); - memcpy(_MAV_PAYLOAD(msg), &packet, 23); -#endif - - msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 23); -} - -/** - * @brief Encode a param_value struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param param_value C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_param_value_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_param_value_t* param_value) -{ - return mavlink_msg_param_value_pack(system_id, component_id, msg, param_value->param_id, param_value->param_value, param_value->param_count, param_value->param_index); -} - -/** - * @brief Send a param_value message - * @param chan MAVLink channel to send the message - * - * @param param_id Onboard parameter id - * @param param_value Onboard parameter value - * @param param_count Total number of onboard parameters - * @param param_index Index of this onboard parameter - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_param_value_send(mavlink_channel_t chan, const int8_t *param_id, float param_value, uint16_t param_count, uint16_t param_index) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[23]; - _mav_put_float(buf, 15, param_value); - _mav_put_uint16_t(buf, 19, param_count); - _mav_put_uint16_t(buf, 21, param_index); - _mav_put_int8_t_array(buf, 0, param_id, 15); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, buf, 23); -#else - mavlink_param_value_t packet; - packet.param_value = param_value; - packet.param_count = param_count; - packet.param_index = param_index; - mav_array_memcpy(packet.param_id, param_id, sizeof(int8_t)*15); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, (const char *)&packet, 23); -#endif -} - -#endif - -// MESSAGE PARAM_VALUE UNPACKING - - -/** - * @brief Get field param_id from param_value message - * - * @return Onboard parameter id - */ -static inline uint16_t mavlink_msg_param_value_get_param_id(const mavlink_message_t* msg, int8_t *param_id) -{ - return _MAV_RETURN_int8_t_array(msg, param_id, 15, 0); -} - -/** - * @brief Get field param_value from param_value message - * - * @return Onboard parameter value - */ -static inline float mavlink_msg_param_value_get_param_value(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 15); -} - -/** - * @brief Get field param_count from param_value message - * - * @return Total number of onboard parameters - */ -static inline uint16_t mavlink_msg_param_value_get_param_count(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 19); -} - -/** - * @brief Get field param_index from param_value message - * - * @return Index of this onboard parameter - */ -static inline uint16_t mavlink_msg_param_value_get_param_index(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 21); -} - -/** - * @brief Decode a param_value message into a struct - * - * @param msg The message to decode - * @param param_value C-struct to decode the message contents into - */ -static inline void mavlink_msg_param_value_decode(const mavlink_message_t* msg, mavlink_param_value_t* param_value) -{ -#if MAVLINK_NEED_BYTE_SWAP - mavlink_msg_param_value_get_param_id(msg, param_value->param_id); - param_value->param_value = mavlink_msg_param_value_get_param_value(msg); - param_value->param_count = mavlink_msg_param_value_get_param_count(msg); - param_value->param_index = mavlink_msg_param_value_get_param_index(msg); -#else - memcpy(param_value, _MAV_PAYLOAD(msg), 23); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_ping.h b/src/GCS_MAVLink/include/common/mavlink_msg_ping.h deleted file mode 100644 index c42422138..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_ping.h +++ /dev/null @@ -1,210 +0,0 @@ -// MESSAGE PING PACKING - -#define MAVLINK_MSG_ID_PING 3 - -typedef struct __mavlink_ping_t -{ - uint32_t seq; ///< PING sequence - uint8_t target_system; ///< 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system - uint8_t target_component; ///< 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system - uint64_t time; ///< Unix timestamp in microseconds -} mavlink_ping_t; - -#define MAVLINK_MSG_ID_PING_LEN 14 -#define MAVLINK_MSG_ID_3_LEN 14 - - - -#define MAVLINK_MESSAGE_INFO_PING { \ - "PING", \ - 4, \ - { { "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_ping_t, seq) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_ping_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_ping_t, target_component) }, \ - { "time", NULL, MAVLINK_TYPE_UINT64_T, 0, 6, offsetof(mavlink_ping_t, time) }, \ - } \ -} - - -/** - * @brief Pack a ping message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param seq PING sequence - * @param target_system 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system - * @param target_component 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system - * @param time Unix timestamp in microseconds - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_ping_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t seq, uint8_t target_system, uint8_t target_component, uint64_t time) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _mav_put_uint32_t(buf, 0, seq); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); - _mav_put_uint64_t(buf, 6, time); - - memcpy(_MAV_PAYLOAD(msg), buf, 14); -#else - mavlink_ping_t packet; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; - packet.time = time; - - memcpy(_MAV_PAYLOAD(msg), &packet, 14); -#endif - - msg->msgid = MAVLINK_MSG_ID_PING; - return mavlink_finalize_message(msg, system_id, component_id, 14); -} - -/** - * @brief Pack a ping message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param seq PING sequence - * @param target_system 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system - * @param target_component 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system - * @param time Unix timestamp in microseconds - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_ping_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t seq,uint8_t target_system,uint8_t target_component,uint64_t time) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _mav_put_uint32_t(buf, 0, seq); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); - _mav_put_uint64_t(buf, 6, time); - - memcpy(_MAV_PAYLOAD(msg), buf, 14); -#else - mavlink_ping_t packet; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; - packet.time = time; - - memcpy(_MAV_PAYLOAD(msg), &packet, 14); -#endif - - msg->msgid = MAVLINK_MSG_ID_PING; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 14); -} - -/** - * @brief Encode a ping struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param ping C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_ping_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ping_t* ping) -{ - return mavlink_msg_ping_pack(system_id, component_id, msg, ping->seq, ping->target_system, ping->target_component, ping->time); -} - -/** - * @brief Send a ping message - * @param chan MAVLink channel to send the message - * - * @param seq PING sequence - * @param target_system 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system - * @param target_component 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system - * @param time Unix timestamp in microseconds - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_ping_send(mavlink_channel_t chan, uint32_t seq, uint8_t target_system, uint8_t target_component, uint64_t time) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _mav_put_uint32_t(buf, 0, seq); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); - _mav_put_uint64_t(buf, 6, time); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, buf, 14); -#else - mavlink_ping_t packet; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; - packet.time = time; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (const char *)&packet, 14); -#endif -} - -#endif - -// MESSAGE PING UNPACKING - - -/** - * @brief Get field seq from ping message - * - * @return PING sequence - */ -static inline uint32_t mavlink_msg_ping_get_seq(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint32_t(msg, 0); -} - -/** - * @brief Get field target_system from ping message - * - * @return 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system - */ -static inline uint8_t mavlink_msg_ping_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 4); -} - -/** - * @brief Get field target_component from ping message - * - * @return 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system - */ -static inline uint8_t mavlink_msg_ping_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 5); -} - -/** - * @brief Get field time from ping message - * - * @return Unix timestamp in microseconds - */ -static inline uint64_t mavlink_msg_ping_get_time(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 6); -} - -/** - * @brief Decode a ping message into a struct - * - * @param msg The message to decode - * @param ping C-struct to decode the message contents into - */ -static inline void mavlink_msg_ping_decode(const mavlink_message_t* msg, mavlink_ping_t* ping) -{ -#if MAVLINK_NEED_BYTE_SWAP - ping->seq = mavlink_msg_ping_get_seq(msg); - ping->target_system = mavlink_msg_ping_get_target_system(msg); - ping->target_component = mavlink_msg_ping_get_target_component(msg); - ping->time = mavlink_msg_ping_get_time(msg); -#else - memcpy(ping, _MAV_PAYLOAD(msg), 14); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_position_target.h b/src/GCS_MAVLink/include/common/mavlink_msg_position_target.h deleted file mode 100644 index 4d9cdc480..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_position_target.h +++ /dev/null @@ -1,210 +0,0 @@ -// MESSAGE POSITION_TARGET PACKING - -#define MAVLINK_MSG_ID_POSITION_TARGET 63 - -typedef struct __mavlink_position_target_t -{ - float x; ///< x position - float y; ///< y position - float z; ///< z position - float yaw; ///< yaw orientation in radians, 0 = NORTH -} mavlink_position_target_t; - -#define MAVLINK_MSG_ID_POSITION_TARGET_LEN 16 -#define MAVLINK_MSG_ID_63_LEN 16 - - - -#define MAVLINK_MESSAGE_INFO_POSITION_TARGET { \ - "POSITION_TARGET", \ - 4, \ - { { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_position_target_t, x) }, \ - { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_position_target_t, y) }, \ - { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_position_target_t, z) }, \ - { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_t, yaw) }, \ - } \ -} - - -/** - * @brief Pack a position_target message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param x x position - * @param y y position - * @param z z position - * @param yaw yaw orientation in radians, 0 = NORTH - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_position_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - float x, float y, float z, float yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; - _mav_put_float(buf, 0, x); - _mav_put_float(buf, 4, y); - _mav_put_float(buf, 8, z); - _mav_put_float(buf, 12, yaw); - - memcpy(_MAV_PAYLOAD(msg), buf, 16); -#else - mavlink_position_target_t packet; - packet.x = x; - packet.y = y; - packet.z = z; - packet.yaw = yaw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 16); -#endif - - msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET; - return mavlink_finalize_message(msg, system_id, component_id, 16); -} - -/** - * @brief Pack a position_target message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param x x position - * @param y y position - * @param z z position - * @param yaw yaw orientation in radians, 0 = NORTH - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_position_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - float x,float y,float z,float yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; - _mav_put_float(buf, 0, x); - _mav_put_float(buf, 4, y); - _mav_put_float(buf, 8, z); - _mav_put_float(buf, 12, yaw); - - memcpy(_MAV_PAYLOAD(msg), buf, 16); -#else - mavlink_position_target_t packet; - packet.x = x; - packet.y = y; - packet.z = z; - packet.yaw = yaw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 16); -#endif - - msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 16); -} - -/** - * @brief Encode a position_target struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param position_target C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_position_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_position_target_t* position_target) -{ - return mavlink_msg_position_target_pack(system_id, component_id, msg, position_target->x, position_target->y, position_target->z, position_target->yaw); -} - -/** - * @brief Send a position_target message - * @param chan MAVLink channel to send the message - * - * @param x x position - * @param y y position - * @param z z position - * @param yaw yaw orientation in radians, 0 = NORTH - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_position_target_send(mavlink_channel_t chan, float x, float y, float z, float yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; - _mav_put_float(buf, 0, x); - _mav_put_float(buf, 4, y); - _mav_put_float(buf, 8, z); - _mav_put_float(buf, 12, yaw); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET, buf, 16); -#else - mavlink_position_target_t packet; - packet.x = x; - packet.y = y; - packet.z = z; - packet.yaw = yaw; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET, (const char *)&packet, 16); -#endif -} - -#endif - -// MESSAGE POSITION_TARGET UNPACKING - - -/** - * @brief Get field x from position_target message - * - * @return x position - */ -static inline float mavlink_msg_position_target_get_x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 0); -} - -/** - * @brief Get field y from position_target message - * - * @return y position - */ -static inline float mavlink_msg_position_target_get_y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Get field z from position_target message - * - * @return z position - */ -static inline float mavlink_msg_position_target_get_z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field yaw from position_target message - * - * @return yaw orientation in radians, 0 = NORTH - */ -static inline float mavlink_msg_position_target_get_yaw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Decode a position_target message into a struct - * - * @param msg The message to decode - * @param position_target C-struct to decode the message contents into - */ -static inline void mavlink_msg_position_target_decode(const mavlink_message_t* msg, mavlink_position_target_t* position_target) -{ -#if MAVLINK_NEED_BYTE_SWAP - position_target->x = mavlink_msg_position_target_get_x(msg); - position_target->y = mavlink_msg_position_target_get_y(msg); - position_target->z = mavlink_msg_position_target_get_z(msg); - position_target->yaw = mavlink_msg_position_target_get_yaw(msg); -#else - memcpy(position_target, _MAV_PAYLOAD(msg), 16); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_raw_imu.h b/src/GCS_MAVLink/include/common/mavlink_msg_raw_imu.h deleted file mode 100644 index a3a3500fd..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_raw_imu.h +++ /dev/null @@ -1,342 +0,0 @@ -// MESSAGE RAW_IMU PACKING - -#define MAVLINK_MSG_ID_RAW_IMU 28 - -typedef struct __mavlink_raw_imu_t -{ - uint64_t usec; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - int16_t xacc; ///< X acceleration (raw) - int16_t yacc; ///< Y acceleration (raw) - int16_t zacc; ///< Z acceleration (raw) - int16_t xgyro; ///< Angular speed around X axis (raw) - int16_t ygyro; ///< Angular speed around Y axis (raw) - int16_t zgyro; ///< Angular speed around Z axis (raw) - int16_t xmag; ///< X Magnetic field (raw) - int16_t ymag; ///< Y Magnetic field (raw) - int16_t zmag; ///< Z Magnetic field (raw) -} mavlink_raw_imu_t; - -#define MAVLINK_MSG_ID_RAW_IMU_LEN 26 -#define MAVLINK_MSG_ID_28_LEN 26 - - - -#define MAVLINK_MESSAGE_INFO_RAW_IMU { \ - "RAW_IMU", \ - 10, \ - { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_raw_imu_t, usec) }, \ - { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_raw_imu_t, xacc) }, \ - { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_raw_imu_t, yacc) }, \ - { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_raw_imu_t, zacc) }, \ - { "xgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_raw_imu_t, xgyro) }, \ - { "ygyro", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_raw_imu_t, ygyro) }, \ - { "zgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_raw_imu_t, zgyro) }, \ - { "xmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_raw_imu_t, xmag) }, \ - { "ymag", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_raw_imu_t, ymag) }, \ - { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 24, offsetof(mavlink_raw_imu_t, zmag) }, \ - } \ -} - - -/** - * @brief Pack a raw_imu message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param xacc X acceleration (raw) - * @param yacc Y acceleration (raw) - * @param zacc Z acceleration (raw) - * @param xgyro Angular speed around X axis (raw) - * @param ygyro Angular speed around Y axis (raw) - * @param zgyro Angular speed around Z axis (raw) - * @param xmag X Magnetic field (raw) - * @param ymag Y Magnetic field (raw) - * @param zmag Z Magnetic field (raw) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_raw_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t usec, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_int16_t(buf, 8, xacc); - _mav_put_int16_t(buf, 10, yacc); - _mav_put_int16_t(buf, 12, zacc); - _mav_put_int16_t(buf, 14, xgyro); - _mav_put_int16_t(buf, 16, ygyro); - _mav_put_int16_t(buf, 18, zgyro); - _mav_put_int16_t(buf, 20, xmag); - _mav_put_int16_t(buf, 22, ymag); - _mav_put_int16_t(buf, 24, zmag); - - memcpy(_MAV_PAYLOAD(msg), buf, 26); -#else - mavlink_raw_imu_t packet; - packet.usec = usec; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; - - memcpy(_MAV_PAYLOAD(msg), &packet, 26); -#endif - - msg->msgid = MAVLINK_MSG_ID_RAW_IMU; - return mavlink_finalize_message(msg, system_id, component_id, 26); -} - -/** - * @brief Pack a raw_imu message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param xacc X acceleration (raw) - * @param yacc Y acceleration (raw) - * @param zacc Z acceleration (raw) - * @param xgyro Angular speed around X axis (raw) - * @param ygyro Angular speed around Y axis (raw) - * @param zgyro Angular speed around Z axis (raw) - * @param xmag X Magnetic field (raw) - * @param ymag Y Magnetic field (raw) - * @param zmag Z Magnetic field (raw) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_raw_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t usec,int16_t xacc,int16_t yacc,int16_t zacc,int16_t xgyro,int16_t ygyro,int16_t zgyro,int16_t xmag,int16_t ymag,int16_t zmag) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_int16_t(buf, 8, xacc); - _mav_put_int16_t(buf, 10, yacc); - _mav_put_int16_t(buf, 12, zacc); - _mav_put_int16_t(buf, 14, xgyro); - _mav_put_int16_t(buf, 16, ygyro); - _mav_put_int16_t(buf, 18, zgyro); - _mav_put_int16_t(buf, 20, xmag); - _mav_put_int16_t(buf, 22, ymag); - _mav_put_int16_t(buf, 24, zmag); - - memcpy(_MAV_PAYLOAD(msg), buf, 26); -#else - mavlink_raw_imu_t packet; - packet.usec = usec; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; - - memcpy(_MAV_PAYLOAD(msg), &packet, 26); -#endif - - msg->msgid = MAVLINK_MSG_ID_RAW_IMU; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 26); -} - -/** - * @brief Encode a raw_imu struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param raw_imu C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_raw_imu_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_raw_imu_t* raw_imu) -{ - return mavlink_msg_raw_imu_pack(system_id, component_id, msg, raw_imu->usec, raw_imu->xacc, raw_imu->yacc, raw_imu->zacc, raw_imu->xgyro, raw_imu->ygyro, raw_imu->zgyro, raw_imu->xmag, raw_imu->ymag, raw_imu->zmag); -} - -/** - * @brief Send a raw_imu message - * @param chan MAVLink channel to send the message - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param xacc X acceleration (raw) - * @param yacc Y acceleration (raw) - * @param zacc Z acceleration (raw) - * @param xgyro Angular speed around X axis (raw) - * @param ygyro Angular speed around Y axis (raw) - * @param zgyro Angular speed around Z axis (raw) - * @param xmag X Magnetic field (raw) - * @param ymag Y Magnetic field (raw) - * @param zmag Z Magnetic field (raw) - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_raw_imu_send(mavlink_channel_t chan, uint64_t usec, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_int16_t(buf, 8, xacc); - _mav_put_int16_t(buf, 10, yacc); - _mav_put_int16_t(buf, 12, zacc); - _mav_put_int16_t(buf, 14, xgyro); - _mav_put_int16_t(buf, 16, ygyro); - _mav_put_int16_t(buf, 18, zgyro); - _mav_put_int16_t(buf, 20, xmag); - _mav_put_int16_t(buf, 22, ymag); - _mav_put_int16_t(buf, 24, zmag); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, buf, 26); -#else - mavlink_raw_imu_t packet; - packet.usec = usec; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, (const char *)&packet, 26); -#endif -} - -#endif - -// MESSAGE RAW_IMU UNPACKING - - -/** - * @brief Get field usec from raw_imu message - * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) - */ -static inline uint64_t mavlink_msg_raw_imu_get_usec(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field xacc from raw_imu message - * - * @return X acceleration (raw) - */ -static inline int16_t mavlink_msg_raw_imu_get_xacc(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 8); -} - -/** - * @brief Get field yacc from raw_imu message - * - * @return Y acceleration (raw) - */ -static inline int16_t mavlink_msg_raw_imu_get_yacc(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 10); -} - -/** - * @brief Get field zacc from raw_imu message - * - * @return Z acceleration (raw) - */ -static inline int16_t mavlink_msg_raw_imu_get_zacc(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 12); -} - -/** - * @brief Get field xgyro from raw_imu message - * - * @return Angular speed around X axis (raw) - */ -static inline int16_t mavlink_msg_raw_imu_get_xgyro(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 14); -} - -/** - * @brief Get field ygyro from raw_imu message - * - * @return Angular speed around Y axis (raw) - */ -static inline int16_t mavlink_msg_raw_imu_get_ygyro(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 16); -} - -/** - * @brief Get field zgyro from raw_imu message - * - * @return Angular speed around Z axis (raw) - */ -static inline int16_t mavlink_msg_raw_imu_get_zgyro(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 18); -} - -/** - * @brief Get field xmag from raw_imu message - * - * @return X Magnetic field (raw) - */ -static inline int16_t mavlink_msg_raw_imu_get_xmag(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 20); -} - -/** - * @brief Get field ymag from raw_imu message - * - * @return Y Magnetic field (raw) - */ -static inline int16_t mavlink_msg_raw_imu_get_ymag(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 22); -} - -/** - * @brief Get field zmag from raw_imu message - * - * @return Z Magnetic field (raw) - */ -static inline int16_t mavlink_msg_raw_imu_get_zmag(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 24); -} - -/** - * @brief Decode a raw_imu message into a struct - * - * @param msg The message to decode - * @param raw_imu C-struct to decode the message contents into - */ -static inline void mavlink_msg_raw_imu_decode(const mavlink_message_t* msg, mavlink_raw_imu_t* raw_imu) -{ -#if MAVLINK_NEED_BYTE_SWAP - raw_imu->usec = mavlink_msg_raw_imu_get_usec(msg); - raw_imu->xacc = mavlink_msg_raw_imu_get_xacc(msg); - raw_imu->yacc = mavlink_msg_raw_imu_get_yacc(msg); - raw_imu->zacc = mavlink_msg_raw_imu_get_zacc(msg); - raw_imu->xgyro = mavlink_msg_raw_imu_get_xgyro(msg); - raw_imu->ygyro = mavlink_msg_raw_imu_get_ygyro(msg); - raw_imu->zgyro = mavlink_msg_raw_imu_get_zgyro(msg); - raw_imu->xmag = mavlink_msg_raw_imu_get_xmag(msg); - raw_imu->ymag = mavlink_msg_raw_imu_get_ymag(msg); - raw_imu->zmag = mavlink_msg_raw_imu_get_zmag(msg); -#else - memcpy(raw_imu, _MAV_PAYLOAD(msg), 26); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_raw_pressure.h b/src/GCS_MAVLink/include/common/mavlink_msg_raw_pressure.h deleted file mode 100644 index b56d3e622..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_raw_pressure.h +++ /dev/null @@ -1,232 +0,0 @@ -// MESSAGE RAW_PRESSURE PACKING - -#define MAVLINK_MSG_ID_RAW_PRESSURE 29 - -typedef struct __mavlink_raw_pressure_t -{ - uint64_t usec; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - int16_t press_abs; ///< Absolute pressure (raw) - int16_t press_diff1; ///< Differential pressure 1 (raw) - int16_t press_diff2; ///< Differential pressure 2 (raw) - int16_t temperature; ///< Raw Temperature measurement (raw) -} mavlink_raw_pressure_t; - -#define MAVLINK_MSG_ID_RAW_PRESSURE_LEN 16 -#define MAVLINK_MSG_ID_29_LEN 16 - - - -#define MAVLINK_MESSAGE_INFO_RAW_PRESSURE { \ - "RAW_PRESSURE", \ - 5, \ - { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_raw_pressure_t, usec) }, \ - { "press_abs", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_raw_pressure_t, press_abs) }, \ - { "press_diff1", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_raw_pressure_t, press_diff1) }, \ - { "press_diff2", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_raw_pressure_t, press_diff2) }, \ - { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_raw_pressure_t, temperature) }, \ - } \ -} - - -/** - * @brief Pack a raw_pressure message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param press_abs Absolute pressure (raw) - * @param press_diff1 Differential pressure 1 (raw) - * @param press_diff2 Differential pressure 2 (raw) - * @param temperature Raw Temperature measurement (raw) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_raw_pressure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t usec, int16_t press_abs, int16_t press_diff1, int16_t press_diff2, int16_t temperature) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_int16_t(buf, 8, press_abs); - _mav_put_int16_t(buf, 10, press_diff1); - _mav_put_int16_t(buf, 12, press_diff2); - _mav_put_int16_t(buf, 14, temperature); - - memcpy(_MAV_PAYLOAD(msg), buf, 16); -#else - mavlink_raw_pressure_t packet; - packet.usec = usec; - packet.press_abs = press_abs; - packet.press_diff1 = press_diff1; - packet.press_diff2 = press_diff2; - packet.temperature = temperature; - - memcpy(_MAV_PAYLOAD(msg), &packet, 16); -#endif - - msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE; - return mavlink_finalize_message(msg, system_id, component_id, 16); -} - -/** - * @brief Pack a raw_pressure message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param press_abs Absolute pressure (raw) - * @param press_diff1 Differential pressure 1 (raw) - * @param press_diff2 Differential pressure 2 (raw) - * @param temperature Raw Temperature measurement (raw) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_raw_pressure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t usec,int16_t press_abs,int16_t press_diff1,int16_t press_diff2,int16_t temperature) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_int16_t(buf, 8, press_abs); - _mav_put_int16_t(buf, 10, press_diff1); - _mav_put_int16_t(buf, 12, press_diff2); - _mav_put_int16_t(buf, 14, temperature); - - memcpy(_MAV_PAYLOAD(msg), buf, 16); -#else - mavlink_raw_pressure_t packet; - packet.usec = usec; - packet.press_abs = press_abs; - packet.press_diff1 = press_diff1; - packet.press_diff2 = press_diff2; - packet.temperature = temperature; - - memcpy(_MAV_PAYLOAD(msg), &packet, 16); -#endif - - msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 16); -} - -/** - * @brief Encode a raw_pressure struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param raw_pressure C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_raw_pressure_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_raw_pressure_t* raw_pressure) -{ - return mavlink_msg_raw_pressure_pack(system_id, component_id, msg, raw_pressure->usec, raw_pressure->press_abs, raw_pressure->press_diff1, raw_pressure->press_diff2, raw_pressure->temperature); -} - -/** - * @brief Send a raw_pressure message - * @param chan MAVLink channel to send the message - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param press_abs Absolute pressure (raw) - * @param press_diff1 Differential pressure 1 (raw) - * @param press_diff2 Differential pressure 2 (raw) - * @param temperature Raw Temperature measurement (raw) - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_raw_pressure_send(mavlink_channel_t chan, uint64_t usec, int16_t press_abs, int16_t press_diff1, int16_t press_diff2, int16_t temperature) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_int16_t(buf, 8, press_abs); - _mav_put_int16_t(buf, 10, press_diff1); - _mav_put_int16_t(buf, 12, press_diff2); - _mav_put_int16_t(buf, 14, temperature); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, buf, 16); -#else - mavlink_raw_pressure_t packet; - packet.usec = usec; - packet.press_abs = press_abs; - packet.press_diff1 = press_diff1; - packet.press_diff2 = press_diff2; - packet.temperature = temperature; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, (const char *)&packet, 16); -#endif -} - -#endif - -// MESSAGE RAW_PRESSURE UNPACKING - - -/** - * @brief Get field usec from raw_pressure message - * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) - */ -static inline uint64_t mavlink_msg_raw_pressure_get_usec(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field press_abs from raw_pressure message - * - * @return Absolute pressure (raw) - */ -static inline int16_t mavlink_msg_raw_pressure_get_press_abs(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 8); -} - -/** - * @brief Get field press_diff1 from raw_pressure message - * - * @return Differential pressure 1 (raw) - */ -static inline int16_t mavlink_msg_raw_pressure_get_press_diff1(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 10); -} - -/** - * @brief Get field press_diff2 from raw_pressure message - * - * @return Differential pressure 2 (raw) - */ -static inline int16_t mavlink_msg_raw_pressure_get_press_diff2(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 12); -} - -/** - * @brief Get field temperature from raw_pressure message - * - * @return Raw Temperature measurement (raw) - */ -static inline int16_t mavlink_msg_raw_pressure_get_temperature(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 14); -} - -/** - * @brief Decode a raw_pressure message into a struct - * - * @param msg The message to decode - * @param raw_pressure C-struct to decode the message contents into - */ -static inline void mavlink_msg_raw_pressure_decode(const mavlink_message_t* msg, mavlink_raw_pressure_t* raw_pressure) -{ -#if MAVLINK_NEED_BYTE_SWAP - raw_pressure->usec = mavlink_msg_raw_pressure_get_usec(msg); - raw_pressure->press_abs = mavlink_msg_raw_pressure_get_press_abs(msg); - raw_pressure->press_diff1 = mavlink_msg_raw_pressure_get_press_diff1(msg); - raw_pressure->press_diff2 = mavlink_msg_raw_pressure_get_press_diff2(msg); - raw_pressure->temperature = mavlink_msg_raw_pressure_get_temperature(msg); -#else - memcpy(raw_pressure, _MAV_PAYLOAD(msg), 16); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_rc_channels_override.h b/src/GCS_MAVLink/include/common/mavlink_msg_rc_channels_override.h deleted file mode 100644 index d163158f7..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_rc_channels_override.h +++ /dev/null @@ -1,342 +0,0 @@ -// MESSAGE RC_CHANNELS_OVERRIDE PACKING - -#define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE 70 - -typedef struct __mavlink_rc_channels_override_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - uint16_t chan1_raw; ///< RC channel 1 value, in microseconds - uint16_t chan2_raw; ///< RC channel 2 value, in microseconds - uint16_t chan3_raw; ///< RC channel 3 value, in microseconds - uint16_t chan4_raw; ///< RC channel 4 value, in microseconds - uint16_t chan5_raw; ///< RC channel 5 value, in microseconds - uint16_t chan6_raw; ///< RC channel 6 value, in microseconds - uint16_t chan7_raw; ///< RC channel 7 value, in microseconds - uint16_t chan8_raw; ///< RC channel 8 value, in microseconds -} mavlink_rc_channels_override_t; - -#define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN 18 -#define MAVLINK_MSG_ID_70_LEN 18 - - - -#define MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE { \ - "RC_CHANNELS_OVERRIDE", \ - 10, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_rc_channels_override_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_rc_channels_override_t, target_component) }, \ - { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_rc_channels_override_t, chan1_raw) }, \ - { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_override_t, chan2_raw) }, \ - { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_override_t, chan3_raw) }, \ - { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_override_t, chan4_raw) }, \ - { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_override_t, chan5_raw) }, \ - { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_override_t, chan6_raw) }, \ - { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_override_t, chan7_raw) }, \ - { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_rc_channels_override_t, chan8_raw) }, \ - } \ -} - - -/** - * @brief Pack a rc_channels_override message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param chan1_raw RC channel 1 value, in microseconds - * @param chan2_raw RC channel 2 value, in microseconds - * @param chan3_raw RC channel 3 value, in microseconds - * @param chan4_raw RC channel 4 value, in microseconds - * @param chan5_raw RC channel 5 value, in microseconds - * @param chan6_raw RC channel 6 value, in microseconds - * @param chan7_raw RC channel 7 value, in microseconds - * @param chan8_raw RC channel 8 value, in microseconds - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint16_t(buf, 2, chan1_raw); - _mav_put_uint16_t(buf, 4, chan2_raw); - _mav_put_uint16_t(buf, 6, chan3_raw); - _mav_put_uint16_t(buf, 8, chan4_raw); - _mav_put_uint16_t(buf, 10, chan5_raw); - _mav_put_uint16_t(buf, 12, chan6_raw); - _mav_put_uint16_t(buf, 14, chan7_raw); - _mav_put_uint16_t(buf, 16, chan8_raw); - - memcpy(_MAV_PAYLOAD(msg), buf, 18); -#else - mavlink_rc_channels_override_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 18); -#endif - - msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE; - return mavlink_finalize_message(msg, system_id, component_id, 18); -} - -/** - * @brief Pack a rc_channels_override message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param chan1_raw RC channel 1 value, in microseconds - * @param chan2_raw RC channel 2 value, in microseconds - * @param chan3_raw RC channel 3 value, in microseconds - * @param chan4_raw RC channel 4 value, in microseconds - * @param chan5_raw RC channel 5 value, in microseconds - * @param chan6_raw RC channel 6 value, in microseconds - * @param chan7_raw RC channel 7 value, in microseconds - * @param chan8_raw RC channel 8 value, in microseconds - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint16_t(buf, 2, chan1_raw); - _mav_put_uint16_t(buf, 4, chan2_raw); - _mav_put_uint16_t(buf, 6, chan3_raw); - _mav_put_uint16_t(buf, 8, chan4_raw); - _mav_put_uint16_t(buf, 10, chan5_raw); - _mav_put_uint16_t(buf, 12, chan6_raw); - _mav_put_uint16_t(buf, 14, chan7_raw); - _mav_put_uint16_t(buf, 16, chan8_raw); - - memcpy(_MAV_PAYLOAD(msg), buf, 18); -#else - mavlink_rc_channels_override_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 18); -#endif - - msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18); -} - -/** - * @brief Encode a rc_channels_override struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param rc_channels_override C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_rc_channels_override_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rc_channels_override_t* rc_channels_override) -{ - return mavlink_msg_rc_channels_override_pack(system_id, component_id, msg, rc_channels_override->target_system, rc_channels_override->target_component, rc_channels_override->chan1_raw, rc_channels_override->chan2_raw, rc_channels_override->chan3_raw, rc_channels_override->chan4_raw, rc_channels_override->chan5_raw, rc_channels_override->chan6_raw, rc_channels_override->chan7_raw, rc_channels_override->chan8_raw); -} - -/** - * @brief Send a rc_channels_override message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param chan1_raw RC channel 1 value, in microseconds - * @param chan2_raw RC channel 2 value, in microseconds - * @param chan3_raw RC channel 3 value, in microseconds - * @param chan4_raw RC channel 4 value, in microseconds - * @param chan5_raw RC channel 5 value, in microseconds - * @param chan6_raw RC channel 6 value, in microseconds - * @param chan7_raw RC channel 7 value, in microseconds - * @param chan8_raw RC channel 8 value, in microseconds - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_rc_channels_override_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint16_t(buf, 2, chan1_raw); - _mav_put_uint16_t(buf, 4, chan2_raw); - _mav_put_uint16_t(buf, 6, chan3_raw); - _mav_put_uint16_t(buf, 8, chan4_raw); - _mav_put_uint16_t(buf, 10, chan5_raw); - _mav_put_uint16_t(buf, 12, chan6_raw); - _mav_put_uint16_t(buf, 14, chan7_raw); - _mav_put_uint16_t(buf, 16, chan8_raw); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, 18); -#else - mavlink_rc_channels_override_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)&packet, 18); -#endif -} - -#endif - -// MESSAGE RC_CHANNELS_OVERRIDE UNPACKING - - -/** - * @brief Get field target_system from rc_channels_override message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_rc_channels_override_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from rc_channels_override message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_rc_channels_override_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field chan1_raw from rc_channels_override message - * - * @return RC channel 1 value, in microseconds - */ -static inline uint16_t mavlink_msg_rc_channels_override_get_chan1_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 2); -} - -/** - * @brief Get field chan2_raw from rc_channels_override message - * - * @return RC channel 2 value, in microseconds - */ -static inline uint16_t mavlink_msg_rc_channels_override_get_chan2_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 4); -} - -/** - * @brief Get field chan3_raw from rc_channels_override message - * - * @return RC channel 3 value, in microseconds - */ -static inline uint16_t mavlink_msg_rc_channels_override_get_chan3_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 6); -} - -/** - * @brief Get field chan4_raw from rc_channels_override message - * - * @return RC channel 4 value, in microseconds - */ -static inline uint16_t mavlink_msg_rc_channels_override_get_chan4_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 8); -} - -/** - * @brief Get field chan5_raw from rc_channels_override message - * - * @return RC channel 5 value, in microseconds - */ -static inline uint16_t mavlink_msg_rc_channels_override_get_chan5_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 10); -} - -/** - * @brief Get field chan6_raw from rc_channels_override message - * - * @return RC channel 6 value, in microseconds - */ -static inline uint16_t mavlink_msg_rc_channels_override_get_chan6_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 12); -} - -/** - * @brief Get field chan7_raw from rc_channels_override message - * - * @return RC channel 7 value, in microseconds - */ -static inline uint16_t mavlink_msg_rc_channels_override_get_chan7_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 14); -} - -/** - * @brief Get field chan8_raw from rc_channels_override message - * - * @return RC channel 8 value, in microseconds - */ -static inline uint16_t mavlink_msg_rc_channels_override_get_chan8_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 16); -} - -/** - * @brief Decode a rc_channels_override message into a struct - * - * @param msg The message to decode - * @param rc_channels_override C-struct to decode the message contents into - */ -static inline void mavlink_msg_rc_channels_override_decode(const mavlink_message_t* msg, mavlink_rc_channels_override_t* rc_channels_override) -{ -#if MAVLINK_NEED_BYTE_SWAP - rc_channels_override->target_system = mavlink_msg_rc_channels_override_get_target_system(msg); - rc_channels_override->target_component = mavlink_msg_rc_channels_override_get_target_component(msg); - rc_channels_override->chan1_raw = mavlink_msg_rc_channels_override_get_chan1_raw(msg); - rc_channels_override->chan2_raw = mavlink_msg_rc_channels_override_get_chan2_raw(msg); - rc_channels_override->chan3_raw = mavlink_msg_rc_channels_override_get_chan3_raw(msg); - rc_channels_override->chan4_raw = mavlink_msg_rc_channels_override_get_chan4_raw(msg); - rc_channels_override->chan5_raw = mavlink_msg_rc_channels_override_get_chan5_raw(msg); - rc_channels_override->chan6_raw = mavlink_msg_rc_channels_override_get_chan6_raw(msg); - rc_channels_override->chan7_raw = mavlink_msg_rc_channels_override_get_chan7_raw(msg); - rc_channels_override->chan8_raw = mavlink_msg_rc_channels_override_get_chan8_raw(msg); -#else - memcpy(rc_channels_override, _MAV_PAYLOAD(msg), 18); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_rc_channels_raw.h b/src/GCS_MAVLink/include/common/mavlink_msg_rc_channels_raw.h deleted file mode 100644 index 6df348508..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_rc_channels_raw.h +++ /dev/null @@ -1,320 +0,0 @@ -// MESSAGE RC_CHANNELS_RAW PACKING - -#define MAVLINK_MSG_ID_RC_CHANNELS_RAW 35 - -typedef struct __mavlink_rc_channels_raw_t -{ - uint16_t chan1_raw; ///< RC channel 1 value, in microseconds - uint16_t chan2_raw; ///< RC channel 2 value, in microseconds - uint16_t chan3_raw; ///< RC channel 3 value, in microseconds - uint16_t chan4_raw; ///< RC channel 4 value, in microseconds - uint16_t chan5_raw; ///< RC channel 5 value, in microseconds - uint16_t chan6_raw; ///< RC channel 6 value, in microseconds - uint16_t chan7_raw; ///< RC channel 7 value, in microseconds - uint16_t chan8_raw; ///< RC channel 8 value, in microseconds - uint8_t rssi; ///< Receive signal strength indicator, 0: 0%, 255: 100% -} mavlink_rc_channels_raw_t; - -#define MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN 17 -#define MAVLINK_MSG_ID_35_LEN 17 - - - -#define MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW { \ - "RC_CHANNELS_RAW", \ - 9, \ - { { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_rc_channels_raw_t, chan1_raw) }, \ - { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_rc_channels_raw_t, chan2_raw) }, \ - { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_raw_t, chan3_raw) }, \ - { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_raw_t, chan4_raw) }, \ - { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_raw_t, chan5_raw) }, \ - { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_raw_t, chan6_raw) }, \ - { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_raw_t, chan7_raw) }, \ - { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_raw_t, chan8_raw) }, \ - { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rc_channels_raw_t, rssi) }, \ - } \ -} - - -/** - * @brief Pack a rc_channels_raw message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param chan1_raw RC channel 1 value, in microseconds - * @param chan2_raw RC channel 2 value, in microseconds - * @param chan3_raw RC channel 3 value, in microseconds - * @param chan4_raw RC channel 4 value, in microseconds - * @param chan5_raw RC channel 5 value, in microseconds - * @param chan6_raw RC channel 6 value, in microseconds - * @param chan7_raw RC channel 7 value, in microseconds - * @param chan8_raw RC channel 8 value, in microseconds - * @param rssi Receive signal strength indicator, 0: 0%, 255: 100% - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint8_t rssi) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[17]; - _mav_put_uint16_t(buf, 0, chan1_raw); - _mav_put_uint16_t(buf, 2, chan2_raw); - _mav_put_uint16_t(buf, 4, chan3_raw); - _mav_put_uint16_t(buf, 6, chan4_raw); - _mav_put_uint16_t(buf, 8, chan5_raw); - _mav_put_uint16_t(buf, 10, chan6_raw); - _mav_put_uint16_t(buf, 12, chan7_raw); - _mav_put_uint16_t(buf, 14, chan8_raw); - _mav_put_uint8_t(buf, 16, rssi); - - memcpy(_MAV_PAYLOAD(msg), buf, 17); -#else - mavlink_rc_channels_raw_t packet; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - packet.rssi = rssi; - - memcpy(_MAV_PAYLOAD(msg), &packet, 17); -#endif - - msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW; - return mavlink_finalize_message(msg, system_id, component_id, 17); -} - -/** - * @brief Pack a rc_channels_raw message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param chan1_raw RC channel 1 value, in microseconds - * @param chan2_raw RC channel 2 value, in microseconds - * @param chan3_raw RC channel 3 value, in microseconds - * @param chan4_raw RC channel 4 value, in microseconds - * @param chan5_raw RC channel 5 value, in microseconds - * @param chan6_raw RC channel 6 value, in microseconds - * @param chan7_raw RC channel 7 value, in microseconds - * @param chan8_raw RC channel 8 value, in microseconds - * @param rssi Receive signal strength indicator, 0: 0%, 255: 100% - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw,uint8_t rssi) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[17]; - _mav_put_uint16_t(buf, 0, chan1_raw); - _mav_put_uint16_t(buf, 2, chan2_raw); - _mav_put_uint16_t(buf, 4, chan3_raw); - _mav_put_uint16_t(buf, 6, chan4_raw); - _mav_put_uint16_t(buf, 8, chan5_raw); - _mav_put_uint16_t(buf, 10, chan6_raw); - _mav_put_uint16_t(buf, 12, chan7_raw); - _mav_put_uint16_t(buf, 14, chan8_raw); - _mav_put_uint8_t(buf, 16, rssi); - - memcpy(_MAV_PAYLOAD(msg), buf, 17); -#else - mavlink_rc_channels_raw_t packet; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - packet.rssi = rssi; - - memcpy(_MAV_PAYLOAD(msg), &packet, 17); -#endif - - msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 17); -} - -/** - * @brief Encode a rc_channels_raw struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param rc_channels_raw C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_rc_channels_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rc_channels_raw_t* rc_channels_raw) -{ - return mavlink_msg_rc_channels_raw_pack(system_id, component_id, msg, rc_channels_raw->chan1_raw, rc_channels_raw->chan2_raw, rc_channels_raw->chan3_raw, rc_channels_raw->chan4_raw, rc_channels_raw->chan5_raw, rc_channels_raw->chan6_raw, rc_channels_raw->chan7_raw, rc_channels_raw->chan8_raw, rc_channels_raw->rssi); -} - -/** - * @brief Send a rc_channels_raw message - * @param chan MAVLink channel to send the message - * - * @param chan1_raw RC channel 1 value, in microseconds - * @param chan2_raw RC channel 2 value, in microseconds - * @param chan3_raw RC channel 3 value, in microseconds - * @param chan4_raw RC channel 4 value, in microseconds - * @param chan5_raw RC channel 5 value, in microseconds - * @param chan6_raw RC channel 6 value, in microseconds - * @param chan7_raw RC channel 7 value, in microseconds - * @param chan8_raw RC channel 8 value, in microseconds - * @param rssi Receive signal strength indicator, 0: 0%, 255: 100% - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_rc_channels_raw_send(mavlink_channel_t chan, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint8_t rssi) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[17]; - _mav_put_uint16_t(buf, 0, chan1_raw); - _mav_put_uint16_t(buf, 2, chan2_raw); - _mav_put_uint16_t(buf, 4, chan3_raw); - _mav_put_uint16_t(buf, 6, chan4_raw); - _mav_put_uint16_t(buf, 8, chan5_raw); - _mav_put_uint16_t(buf, 10, chan6_raw); - _mav_put_uint16_t(buf, 12, chan7_raw); - _mav_put_uint16_t(buf, 14, chan8_raw); - _mav_put_uint8_t(buf, 16, rssi); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, buf, 17); -#else - mavlink_rc_channels_raw_t packet; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - packet.rssi = rssi; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, (const char *)&packet, 17); -#endif -} - -#endif - -// MESSAGE RC_CHANNELS_RAW UNPACKING - - -/** - * @brief Get field chan1_raw from rc_channels_raw message - * - * @return RC channel 1 value, in microseconds - */ -static inline uint16_t mavlink_msg_rc_channels_raw_get_chan1_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 0); -} - -/** - * @brief Get field chan2_raw from rc_channels_raw message - * - * @return RC channel 2 value, in microseconds - */ -static inline uint16_t mavlink_msg_rc_channels_raw_get_chan2_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 2); -} - -/** - * @brief Get field chan3_raw from rc_channels_raw message - * - * @return RC channel 3 value, in microseconds - */ -static inline uint16_t mavlink_msg_rc_channels_raw_get_chan3_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 4); -} - -/** - * @brief Get field chan4_raw from rc_channels_raw message - * - * @return RC channel 4 value, in microseconds - */ -static inline uint16_t mavlink_msg_rc_channels_raw_get_chan4_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 6); -} - -/** - * @brief Get field chan5_raw from rc_channels_raw message - * - * @return RC channel 5 value, in microseconds - */ -static inline uint16_t mavlink_msg_rc_channels_raw_get_chan5_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 8); -} - -/** - * @brief Get field chan6_raw from rc_channels_raw message - * - * @return RC channel 6 value, in microseconds - */ -static inline uint16_t mavlink_msg_rc_channels_raw_get_chan6_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 10); -} - -/** - * @brief Get field chan7_raw from rc_channels_raw message - * - * @return RC channel 7 value, in microseconds - */ -static inline uint16_t mavlink_msg_rc_channels_raw_get_chan7_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 12); -} - -/** - * @brief Get field chan8_raw from rc_channels_raw message - * - * @return RC channel 8 value, in microseconds - */ -static inline uint16_t mavlink_msg_rc_channels_raw_get_chan8_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 14); -} - -/** - * @brief Get field rssi from rc_channels_raw message - * - * @return Receive signal strength indicator, 0: 0%, 255: 100% - */ -static inline uint8_t mavlink_msg_rc_channels_raw_get_rssi(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 16); -} - -/** - * @brief Decode a rc_channels_raw message into a struct - * - * @param msg The message to decode - * @param rc_channels_raw C-struct to decode the message contents into - */ -static inline void mavlink_msg_rc_channels_raw_decode(const mavlink_message_t* msg, mavlink_rc_channels_raw_t* rc_channels_raw) -{ -#if MAVLINK_NEED_BYTE_SWAP - rc_channels_raw->chan1_raw = mavlink_msg_rc_channels_raw_get_chan1_raw(msg); - rc_channels_raw->chan2_raw = mavlink_msg_rc_channels_raw_get_chan2_raw(msg); - rc_channels_raw->chan3_raw = mavlink_msg_rc_channels_raw_get_chan3_raw(msg); - rc_channels_raw->chan4_raw = mavlink_msg_rc_channels_raw_get_chan4_raw(msg); - rc_channels_raw->chan5_raw = mavlink_msg_rc_channels_raw_get_chan5_raw(msg); - rc_channels_raw->chan6_raw = mavlink_msg_rc_channels_raw_get_chan6_raw(msg); - rc_channels_raw->chan7_raw = mavlink_msg_rc_channels_raw_get_chan7_raw(msg); - rc_channels_raw->chan8_raw = mavlink_msg_rc_channels_raw_get_chan8_raw(msg); - rc_channels_raw->rssi = mavlink_msg_rc_channels_raw_get_rssi(msg); -#else - memcpy(rc_channels_raw, _MAV_PAYLOAD(msg), 17); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_rc_channels_scaled.h b/src/GCS_MAVLink/include/common/mavlink_msg_rc_channels_scaled.h deleted file mode 100644 index b178ad173..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_rc_channels_scaled.h +++ /dev/null @@ -1,320 +0,0 @@ -// MESSAGE RC_CHANNELS_SCALED PACKING - -#define MAVLINK_MSG_ID_RC_CHANNELS_SCALED 36 - -typedef struct __mavlink_rc_channels_scaled_t -{ - int16_t chan1_scaled; ///< RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - int16_t chan2_scaled; ///< RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - int16_t chan3_scaled; ///< RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - int16_t chan4_scaled; ///< RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - int16_t chan5_scaled; ///< RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - int16_t chan6_scaled; ///< RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - int16_t chan7_scaled; ///< RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - int16_t chan8_scaled; ///< RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - uint8_t rssi; ///< Receive signal strength indicator, 0: 0%, 255: 100% -} mavlink_rc_channels_scaled_t; - -#define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN 17 -#define MAVLINK_MSG_ID_36_LEN 17 - - - -#define MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED { \ - "RC_CHANNELS_SCALED", \ - 9, \ - { { "chan1_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_rc_channels_scaled_t, chan1_scaled) }, \ - { "chan2_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_rc_channels_scaled_t, chan2_scaled) }, \ - { "chan3_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_rc_channels_scaled_t, chan3_scaled) }, \ - { "chan4_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_rc_channels_scaled_t, chan4_scaled) }, \ - { "chan5_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_rc_channels_scaled_t, chan5_scaled) }, \ - { "chan6_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_rc_channels_scaled_t, chan6_scaled) }, \ - { "chan7_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_rc_channels_scaled_t, chan7_scaled) }, \ - { "chan8_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_rc_channels_scaled_t, chan8_scaled) }, \ - { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rc_channels_scaled_t, rssi) }, \ - } \ -} - - -/** - * @brief Pack a rc_channels_scaled message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param rssi Receive signal strength indicator, 0: 0%, 255: 100% - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - int16_t chan1_scaled, int16_t chan2_scaled, int16_t chan3_scaled, int16_t chan4_scaled, int16_t chan5_scaled, int16_t chan6_scaled, int16_t chan7_scaled, int16_t chan8_scaled, uint8_t rssi) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[17]; - _mav_put_int16_t(buf, 0, chan1_scaled); - _mav_put_int16_t(buf, 2, chan2_scaled); - _mav_put_int16_t(buf, 4, chan3_scaled); - _mav_put_int16_t(buf, 6, chan4_scaled); - _mav_put_int16_t(buf, 8, chan5_scaled); - _mav_put_int16_t(buf, 10, chan6_scaled); - _mav_put_int16_t(buf, 12, chan7_scaled); - _mav_put_int16_t(buf, 14, chan8_scaled); - _mav_put_uint8_t(buf, 16, rssi); - - memcpy(_MAV_PAYLOAD(msg), buf, 17); -#else - mavlink_rc_channels_scaled_t packet; - packet.chan1_scaled = chan1_scaled; - packet.chan2_scaled = chan2_scaled; - packet.chan3_scaled = chan3_scaled; - packet.chan4_scaled = chan4_scaled; - packet.chan5_scaled = chan5_scaled; - packet.chan6_scaled = chan6_scaled; - packet.chan7_scaled = chan7_scaled; - packet.chan8_scaled = chan8_scaled; - packet.rssi = rssi; - - memcpy(_MAV_PAYLOAD(msg), &packet, 17); -#endif - - msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED; - return mavlink_finalize_message(msg, system_id, component_id, 17); -} - -/** - * @brief Pack a rc_channels_scaled message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param rssi Receive signal strength indicator, 0: 0%, 255: 100% - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - int16_t chan1_scaled,int16_t chan2_scaled,int16_t chan3_scaled,int16_t chan4_scaled,int16_t chan5_scaled,int16_t chan6_scaled,int16_t chan7_scaled,int16_t chan8_scaled,uint8_t rssi) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[17]; - _mav_put_int16_t(buf, 0, chan1_scaled); - _mav_put_int16_t(buf, 2, chan2_scaled); - _mav_put_int16_t(buf, 4, chan3_scaled); - _mav_put_int16_t(buf, 6, chan4_scaled); - _mav_put_int16_t(buf, 8, chan5_scaled); - _mav_put_int16_t(buf, 10, chan6_scaled); - _mav_put_int16_t(buf, 12, chan7_scaled); - _mav_put_int16_t(buf, 14, chan8_scaled); - _mav_put_uint8_t(buf, 16, rssi); - - memcpy(_MAV_PAYLOAD(msg), buf, 17); -#else - mavlink_rc_channels_scaled_t packet; - packet.chan1_scaled = chan1_scaled; - packet.chan2_scaled = chan2_scaled; - packet.chan3_scaled = chan3_scaled; - packet.chan4_scaled = chan4_scaled; - packet.chan5_scaled = chan5_scaled; - packet.chan6_scaled = chan6_scaled; - packet.chan7_scaled = chan7_scaled; - packet.chan8_scaled = chan8_scaled; - packet.rssi = rssi; - - memcpy(_MAV_PAYLOAD(msg), &packet, 17); -#endif - - msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 17); -} - -/** - * @brief Encode a rc_channels_scaled struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param rc_channels_scaled C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_rc_channels_scaled_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rc_channels_scaled_t* rc_channels_scaled) -{ - return mavlink_msg_rc_channels_scaled_pack(system_id, component_id, msg, rc_channels_scaled->chan1_scaled, rc_channels_scaled->chan2_scaled, rc_channels_scaled->chan3_scaled, rc_channels_scaled->chan4_scaled, rc_channels_scaled->chan5_scaled, rc_channels_scaled->chan6_scaled, rc_channels_scaled->chan7_scaled, rc_channels_scaled->chan8_scaled, rc_channels_scaled->rssi); -} - -/** - * @brief Send a rc_channels_scaled message - * @param chan MAVLink channel to send the message - * - * @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - * @param rssi Receive signal strength indicator, 0: 0%, 255: 100% - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_rc_channels_scaled_send(mavlink_channel_t chan, int16_t chan1_scaled, int16_t chan2_scaled, int16_t chan3_scaled, int16_t chan4_scaled, int16_t chan5_scaled, int16_t chan6_scaled, int16_t chan7_scaled, int16_t chan8_scaled, uint8_t rssi) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[17]; - _mav_put_int16_t(buf, 0, chan1_scaled); - _mav_put_int16_t(buf, 2, chan2_scaled); - _mav_put_int16_t(buf, 4, chan3_scaled); - _mav_put_int16_t(buf, 6, chan4_scaled); - _mav_put_int16_t(buf, 8, chan5_scaled); - _mav_put_int16_t(buf, 10, chan6_scaled); - _mav_put_int16_t(buf, 12, chan7_scaled); - _mav_put_int16_t(buf, 14, chan8_scaled); - _mav_put_uint8_t(buf, 16, rssi); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, buf, 17); -#else - mavlink_rc_channels_scaled_t packet; - packet.chan1_scaled = chan1_scaled; - packet.chan2_scaled = chan2_scaled; - packet.chan3_scaled = chan3_scaled; - packet.chan4_scaled = chan4_scaled; - packet.chan5_scaled = chan5_scaled; - packet.chan6_scaled = chan6_scaled; - packet.chan7_scaled = chan7_scaled; - packet.chan8_scaled = chan8_scaled; - packet.rssi = rssi; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, (const char *)&packet, 17); -#endif -} - -#endif - -// MESSAGE RC_CHANNELS_SCALED UNPACKING - - -/** - * @brief Get field chan1_scaled from rc_channels_scaled message - * - * @return RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - */ -static inline int16_t mavlink_msg_rc_channels_scaled_get_chan1_scaled(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 0); -} - -/** - * @brief Get field chan2_scaled from rc_channels_scaled message - * - * @return RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - */ -static inline int16_t mavlink_msg_rc_channels_scaled_get_chan2_scaled(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 2); -} - -/** - * @brief Get field chan3_scaled from rc_channels_scaled message - * - * @return RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - */ -static inline int16_t mavlink_msg_rc_channels_scaled_get_chan3_scaled(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 4); -} - -/** - * @brief Get field chan4_scaled from rc_channels_scaled message - * - * @return RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - */ -static inline int16_t mavlink_msg_rc_channels_scaled_get_chan4_scaled(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 6); -} - -/** - * @brief Get field chan5_scaled from rc_channels_scaled message - * - * @return RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - */ -static inline int16_t mavlink_msg_rc_channels_scaled_get_chan5_scaled(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 8); -} - -/** - * @brief Get field chan6_scaled from rc_channels_scaled message - * - * @return RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - */ -static inline int16_t mavlink_msg_rc_channels_scaled_get_chan6_scaled(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 10); -} - -/** - * @brief Get field chan7_scaled from rc_channels_scaled message - * - * @return RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - */ -static inline int16_t mavlink_msg_rc_channels_scaled_get_chan7_scaled(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 12); -} - -/** - * @brief Get field chan8_scaled from rc_channels_scaled message - * - * @return RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - */ -static inline int16_t mavlink_msg_rc_channels_scaled_get_chan8_scaled(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 14); -} - -/** - * @brief Get field rssi from rc_channels_scaled message - * - * @return Receive signal strength indicator, 0: 0%, 255: 100% - */ -static inline uint8_t mavlink_msg_rc_channels_scaled_get_rssi(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 16); -} - -/** - * @brief Decode a rc_channels_scaled message into a struct - * - * @param msg The message to decode - * @param rc_channels_scaled C-struct to decode the message contents into - */ -static inline void mavlink_msg_rc_channels_scaled_decode(const mavlink_message_t* msg, mavlink_rc_channels_scaled_t* rc_channels_scaled) -{ -#if MAVLINK_NEED_BYTE_SWAP - rc_channels_scaled->chan1_scaled = mavlink_msg_rc_channels_scaled_get_chan1_scaled(msg); - rc_channels_scaled->chan2_scaled = mavlink_msg_rc_channels_scaled_get_chan2_scaled(msg); - rc_channels_scaled->chan3_scaled = mavlink_msg_rc_channels_scaled_get_chan3_scaled(msg); - rc_channels_scaled->chan4_scaled = mavlink_msg_rc_channels_scaled_get_chan4_scaled(msg); - rc_channels_scaled->chan5_scaled = mavlink_msg_rc_channels_scaled_get_chan5_scaled(msg); - rc_channels_scaled->chan6_scaled = mavlink_msg_rc_channels_scaled_get_chan6_scaled(msg); - rc_channels_scaled->chan7_scaled = mavlink_msg_rc_channels_scaled_get_chan7_scaled(msg); - rc_channels_scaled->chan8_scaled = mavlink_msg_rc_channels_scaled_get_chan8_scaled(msg); - rc_channels_scaled->rssi = mavlink_msg_rc_channels_scaled_get_rssi(msg); -#else - memcpy(rc_channels_scaled, _MAV_PAYLOAD(msg), 17); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_request_data_stream.h b/src/GCS_MAVLink/include/common/mavlink_msg_request_data_stream.h deleted file mode 100644 index 895897738..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_request_data_stream.h +++ /dev/null @@ -1,232 +0,0 @@ -// MESSAGE REQUEST_DATA_STREAM PACKING - -#define MAVLINK_MSG_ID_REQUEST_DATA_STREAM 66 - -typedef struct __mavlink_request_data_stream_t -{ - uint8_t target_system; ///< The target requested to send the message stream. - uint8_t target_component; ///< The target requested to send the message stream. - uint8_t req_stream_id; ///< The ID of the requested message type - uint16_t req_message_rate; ///< Update rate in Hertz - uint8_t start_stop; ///< 1 to start sending, 0 to stop sending. -} mavlink_request_data_stream_t; - -#define MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN 6 -#define MAVLINK_MSG_ID_66_LEN 6 - - - -#define MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM { \ - "REQUEST_DATA_STREAM", \ - 5, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_request_data_stream_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_request_data_stream_t, target_component) }, \ - { "req_stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_request_data_stream_t, req_stream_id) }, \ - { "req_message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 3, offsetof(mavlink_request_data_stream_t, req_message_rate) }, \ - { "start_stop", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_request_data_stream_t, start_stop) }, \ - } \ -} - - -/** - * @brief Pack a request_data_stream message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system The target requested to send the message stream. - * @param target_component The target requested to send the message stream. - * @param req_stream_id The ID of the requested message type - * @param req_message_rate Update rate in Hertz - * @param start_stop 1 to start sending, 0 to stop sending. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_request_data_stream_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint8_t req_stream_id, uint16_t req_message_rate, uint8_t start_stop) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, req_stream_id); - _mav_put_uint16_t(buf, 3, req_message_rate); - _mav_put_uint8_t(buf, 5, start_stop); - - memcpy(_MAV_PAYLOAD(msg), buf, 6); -#else - mavlink_request_data_stream_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.req_stream_id = req_stream_id; - packet.req_message_rate = req_message_rate; - packet.start_stop = start_stop; - - memcpy(_MAV_PAYLOAD(msg), &packet, 6); -#endif - - msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM; - return mavlink_finalize_message(msg, system_id, component_id, 6); -} - -/** - * @brief Pack a request_data_stream message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system The target requested to send the message stream. - * @param target_component The target requested to send the message stream. - * @param req_stream_id The ID of the requested message type - * @param req_message_rate Update rate in Hertz - * @param start_stop 1 to start sending, 0 to stop sending. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_request_data_stream_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint8_t req_stream_id,uint16_t req_message_rate,uint8_t start_stop) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, req_stream_id); - _mav_put_uint16_t(buf, 3, req_message_rate); - _mav_put_uint8_t(buf, 5, start_stop); - - memcpy(_MAV_PAYLOAD(msg), buf, 6); -#else - mavlink_request_data_stream_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.req_stream_id = req_stream_id; - packet.req_message_rate = req_message_rate; - packet.start_stop = start_stop; - - memcpy(_MAV_PAYLOAD(msg), &packet, 6); -#endif - - msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 6); -} - -/** - * @brief Encode a request_data_stream struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param request_data_stream C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_request_data_stream_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_request_data_stream_t* request_data_stream) -{ - return mavlink_msg_request_data_stream_pack(system_id, component_id, msg, request_data_stream->target_system, request_data_stream->target_component, request_data_stream->req_stream_id, request_data_stream->req_message_rate, request_data_stream->start_stop); -} - -/** - * @brief Send a request_data_stream message - * @param chan MAVLink channel to send the message - * - * @param target_system The target requested to send the message stream. - * @param target_component The target requested to send the message stream. - * @param req_stream_id The ID of the requested message type - * @param req_message_rate Update rate in Hertz - * @param start_stop 1 to start sending, 0 to stop sending. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_request_data_stream_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t req_stream_id, uint16_t req_message_rate, uint8_t start_stop) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, req_stream_id); - _mav_put_uint16_t(buf, 3, req_message_rate); - _mav_put_uint8_t(buf, 5, start_stop); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, buf, 6); -#else - mavlink_request_data_stream_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.req_stream_id = req_stream_id; - packet.req_message_rate = req_message_rate; - packet.start_stop = start_stop; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, (const char *)&packet, 6); -#endif -} - -#endif - -// MESSAGE REQUEST_DATA_STREAM UNPACKING - - -/** - * @brief Get field target_system from request_data_stream message - * - * @return The target requested to send the message stream. - */ -static inline uint8_t mavlink_msg_request_data_stream_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from request_data_stream message - * - * @return The target requested to send the message stream. - */ -static inline uint8_t mavlink_msg_request_data_stream_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field req_stream_id from request_data_stream message - * - * @return The ID of the requested message type - */ -static inline uint8_t mavlink_msg_request_data_stream_get_req_stream_id(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Get field req_message_rate from request_data_stream message - * - * @return Update rate in Hertz - */ -static inline uint16_t mavlink_msg_request_data_stream_get_req_message_rate(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 3); -} - -/** - * @brief Get field start_stop from request_data_stream message - * - * @return 1 to start sending, 0 to stop sending. - */ -static inline uint8_t mavlink_msg_request_data_stream_get_start_stop(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 5); -} - -/** - * @brief Decode a request_data_stream message into a struct - * - * @param msg The message to decode - * @param request_data_stream C-struct to decode the message contents into - */ -static inline void mavlink_msg_request_data_stream_decode(const mavlink_message_t* msg, mavlink_request_data_stream_t* request_data_stream) -{ -#if MAVLINK_NEED_BYTE_SWAP - request_data_stream->target_system = mavlink_msg_request_data_stream_get_target_system(msg); - request_data_stream->target_component = mavlink_msg_request_data_stream_get_target_component(msg); - request_data_stream->req_stream_id = mavlink_msg_request_data_stream_get_req_stream_id(msg); - request_data_stream->req_message_rate = mavlink_msg_request_data_stream_get_req_message_rate(msg); - request_data_stream->start_stop = mavlink_msg_request_data_stream_get_start_stop(msg); -#else - memcpy(request_data_stream, _MAV_PAYLOAD(msg), 6); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h b/src/GCS_MAVLink/include/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h deleted file mode 100644 index 4d0a87e2f..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h +++ /dev/null @@ -1,232 +0,0 @@ -// MESSAGE ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT PACKING - -#define MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT 58 - -typedef struct __mavlink_roll_pitch_yaw_speed_thrust_setpoint_t -{ - uint64_t time_us; ///< Timestamp in micro seconds since unix epoch - float roll_speed; ///< Desired roll angular speed in rad/s - float pitch_speed; ///< Desired pitch angular speed in rad/s - float yaw_speed; ///< Desired yaw angular speed in rad/s - float thrust; ///< Collective thrust, normalized to 0 .. 1 -} mavlink_roll_pitch_yaw_speed_thrust_setpoint_t; - -#define MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN 24 -#define MAVLINK_MSG_ID_58_LEN 24 - - - -#define MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT { \ - "ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT", \ - 5, \ - { { "time_us", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_roll_pitch_yaw_speed_thrust_setpoint_t, time_us) }, \ - { "roll_speed", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_roll_pitch_yaw_speed_thrust_setpoint_t, roll_speed) }, \ - { "pitch_speed", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_roll_pitch_yaw_speed_thrust_setpoint_t, pitch_speed) }, \ - { "yaw_speed", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_roll_pitch_yaw_speed_thrust_setpoint_t, yaw_speed) }, \ - { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_roll_pitch_yaw_speed_thrust_setpoint_t, thrust) }, \ - } \ -} - - -/** - * @brief Pack a roll_pitch_yaw_speed_thrust_setpoint message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param time_us Timestamp in micro seconds since unix epoch - * @param roll_speed Desired roll angular speed in rad/s - * @param pitch_speed Desired pitch angular speed in rad/s - * @param yaw_speed Desired yaw angular speed in rad/s - * @param thrust Collective thrust, normalized to 0 .. 1 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_us, float roll_speed, float pitch_speed, float yaw_speed, float thrust) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[24]; - _mav_put_uint64_t(buf, 0, time_us); - _mav_put_float(buf, 8, roll_speed); - _mav_put_float(buf, 12, pitch_speed); - _mav_put_float(buf, 16, yaw_speed); - _mav_put_float(buf, 20, thrust); - - memcpy(_MAV_PAYLOAD(msg), buf, 24); -#else - mavlink_roll_pitch_yaw_speed_thrust_setpoint_t packet; - packet.time_us = time_us; - packet.roll_speed = roll_speed; - packet.pitch_speed = pitch_speed; - packet.yaw_speed = yaw_speed; - packet.thrust = thrust; - - memcpy(_MAV_PAYLOAD(msg), &packet, 24); -#endif - - msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT; - return mavlink_finalize_message(msg, system_id, component_id, 24); -} - -/** - * @brief Pack a roll_pitch_yaw_speed_thrust_setpoint message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param time_us Timestamp in micro seconds since unix epoch - * @param roll_speed Desired roll angular speed in rad/s - * @param pitch_speed Desired pitch angular speed in rad/s - * @param yaw_speed Desired yaw angular speed in rad/s - * @param thrust Collective thrust, normalized to 0 .. 1 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_us,float roll_speed,float pitch_speed,float yaw_speed,float thrust) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[24]; - _mav_put_uint64_t(buf, 0, time_us); - _mav_put_float(buf, 8, roll_speed); - _mav_put_float(buf, 12, pitch_speed); - _mav_put_float(buf, 16, yaw_speed); - _mav_put_float(buf, 20, thrust); - - memcpy(_MAV_PAYLOAD(msg), buf, 24); -#else - mavlink_roll_pitch_yaw_speed_thrust_setpoint_t packet; - packet.time_us = time_us; - packet.roll_speed = roll_speed; - packet.pitch_speed = pitch_speed; - packet.yaw_speed = yaw_speed; - packet.thrust = thrust; - - memcpy(_MAV_PAYLOAD(msg), &packet, 24); -#endif - - msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 24); -} - -/** - * @brief Encode a roll_pitch_yaw_speed_thrust_setpoint struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param roll_pitch_yaw_speed_thrust_setpoint C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_roll_pitch_yaw_speed_thrust_setpoint_t* roll_pitch_yaw_speed_thrust_setpoint) -{ - return mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack(system_id, component_id, msg, roll_pitch_yaw_speed_thrust_setpoint->time_us, roll_pitch_yaw_speed_thrust_setpoint->roll_speed, roll_pitch_yaw_speed_thrust_setpoint->pitch_speed, roll_pitch_yaw_speed_thrust_setpoint->yaw_speed, roll_pitch_yaw_speed_thrust_setpoint->thrust); -} - -/** - * @brief Send a roll_pitch_yaw_speed_thrust_setpoint message - * @param chan MAVLink channel to send the message - * - * @param time_us Timestamp in micro seconds since unix epoch - * @param roll_speed Desired roll angular speed in rad/s - * @param pitch_speed Desired pitch angular speed in rad/s - * @param yaw_speed Desired yaw angular speed in rad/s - * @param thrust Collective thrust, normalized to 0 .. 1 - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_send(mavlink_channel_t chan, uint64_t time_us, float roll_speed, float pitch_speed, float yaw_speed, float thrust) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[24]; - _mav_put_uint64_t(buf, 0, time_us); - _mav_put_float(buf, 8, roll_speed); - _mav_put_float(buf, 12, pitch_speed); - _mav_put_float(buf, 16, yaw_speed); - _mav_put_float(buf, 20, thrust); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, buf, 24); -#else - mavlink_roll_pitch_yaw_speed_thrust_setpoint_t packet; - packet.time_us = time_us; - packet.roll_speed = roll_speed; - packet.pitch_speed = pitch_speed; - packet.yaw_speed = yaw_speed; - packet.thrust = thrust; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, (const char *)&packet, 24); -#endif -} - -#endif - -// MESSAGE ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT UNPACKING - - -/** - * @brief Get field time_us from roll_pitch_yaw_speed_thrust_setpoint message - * - * @return Timestamp in micro seconds since unix epoch - */ -static inline uint64_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_get_time_us(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field roll_speed from roll_pitch_yaw_speed_thrust_setpoint message - * - * @return Desired roll angular speed in rad/s - */ -static inline float mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_get_roll_speed(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field pitch_speed from roll_pitch_yaw_speed_thrust_setpoint message - * - * @return Desired pitch angular speed in rad/s - */ -static inline float mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_get_pitch_speed(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field yaw_speed from roll_pitch_yaw_speed_thrust_setpoint message - * - * @return Desired yaw angular speed in rad/s - */ -static inline float mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_get_yaw_speed(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 16); -} - -/** - * @brief Get field thrust from roll_pitch_yaw_speed_thrust_setpoint message - * - * @return Collective thrust, normalized to 0 .. 1 - */ -static inline float mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_get_thrust(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 20); -} - -/** - * @brief Decode a roll_pitch_yaw_speed_thrust_setpoint message into a struct - * - * @param msg The message to decode - * @param roll_pitch_yaw_speed_thrust_setpoint C-struct to decode the message contents into - */ -static inline void mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_decode(const mavlink_message_t* msg, mavlink_roll_pitch_yaw_speed_thrust_setpoint_t* roll_pitch_yaw_speed_thrust_setpoint) -{ -#if MAVLINK_NEED_BYTE_SWAP - roll_pitch_yaw_speed_thrust_setpoint->time_us = mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_get_time_us(msg); - roll_pitch_yaw_speed_thrust_setpoint->roll_speed = mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_get_roll_speed(msg); - roll_pitch_yaw_speed_thrust_setpoint->pitch_speed = mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_get_pitch_speed(msg); - roll_pitch_yaw_speed_thrust_setpoint->yaw_speed = mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_get_yaw_speed(msg); - roll_pitch_yaw_speed_thrust_setpoint->thrust = mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_get_thrust(msg); -#else - memcpy(roll_pitch_yaw_speed_thrust_setpoint, _MAV_PAYLOAD(msg), 24); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h b/src/GCS_MAVLink/include/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h deleted file mode 100644 index 7de8441ab..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h +++ /dev/null @@ -1,232 +0,0 @@ -// MESSAGE ROLL_PITCH_YAW_THRUST_SETPOINT PACKING - -#define MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT 57 - -typedef struct __mavlink_roll_pitch_yaw_thrust_setpoint_t -{ - uint64_t time_us; ///< Timestamp in micro seconds since unix epoch - float roll; ///< Desired roll angle in radians - float pitch; ///< Desired pitch angle in radians - float yaw; ///< Desired yaw angle in radians - float thrust; ///< Collective thrust, normalized to 0 .. 1 -} mavlink_roll_pitch_yaw_thrust_setpoint_t; - -#define MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN 24 -#define MAVLINK_MSG_ID_57_LEN 24 - - - -#define MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT { \ - "ROLL_PITCH_YAW_THRUST_SETPOINT", \ - 5, \ - { { "time_us", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_roll_pitch_yaw_thrust_setpoint_t, time_us) }, \ - { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_roll_pitch_yaw_thrust_setpoint_t, roll) }, \ - { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_roll_pitch_yaw_thrust_setpoint_t, pitch) }, \ - { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_roll_pitch_yaw_thrust_setpoint_t, yaw) }, \ - { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_roll_pitch_yaw_thrust_setpoint_t, thrust) }, \ - } \ -} - - -/** - * @brief Pack a roll_pitch_yaw_thrust_setpoint message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param time_us Timestamp in micro seconds since unix epoch - * @param roll Desired roll angle in radians - * @param pitch Desired pitch angle in radians - * @param yaw Desired yaw angle in radians - * @param thrust Collective thrust, normalized to 0 .. 1 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_us, float roll, float pitch, float yaw, float thrust) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[24]; - _mav_put_uint64_t(buf, 0, time_us); - _mav_put_float(buf, 8, roll); - _mav_put_float(buf, 12, pitch); - _mav_put_float(buf, 16, yaw); - _mav_put_float(buf, 20, thrust); - - memcpy(_MAV_PAYLOAD(msg), buf, 24); -#else - mavlink_roll_pitch_yaw_thrust_setpoint_t packet; - packet.time_us = time_us; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.thrust = thrust; - - memcpy(_MAV_PAYLOAD(msg), &packet, 24); -#endif - - msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT; - return mavlink_finalize_message(msg, system_id, component_id, 24); -} - -/** - * @brief Pack a roll_pitch_yaw_thrust_setpoint message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param time_us Timestamp in micro seconds since unix epoch - * @param roll Desired roll angle in radians - * @param pitch Desired pitch angle in radians - * @param yaw Desired yaw angle in radians - * @param thrust Collective thrust, normalized to 0 .. 1 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_us,float roll,float pitch,float yaw,float thrust) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[24]; - _mav_put_uint64_t(buf, 0, time_us); - _mav_put_float(buf, 8, roll); - _mav_put_float(buf, 12, pitch); - _mav_put_float(buf, 16, yaw); - _mav_put_float(buf, 20, thrust); - - memcpy(_MAV_PAYLOAD(msg), buf, 24); -#else - mavlink_roll_pitch_yaw_thrust_setpoint_t packet; - packet.time_us = time_us; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.thrust = thrust; - - memcpy(_MAV_PAYLOAD(msg), &packet, 24); -#endif - - msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 24); -} - -/** - * @brief Encode a roll_pitch_yaw_thrust_setpoint struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param roll_pitch_yaw_thrust_setpoint C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_roll_pitch_yaw_thrust_setpoint_t* roll_pitch_yaw_thrust_setpoint) -{ - return mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack(system_id, component_id, msg, roll_pitch_yaw_thrust_setpoint->time_us, roll_pitch_yaw_thrust_setpoint->roll, roll_pitch_yaw_thrust_setpoint->pitch, roll_pitch_yaw_thrust_setpoint->yaw, roll_pitch_yaw_thrust_setpoint->thrust); -} - -/** - * @brief Send a roll_pitch_yaw_thrust_setpoint message - * @param chan MAVLink channel to send the message - * - * @param time_us Timestamp in micro seconds since unix epoch - * @param roll Desired roll angle in radians - * @param pitch Desired pitch angle in radians - * @param yaw Desired yaw angle in radians - * @param thrust Collective thrust, normalized to 0 .. 1 - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_roll_pitch_yaw_thrust_setpoint_send(mavlink_channel_t chan, uint64_t time_us, float roll, float pitch, float yaw, float thrust) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[24]; - _mav_put_uint64_t(buf, 0, time_us); - _mav_put_float(buf, 8, roll); - _mav_put_float(buf, 12, pitch); - _mav_put_float(buf, 16, yaw); - _mav_put_float(buf, 20, thrust); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT, buf, 24); -#else - mavlink_roll_pitch_yaw_thrust_setpoint_t packet; - packet.time_us = time_us; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.thrust = thrust; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT, (const char *)&packet, 24); -#endif -} - -#endif - -// MESSAGE ROLL_PITCH_YAW_THRUST_SETPOINT UNPACKING - - -/** - * @brief Get field time_us from roll_pitch_yaw_thrust_setpoint message - * - * @return Timestamp in micro seconds since unix epoch - */ -static inline uint64_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_get_time_us(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field roll from roll_pitch_yaw_thrust_setpoint message - * - * @return Desired roll angle in radians - */ -static inline float mavlink_msg_roll_pitch_yaw_thrust_setpoint_get_roll(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field pitch from roll_pitch_yaw_thrust_setpoint message - * - * @return Desired pitch angle in radians - */ -static inline float mavlink_msg_roll_pitch_yaw_thrust_setpoint_get_pitch(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field yaw from roll_pitch_yaw_thrust_setpoint message - * - * @return Desired yaw angle in radians - */ -static inline float mavlink_msg_roll_pitch_yaw_thrust_setpoint_get_yaw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 16); -} - -/** - * @brief Get field thrust from roll_pitch_yaw_thrust_setpoint message - * - * @return Collective thrust, normalized to 0 .. 1 - */ -static inline float mavlink_msg_roll_pitch_yaw_thrust_setpoint_get_thrust(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 20); -} - -/** - * @brief Decode a roll_pitch_yaw_thrust_setpoint message into a struct - * - * @param msg The message to decode - * @param roll_pitch_yaw_thrust_setpoint C-struct to decode the message contents into - */ -static inline void mavlink_msg_roll_pitch_yaw_thrust_setpoint_decode(const mavlink_message_t* msg, mavlink_roll_pitch_yaw_thrust_setpoint_t* roll_pitch_yaw_thrust_setpoint) -{ -#if MAVLINK_NEED_BYTE_SWAP - roll_pitch_yaw_thrust_setpoint->time_us = mavlink_msg_roll_pitch_yaw_thrust_setpoint_get_time_us(msg); - roll_pitch_yaw_thrust_setpoint->roll = mavlink_msg_roll_pitch_yaw_thrust_setpoint_get_roll(msg); - roll_pitch_yaw_thrust_setpoint->pitch = mavlink_msg_roll_pitch_yaw_thrust_setpoint_get_pitch(msg); - roll_pitch_yaw_thrust_setpoint->yaw = mavlink_msg_roll_pitch_yaw_thrust_setpoint_get_yaw(msg); - roll_pitch_yaw_thrust_setpoint->thrust = mavlink_msg_roll_pitch_yaw_thrust_setpoint_get_thrust(msg); -#else - memcpy(roll_pitch_yaw_thrust_setpoint, _MAV_PAYLOAD(msg), 24); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_safety_allowed_area.h b/src/GCS_MAVLink/include/common/mavlink_msg_safety_allowed_area.h deleted file mode 100644 index d76c204f7..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_safety_allowed_area.h +++ /dev/null @@ -1,276 +0,0 @@ -// MESSAGE SAFETY_ALLOWED_AREA PACKING - -#define MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA 54 - -typedef struct __mavlink_safety_allowed_area_t -{ - uint8_t frame; ///< Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - float p1x; ///< x position 1 / Latitude 1 - float p1y; ///< y position 1 / Longitude 1 - float p1z; ///< z position 1 / Altitude 1 - float p2x; ///< x position 2 / Latitude 2 - float p2y; ///< y position 2 / Longitude 2 - float p2z; ///< z position 2 / Altitude 2 -} mavlink_safety_allowed_area_t; - -#define MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN 25 -#define MAVLINK_MSG_ID_54_LEN 25 - - - -#define MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA { \ - "SAFETY_ALLOWED_AREA", \ - 7, \ - { { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_safety_allowed_area_t, frame) }, \ - { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 1, offsetof(mavlink_safety_allowed_area_t, p1x) }, \ - { "p1y", NULL, MAVLINK_TYPE_FLOAT, 0, 5, offsetof(mavlink_safety_allowed_area_t, p1y) }, \ - { "p1z", NULL, MAVLINK_TYPE_FLOAT, 0, 9, offsetof(mavlink_safety_allowed_area_t, p1z) }, \ - { "p2x", NULL, MAVLINK_TYPE_FLOAT, 0, 13, offsetof(mavlink_safety_allowed_area_t, p2x) }, \ - { "p2y", NULL, MAVLINK_TYPE_FLOAT, 0, 17, offsetof(mavlink_safety_allowed_area_t, p2y) }, \ - { "p2z", NULL, MAVLINK_TYPE_FLOAT, 0, 21, offsetof(mavlink_safety_allowed_area_t, p2z) }, \ - } \ -} - - -/** - * @brief Pack a safety_allowed_area message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - * @param p1x x position 1 / Latitude 1 - * @param p1y y position 1 / Longitude 1 - * @param p1z z position 1 / Altitude 1 - * @param p2x x position 2 / Latitude 2 - * @param p2y y position 2 / Longitude 2 - * @param p2z z position 2 / Altitude 2 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[25]; - _mav_put_uint8_t(buf, 0, frame); - _mav_put_float(buf, 1, p1x); - _mav_put_float(buf, 5, p1y); - _mav_put_float(buf, 9, p1z); - _mav_put_float(buf, 13, p2x); - _mav_put_float(buf, 17, p2y); - _mav_put_float(buf, 21, p2z); - - memcpy(_MAV_PAYLOAD(msg), buf, 25); -#else - mavlink_safety_allowed_area_t packet; - packet.frame = frame; - packet.p1x = p1x; - packet.p1y = p1y; - packet.p1z = p1z; - packet.p2x = p2x; - packet.p2y = p2y; - packet.p2z = p2z; - - memcpy(_MAV_PAYLOAD(msg), &packet, 25); -#endif - - msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; - return mavlink_finalize_message(msg, system_id, component_id, 25); -} - -/** - * @brief Pack a safety_allowed_area message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - * @param p1x x position 1 / Latitude 1 - * @param p1y y position 1 / Longitude 1 - * @param p1z z position 1 / Altitude 1 - * @param p2x x position 2 / Latitude 2 - * @param p2y y position 2 / Longitude 2 - * @param p2z z position 2 / Altitude 2 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_safety_allowed_area_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t frame,float p1x,float p1y,float p1z,float p2x,float p2y,float p2z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[25]; - _mav_put_uint8_t(buf, 0, frame); - _mav_put_float(buf, 1, p1x); - _mav_put_float(buf, 5, p1y); - _mav_put_float(buf, 9, p1z); - _mav_put_float(buf, 13, p2x); - _mav_put_float(buf, 17, p2y); - _mav_put_float(buf, 21, p2z); - - memcpy(_MAV_PAYLOAD(msg), buf, 25); -#else - mavlink_safety_allowed_area_t packet; - packet.frame = frame; - packet.p1x = p1x; - packet.p1y = p1y; - packet.p1z = p1z; - packet.p2x = p2x; - packet.p2y = p2y; - packet.p2z = p2z; - - memcpy(_MAV_PAYLOAD(msg), &packet, 25); -#endif - - msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 25); -} - -/** - * @brief Encode a safety_allowed_area struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param safety_allowed_area C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_safety_allowed_area_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_safety_allowed_area_t* safety_allowed_area) -{ - return mavlink_msg_safety_allowed_area_pack(system_id, component_id, msg, safety_allowed_area->frame, safety_allowed_area->p1x, safety_allowed_area->p1y, safety_allowed_area->p1z, safety_allowed_area->p2x, safety_allowed_area->p2y, safety_allowed_area->p2z); -} - -/** - * @brief Send a safety_allowed_area message - * @param chan MAVLink channel to send the message - * - * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - * @param p1x x position 1 / Latitude 1 - * @param p1y y position 1 / Longitude 1 - * @param p1z z position 1 / Altitude 1 - * @param p2x x position 2 / Latitude 2 - * @param p2y y position 2 / Longitude 2 - * @param p2z z position 2 / Altitude 2 - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_safety_allowed_area_send(mavlink_channel_t chan, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[25]; - _mav_put_uint8_t(buf, 0, frame); - _mav_put_float(buf, 1, p1x); - _mav_put_float(buf, 5, p1y); - _mav_put_float(buf, 9, p1z); - _mav_put_float(buf, 13, p2x); - _mav_put_float(buf, 17, p2y); - _mav_put_float(buf, 21, p2z); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, buf, 25); -#else - mavlink_safety_allowed_area_t packet; - packet.frame = frame; - packet.p1x = p1x; - packet.p1y = p1y; - packet.p1z = p1z; - packet.p2x = p2x; - packet.p2y = p2y; - packet.p2z = p2z; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, (const char *)&packet, 25); -#endif -} - -#endif - -// MESSAGE SAFETY_ALLOWED_AREA UNPACKING - - -/** - * @brief Get field frame from safety_allowed_area message - * - * @return Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - */ -static inline uint8_t mavlink_msg_safety_allowed_area_get_frame(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field p1x from safety_allowed_area message - * - * @return x position 1 / Latitude 1 - */ -static inline float mavlink_msg_safety_allowed_area_get_p1x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 1); -} - -/** - * @brief Get field p1y from safety_allowed_area message - * - * @return y position 1 / Longitude 1 - */ -static inline float mavlink_msg_safety_allowed_area_get_p1y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 5); -} - -/** - * @brief Get field p1z from safety_allowed_area message - * - * @return z position 1 / Altitude 1 - */ -static inline float mavlink_msg_safety_allowed_area_get_p1z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 9); -} - -/** - * @brief Get field p2x from safety_allowed_area message - * - * @return x position 2 / Latitude 2 - */ -static inline float mavlink_msg_safety_allowed_area_get_p2x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 13); -} - -/** - * @brief Get field p2y from safety_allowed_area message - * - * @return y position 2 / Longitude 2 - */ -static inline float mavlink_msg_safety_allowed_area_get_p2y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 17); -} - -/** - * @brief Get field p2z from safety_allowed_area message - * - * @return z position 2 / Altitude 2 - */ -static inline float mavlink_msg_safety_allowed_area_get_p2z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 21); -} - -/** - * @brief Decode a safety_allowed_area message into a struct - * - * @param msg The message to decode - * @param safety_allowed_area C-struct to decode the message contents into - */ -static inline void mavlink_msg_safety_allowed_area_decode(const mavlink_message_t* msg, mavlink_safety_allowed_area_t* safety_allowed_area) -{ -#if MAVLINK_NEED_BYTE_SWAP - safety_allowed_area->frame = mavlink_msg_safety_allowed_area_get_frame(msg); - safety_allowed_area->p1x = mavlink_msg_safety_allowed_area_get_p1x(msg); - safety_allowed_area->p1y = mavlink_msg_safety_allowed_area_get_p1y(msg); - safety_allowed_area->p1z = mavlink_msg_safety_allowed_area_get_p1z(msg); - safety_allowed_area->p2x = mavlink_msg_safety_allowed_area_get_p2x(msg); - safety_allowed_area->p2y = mavlink_msg_safety_allowed_area_get_p2y(msg); - safety_allowed_area->p2z = mavlink_msg_safety_allowed_area_get_p2z(msg); -#else - memcpy(safety_allowed_area, _MAV_PAYLOAD(msg), 25); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_safety_set_allowed_area.h b/src/GCS_MAVLink/include/common/mavlink_msg_safety_set_allowed_area.h deleted file mode 100644 index 8afdf6f13..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_safety_set_allowed_area.h +++ /dev/null @@ -1,320 +0,0 @@ -// MESSAGE SAFETY_SET_ALLOWED_AREA PACKING - -#define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA 53 - -typedef struct __mavlink_safety_set_allowed_area_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - uint8_t frame; ///< Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - float p1x; ///< x position 1 / Latitude 1 - float p1y; ///< y position 1 / Longitude 1 - float p1z; ///< z position 1 / Altitude 1 - float p2x; ///< x position 2 / Latitude 2 - float p2y; ///< y position 2 / Longitude 2 - float p2z; ///< z position 2 / Altitude 2 -} mavlink_safety_set_allowed_area_t; - -#define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN 27 -#define MAVLINK_MSG_ID_53_LEN 27 - - - -#define MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA { \ - "SAFETY_SET_ALLOWED_AREA", \ - 9, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_safety_set_allowed_area_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_safety_set_allowed_area_t, target_component) }, \ - { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_safety_set_allowed_area_t, frame) }, \ - { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 3, offsetof(mavlink_safety_set_allowed_area_t, p1x) }, \ - { "p1y", NULL, MAVLINK_TYPE_FLOAT, 0, 7, offsetof(mavlink_safety_set_allowed_area_t, p1y) }, \ - { "p1z", NULL, MAVLINK_TYPE_FLOAT, 0, 11, offsetof(mavlink_safety_set_allowed_area_t, p1z) }, \ - { "p2x", NULL, MAVLINK_TYPE_FLOAT, 0, 15, offsetof(mavlink_safety_set_allowed_area_t, p2x) }, \ - { "p2y", NULL, MAVLINK_TYPE_FLOAT, 0, 19, offsetof(mavlink_safety_set_allowed_area_t, p2y) }, \ - { "p2z", NULL, MAVLINK_TYPE_FLOAT, 0, 23, offsetof(mavlink_safety_set_allowed_area_t, p2z) }, \ - } \ -} - - -/** - * @brief Pack a safety_set_allowed_area message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - * @param p1x x position 1 / Latitude 1 - * @param p1y y position 1 / Longitude 1 - * @param p1z z position 1 / Altitude 1 - * @param p2x x position 2 / Latitude 2 - * @param p2y y position 2 / Longitude 2 - * @param p2z z position 2 / Altitude 2 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[27]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, frame); - _mav_put_float(buf, 3, p1x); - _mav_put_float(buf, 7, p1y); - _mav_put_float(buf, 11, p1z); - _mav_put_float(buf, 15, p2x); - _mav_put_float(buf, 19, p2y); - _mav_put_float(buf, 23, p2z); - - memcpy(_MAV_PAYLOAD(msg), buf, 27); -#else - mavlink_safety_set_allowed_area_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; - packet.p1x = p1x; - packet.p1y = p1y; - packet.p1z = p1z; - packet.p2x = p2x; - packet.p2y = p2y; - packet.p2z = p2z; - - memcpy(_MAV_PAYLOAD(msg), &packet, 27); -#endif - - msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA; - return mavlink_finalize_message(msg, system_id, component_id, 27); -} - -/** - * @brief Pack a safety_set_allowed_area message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - * @param p1x x position 1 / Latitude 1 - * @param p1y y position 1 / Longitude 1 - * @param p1z z position 1 / Altitude 1 - * @param p2x x position 2 / Latitude 2 - * @param p2y y position 2 / Longitude 2 - * @param p2z z position 2 / Altitude 2 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint8_t frame,float p1x,float p1y,float p1z,float p2x,float p2y,float p2z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[27]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, frame); - _mav_put_float(buf, 3, p1x); - _mav_put_float(buf, 7, p1y); - _mav_put_float(buf, 11, p1z); - _mav_put_float(buf, 15, p2x); - _mav_put_float(buf, 19, p2y); - _mav_put_float(buf, 23, p2z); - - memcpy(_MAV_PAYLOAD(msg), buf, 27); -#else - mavlink_safety_set_allowed_area_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; - packet.p1x = p1x; - packet.p1y = p1y; - packet.p1z = p1z; - packet.p2x = p2x; - packet.p2y = p2y; - packet.p2z = p2z; - - memcpy(_MAV_PAYLOAD(msg), &packet, 27); -#endif - - msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 27); -} - -/** - * @brief Encode a safety_set_allowed_area struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param safety_set_allowed_area C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_safety_set_allowed_area_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_safety_set_allowed_area_t* safety_set_allowed_area) -{ - return mavlink_msg_safety_set_allowed_area_pack(system_id, component_id, msg, safety_set_allowed_area->target_system, safety_set_allowed_area->target_component, safety_set_allowed_area->frame, safety_set_allowed_area->p1x, safety_set_allowed_area->p1y, safety_set_allowed_area->p1z, safety_set_allowed_area->p2x, safety_set_allowed_area->p2y, safety_set_allowed_area->p2z); -} - -/** - * @brief Send a safety_set_allowed_area message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - * @param p1x x position 1 / Latitude 1 - * @param p1y y position 1 / Longitude 1 - * @param p1z z position 1 / Altitude 1 - * @param p2x x position 2 / Latitude 2 - * @param p2y y position 2 / Longitude 2 - * @param p2z z position 2 / Altitude 2 - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_safety_set_allowed_area_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[27]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, frame); - _mav_put_float(buf, 3, p1x); - _mav_put_float(buf, 7, p1y); - _mav_put_float(buf, 11, p1z); - _mav_put_float(buf, 15, p2x); - _mav_put_float(buf, 19, p2y); - _mav_put_float(buf, 23, p2z); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, buf, 27); -#else - mavlink_safety_set_allowed_area_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; - packet.p1x = p1x; - packet.p1y = p1y; - packet.p1z = p1z; - packet.p2x = p2x; - packet.p2y = p2y; - packet.p2z = p2z; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, (const char *)&packet, 27); -#endif -} - -#endif - -// MESSAGE SAFETY_SET_ALLOWED_AREA UNPACKING - - -/** - * @brief Get field target_system from safety_set_allowed_area message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_safety_set_allowed_area_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from safety_set_allowed_area message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_safety_set_allowed_area_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field frame from safety_set_allowed_area message - * - * @return Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - */ -static inline uint8_t mavlink_msg_safety_set_allowed_area_get_frame(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Get field p1x from safety_set_allowed_area message - * - * @return x position 1 / Latitude 1 - */ -static inline float mavlink_msg_safety_set_allowed_area_get_p1x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 3); -} - -/** - * @brief Get field p1y from safety_set_allowed_area message - * - * @return y position 1 / Longitude 1 - */ -static inline float mavlink_msg_safety_set_allowed_area_get_p1y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 7); -} - -/** - * @brief Get field p1z from safety_set_allowed_area message - * - * @return z position 1 / Altitude 1 - */ -static inline float mavlink_msg_safety_set_allowed_area_get_p1z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 11); -} - -/** - * @brief Get field p2x from safety_set_allowed_area message - * - * @return x position 2 / Latitude 2 - */ -static inline float mavlink_msg_safety_set_allowed_area_get_p2x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 15); -} - -/** - * @brief Get field p2y from safety_set_allowed_area message - * - * @return y position 2 / Longitude 2 - */ -static inline float mavlink_msg_safety_set_allowed_area_get_p2y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 19); -} - -/** - * @brief Get field p2z from safety_set_allowed_area message - * - * @return z position 2 / Altitude 2 - */ -static inline float mavlink_msg_safety_set_allowed_area_get_p2z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 23); -} - -/** - * @brief Decode a safety_set_allowed_area message into a struct - * - * @param msg The message to decode - * @param safety_set_allowed_area C-struct to decode the message contents into - */ -static inline void mavlink_msg_safety_set_allowed_area_decode(const mavlink_message_t* msg, mavlink_safety_set_allowed_area_t* safety_set_allowed_area) -{ -#if MAVLINK_NEED_BYTE_SWAP - safety_set_allowed_area->target_system = mavlink_msg_safety_set_allowed_area_get_target_system(msg); - safety_set_allowed_area->target_component = mavlink_msg_safety_set_allowed_area_get_target_component(msg); - safety_set_allowed_area->frame = mavlink_msg_safety_set_allowed_area_get_frame(msg); - safety_set_allowed_area->p1x = mavlink_msg_safety_set_allowed_area_get_p1x(msg); - safety_set_allowed_area->p1y = mavlink_msg_safety_set_allowed_area_get_p1y(msg); - safety_set_allowed_area->p1z = mavlink_msg_safety_set_allowed_area_get_p1z(msg); - safety_set_allowed_area->p2x = mavlink_msg_safety_set_allowed_area_get_p2x(msg); - safety_set_allowed_area->p2y = mavlink_msg_safety_set_allowed_area_get_p2y(msg); - safety_set_allowed_area->p2z = mavlink_msg_safety_set_allowed_area_get_p2z(msg); -#else - memcpy(safety_set_allowed_area, _MAV_PAYLOAD(msg), 27); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_scaled_imu.h b/src/GCS_MAVLink/include/common/mavlink_msg_scaled_imu.h deleted file mode 100644 index 7bec81d9d..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_scaled_imu.h +++ /dev/null @@ -1,342 +0,0 @@ -// MESSAGE SCALED_IMU PACKING - -#define MAVLINK_MSG_ID_SCALED_IMU 26 - -typedef struct __mavlink_scaled_imu_t -{ - uint64_t usec; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - int16_t xacc; ///< X acceleration (mg) - int16_t yacc; ///< Y acceleration (mg) - int16_t zacc; ///< Z acceleration (mg) - int16_t xgyro; ///< Angular speed around X axis (millirad /sec) - int16_t ygyro; ///< Angular speed around Y axis (millirad /sec) - int16_t zgyro; ///< Angular speed around Z axis (millirad /sec) - int16_t xmag; ///< X Magnetic field (milli tesla) - int16_t ymag; ///< Y Magnetic field (milli tesla) - int16_t zmag; ///< Z Magnetic field (milli tesla) -} mavlink_scaled_imu_t; - -#define MAVLINK_MSG_ID_SCALED_IMU_LEN 26 -#define MAVLINK_MSG_ID_26_LEN 26 - - - -#define MAVLINK_MESSAGE_INFO_SCALED_IMU { \ - "SCALED_IMU", \ - 10, \ - { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_scaled_imu_t, usec) }, \ - { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_scaled_imu_t, xacc) }, \ - { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_scaled_imu_t, yacc) }, \ - { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_imu_t, zacc) }, \ - { "xgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_scaled_imu_t, xgyro) }, \ - { "ygyro", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_scaled_imu_t, ygyro) }, \ - { "zgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_scaled_imu_t, zgyro) }, \ - { "xmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_scaled_imu_t, xmag) }, \ - { "ymag", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_scaled_imu_t, ymag) }, \ - { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 24, offsetof(mavlink_scaled_imu_t, zmag) }, \ - } \ -} - - -/** - * @brief Pack a scaled_imu message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) - * @param xgyro Angular speed around X axis (millirad /sec) - * @param ygyro Angular speed around Y axis (millirad /sec) - * @param zgyro Angular speed around Z axis (millirad /sec) - * @param xmag X Magnetic field (milli tesla) - * @param ymag Y Magnetic field (milli tesla) - * @param zmag Z Magnetic field (milli tesla) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_scaled_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t usec, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_int16_t(buf, 8, xacc); - _mav_put_int16_t(buf, 10, yacc); - _mav_put_int16_t(buf, 12, zacc); - _mav_put_int16_t(buf, 14, xgyro); - _mav_put_int16_t(buf, 16, ygyro); - _mav_put_int16_t(buf, 18, zgyro); - _mav_put_int16_t(buf, 20, xmag); - _mav_put_int16_t(buf, 22, ymag); - _mav_put_int16_t(buf, 24, zmag); - - memcpy(_MAV_PAYLOAD(msg), buf, 26); -#else - mavlink_scaled_imu_t packet; - packet.usec = usec; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; - - memcpy(_MAV_PAYLOAD(msg), &packet, 26); -#endif - - msg->msgid = MAVLINK_MSG_ID_SCALED_IMU; - return mavlink_finalize_message(msg, system_id, component_id, 26); -} - -/** - * @brief Pack a scaled_imu message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) - * @param xgyro Angular speed around X axis (millirad /sec) - * @param ygyro Angular speed around Y axis (millirad /sec) - * @param zgyro Angular speed around Z axis (millirad /sec) - * @param xmag X Magnetic field (milli tesla) - * @param ymag Y Magnetic field (milli tesla) - * @param zmag Z Magnetic field (milli tesla) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_scaled_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t usec,int16_t xacc,int16_t yacc,int16_t zacc,int16_t xgyro,int16_t ygyro,int16_t zgyro,int16_t xmag,int16_t ymag,int16_t zmag) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_int16_t(buf, 8, xacc); - _mav_put_int16_t(buf, 10, yacc); - _mav_put_int16_t(buf, 12, zacc); - _mav_put_int16_t(buf, 14, xgyro); - _mav_put_int16_t(buf, 16, ygyro); - _mav_put_int16_t(buf, 18, zgyro); - _mav_put_int16_t(buf, 20, xmag); - _mav_put_int16_t(buf, 22, ymag); - _mav_put_int16_t(buf, 24, zmag); - - memcpy(_MAV_PAYLOAD(msg), buf, 26); -#else - mavlink_scaled_imu_t packet; - packet.usec = usec; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; - - memcpy(_MAV_PAYLOAD(msg), &packet, 26); -#endif - - msg->msgid = MAVLINK_MSG_ID_SCALED_IMU; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 26); -} - -/** - * @brief Encode a scaled_imu struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param scaled_imu C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_scaled_imu_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_scaled_imu_t* scaled_imu) -{ - return mavlink_msg_scaled_imu_pack(system_id, component_id, msg, scaled_imu->usec, scaled_imu->xacc, scaled_imu->yacc, scaled_imu->zacc, scaled_imu->xgyro, scaled_imu->ygyro, scaled_imu->zgyro, scaled_imu->xmag, scaled_imu->ymag, scaled_imu->zmag); -} - -/** - * @brief Send a scaled_imu message - * @param chan MAVLink channel to send the message - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) - * @param xgyro Angular speed around X axis (millirad /sec) - * @param ygyro Angular speed around Y axis (millirad /sec) - * @param zgyro Angular speed around Z axis (millirad /sec) - * @param xmag X Magnetic field (milli tesla) - * @param ymag Y Magnetic field (milli tesla) - * @param zmag Z Magnetic field (milli tesla) - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_scaled_imu_send(mavlink_channel_t chan, uint64_t usec, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_int16_t(buf, 8, xacc); - _mav_put_int16_t(buf, 10, yacc); - _mav_put_int16_t(buf, 12, zacc); - _mav_put_int16_t(buf, 14, xgyro); - _mav_put_int16_t(buf, 16, ygyro); - _mav_put_int16_t(buf, 18, zgyro); - _mav_put_int16_t(buf, 20, xmag); - _mav_put_int16_t(buf, 22, ymag); - _mav_put_int16_t(buf, 24, zmag); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, buf, 26); -#else - mavlink_scaled_imu_t packet; - packet.usec = usec; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, (const char *)&packet, 26); -#endif -} - -#endif - -// MESSAGE SCALED_IMU UNPACKING - - -/** - * @brief Get field usec from scaled_imu message - * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) - */ -static inline uint64_t mavlink_msg_scaled_imu_get_usec(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field xacc from scaled_imu message - * - * @return X acceleration (mg) - */ -static inline int16_t mavlink_msg_scaled_imu_get_xacc(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 8); -} - -/** - * @brief Get field yacc from scaled_imu message - * - * @return Y acceleration (mg) - */ -static inline int16_t mavlink_msg_scaled_imu_get_yacc(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 10); -} - -/** - * @brief Get field zacc from scaled_imu message - * - * @return Z acceleration (mg) - */ -static inline int16_t mavlink_msg_scaled_imu_get_zacc(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 12); -} - -/** - * @brief Get field xgyro from scaled_imu message - * - * @return Angular speed around X axis (millirad /sec) - */ -static inline int16_t mavlink_msg_scaled_imu_get_xgyro(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 14); -} - -/** - * @brief Get field ygyro from scaled_imu message - * - * @return Angular speed around Y axis (millirad /sec) - */ -static inline int16_t mavlink_msg_scaled_imu_get_ygyro(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 16); -} - -/** - * @brief Get field zgyro from scaled_imu message - * - * @return Angular speed around Z axis (millirad /sec) - */ -static inline int16_t mavlink_msg_scaled_imu_get_zgyro(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 18); -} - -/** - * @brief Get field xmag from scaled_imu message - * - * @return X Magnetic field (milli tesla) - */ -static inline int16_t mavlink_msg_scaled_imu_get_xmag(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 20); -} - -/** - * @brief Get field ymag from scaled_imu message - * - * @return Y Magnetic field (milli tesla) - */ -static inline int16_t mavlink_msg_scaled_imu_get_ymag(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 22); -} - -/** - * @brief Get field zmag from scaled_imu message - * - * @return Z Magnetic field (milli tesla) - */ -static inline int16_t mavlink_msg_scaled_imu_get_zmag(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 24); -} - -/** - * @brief Decode a scaled_imu message into a struct - * - * @param msg The message to decode - * @param scaled_imu C-struct to decode the message contents into - */ -static inline void mavlink_msg_scaled_imu_decode(const mavlink_message_t* msg, mavlink_scaled_imu_t* scaled_imu) -{ -#if MAVLINK_NEED_BYTE_SWAP - scaled_imu->usec = mavlink_msg_scaled_imu_get_usec(msg); - scaled_imu->xacc = mavlink_msg_scaled_imu_get_xacc(msg); - scaled_imu->yacc = mavlink_msg_scaled_imu_get_yacc(msg); - scaled_imu->zacc = mavlink_msg_scaled_imu_get_zacc(msg); - scaled_imu->xgyro = mavlink_msg_scaled_imu_get_xgyro(msg); - scaled_imu->ygyro = mavlink_msg_scaled_imu_get_ygyro(msg); - scaled_imu->zgyro = mavlink_msg_scaled_imu_get_zgyro(msg); - scaled_imu->xmag = mavlink_msg_scaled_imu_get_xmag(msg); - scaled_imu->ymag = mavlink_msg_scaled_imu_get_ymag(msg); - scaled_imu->zmag = mavlink_msg_scaled_imu_get_zmag(msg); -#else - memcpy(scaled_imu, _MAV_PAYLOAD(msg), 26); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_scaled_pressure.h b/src/GCS_MAVLink/include/common/mavlink_msg_scaled_pressure.h deleted file mode 100644 index 287c9a95b..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_scaled_pressure.h +++ /dev/null @@ -1,210 +0,0 @@ -// MESSAGE SCALED_PRESSURE PACKING - -#define MAVLINK_MSG_ID_SCALED_PRESSURE 38 - -typedef struct __mavlink_scaled_pressure_t -{ - uint64_t usec; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - float press_abs; ///< Absolute pressure (hectopascal) - float press_diff; ///< Differential pressure 1 (hectopascal) - int16_t temperature; ///< Temperature measurement (0.01 degrees celsius) -} mavlink_scaled_pressure_t; - -#define MAVLINK_MSG_ID_SCALED_PRESSURE_LEN 18 -#define MAVLINK_MSG_ID_38_LEN 18 - - - -#define MAVLINK_MESSAGE_INFO_SCALED_PRESSURE { \ - "SCALED_PRESSURE", \ - 4, \ - { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_scaled_pressure_t, usec) }, \ - { "press_abs", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_scaled_pressure_t, press_abs) }, \ - { "press_diff", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_scaled_pressure_t, press_diff) }, \ - { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_scaled_pressure_t, temperature) }, \ - } \ -} - - -/** - * @brief Pack a scaled_pressure message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param press_abs Absolute pressure (hectopascal) - * @param press_diff Differential pressure 1 (hectopascal) - * @param temperature Temperature measurement (0.01 degrees celsius) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t usec, float press_abs, float press_diff, int16_t temperature) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, press_abs); - _mav_put_float(buf, 12, press_diff); - _mav_put_int16_t(buf, 16, temperature); - - memcpy(_MAV_PAYLOAD(msg), buf, 18); -#else - mavlink_scaled_pressure_t packet; - packet.usec = usec; - packet.press_abs = press_abs; - packet.press_diff = press_diff; - packet.temperature = temperature; - - memcpy(_MAV_PAYLOAD(msg), &packet, 18); -#endif - - msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE; - return mavlink_finalize_message(msg, system_id, component_id, 18); -} - -/** - * @brief Pack a scaled_pressure message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param press_abs Absolute pressure (hectopascal) - * @param press_diff Differential pressure 1 (hectopascal) - * @param temperature Temperature measurement (0.01 degrees celsius) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_scaled_pressure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t usec,float press_abs,float press_diff,int16_t temperature) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, press_abs); - _mav_put_float(buf, 12, press_diff); - _mav_put_int16_t(buf, 16, temperature); - - memcpy(_MAV_PAYLOAD(msg), buf, 18); -#else - mavlink_scaled_pressure_t packet; - packet.usec = usec; - packet.press_abs = press_abs; - packet.press_diff = press_diff; - packet.temperature = temperature; - - memcpy(_MAV_PAYLOAD(msg), &packet, 18); -#endif - - msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18); -} - -/** - * @brief Encode a scaled_pressure struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param scaled_pressure C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_scaled_pressure_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_scaled_pressure_t* scaled_pressure) -{ - return mavlink_msg_scaled_pressure_pack(system_id, component_id, msg, scaled_pressure->usec, scaled_pressure->press_abs, scaled_pressure->press_diff, scaled_pressure->temperature); -} - -/** - * @brief Send a scaled_pressure message - * @param chan MAVLink channel to send the message - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param press_abs Absolute pressure (hectopascal) - * @param press_diff Differential pressure 1 (hectopascal) - * @param temperature Temperature measurement (0.01 degrees celsius) - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_scaled_pressure_send(mavlink_channel_t chan, uint64_t usec, float press_abs, float press_diff, int16_t temperature) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, press_abs); - _mav_put_float(buf, 12, press_diff); - _mav_put_int16_t(buf, 16, temperature); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, buf, 18); -#else - mavlink_scaled_pressure_t packet; - packet.usec = usec; - packet.press_abs = press_abs; - packet.press_diff = press_diff; - packet.temperature = temperature; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, (const char *)&packet, 18); -#endif -} - -#endif - -// MESSAGE SCALED_PRESSURE UNPACKING - - -/** - * @brief Get field usec from scaled_pressure message - * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) - */ -static inline uint64_t mavlink_msg_scaled_pressure_get_usec(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field press_abs from scaled_pressure message - * - * @return Absolute pressure (hectopascal) - */ -static inline float mavlink_msg_scaled_pressure_get_press_abs(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field press_diff from scaled_pressure message - * - * @return Differential pressure 1 (hectopascal) - */ -static inline float mavlink_msg_scaled_pressure_get_press_diff(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field temperature from scaled_pressure message - * - * @return Temperature measurement (0.01 degrees celsius) - */ -static inline int16_t mavlink_msg_scaled_pressure_get_temperature(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 16); -} - -/** - * @brief Decode a scaled_pressure message into a struct - * - * @param msg The message to decode - * @param scaled_pressure C-struct to decode the message contents into - */ -static inline void mavlink_msg_scaled_pressure_decode(const mavlink_message_t* msg, mavlink_scaled_pressure_t* scaled_pressure) -{ -#if MAVLINK_NEED_BYTE_SWAP - scaled_pressure->usec = mavlink_msg_scaled_pressure_get_usec(msg); - scaled_pressure->press_abs = mavlink_msg_scaled_pressure_get_press_abs(msg); - scaled_pressure->press_diff = mavlink_msg_scaled_pressure_get_press_diff(msg); - scaled_pressure->temperature = mavlink_msg_scaled_pressure_get_temperature(msg); -#else - memcpy(scaled_pressure, _MAV_PAYLOAD(msg), 18); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_servo_output_raw.h b/src/GCS_MAVLink/include/common/mavlink_msg_servo_output_raw.h deleted file mode 100644 index 3c2b52e90..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_servo_output_raw.h +++ /dev/null @@ -1,298 +0,0 @@ -// MESSAGE SERVO_OUTPUT_RAW PACKING - -#define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW 37 - -typedef struct __mavlink_servo_output_raw_t -{ - uint16_t servo1_raw; ///< Servo output 1 value, in microseconds - uint16_t servo2_raw; ///< Servo output 2 value, in microseconds - uint16_t servo3_raw; ///< Servo output 3 value, in microseconds - uint16_t servo4_raw; ///< Servo output 4 value, in microseconds - uint16_t servo5_raw; ///< Servo output 5 value, in microseconds - uint16_t servo6_raw; ///< Servo output 6 value, in microseconds - uint16_t servo7_raw; ///< Servo output 7 value, in microseconds - uint16_t servo8_raw; ///< Servo output 8 value, in microseconds -} mavlink_servo_output_raw_t; - -#define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN 16 -#define MAVLINK_MSG_ID_37_LEN 16 - - - -#define MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW { \ - "SERVO_OUTPUT_RAW", \ - 8, \ - { { "servo1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_servo_output_raw_t, servo1_raw) }, \ - { "servo2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_servo_output_raw_t, servo2_raw) }, \ - { "servo3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_servo_output_raw_t, servo3_raw) }, \ - { "servo4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_servo_output_raw_t, servo4_raw) }, \ - { "servo5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_servo_output_raw_t, servo5_raw) }, \ - { "servo6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_servo_output_raw_t, servo6_raw) }, \ - { "servo7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_servo_output_raw_t, servo7_raw) }, \ - { "servo8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_servo_output_raw_t, servo8_raw) }, \ - } \ -} - - -/** - * @brief Pack a servo_output_raw message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param servo1_raw Servo output 1 value, in microseconds - * @param servo2_raw Servo output 2 value, in microseconds - * @param servo3_raw Servo output 3 value, in microseconds - * @param servo4_raw Servo output 4 value, in microseconds - * @param servo5_raw Servo output 5 value, in microseconds - * @param servo6_raw Servo output 6 value, in microseconds - * @param servo7_raw Servo output 7 value, in microseconds - * @param servo8_raw Servo output 8 value, in microseconds - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; - _mav_put_uint16_t(buf, 0, servo1_raw); - _mav_put_uint16_t(buf, 2, servo2_raw); - _mav_put_uint16_t(buf, 4, servo3_raw); - _mav_put_uint16_t(buf, 6, servo4_raw); - _mav_put_uint16_t(buf, 8, servo5_raw); - _mav_put_uint16_t(buf, 10, servo6_raw); - _mav_put_uint16_t(buf, 12, servo7_raw); - _mav_put_uint16_t(buf, 14, servo8_raw); - - memcpy(_MAV_PAYLOAD(msg), buf, 16); -#else - mavlink_servo_output_raw_t packet; - packet.servo1_raw = servo1_raw; - packet.servo2_raw = servo2_raw; - packet.servo3_raw = servo3_raw; - packet.servo4_raw = servo4_raw; - packet.servo5_raw = servo5_raw; - packet.servo6_raw = servo6_raw; - packet.servo7_raw = servo7_raw; - packet.servo8_raw = servo8_raw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 16); -#endif - - msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW; - return mavlink_finalize_message(msg, system_id, component_id, 16); -} - -/** - * @brief Pack a servo_output_raw message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param servo1_raw Servo output 1 value, in microseconds - * @param servo2_raw Servo output 2 value, in microseconds - * @param servo3_raw Servo output 3 value, in microseconds - * @param servo4_raw Servo output 4 value, in microseconds - * @param servo5_raw Servo output 5 value, in microseconds - * @param servo6_raw Servo output 6 value, in microseconds - * @param servo7_raw Servo output 7 value, in microseconds - * @param servo8_raw Servo output 8 value, in microseconds - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint16_t servo1_raw,uint16_t servo2_raw,uint16_t servo3_raw,uint16_t servo4_raw,uint16_t servo5_raw,uint16_t servo6_raw,uint16_t servo7_raw,uint16_t servo8_raw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; - _mav_put_uint16_t(buf, 0, servo1_raw); - _mav_put_uint16_t(buf, 2, servo2_raw); - _mav_put_uint16_t(buf, 4, servo3_raw); - _mav_put_uint16_t(buf, 6, servo4_raw); - _mav_put_uint16_t(buf, 8, servo5_raw); - _mav_put_uint16_t(buf, 10, servo6_raw); - _mav_put_uint16_t(buf, 12, servo7_raw); - _mav_put_uint16_t(buf, 14, servo8_raw); - - memcpy(_MAV_PAYLOAD(msg), buf, 16); -#else - mavlink_servo_output_raw_t packet; - packet.servo1_raw = servo1_raw; - packet.servo2_raw = servo2_raw; - packet.servo3_raw = servo3_raw; - packet.servo4_raw = servo4_raw; - packet.servo5_raw = servo5_raw; - packet.servo6_raw = servo6_raw; - packet.servo7_raw = servo7_raw; - packet.servo8_raw = servo8_raw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 16); -#endif - - msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 16); -} - -/** - * @brief Encode a servo_output_raw struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param servo_output_raw C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_servo_output_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_servo_output_raw_t* servo_output_raw) -{ - return mavlink_msg_servo_output_raw_pack(system_id, component_id, msg, servo_output_raw->servo1_raw, servo_output_raw->servo2_raw, servo_output_raw->servo3_raw, servo_output_raw->servo4_raw, servo_output_raw->servo5_raw, servo_output_raw->servo6_raw, servo_output_raw->servo7_raw, servo_output_raw->servo8_raw); -} - -/** - * @brief Send a servo_output_raw message - * @param chan MAVLink channel to send the message - * - * @param servo1_raw Servo output 1 value, in microseconds - * @param servo2_raw Servo output 2 value, in microseconds - * @param servo3_raw Servo output 3 value, in microseconds - * @param servo4_raw Servo output 4 value, in microseconds - * @param servo5_raw Servo output 5 value, in microseconds - * @param servo6_raw Servo output 6 value, in microseconds - * @param servo7_raw Servo output 7 value, in microseconds - * @param servo8_raw Servo output 8 value, in microseconds - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_servo_output_raw_send(mavlink_channel_t chan, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; - _mav_put_uint16_t(buf, 0, servo1_raw); - _mav_put_uint16_t(buf, 2, servo2_raw); - _mav_put_uint16_t(buf, 4, servo3_raw); - _mav_put_uint16_t(buf, 6, servo4_raw); - _mav_put_uint16_t(buf, 8, servo5_raw); - _mav_put_uint16_t(buf, 10, servo6_raw); - _mav_put_uint16_t(buf, 12, servo7_raw); - _mav_put_uint16_t(buf, 14, servo8_raw); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, 16); -#else - mavlink_servo_output_raw_t packet; - packet.servo1_raw = servo1_raw; - packet.servo2_raw = servo2_raw; - packet.servo3_raw = servo3_raw; - packet.servo4_raw = servo4_raw; - packet.servo5_raw = servo5_raw; - packet.servo6_raw = servo6_raw; - packet.servo7_raw = servo7_raw; - packet.servo8_raw = servo8_raw; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)&packet, 16); -#endif -} - -#endif - -// MESSAGE SERVO_OUTPUT_RAW UNPACKING - - -/** - * @brief Get field servo1_raw from servo_output_raw message - * - * @return Servo output 1 value, in microseconds - */ -static inline uint16_t mavlink_msg_servo_output_raw_get_servo1_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 0); -} - -/** - * @brief Get field servo2_raw from servo_output_raw message - * - * @return Servo output 2 value, in microseconds - */ -static inline uint16_t mavlink_msg_servo_output_raw_get_servo2_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 2); -} - -/** - * @brief Get field servo3_raw from servo_output_raw message - * - * @return Servo output 3 value, in microseconds - */ -static inline uint16_t mavlink_msg_servo_output_raw_get_servo3_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 4); -} - -/** - * @brief Get field servo4_raw from servo_output_raw message - * - * @return Servo output 4 value, in microseconds - */ -static inline uint16_t mavlink_msg_servo_output_raw_get_servo4_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 6); -} - -/** - * @brief Get field servo5_raw from servo_output_raw message - * - * @return Servo output 5 value, in microseconds - */ -static inline uint16_t mavlink_msg_servo_output_raw_get_servo5_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 8); -} - -/** - * @brief Get field servo6_raw from servo_output_raw message - * - * @return Servo output 6 value, in microseconds - */ -static inline uint16_t mavlink_msg_servo_output_raw_get_servo6_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 10); -} - -/** - * @brief Get field servo7_raw from servo_output_raw message - * - * @return Servo output 7 value, in microseconds - */ -static inline uint16_t mavlink_msg_servo_output_raw_get_servo7_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 12); -} - -/** - * @brief Get field servo8_raw from servo_output_raw message - * - * @return Servo output 8 value, in microseconds - */ -static inline uint16_t mavlink_msg_servo_output_raw_get_servo8_raw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 14); -} - -/** - * @brief Decode a servo_output_raw message into a struct - * - * @param msg The message to decode - * @param servo_output_raw C-struct to decode the message contents into - */ -static inline void mavlink_msg_servo_output_raw_decode(const mavlink_message_t* msg, mavlink_servo_output_raw_t* servo_output_raw) -{ -#if MAVLINK_NEED_BYTE_SWAP - servo_output_raw->servo1_raw = mavlink_msg_servo_output_raw_get_servo1_raw(msg); - servo_output_raw->servo2_raw = mavlink_msg_servo_output_raw_get_servo2_raw(msg); - servo_output_raw->servo3_raw = mavlink_msg_servo_output_raw_get_servo3_raw(msg); - servo_output_raw->servo4_raw = mavlink_msg_servo_output_raw_get_servo4_raw(msg); - servo_output_raw->servo5_raw = mavlink_msg_servo_output_raw_get_servo5_raw(msg); - servo_output_raw->servo6_raw = mavlink_msg_servo_output_raw_get_servo6_raw(msg); - servo_output_raw->servo7_raw = mavlink_msg_servo_output_raw_get_servo7_raw(msg); - servo_output_raw->servo8_raw = mavlink_msg_servo_output_raw_get_servo8_raw(msg); -#else - memcpy(servo_output_raw, _MAV_PAYLOAD(msg), 16); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_set_altitude.h b/src/GCS_MAVLink/include/common/mavlink_msg_set_altitude.h deleted file mode 100644 index 14398bc53..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_set_altitude.h +++ /dev/null @@ -1,166 +0,0 @@ -// MESSAGE SET_ALTITUDE PACKING - -#define MAVLINK_MSG_ID_SET_ALTITUDE 65 - -typedef struct __mavlink_set_altitude_t -{ - uint8_t target; ///< The system setting the altitude - uint32_t mode; ///< The new altitude in meters -} mavlink_set_altitude_t; - -#define MAVLINK_MSG_ID_SET_ALTITUDE_LEN 5 -#define MAVLINK_MSG_ID_65_LEN 5 - - - -#define MAVLINK_MESSAGE_INFO_SET_ALTITUDE { \ - "SET_ALTITUDE", \ - 2, \ - { { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_set_altitude_t, target) }, \ - { "mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 1, offsetof(mavlink_set_altitude_t, mode) }, \ - } \ -} - - -/** - * @brief Pack a set_altitude message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target The system setting the altitude - * @param mode The new altitude in meters - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_set_altitude_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target, uint32_t mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[5]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint32_t(buf, 1, mode); - - memcpy(_MAV_PAYLOAD(msg), buf, 5); -#else - mavlink_set_altitude_t packet; - packet.target = target; - packet.mode = mode; - - memcpy(_MAV_PAYLOAD(msg), &packet, 5); -#endif - - msg->msgid = MAVLINK_MSG_ID_SET_ALTITUDE; - return mavlink_finalize_message(msg, system_id, component_id, 5); -} - -/** - * @brief Pack a set_altitude message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target The system setting the altitude - * @param mode The new altitude in meters - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_set_altitude_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target,uint32_t mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[5]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint32_t(buf, 1, mode); - - memcpy(_MAV_PAYLOAD(msg), buf, 5); -#else - mavlink_set_altitude_t packet; - packet.target = target; - packet.mode = mode; - - memcpy(_MAV_PAYLOAD(msg), &packet, 5); -#endif - - msg->msgid = MAVLINK_MSG_ID_SET_ALTITUDE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 5); -} - -/** - * @brief Encode a set_altitude struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param set_altitude C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_set_altitude_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_altitude_t* set_altitude) -{ - return mavlink_msg_set_altitude_pack(system_id, component_id, msg, set_altitude->target, set_altitude->mode); -} - -/** - * @brief Send a set_altitude message - * @param chan MAVLink channel to send the message - * - * @param target The system setting the altitude - * @param mode The new altitude in meters - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_set_altitude_send(mavlink_channel_t chan, uint8_t target, uint32_t mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[5]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint32_t(buf, 1, mode); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ALTITUDE, buf, 5); -#else - mavlink_set_altitude_t packet; - packet.target = target; - packet.mode = mode; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ALTITUDE, (const char *)&packet, 5); -#endif -} - -#endif - -// MESSAGE SET_ALTITUDE UNPACKING - - -/** - * @brief Get field target from set_altitude message - * - * @return The system setting the altitude - */ -static inline uint8_t mavlink_msg_set_altitude_get_target(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field mode from set_altitude message - * - * @return The new altitude in meters - */ -static inline uint32_t mavlink_msg_set_altitude_get_mode(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint32_t(msg, 1); -} - -/** - * @brief Decode a set_altitude message into a struct - * - * @param msg The message to decode - * @param set_altitude C-struct to decode the message contents into - */ -static inline void mavlink_msg_set_altitude_decode(const mavlink_message_t* msg, mavlink_set_altitude_t* set_altitude) -{ -#if MAVLINK_NEED_BYTE_SWAP - set_altitude->target = mavlink_msg_set_altitude_get_target(msg); - set_altitude->mode = mavlink_msg_set_altitude_get_mode(msg); -#else - memcpy(set_altitude, _MAV_PAYLOAD(msg), 5); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_set_mode.h b/src/GCS_MAVLink/include/common/mavlink_msg_set_mode.h deleted file mode 100644 index 6630aea48..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_set_mode.h +++ /dev/null @@ -1,166 +0,0 @@ -// MESSAGE SET_MODE PACKING - -#define MAVLINK_MSG_ID_SET_MODE 11 - -typedef struct __mavlink_set_mode_t -{ - uint8_t target; ///< The system setting the mode - uint8_t mode; ///< The new mode -} mavlink_set_mode_t; - -#define MAVLINK_MSG_ID_SET_MODE_LEN 2 -#define MAVLINK_MSG_ID_11_LEN 2 - - - -#define MAVLINK_MESSAGE_INFO_SET_MODE { \ - "SET_MODE", \ - 2, \ - { { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_set_mode_t, target) }, \ - { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_set_mode_t, mode) }, \ - } \ -} - - -/** - * @brief Pack a set_mode message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target The system setting the mode - * @param mode The new mode - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_set_mode_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target, uint8_t mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint8_t(buf, 1, mode); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_set_mode_t packet; - packet.target = target; - packet.mode = mode; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_SET_MODE; - return mavlink_finalize_message(msg, system_id, component_id, 2); -} - -/** - * @brief Pack a set_mode message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target The system setting the mode - * @param mode The new mode - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_set_mode_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target,uint8_t mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint8_t(buf, 1, mode); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_set_mode_t packet; - packet.target = target; - packet.mode = mode; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_SET_MODE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2); -} - -/** - * @brief Encode a set_mode struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param set_mode C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_set_mode_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_mode_t* set_mode) -{ - return mavlink_msg_set_mode_pack(system_id, component_id, msg, set_mode->target, set_mode->mode); -} - -/** - * @brief Send a set_mode message - * @param chan MAVLink channel to send the message - * - * @param target The system setting the mode - * @param mode The new mode - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_set_mode_send(mavlink_channel_t chan, uint8_t target, uint8_t mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint8_t(buf, 1, mode); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, buf, 2); -#else - mavlink_set_mode_t packet; - packet.target = target; - packet.mode = mode; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, (const char *)&packet, 2); -#endif -} - -#endif - -// MESSAGE SET_MODE UNPACKING - - -/** - * @brief Get field target from set_mode message - * - * @return The system setting the mode - */ -static inline uint8_t mavlink_msg_set_mode_get_target(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field mode from set_mode message - * - * @return The new mode - */ -static inline uint8_t mavlink_msg_set_mode_get_mode(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Decode a set_mode message into a struct - * - * @param msg The message to decode - * @param set_mode C-struct to decode the message contents into - */ -static inline void mavlink_msg_set_mode_decode(const mavlink_message_t* msg, mavlink_set_mode_t* set_mode) -{ -#if MAVLINK_NEED_BYTE_SWAP - set_mode->target = mavlink_msg_set_mode_get_target(msg); - set_mode->mode = mavlink_msg_set_mode_get_mode(msg); -#else - memcpy(set_mode, _MAV_PAYLOAD(msg), 2); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_set_nav_mode.h b/src/GCS_MAVLink/include/common/mavlink_msg_set_nav_mode.h deleted file mode 100644 index fafb6ec7e..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_set_nav_mode.h +++ /dev/null @@ -1,166 +0,0 @@ -// MESSAGE SET_NAV_MODE PACKING - -#define MAVLINK_MSG_ID_SET_NAV_MODE 12 - -typedef struct __mavlink_set_nav_mode_t -{ - uint8_t target; ///< The system setting the mode - uint8_t nav_mode; ///< The new navigation mode -} mavlink_set_nav_mode_t; - -#define MAVLINK_MSG_ID_SET_NAV_MODE_LEN 2 -#define MAVLINK_MSG_ID_12_LEN 2 - - - -#define MAVLINK_MESSAGE_INFO_SET_NAV_MODE { \ - "SET_NAV_MODE", \ - 2, \ - { { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_set_nav_mode_t, target) }, \ - { "nav_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_set_nav_mode_t, nav_mode) }, \ - } \ -} - - -/** - * @brief Pack a set_nav_mode message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target The system setting the mode - * @param nav_mode The new navigation mode - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_set_nav_mode_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target, uint8_t nav_mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint8_t(buf, 1, nav_mode); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_set_nav_mode_t packet; - packet.target = target; - packet.nav_mode = nav_mode; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_SET_NAV_MODE; - return mavlink_finalize_message(msg, system_id, component_id, 2); -} - -/** - * @brief Pack a set_nav_mode message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target The system setting the mode - * @param nav_mode The new navigation mode - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_set_nav_mode_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target,uint8_t nav_mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint8_t(buf, 1, nav_mode); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_set_nav_mode_t packet; - packet.target = target; - packet.nav_mode = nav_mode; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_SET_NAV_MODE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2); -} - -/** - * @brief Encode a set_nav_mode struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param set_nav_mode C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_set_nav_mode_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_nav_mode_t* set_nav_mode) -{ - return mavlink_msg_set_nav_mode_pack(system_id, component_id, msg, set_nav_mode->target, set_nav_mode->nav_mode); -} - -/** - * @brief Send a set_nav_mode message - * @param chan MAVLink channel to send the message - * - * @param target The system setting the mode - * @param nav_mode The new navigation mode - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_set_nav_mode_send(mavlink_channel_t chan, uint8_t target, uint8_t nav_mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint8_t(buf, 1, nav_mode); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_NAV_MODE, buf, 2); -#else - mavlink_set_nav_mode_t packet; - packet.target = target; - packet.nav_mode = nav_mode; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_NAV_MODE, (const char *)&packet, 2); -#endif -} - -#endif - -// MESSAGE SET_NAV_MODE UNPACKING - - -/** - * @brief Get field target from set_nav_mode message - * - * @return The system setting the mode - */ -static inline uint8_t mavlink_msg_set_nav_mode_get_target(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field nav_mode from set_nav_mode message - * - * @return The new navigation mode - */ -static inline uint8_t mavlink_msg_set_nav_mode_get_nav_mode(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Decode a set_nav_mode message into a struct - * - * @param msg The message to decode - * @param set_nav_mode C-struct to decode the message contents into - */ -static inline void mavlink_msg_set_nav_mode_decode(const mavlink_message_t* msg, mavlink_set_nav_mode_t* set_nav_mode) -{ -#if MAVLINK_NEED_BYTE_SWAP - set_nav_mode->target = mavlink_msg_set_nav_mode_get_target(msg); - set_nav_mode->nav_mode = mavlink_msg_set_nav_mode_get_nav_mode(msg); -#else - memcpy(set_nav_mode, _MAV_PAYLOAD(msg), 2); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h b/src/GCS_MAVLink/include/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h deleted file mode 100644 index d666d0cca..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h +++ /dev/null @@ -1,254 +0,0 @@ -// MESSAGE SET_ROLL_PITCH_YAW_SPEED_THRUST PACKING - -#define MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST 56 - -typedef struct __mavlink_set_roll_pitch_yaw_speed_thrust_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - float roll_speed; ///< Desired roll angular speed in rad/s - float pitch_speed; ///< Desired pitch angular speed in rad/s - float yaw_speed; ///< Desired yaw angular speed in rad/s - float thrust; ///< Collective thrust, normalized to 0 .. 1 -} mavlink_set_roll_pitch_yaw_speed_thrust_t; - -#define MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN 18 -#define MAVLINK_MSG_ID_56_LEN 18 - - - -#define MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST { \ - "SET_ROLL_PITCH_YAW_SPEED_THRUST", \ - 6, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_set_roll_pitch_yaw_speed_thrust_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_set_roll_pitch_yaw_speed_thrust_t, target_component) }, \ - { "roll_speed", NULL, MAVLINK_TYPE_FLOAT, 0, 2, offsetof(mavlink_set_roll_pitch_yaw_speed_thrust_t, roll_speed) }, \ - { "pitch_speed", NULL, MAVLINK_TYPE_FLOAT, 0, 6, offsetof(mavlink_set_roll_pitch_yaw_speed_thrust_t, pitch_speed) }, \ - { "yaw_speed", NULL, MAVLINK_TYPE_FLOAT, 0, 10, offsetof(mavlink_set_roll_pitch_yaw_speed_thrust_t, yaw_speed) }, \ - { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 14, offsetof(mavlink_set_roll_pitch_yaw_speed_thrust_t, thrust) }, \ - } \ -} - - -/** - * @brief Pack a set_roll_pitch_yaw_speed_thrust message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param roll_speed Desired roll angular speed in rad/s - * @param pitch_speed Desired pitch angular speed in rad/s - * @param yaw_speed Desired yaw angular speed in rad/s - * @param thrust Collective thrust, normalized to 0 .. 1 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, float roll_speed, float pitch_speed, float yaw_speed, float thrust) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_float(buf, 2, roll_speed); - _mav_put_float(buf, 6, pitch_speed); - _mav_put_float(buf, 10, yaw_speed); - _mav_put_float(buf, 14, thrust); - - memcpy(_MAV_PAYLOAD(msg), buf, 18); -#else - mavlink_set_roll_pitch_yaw_speed_thrust_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.roll_speed = roll_speed; - packet.pitch_speed = pitch_speed; - packet.yaw_speed = yaw_speed; - packet.thrust = thrust; - - memcpy(_MAV_PAYLOAD(msg), &packet, 18); -#endif - - msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST; - return mavlink_finalize_message(msg, system_id, component_id, 18); -} - -/** - * @brief Pack a set_roll_pitch_yaw_speed_thrust message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param roll_speed Desired roll angular speed in rad/s - * @param pitch_speed Desired pitch angular speed in rad/s - * @param yaw_speed Desired yaw angular speed in rad/s - * @param thrust Collective thrust, normalized to 0 .. 1 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,float roll_speed,float pitch_speed,float yaw_speed,float thrust) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_float(buf, 2, roll_speed); - _mav_put_float(buf, 6, pitch_speed); - _mav_put_float(buf, 10, yaw_speed); - _mav_put_float(buf, 14, thrust); - - memcpy(_MAV_PAYLOAD(msg), buf, 18); -#else - mavlink_set_roll_pitch_yaw_speed_thrust_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.roll_speed = roll_speed; - packet.pitch_speed = pitch_speed; - packet.yaw_speed = yaw_speed; - packet.thrust = thrust; - - memcpy(_MAV_PAYLOAD(msg), &packet, 18); -#endif - - msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18); -} - -/** - * @brief Encode a set_roll_pitch_yaw_speed_thrust struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param set_roll_pitch_yaw_speed_thrust C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_roll_pitch_yaw_speed_thrust_t* set_roll_pitch_yaw_speed_thrust) -{ - return mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack(system_id, component_id, msg, set_roll_pitch_yaw_speed_thrust->target_system, set_roll_pitch_yaw_speed_thrust->target_component, set_roll_pitch_yaw_speed_thrust->roll_speed, set_roll_pitch_yaw_speed_thrust->pitch_speed, set_roll_pitch_yaw_speed_thrust->yaw_speed, set_roll_pitch_yaw_speed_thrust->thrust); -} - -/** - * @brief Send a set_roll_pitch_yaw_speed_thrust message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param roll_speed Desired roll angular speed in rad/s - * @param pitch_speed Desired pitch angular speed in rad/s - * @param yaw_speed Desired yaw angular speed in rad/s - * @param thrust Collective thrust, normalized to 0 .. 1 - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_set_roll_pitch_yaw_speed_thrust_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float roll_speed, float pitch_speed, float yaw_speed, float thrust) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_float(buf, 2, roll_speed); - _mav_put_float(buf, 6, pitch_speed); - _mav_put_float(buf, 10, yaw_speed); - _mav_put_float(buf, 14, thrust); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST, buf, 18); -#else - mavlink_set_roll_pitch_yaw_speed_thrust_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.roll_speed = roll_speed; - packet.pitch_speed = pitch_speed; - packet.yaw_speed = yaw_speed; - packet.thrust = thrust; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST, (const char *)&packet, 18); -#endif -} - -#endif - -// MESSAGE SET_ROLL_PITCH_YAW_SPEED_THRUST UNPACKING - - -/** - * @brief Get field target_system from set_roll_pitch_yaw_speed_thrust message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from set_roll_pitch_yaw_speed_thrust message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field roll_speed from set_roll_pitch_yaw_speed_thrust message - * - * @return Desired roll angular speed in rad/s - */ -static inline float mavlink_msg_set_roll_pitch_yaw_speed_thrust_get_roll_speed(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 2); -} - -/** - * @brief Get field pitch_speed from set_roll_pitch_yaw_speed_thrust message - * - * @return Desired pitch angular speed in rad/s - */ -static inline float mavlink_msg_set_roll_pitch_yaw_speed_thrust_get_pitch_speed(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 6); -} - -/** - * @brief Get field yaw_speed from set_roll_pitch_yaw_speed_thrust message - * - * @return Desired yaw angular speed in rad/s - */ -static inline float mavlink_msg_set_roll_pitch_yaw_speed_thrust_get_yaw_speed(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 10); -} - -/** - * @brief Get field thrust from set_roll_pitch_yaw_speed_thrust message - * - * @return Collective thrust, normalized to 0 .. 1 - */ -static inline float mavlink_msg_set_roll_pitch_yaw_speed_thrust_get_thrust(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 14); -} - -/** - * @brief Decode a set_roll_pitch_yaw_speed_thrust message into a struct - * - * @param msg The message to decode - * @param set_roll_pitch_yaw_speed_thrust C-struct to decode the message contents into - */ -static inline void mavlink_msg_set_roll_pitch_yaw_speed_thrust_decode(const mavlink_message_t* msg, mavlink_set_roll_pitch_yaw_speed_thrust_t* set_roll_pitch_yaw_speed_thrust) -{ -#if MAVLINK_NEED_BYTE_SWAP - set_roll_pitch_yaw_speed_thrust->target_system = mavlink_msg_set_roll_pitch_yaw_speed_thrust_get_target_system(msg); - set_roll_pitch_yaw_speed_thrust->target_component = mavlink_msg_set_roll_pitch_yaw_speed_thrust_get_target_component(msg); - set_roll_pitch_yaw_speed_thrust->roll_speed = mavlink_msg_set_roll_pitch_yaw_speed_thrust_get_roll_speed(msg); - set_roll_pitch_yaw_speed_thrust->pitch_speed = mavlink_msg_set_roll_pitch_yaw_speed_thrust_get_pitch_speed(msg); - set_roll_pitch_yaw_speed_thrust->yaw_speed = mavlink_msg_set_roll_pitch_yaw_speed_thrust_get_yaw_speed(msg); - set_roll_pitch_yaw_speed_thrust->thrust = mavlink_msg_set_roll_pitch_yaw_speed_thrust_get_thrust(msg); -#else - memcpy(set_roll_pitch_yaw_speed_thrust, _MAV_PAYLOAD(msg), 18); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_set_roll_pitch_yaw_thrust.h b/src/GCS_MAVLink/include/common/mavlink_msg_set_roll_pitch_yaw_thrust.h deleted file mode 100644 index ad9425158..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_set_roll_pitch_yaw_thrust.h +++ /dev/null @@ -1,254 +0,0 @@ -// MESSAGE SET_ROLL_PITCH_YAW_THRUST PACKING - -#define MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST 55 - -typedef struct __mavlink_set_roll_pitch_yaw_thrust_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - float roll; ///< Desired roll angle in radians - float pitch; ///< Desired pitch angle in radians - float yaw; ///< Desired yaw angle in radians - float thrust; ///< Collective thrust, normalized to 0 .. 1 -} mavlink_set_roll_pitch_yaw_thrust_t; - -#define MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN 18 -#define MAVLINK_MSG_ID_55_LEN 18 - - - -#define MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST { \ - "SET_ROLL_PITCH_YAW_THRUST", \ - 6, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_set_roll_pitch_yaw_thrust_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_set_roll_pitch_yaw_thrust_t, target_component) }, \ - { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 2, offsetof(mavlink_set_roll_pitch_yaw_thrust_t, roll) }, \ - { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 6, offsetof(mavlink_set_roll_pitch_yaw_thrust_t, pitch) }, \ - { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 10, offsetof(mavlink_set_roll_pitch_yaw_thrust_t, yaw) }, \ - { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 14, offsetof(mavlink_set_roll_pitch_yaw_thrust_t, thrust) }, \ - } \ -} - - -/** - * @brief Pack a set_roll_pitch_yaw_thrust message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param roll Desired roll angle in radians - * @param pitch Desired pitch angle in radians - * @param yaw Desired yaw angle in radians - * @param thrust Collective thrust, normalized to 0 .. 1 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, float roll, float pitch, float yaw, float thrust) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_float(buf, 2, roll); - _mav_put_float(buf, 6, pitch); - _mav_put_float(buf, 10, yaw); - _mav_put_float(buf, 14, thrust); - - memcpy(_MAV_PAYLOAD(msg), buf, 18); -#else - mavlink_set_roll_pitch_yaw_thrust_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.thrust = thrust; - - memcpy(_MAV_PAYLOAD(msg), &packet, 18); -#endif - - msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST; - return mavlink_finalize_message(msg, system_id, component_id, 18); -} - -/** - * @brief Pack a set_roll_pitch_yaw_thrust message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param roll Desired roll angle in radians - * @param pitch Desired pitch angle in radians - * @param yaw Desired yaw angle in radians - * @param thrust Collective thrust, normalized to 0 .. 1 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,float roll,float pitch,float yaw,float thrust) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_float(buf, 2, roll); - _mav_put_float(buf, 6, pitch); - _mav_put_float(buf, 10, yaw); - _mav_put_float(buf, 14, thrust); - - memcpy(_MAV_PAYLOAD(msg), buf, 18); -#else - mavlink_set_roll_pitch_yaw_thrust_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.thrust = thrust; - - memcpy(_MAV_PAYLOAD(msg), &packet, 18); -#endif - - msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18); -} - -/** - * @brief Encode a set_roll_pitch_yaw_thrust struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param set_roll_pitch_yaw_thrust C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_roll_pitch_yaw_thrust_t* set_roll_pitch_yaw_thrust) -{ - return mavlink_msg_set_roll_pitch_yaw_thrust_pack(system_id, component_id, msg, set_roll_pitch_yaw_thrust->target_system, set_roll_pitch_yaw_thrust->target_component, set_roll_pitch_yaw_thrust->roll, set_roll_pitch_yaw_thrust->pitch, set_roll_pitch_yaw_thrust->yaw, set_roll_pitch_yaw_thrust->thrust); -} - -/** - * @brief Send a set_roll_pitch_yaw_thrust message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param roll Desired roll angle in radians - * @param pitch Desired pitch angle in radians - * @param yaw Desired yaw angle in radians - * @param thrust Collective thrust, normalized to 0 .. 1 - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_set_roll_pitch_yaw_thrust_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float roll, float pitch, float yaw, float thrust) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_float(buf, 2, roll); - _mav_put_float(buf, 6, pitch); - _mav_put_float(buf, 10, yaw); - _mav_put_float(buf, 14, thrust); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST, buf, 18); -#else - mavlink_set_roll_pitch_yaw_thrust_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.thrust = thrust; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST, (const char *)&packet, 18); -#endif -} - -#endif - -// MESSAGE SET_ROLL_PITCH_YAW_THRUST UNPACKING - - -/** - * @brief Get field target_system from set_roll_pitch_yaw_thrust message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_set_roll_pitch_yaw_thrust_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from set_roll_pitch_yaw_thrust message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_set_roll_pitch_yaw_thrust_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field roll from set_roll_pitch_yaw_thrust message - * - * @return Desired roll angle in radians - */ -static inline float mavlink_msg_set_roll_pitch_yaw_thrust_get_roll(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 2); -} - -/** - * @brief Get field pitch from set_roll_pitch_yaw_thrust message - * - * @return Desired pitch angle in radians - */ -static inline float mavlink_msg_set_roll_pitch_yaw_thrust_get_pitch(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 6); -} - -/** - * @brief Get field yaw from set_roll_pitch_yaw_thrust message - * - * @return Desired yaw angle in radians - */ -static inline float mavlink_msg_set_roll_pitch_yaw_thrust_get_yaw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 10); -} - -/** - * @brief Get field thrust from set_roll_pitch_yaw_thrust message - * - * @return Collective thrust, normalized to 0 .. 1 - */ -static inline float mavlink_msg_set_roll_pitch_yaw_thrust_get_thrust(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 14); -} - -/** - * @brief Decode a set_roll_pitch_yaw_thrust message into a struct - * - * @param msg The message to decode - * @param set_roll_pitch_yaw_thrust C-struct to decode the message contents into - */ -static inline void mavlink_msg_set_roll_pitch_yaw_thrust_decode(const mavlink_message_t* msg, mavlink_set_roll_pitch_yaw_thrust_t* set_roll_pitch_yaw_thrust) -{ -#if MAVLINK_NEED_BYTE_SWAP - set_roll_pitch_yaw_thrust->target_system = mavlink_msg_set_roll_pitch_yaw_thrust_get_target_system(msg); - set_roll_pitch_yaw_thrust->target_component = mavlink_msg_set_roll_pitch_yaw_thrust_get_target_component(msg); - set_roll_pitch_yaw_thrust->roll = mavlink_msg_set_roll_pitch_yaw_thrust_get_roll(msg); - set_roll_pitch_yaw_thrust->pitch = mavlink_msg_set_roll_pitch_yaw_thrust_get_pitch(msg); - set_roll_pitch_yaw_thrust->yaw = mavlink_msg_set_roll_pitch_yaw_thrust_get_yaw(msg); - set_roll_pitch_yaw_thrust->thrust = mavlink_msg_set_roll_pitch_yaw_thrust_get_thrust(msg); -#else - memcpy(set_roll_pitch_yaw_thrust, _MAV_PAYLOAD(msg), 18); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_state_correction.h b/src/GCS_MAVLink/include/common/mavlink_msg_state_correction.h deleted file mode 100644 index 9c9f6d9b8..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_state_correction.h +++ /dev/null @@ -1,320 +0,0 @@ -// MESSAGE STATE_CORRECTION PACKING - -#define MAVLINK_MSG_ID_STATE_CORRECTION 64 - -typedef struct __mavlink_state_correction_t -{ - float xErr; ///< x position error - float yErr; ///< y position error - float zErr; ///< z position error - float rollErr; ///< roll error (radians) - float pitchErr; ///< pitch error (radians) - float yawErr; ///< yaw error (radians) - float vxErr; ///< x velocity - float vyErr; ///< y velocity - float vzErr; ///< z velocity -} mavlink_state_correction_t; - -#define MAVLINK_MSG_ID_STATE_CORRECTION_LEN 36 -#define MAVLINK_MSG_ID_64_LEN 36 - - - -#define MAVLINK_MESSAGE_INFO_STATE_CORRECTION { \ - "STATE_CORRECTION", \ - 9, \ - { { "xErr", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_state_correction_t, xErr) }, \ - { "yErr", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_state_correction_t, yErr) }, \ - { "zErr", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_state_correction_t, zErr) }, \ - { "rollErr", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_state_correction_t, rollErr) }, \ - { "pitchErr", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_state_correction_t, pitchErr) }, \ - { "yawErr", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_state_correction_t, yawErr) }, \ - { "vxErr", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_state_correction_t, vxErr) }, \ - { "vyErr", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_state_correction_t, vyErr) }, \ - { "vzErr", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_state_correction_t, vzErr) }, \ - } \ -} - - -/** - * @brief Pack a state_correction message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param xErr x position error - * @param yErr y position error - * @param zErr z position error - * @param rollErr roll error (radians) - * @param pitchErr pitch error (radians) - * @param yawErr yaw error (radians) - * @param vxErr x velocity - * @param vyErr y velocity - * @param vzErr z velocity - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_state_correction_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - float xErr, float yErr, float zErr, float rollErr, float pitchErr, float yawErr, float vxErr, float vyErr, float vzErr) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; - _mav_put_float(buf, 0, xErr); - _mav_put_float(buf, 4, yErr); - _mav_put_float(buf, 8, zErr); - _mav_put_float(buf, 12, rollErr); - _mav_put_float(buf, 16, pitchErr); - _mav_put_float(buf, 20, yawErr); - _mav_put_float(buf, 24, vxErr); - _mav_put_float(buf, 28, vyErr); - _mav_put_float(buf, 32, vzErr); - - memcpy(_MAV_PAYLOAD(msg), buf, 36); -#else - mavlink_state_correction_t packet; - packet.xErr = xErr; - packet.yErr = yErr; - packet.zErr = zErr; - packet.rollErr = rollErr; - packet.pitchErr = pitchErr; - packet.yawErr = yawErr; - packet.vxErr = vxErr; - packet.vyErr = vyErr; - packet.vzErr = vzErr; - - memcpy(_MAV_PAYLOAD(msg), &packet, 36); -#endif - - msg->msgid = MAVLINK_MSG_ID_STATE_CORRECTION; - return mavlink_finalize_message(msg, system_id, component_id, 36); -} - -/** - * @brief Pack a state_correction message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param xErr x position error - * @param yErr y position error - * @param zErr z position error - * @param rollErr roll error (radians) - * @param pitchErr pitch error (radians) - * @param yawErr yaw error (radians) - * @param vxErr x velocity - * @param vyErr y velocity - * @param vzErr z velocity - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_state_correction_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - float xErr,float yErr,float zErr,float rollErr,float pitchErr,float yawErr,float vxErr,float vyErr,float vzErr) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; - _mav_put_float(buf, 0, xErr); - _mav_put_float(buf, 4, yErr); - _mav_put_float(buf, 8, zErr); - _mav_put_float(buf, 12, rollErr); - _mav_put_float(buf, 16, pitchErr); - _mav_put_float(buf, 20, yawErr); - _mav_put_float(buf, 24, vxErr); - _mav_put_float(buf, 28, vyErr); - _mav_put_float(buf, 32, vzErr); - - memcpy(_MAV_PAYLOAD(msg), buf, 36); -#else - mavlink_state_correction_t packet; - packet.xErr = xErr; - packet.yErr = yErr; - packet.zErr = zErr; - packet.rollErr = rollErr; - packet.pitchErr = pitchErr; - packet.yawErr = yawErr; - packet.vxErr = vxErr; - packet.vyErr = vyErr; - packet.vzErr = vzErr; - - memcpy(_MAV_PAYLOAD(msg), &packet, 36); -#endif - - msg->msgid = MAVLINK_MSG_ID_STATE_CORRECTION; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 36); -} - -/** - * @brief Encode a state_correction struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param state_correction C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_state_correction_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_state_correction_t* state_correction) -{ - return mavlink_msg_state_correction_pack(system_id, component_id, msg, state_correction->xErr, state_correction->yErr, state_correction->zErr, state_correction->rollErr, state_correction->pitchErr, state_correction->yawErr, state_correction->vxErr, state_correction->vyErr, state_correction->vzErr); -} - -/** - * @brief Send a state_correction message - * @param chan MAVLink channel to send the message - * - * @param xErr x position error - * @param yErr y position error - * @param zErr z position error - * @param rollErr roll error (radians) - * @param pitchErr pitch error (radians) - * @param yawErr yaw error (radians) - * @param vxErr x velocity - * @param vyErr y velocity - * @param vzErr z velocity - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_state_correction_send(mavlink_channel_t chan, float xErr, float yErr, float zErr, float rollErr, float pitchErr, float yawErr, float vxErr, float vyErr, float vzErr) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; - _mav_put_float(buf, 0, xErr); - _mav_put_float(buf, 4, yErr); - _mav_put_float(buf, 8, zErr); - _mav_put_float(buf, 12, rollErr); - _mav_put_float(buf, 16, pitchErr); - _mav_put_float(buf, 20, yawErr); - _mav_put_float(buf, 24, vxErr); - _mav_put_float(buf, 28, vyErr); - _mav_put_float(buf, 32, vzErr); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATE_CORRECTION, buf, 36); -#else - mavlink_state_correction_t packet; - packet.xErr = xErr; - packet.yErr = yErr; - packet.zErr = zErr; - packet.rollErr = rollErr; - packet.pitchErr = pitchErr; - packet.yawErr = yawErr; - packet.vxErr = vxErr; - packet.vyErr = vyErr; - packet.vzErr = vzErr; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATE_CORRECTION, (const char *)&packet, 36); -#endif -} - -#endif - -// MESSAGE STATE_CORRECTION UNPACKING - - -/** - * @brief Get field xErr from state_correction message - * - * @return x position error - */ -static inline float mavlink_msg_state_correction_get_xErr(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 0); -} - -/** - * @brief Get field yErr from state_correction message - * - * @return y position error - */ -static inline float mavlink_msg_state_correction_get_yErr(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Get field zErr from state_correction message - * - * @return z position error - */ -static inline float mavlink_msg_state_correction_get_zErr(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field rollErr from state_correction message - * - * @return roll error (radians) - */ -static inline float mavlink_msg_state_correction_get_rollErr(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field pitchErr from state_correction message - * - * @return pitch error (radians) - */ -static inline float mavlink_msg_state_correction_get_pitchErr(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 16); -} - -/** - * @brief Get field yawErr from state_correction message - * - * @return yaw error (radians) - */ -static inline float mavlink_msg_state_correction_get_yawErr(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 20); -} - -/** - * @brief Get field vxErr from state_correction message - * - * @return x velocity - */ -static inline float mavlink_msg_state_correction_get_vxErr(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 24); -} - -/** - * @brief Get field vyErr from state_correction message - * - * @return y velocity - */ -static inline float mavlink_msg_state_correction_get_vyErr(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 28); -} - -/** - * @brief Get field vzErr from state_correction message - * - * @return z velocity - */ -static inline float mavlink_msg_state_correction_get_vzErr(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 32); -} - -/** - * @brief Decode a state_correction message into a struct - * - * @param msg The message to decode - * @param state_correction C-struct to decode the message contents into - */ -static inline void mavlink_msg_state_correction_decode(const mavlink_message_t* msg, mavlink_state_correction_t* state_correction) -{ -#if MAVLINK_NEED_BYTE_SWAP - state_correction->xErr = mavlink_msg_state_correction_get_xErr(msg); - state_correction->yErr = mavlink_msg_state_correction_get_yErr(msg); - state_correction->zErr = mavlink_msg_state_correction_get_zErr(msg); - state_correction->rollErr = mavlink_msg_state_correction_get_rollErr(msg); - state_correction->pitchErr = mavlink_msg_state_correction_get_pitchErr(msg); - state_correction->yawErr = mavlink_msg_state_correction_get_yawErr(msg); - state_correction->vxErr = mavlink_msg_state_correction_get_vxErr(msg); - state_correction->vyErr = mavlink_msg_state_correction_get_vyErr(msg); - state_correction->vzErr = mavlink_msg_state_correction_get_vzErr(msg); -#else - memcpy(state_correction, _MAV_PAYLOAD(msg), 36); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_statustext.h b/src/GCS_MAVLink/include/common/mavlink_msg_statustext.h deleted file mode 100644 index da6cd7a18..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_statustext.h +++ /dev/null @@ -1,160 +0,0 @@ -// MESSAGE STATUSTEXT PACKING - -#define MAVLINK_MSG_ID_STATUSTEXT 254 - -typedef struct __mavlink_statustext_t -{ - uint8_t severity; ///< Severity of status, 0 = info message, 255 = critical fault - int8_t text[50]; ///< Status text message, without null termination character -} mavlink_statustext_t; - -#define MAVLINK_MSG_ID_STATUSTEXT_LEN 51 -#define MAVLINK_MSG_ID_254_LEN 51 - -#define MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN 50 - -#define MAVLINK_MESSAGE_INFO_STATUSTEXT { \ - "STATUSTEXT", \ - 2, \ - { { "severity", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_statustext_t, severity) }, \ - { "text", NULL, MAVLINK_TYPE_INT8_T, 50, 1, offsetof(mavlink_statustext_t, text) }, \ - } \ -} - - -/** - * @brief Pack a statustext message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param severity Severity of status, 0 = info message, 255 = critical fault - * @param text Status text message, without null termination character - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_statustext_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t severity, const int8_t *text) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[51]; - _mav_put_uint8_t(buf, 0, severity); - _mav_put_int8_t_array(buf, 1, text, 50); - memcpy(_MAV_PAYLOAD(msg), buf, 51); -#else - mavlink_statustext_t packet; - packet.severity = severity; - mav_array_memcpy(packet.text, text, sizeof(int8_t)*50); - memcpy(_MAV_PAYLOAD(msg), &packet, 51); -#endif - - msg->msgid = MAVLINK_MSG_ID_STATUSTEXT; - return mavlink_finalize_message(msg, system_id, component_id, 51); -} - -/** - * @brief Pack a statustext message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param severity Severity of status, 0 = info message, 255 = critical fault - * @param text Status text message, without null termination character - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_statustext_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t severity,const int8_t *text) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[51]; - _mav_put_uint8_t(buf, 0, severity); - _mav_put_int8_t_array(buf, 1, text, 50); - memcpy(_MAV_PAYLOAD(msg), buf, 51); -#else - mavlink_statustext_t packet; - packet.severity = severity; - mav_array_memcpy(packet.text, text, sizeof(int8_t)*50); - memcpy(_MAV_PAYLOAD(msg), &packet, 51); -#endif - - msg->msgid = MAVLINK_MSG_ID_STATUSTEXT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 51); -} - -/** - * @brief Encode a statustext struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param statustext C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_statustext_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_statustext_t* statustext) -{ - return mavlink_msg_statustext_pack(system_id, component_id, msg, statustext->severity, statustext->text); -} - -/** - * @brief Send a statustext message - * @param chan MAVLink channel to send the message - * - * @param severity Severity of status, 0 = info message, 255 = critical fault - * @param text Status text message, without null termination character - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_statustext_send(mavlink_channel_t chan, uint8_t severity, const int8_t *text) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[51]; - _mav_put_uint8_t(buf, 0, severity); - _mav_put_int8_t_array(buf, 1, text, 50); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, buf, 51); -#else - mavlink_statustext_t packet; - packet.severity = severity; - mav_array_memcpy(packet.text, text, sizeof(int8_t)*50); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (const char *)&packet, 51); -#endif -} - -#endif - -// MESSAGE STATUSTEXT UNPACKING - - -/** - * @brief Get field severity from statustext message - * - * @return Severity of status, 0 = info message, 255 = critical fault - */ -static inline uint8_t mavlink_msg_statustext_get_severity(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field text from statustext message - * - * @return Status text message, without null termination character - */ -static inline uint16_t mavlink_msg_statustext_get_text(const mavlink_message_t* msg, int8_t *text) -{ - return _MAV_RETURN_int8_t_array(msg, text, 50, 1); -} - -/** - * @brief Decode a statustext message into a struct - * - * @param msg The message to decode - * @param statustext C-struct to decode the message contents into - */ -static inline void mavlink_msg_statustext_decode(const mavlink_message_t* msg, mavlink_statustext_t* statustext) -{ -#if MAVLINK_NEED_BYTE_SWAP - statustext->severity = mavlink_msg_statustext_get_severity(msg); - mavlink_msg_statustext_get_text(msg, statustext->text); -#else - memcpy(statustext, _MAV_PAYLOAD(msg), 51); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_sys_status.h b/src/GCS_MAVLink/include/common/mavlink_msg_sys_status.h deleted file mode 100644 index 9add0d069..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_sys_status.h +++ /dev/null @@ -1,276 +0,0 @@ -// MESSAGE SYS_STATUS PACKING - -#define MAVLINK_MSG_ID_SYS_STATUS 34 - -typedef struct __mavlink_sys_status_t -{ - uint8_t mode; ///< System mode, see MAV_MODE ENUM in mavlink/include/mavlink_types.h - uint8_t nav_mode; ///< Navigation mode, see MAV_NAV_MODE ENUM - uint8_t status; ///< System status flag, see MAV_STATUS ENUM - uint16_t load; ///< Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 - uint16_t vbat; ///< Battery voltage, in millivolts (1 = 1 millivolt) - uint16_t battery_remaining; ///< Remaining battery energy: (0%: 0, 100%: 1000) - uint16_t packet_drop; ///< Dropped packets (packets that were corrupted on reception on the MAV) -} mavlink_sys_status_t; - -#define MAVLINK_MSG_ID_SYS_STATUS_LEN 11 -#define MAVLINK_MSG_ID_34_LEN 11 - - - -#define MAVLINK_MESSAGE_INFO_SYS_STATUS { \ - "SYS_STATUS", \ - 7, \ - { { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_sys_status_t, mode) }, \ - { "nav_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_sys_status_t, nav_mode) }, \ - { "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_sys_status_t, status) }, \ - { "load", NULL, MAVLINK_TYPE_UINT16_T, 0, 3, offsetof(mavlink_sys_status_t, load) }, \ - { "vbat", NULL, MAVLINK_TYPE_UINT16_T, 0, 5, offsetof(mavlink_sys_status_t, vbat) }, \ - { "battery_remaining", NULL, MAVLINK_TYPE_UINT16_T, 0, 7, offsetof(mavlink_sys_status_t, battery_remaining) }, \ - { "packet_drop", NULL, MAVLINK_TYPE_UINT16_T, 0, 9, offsetof(mavlink_sys_status_t, packet_drop) }, \ - } \ -} - - -/** - * @brief Pack a sys_status message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param mode System mode, see MAV_MODE ENUM in mavlink/include/mavlink_types.h - * @param nav_mode Navigation mode, see MAV_NAV_MODE ENUM - * @param status System status flag, see MAV_STATUS ENUM - * @param load Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 - * @param vbat Battery voltage, in millivolts (1 = 1 millivolt) - * @param battery_remaining Remaining battery energy: (0%: 0, 100%: 1000) - * @param packet_drop Dropped packets (packets that were corrupted on reception on the MAV) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_sys_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t mode, uint8_t nav_mode, uint8_t status, uint16_t load, uint16_t vbat, uint16_t battery_remaining, uint16_t packet_drop) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[11]; - _mav_put_uint8_t(buf, 0, mode); - _mav_put_uint8_t(buf, 1, nav_mode); - _mav_put_uint8_t(buf, 2, status); - _mav_put_uint16_t(buf, 3, load); - _mav_put_uint16_t(buf, 5, vbat); - _mav_put_uint16_t(buf, 7, battery_remaining); - _mav_put_uint16_t(buf, 9, packet_drop); - - memcpy(_MAV_PAYLOAD(msg), buf, 11); -#else - mavlink_sys_status_t packet; - packet.mode = mode; - packet.nav_mode = nav_mode; - packet.status = status; - packet.load = load; - packet.vbat = vbat; - packet.battery_remaining = battery_remaining; - packet.packet_drop = packet_drop; - - memcpy(_MAV_PAYLOAD(msg), &packet, 11); -#endif - - msg->msgid = MAVLINK_MSG_ID_SYS_STATUS; - return mavlink_finalize_message(msg, system_id, component_id, 11); -} - -/** - * @brief Pack a sys_status message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param mode System mode, see MAV_MODE ENUM in mavlink/include/mavlink_types.h - * @param nav_mode Navigation mode, see MAV_NAV_MODE ENUM - * @param status System status flag, see MAV_STATUS ENUM - * @param load Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 - * @param vbat Battery voltage, in millivolts (1 = 1 millivolt) - * @param battery_remaining Remaining battery energy: (0%: 0, 100%: 1000) - * @param packet_drop Dropped packets (packets that were corrupted on reception on the MAV) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_sys_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t mode,uint8_t nav_mode,uint8_t status,uint16_t load,uint16_t vbat,uint16_t battery_remaining,uint16_t packet_drop) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[11]; - _mav_put_uint8_t(buf, 0, mode); - _mav_put_uint8_t(buf, 1, nav_mode); - _mav_put_uint8_t(buf, 2, status); - _mav_put_uint16_t(buf, 3, load); - _mav_put_uint16_t(buf, 5, vbat); - _mav_put_uint16_t(buf, 7, battery_remaining); - _mav_put_uint16_t(buf, 9, packet_drop); - - memcpy(_MAV_PAYLOAD(msg), buf, 11); -#else - mavlink_sys_status_t packet; - packet.mode = mode; - packet.nav_mode = nav_mode; - packet.status = status; - packet.load = load; - packet.vbat = vbat; - packet.battery_remaining = battery_remaining; - packet.packet_drop = packet_drop; - - memcpy(_MAV_PAYLOAD(msg), &packet, 11); -#endif - - msg->msgid = MAVLINK_MSG_ID_SYS_STATUS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 11); -} - -/** - * @brief Encode a sys_status struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param sys_status C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_sys_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_sys_status_t* sys_status) -{ - return mavlink_msg_sys_status_pack(system_id, component_id, msg, sys_status->mode, sys_status->nav_mode, sys_status->status, sys_status->load, sys_status->vbat, sys_status->battery_remaining, sys_status->packet_drop); -} - -/** - * @brief Send a sys_status message - * @param chan MAVLink channel to send the message - * - * @param mode System mode, see MAV_MODE ENUM in mavlink/include/mavlink_types.h - * @param nav_mode Navigation mode, see MAV_NAV_MODE ENUM - * @param status System status flag, see MAV_STATUS ENUM - * @param load Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 - * @param vbat Battery voltage, in millivolts (1 = 1 millivolt) - * @param battery_remaining Remaining battery energy: (0%: 0, 100%: 1000) - * @param packet_drop Dropped packets (packets that were corrupted on reception on the MAV) - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_sys_status_send(mavlink_channel_t chan, uint8_t mode, uint8_t nav_mode, uint8_t status, uint16_t load, uint16_t vbat, uint16_t battery_remaining, uint16_t packet_drop) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[11]; - _mav_put_uint8_t(buf, 0, mode); - _mav_put_uint8_t(buf, 1, nav_mode); - _mav_put_uint8_t(buf, 2, status); - _mav_put_uint16_t(buf, 3, load); - _mav_put_uint16_t(buf, 5, vbat); - _mav_put_uint16_t(buf, 7, battery_remaining); - _mav_put_uint16_t(buf, 9, packet_drop); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, buf, 11); -#else - mavlink_sys_status_t packet; - packet.mode = mode; - packet.nav_mode = nav_mode; - packet.status = status; - packet.load = load; - packet.vbat = vbat; - packet.battery_remaining = battery_remaining; - packet.packet_drop = packet_drop; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, (const char *)&packet, 11); -#endif -} - -#endif - -// MESSAGE SYS_STATUS UNPACKING - - -/** - * @brief Get field mode from sys_status message - * - * @return System mode, see MAV_MODE ENUM in mavlink/include/mavlink_types.h - */ -static inline uint8_t mavlink_msg_sys_status_get_mode(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field nav_mode from sys_status message - * - * @return Navigation mode, see MAV_NAV_MODE ENUM - */ -static inline uint8_t mavlink_msg_sys_status_get_nav_mode(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field status from sys_status message - * - * @return System status flag, see MAV_STATUS ENUM - */ -static inline uint8_t mavlink_msg_sys_status_get_status(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Get field load from sys_status message - * - * @return Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 - */ -static inline uint16_t mavlink_msg_sys_status_get_load(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 3); -} - -/** - * @brief Get field vbat from sys_status message - * - * @return Battery voltage, in millivolts (1 = 1 millivolt) - */ -static inline uint16_t mavlink_msg_sys_status_get_vbat(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 5); -} - -/** - * @brief Get field battery_remaining from sys_status message - * - * @return Remaining battery energy: (0%: 0, 100%: 1000) - */ -static inline uint16_t mavlink_msg_sys_status_get_battery_remaining(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 7); -} - -/** - * @brief Get field packet_drop from sys_status message - * - * @return Dropped packets (packets that were corrupted on reception on the MAV) - */ -static inline uint16_t mavlink_msg_sys_status_get_packet_drop(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 9); -} - -/** - * @brief Decode a sys_status message into a struct - * - * @param msg The message to decode - * @param sys_status C-struct to decode the message contents into - */ -static inline void mavlink_msg_sys_status_decode(const mavlink_message_t* msg, mavlink_sys_status_t* sys_status) -{ -#if MAVLINK_NEED_BYTE_SWAP - sys_status->mode = mavlink_msg_sys_status_get_mode(msg); - sys_status->nav_mode = mavlink_msg_sys_status_get_nav_mode(msg); - sys_status->status = mavlink_msg_sys_status_get_status(msg); - sys_status->load = mavlink_msg_sys_status_get_load(msg); - sys_status->vbat = mavlink_msg_sys_status_get_vbat(msg); - sys_status->battery_remaining = mavlink_msg_sys_status_get_battery_remaining(msg); - sys_status->packet_drop = mavlink_msg_sys_status_get_packet_drop(msg); -#else - memcpy(sys_status, _MAV_PAYLOAD(msg), 11); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_system_time.h b/src/GCS_MAVLink/include/common/mavlink_msg_system_time.h deleted file mode 100644 index cf2b1f6fe..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_system_time.h +++ /dev/null @@ -1,144 +0,0 @@ -// MESSAGE SYSTEM_TIME PACKING - -#define MAVLINK_MSG_ID_SYSTEM_TIME 2 - -typedef struct __mavlink_system_time_t -{ - uint64_t time_usec; ///< Timestamp of the master clock in microseconds since UNIX epoch. -} mavlink_system_time_t; - -#define MAVLINK_MSG_ID_SYSTEM_TIME_LEN 8 -#define MAVLINK_MSG_ID_2_LEN 8 - - - -#define MAVLINK_MESSAGE_INFO_SYSTEM_TIME { \ - "SYSTEM_TIME", \ - 1, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_system_time_t, time_usec) }, \ - } \ -} - - -/** - * @brief Pack a system_time message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param time_usec Timestamp of the master clock in microseconds since UNIX epoch. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_system_time_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint64_t(buf, 0, time_usec); - - memcpy(_MAV_PAYLOAD(msg), buf, 8); -#else - mavlink_system_time_t packet; - packet.time_usec = time_usec; - - memcpy(_MAV_PAYLOAD(msg), &packet, 8); -#endif - - msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME; - return mavlink_finalize_message(msg, system_id, component_id, 8); -} - -/** - * @brief Pack a system_time message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp of the master clock in microseconds since UNIX epoch. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_system_time_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint64_t(buf, 0, time_usec); - - memcpy(_MAV_PAYLOAD(msg), buf, 8); -#else - mavlink_system_time_t packet; - packet.time_usec = time_usec; - - memcpy(_MAV_PAYLOAD(msg), &packet, 8); -#endif - - msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8); -} - -/** - * @brief Encode a system_time struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param system_time C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_system_time_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_system_time_t* system_time) -{ - return mavlink_msg_system_time_pack(system_id, component_id, msg, system_time->time_usec); -} - -/** - * @brief Send a system_time message - * @param chan MAVLink channel to send the message - * - * @param time_usec Timestamp of the master clock in microseconds since UNIX epoch. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_system_time_send(mavlink_channel_t chan, uint64_t time_usec) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint64_t(buf, 0, time_usec); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, buf, 8); -#else - mavlink_system_time_t packet; - packet.time_usec = time_usec; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (const char *)&packet, 8); -#endif -} - -#endif - -// MESSAGE SYSTEM_TIME UNPACKING - - -/** - * @brief Get field time_usec from system_time message - * - * @return Timestamp of the master clock in microseconds since UNIX epoch. - */ -static inline uint64_t mavlink_msg_system_time_get_time_usec(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Decode a system_time message into a struct - * - * @param msg The message to decode - * @param system_time C-struct to decode the message contents into - */ -static inline void mavlink_msg_system_time_decode(const mavlink_message_t* msg, mavlink_system_time_t* system_time) -{ -#if MAVLINK_NEED_BYTE_SWAP - system_time->time_usec = mavlink_msg_system_time_get_time_usec(msg); -#else - memcpy(system_time, _MAV_PAYLOAD(msg), 8); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_system_time_utc.h b/src/GCS_MAVLink/include/common/mavlink_msg_system_time_utc.h deleted file mode 100644 index 70ebf5638..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_system_time_utc.h +++ /dev/null @@ -1,166 +0,0 @@ -// MESSAGE SYSTEM_TIME_UTC PACKING - -#define MAVLINK_MSG_ID_SYSTEM_TIME_UTC 4 - -typedef struct __mavlink_system_time_utc_t -{ - uint32_t utc_date; ///< GPS UTC date ddmmyy - uint32_t utc_time; ///< GPS UTC time hhmmss -} mavlink_system_time_utc_t; - -#define MAVLINK_MSG_ID_SYSTEM_TIME_UTC_LEN 8 -#define MAVLINK_MSG_ID_4_LEN 8 - - - -#define MAVLINK_MESSAGE_INFO_SYSTEM_TIME_UTC { \ - "SYSTEM_TIME_UTC", \ - 2, \ - { { "utc_date", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_system_time_utc_t, utc_date) }, \ - { "utc_time", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_system_time_utc_t, utc_time) }, \ - } \ -} - - -/** - * @brief Pack a system_time_utc message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param utc_date GPS UTC date ddmmyy - * @param utc_time GPS UTC time hhmmss - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_system_time_utc_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t utc_date, uint32_t utc_time) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint32_t(buf, 0, utc_date); - _mav_put_uint32_t(buf, 4, utc_time); - - memcpy(_MAV_PAYLOAD(msg), buf, 8); -#else - mavlink_system_time_utc_t packet; - packet.utc_date = utc_date; - packet.utc_time = utc_time; - - memcpy(_MAV_PAYLOAD(msg), &packet, 8); -#endif - - msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME_UTC; - return mavlink_finalize_message(msg, system_id, component_id, 8); -} - -/** - * @brief Pack a system_time_utc message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param utc_date GPS UTC date ddmmyy - * @param utc_time GPS UTC time hhmmss - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_system_time_utc_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t utc_date,uint32_t utc_time) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint32_t(buf, 0, utc_date); - _mav_put_uint32_t(buf, 4, utc_time); - - memcpy(_MAV_PAYLOAD(msg), buf, 8); -#else - mavlink_system_time_utc_t packet; - packet.utc_date = utc_date; - packet.utc_time = utc_time; - - memcpy(_MAV_PAYLOAD(msg), &packet, 8); -#endif - - msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME_UTC; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8); -} - -/** - * @brief Encode a system_time_utc struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param system_time_utc C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_system_time_utc_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_system_time_utc_t* system_time_utc) -{ - return mavlink_msg_system_time_utc_pack(system_id, component_id, msg, system_time_utc->utc_date, system_time_utc->utc_time); -} - -/** - * @brief Send a system_time_utc message - * @param chan MAVLink channel to send the message - * - * @param utc_date GPS UTC date ddmmyy - * @param utc_time GPS UTC time hhmmss - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_system_time_utc_send(mavlink_channel_t chan, uint32_t utc_date, uint32_t utc_time) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint32_t(buf, 0, utc_date); - _mav_put_uint32_t(buf, 4, utc_time); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME_UTC, buf, 8); -#else - mavlink_system_time_utc_t packet; - packet.utc_date = utc_date; - packet.utc_time = utc_time; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME_UTC, (const char *)&packet, 8); -#endif -} - -#endif - -// MESSAGE SYSTEM_TIME_UTC UNPACKING - - -/** - * @brief Get field utc_date from system_time_utc message - * - * @return GPS UTC date ddmmyy - */ -static inline uint32_t mavlink_msg_system_time_utc_get_utc_date(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint32_t(msg, 0); -} - -/** - * @brief Get field utc_time from system_time_utc message - * - * @return GPS UTC time hhmmss - */ -static inline uint32_t mavlink_msg_system_time_utc_get_utc_time(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint32_t(msg, 4); -} - -/** - * @brief Decode a system_time_utc message into a struct - * - * @param msg The message to decode - * @param system_time_utc C-struct to decode the message contents into - */ -static inline void mavlink_msg_system_time_utc_decode(const mavlink_message_t* msg, mavlink_system_time_utc_t* system_time_utc) -{ -#if MAVLINK_NEED_BYTE_SWAP - system_time_utc->utc_date = mavlink_msg_system_time_utc_get_utc_date(msg); - system_time_utc->utc_time = mavlink_msg_system_time_utc_get_utc_time(msg); -#else - memcpy(system_time_utc, _MAV_PAYLOAD(msg), 8); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_vfr_hud.h b/src/GCS_MAVLink/include/common/mavlink_msg_vfr_hud.h deleted file mode 100644 index 705d8d4db..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_vfr_hud.h +++ /dev/null @@ -1,254 +0,0 @@ -// MESSAGE VFR_HUD PACKING - -#define MAVLINK_MSG_ID_VFR_HUD 74 - -typedef struct __mavlink_vfr_hud_t -{ - float airspeed; ///< Current airspeed in m/s - float groundspeed; ///< Current ground speed in m/s - int16_t heading; ///< Current heading in degrees, in compass units (0..360, 0=north) - uint16_t throttle; ///< Current throttle setting in integer percent, 0 to 100 - float alt; ///< Current altitude (MSL), in meters - float climb; ///< Current climb rate in meters/second -} mavlink_vfr_hud_t; - -#define MAVLINK_MSG_ID_VFR_HUD_LEN 20 -#define MAVLINK_MSG_ID_74_LEN 20 - - - -#define MAVLINK_MESSAGE_INFO_VFR_HUD { \ - "VFR_HUD", \ - 6, \ - { { "airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_vfr_hud_t, airspeed) }, \ - { "groundspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_vfr_hud_t, groundspeed) }, \ - { "heading", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_vfr_hud_t, heading) }, \ - { "throttle", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_vfr_hud_t, throttle) }, \ - { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vfr_hud_t, alt) }, \ - { "climb", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vfr_hud_t, climb) }, \ - } \ -} - - -/** - * @brief Pack a vfr_hud message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param airspeed Current airspeed in m/s - * @param groundspeed Current ground speed in m/s - * @param heading Current heading in degrees, in compass units (0..360, 0=north) - * @param throttle Current throttle setting in integer percent, 0 to 100 - * @param alt Current altitude (MSL), in meters - * @param climb Current climb rate in meters/second - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_vfr_hud_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - float airspeed, float groundspeed, int16_t heading, uint16_t throttle, float alt, float climb) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; - _mav_put_float(buf, 0, airspeed); - _mav_put_float(buf, 4, groundspeed); - _mav_put_int16_t(buf, 8, heading); - _mav_put_uint16_t(buf, 10, throttle); - _mav_put_float(buf, 12, alt); - _mav_put_float(buf, 16, climb); - - memcpy(_MAV_PAYLOAD(msg), buf, 20); -#else - mavlink_vfr_hud_t packet; - packet.airspeed = airspeed; - packet.groundspeed = groundspeed; - packet.heading = heading; - packet.throttle = throttle; - packet.alt = alt; - packet.climb = climb; - - memcpy(_MAV_PAYLOAD(msg), &packet, 20); -#endif - - msg->msgid = MAVLINK_MSG_ID_VFR_HUD; - return mavlink_finalize_message(msg, system_id, component_id, 20); -} - -/** - * @brief Pack a vfr_hud message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param airspeed Current airspeed in m/s - * @param groundspeed Current ground speed in m/s - * @param heading Current heading in degrees, in compass units (0..360, 0=north) - * @param throttle Current throttle setting in integer percent, 0 to 100 - * @param alt Current altitude (MSL), in meters - * @param climb Current climb rate in meters/second - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_vfr_hud_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - float airspeed,float groundspeed,int16_t heading,uint16_t throttle,float alt,float climb) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; - _mav_put_float(buf, 0, airspeed); - _mav_put_float(buf, 4, groundspeed); - _mav_put_int16_t(buf, 8, heading); - _mav_put_uint16_t(buf, 10, throttle); - _mav_put_float(buf, 12, alt); - _mav_put_float(buf, 16, climb); - - memcpy(_MAV_PAYLOAD(msg), buf, 20); -#else - mavlink_vfr_hud_t packet; - packet.airspeed = airspeed; - packet.groundspeed = groundspeed; - packet.heading = heading; - packet.throttle = throttle; - packet.alt = alt; - packet.climb = climb; - - memcpy(_MAV_PAYLOAD(msg), &packet, 20); -#endif - - msg->msgid = MAVLINK_MSG_ID_VFR_HUD; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 20); -} - -/** - * @brief Encode a vfr_hud struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param vfr_hud C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_vfr_hud_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vfr_hud_t* vfr_hud) -{ - return mavlink_msg_vfr_hud_pack(system_id, component_id, msg, vfr_hud->airspeed, vfr_hud->groundspeed, vfr_hud->heading, vfr_hud->throttle, vfr_hud->alt, vfr_hud->climb); -} - -/** - * @brief Send a vfr_hud message - * @param chan MAVLink channel to send the message - * - * @param airspeed Current airspeed in m/s - * @param groundspeed Current ground speed in m/s - * @param heading Current heading in degrees, in compass units (0..360, 0=north) - * @param throttle Current throttle setting in integer percent, 0 to 100 - * @param alt Current altitude (MSL), in meters - * @param climb Current climb rate in meters/second - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_vfr_hud_send(mavlink_channel_t chan, float airspeed, float groundspeed, int16_t heading, uint16_t throttle, float alt, float climb) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; - _mav_put_float(buf, 0, airspeed); - _mav_put_float(buf, 4, groundspeed); - _mav_put_int16_t(buf, 8, heading); - _mav_put_uint16_t(buf, 10, throttle); - _mav_put_float(buf, 12, alt); - _mav_put_float(buf, 16, climb); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, buf, 20); -#else - mavlink_vfr_hud_t packet; - packet.airspeed = airspeed; - packet.groundspeed = groundspeed; - packet.heading = heading; - packet.throttle = throttle; - packet.alt = alt; - packet.climb = climb; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, (const char *)&packet, 20); -#endif -} - -#endif - -// MESSAGE VFR_HUD UNPACKING - - -/** - * @brief Get field airspeed from vfr_hud message - * - * @return Current airspeed in m/s - */ -static inline float mavlink_msg_vfr_hud_get_airspeed(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 0); -} - -/** - * @brief Get field groundspeed from vfr_hud message - * - * @return Current ground speed in m/s - */ -static inline float mavlink_msg_vfr_hud_get_groundspeed(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Get field heading from vfr_hud message - * - * @return Current heading in degrees, in compass units (0..360, 0=north) - */ -static inline int16_t mavlink_msg_vfr_hud_get_heading(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int16_t(msg, 8); -} - -/** - * @brief Get field throttle from vfr_hud message - * - * @return Current throttle setting in integer percent, 0 to 100 - */ -static inline uint16_t mavlink_msg_vfr_hud_get_throttle(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 10); -} - -/** - * @brief Get field alt from vfr_hud message - * - * @return Current altitude (MSL), in meters - */ -static inline float mavlink_msg_vfr_hud_get_alt(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field climb from vfr_hud message - * - * @return Current climb rate in meters/second - */ -static inline float mavlink_msg_vfr_hud_get_climb(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 16); -} - -/** - * @brief Decode a vfr_hud message into a struct - * - * @param msg The message to decode - * @param vfr_hud C-struct to decode the message contents into - */ -static inline void mavlink_msg_vfr_hud_decode(const mavlink_message_t* msg, mavlink_vfr_hud_t* vfr_hud) -{ -#if MAVLINK_NEED_BYTE_SWAP - vfr_hud->airspeed = mavlink_msg_vfr_hud_get_airspeed(msg); - vfr_hud->groundspeed = mavlink_msg_vfr_hud_get_groundspeed(msg); - vfr_hud->heading = mavlink_msg_vfr_hud_get_heading(msg); - vfr_hud->throttle = mavlink_msg_vfr_hud_get_throttle(msg); - vfr_hud->alt = mavlink_msg_vfr_hud_get_alt(msg); - vfr_hud->climb = mavlink_msg_vfr_hud_get_climb(msg); -#else - memcpy(vfr_hud, _MAV_PAYLOAD(msg), 20); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint.h b/src/GCS_MAVLink/include/common/mavlink_msg_waypoint.h deleted file mode 100644 index 27e89de1f..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint.h +++ /dev/null @@ -1,430 +0,0 @@ -// MESSAGE WAYPOINT PACKING - -#define MAVLINK_MSG_ID_WAYPOINT 39 - -typedef struct __mavlink_waypoint_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - uint16_t seq; ///< Sequence - uint8_t frame; ///< The coordinate system of the waypoint. see MAV_FRAME in mavlink_types.h - uint8_t command; ///< The scheduled action for the waypoint. see MAV_COMMAND in common.xml MAVLink specs - uint8_t current; ///< false:0, true:1 - uint8_t autocontinue; ///< autocontinue to next wp - float param1; ///< PARAM1 / For NAV command waypoints: Radius in which the waypoint is accepted as reached, in meters - float param2; ///< PARAM2 / For NAV command waypoints: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds - float param3; ///< PARAM3 / For LOITER command waypoints: Orbit to circle around the waypoint, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise. - float param4; ///< PARAM4 / For NAV and LOITER command waypoints: Yaw orientation in degrees, [0..360] 0 = NORTH - float x; ///< PARAM5 / local: x position, global: latitude - float y; ///< PARAM6 / y position: global: longitude - float z; ///< PARAM7 / z position: global: altitude -} mavlink_waypoint_t; - -#define MAVLINK_MSG_ID_WAYPOINT_LEN 36 -#define MAVLINK_MSG_ID_39_LEN 36 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT { \ - "WAYPOINT", \ - 14, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_waypoint_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_waypoint_t, target_component) }, \ - { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_waypoint_t, seq) }, \ - { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_waypoint_t, frame) }, \ - { "command", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_waypoint_t, command) }, \ - { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_waypoint_t, current) }, \ - { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_waypoint_t, autocontinue) }, \ - { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_waypoint_t, param1) }, \ - { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_waypoint_t, param2) }, \ - { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_waypoint_t, param3) }, \ - { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_waypoint_t, param4) }, \ - { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_waypoint_t, x) }, \ - { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_waypoint_t, y) }, \ - { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_waypoint_t, z) }, \ - } \ -} - - -/** - * @brief Pack a waypoint message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence - * @param frame The coordinate system of the waypoint. see MAV_FRAME in mavlink_types.h - * @param command The scheduled action for the waypoint. see MAV_COMMAND in common.xml MAVLink specs - * @param current false:0, true:1 - * @param autocontinue autocontinue to next wp - * @param param1 PARAM1 / For NAV command waypoints: Radius in which the waypoint is accepted as reached, in meters - * @param param2 PARAM2 / For NAV command waypoints: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds - * @param param3 PARAM3 / For LOITER command waypoints: Orbit to circle around the waypoint, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise. - * @param param4 PARAM4 / For NAV and LOITER command waypoints: Yaw orientation in degrees, [0..360] 0 = NORTH - * @param x PARAM5 / local: x position, global: latitude - * @param y PARAM6 / y position: global: longitude - * @param z PARAM7 / z position: global: altitude - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint8_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint16_t(buf, 2, seq); - _mav_put_uint8_t(buf, 4, frame); - _mav_put_uint8_t(buf, 5, command); - _mav_put_uint8_t(buf, 6, current); - _mav_put_uint8_t(buf, 7, autocontinue); - _mav_put_float(buf, 8, param1); - _mav_put_float(buf, 12, param2); - _mav_put_float(buf, 16, param3); - _mav_put_float(buf, 20, param4); - _mav_put_float(buf, 24, x); - _mav_put_float(buf, 28, y); - _mav_put_float(buf, 32, z); - - memcpy(_MAV_PAYLOAD(msg), buf, 36); -#else - mavlink_waypoint_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.seq = seq; - packet.frame = frame; - packet.command = command; - packet.current = current; - packet.autocontinue = autocontinue; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.x = x; - packet.y = y; - packet.z = z; - - memcpy(_MAV_PAYLOAD(msg), &packet, 36); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT; - return mavlink_finalize_message(msg, system_id, component_id, 36); -} - -/** - * @brief Pack a waypoint message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence - * @param frame The coordinate system of the waypoint. see MAV_FRAME in mavlink_types.h - * @param command The scheduled action for the waypoint. see MAV_COMMAND in common.xml MAVLink specs - * @param current false:0, true:1 - * @param autocontinue autocontinue to next wp - * @param param1 PARAM1 / For NAV command waypoints: Radius in which the waypoint is accepted as reached, in meters - * @param param2 PARAM2 / For NAV command waypoints: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds - * @param param3 PARAM3 / For LOITER command waypoints: Orbit to circle around the waypoint, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise. - * @param param4 PARAM4 / For NAV and LOITER command waypoints: Yaw orientation in degrees, [0..360] 0 = NORTH - * @param x PARAM5 / local: x position, global: latitude - * @param y PARAM6 / y position: global: longitude - * @param z PARAM7 / z position: global: altitude - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint16_t seq,uint8_t frame,uint8_t command,uint8_t current,uint8_t autocontinue,float param1,float param2,float param3,float param4,float x,float y,float z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint16_t(buf, 2, seq); - _mav_put_uint8_t(buf, 4, frame); - _mav_put_uint8_t(buf, 5, command); - _mav_put_uint8_t(buf, 6, current); - _mav_put_uint8_t(buf, 7, autocontinue); - _mav_put_float(buf, 8, param1); - _mav_put_float(buf, 12, param2); - _mav_put_float(buf, 16, param3); - _mav_put_float(buf, 20, param4); - _mav_put_float(buf, 24, x); - _mav_put_float(buf, 28, y); - _mav_put_float(buf, 32, z); - - memcpy(_MAV_PAYLOAD(msg), buf, 36); -#else - mavlink_waypoint_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.seq = seq; - packet.frame = frame; - packet.command = command; - packet.current = current; - packet.autocontinue = autocontinue; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.x = x; - packet.y = y; - packet.z = z; - - memcpy(_MAV_PAYLOAD(msg), &packet, 36); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 36); -} - -/** - * @brief Encode a waypoint struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param waypoint C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_t* waypoint) -{ - return mavlink_msg_waypoint_pack(system_id, component_id, msg, waypoint->target_system, waypoint->target_component, waypoint->seq, waypoint->frame, waypoint->command, waypoint->current, waypoint->autocontinue, waypoint->param1, waypoint->param2, waypoint->param3, waypoint->param4, waypoint->x, waypoint->y, waypoint->z); -} - -/** - * @brief Send a waypoint message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence - * @param frame The coordinate system of the waypoint. see MAV_FRAME in mavlink_types.h - * @param command The scheduled action for the waypoint. see MAV_COMMAND in common.xml MAVLink specs - * @param current false:0, true:1 - * @param autocontinue autocontinue to next wp - * @param param1 PARAM1 / For NAV command waypoints: Radius in which the waypoint is accepted as reached, in meters - * @param param2 PARAM2 / For NAV command waypoints: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds - * @param param3 PARAM3 / For LOITER command waypoints: Orbit to circle around the waypoint, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise. - * @param param4 PARAM4 / For NAV and LOITER command waypoints: Yaw orientation in degrees, [0..360] 0 = NORTH - * @param x PARAM5 / local: x position, global: latitude - * @param y PARAM6 / y position: global: longitude - * @param z PARAM7 / z position: global: altitude - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_waypoint_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint8_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint16_t(buf, 2, seq); - _mav_put_uint8_t(buf, 4, frame); - _mav_put_uint8_t(buf, 5, command); - _mav_put_uint8_t(buf, 6, current); - _mav_put_uint8_t(buf, 7, autocontinue); - _mav_put_float(buf, 8, param1); - _mav_put_float(buf, 12, param2); - _mav_put_float(buf, 16, param3); - _mav_put_float(buf, 20, param4); - _mav_put_float(buf, 24, x); - _mav_put_float(buf, 28, y); - _mav_put_float(buf, 32, z); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT, buf, 36); -#else - mavlink_waypoint_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.seq = seq; - packet.frame = frame; - packet.command = command; - packet.current = current; - packet.autocontinue = autocontinue; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.x = x; - packet.y = y; - packet.z = z; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT, (const char *)&packet, 36); -#endif -} - -#endif - -// MESSAGE WAYPOINT UNPACKING - - -/** - * @brief Get field target_system from waypoint message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_waypoint_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from waypoint message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_waypoint_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field seq from waypoint message - * - * @return Sequence - */ -static inline uint16_t mavlink_msg_waypoint_get_seq(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 2); -} - -/** - * @brief Get field frame from waypoint message - * - * @return The coordinate system of the waypoint. see MAV_FRAME in mavlink_types.h - */ -static inline uint8_t mavlink_msg_waypoint_get_frame(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 4); -} - -/** - * @brief Get field command from waypoint message - * - * @return The scheduled action for the waypoint. see MAV_COMMAND in common.xml MAVLink specs - */ -static inline uint8_t mavlink_msg_waypoint_get_command(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 5); -} - -/** - * @brief Get field current from waypoint message - * - * @return false:0, true:1 - */ -static inline uint8_t mavlink_msg_waypoint_get_current(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 6); -} - -/** - * @brief Get field autocontinue from waypoint message - * - * @return autocontinue to next wp - */ -static inline uint8_t mavlink_msg_waypoint_get_autocontinue(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 7); -} - -/** - * @brief Get field param1 from waypoint message - * - * @return PARAM1 / For NAV command waypoints: Radius in which the waypoint is accepted as reached, in meters - */ -static inline float mavlink_msg_waypoint_get_param1(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field param2 from waypoint message - * - * @return PARAM2 / For NAV command waypoints: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds - */ -static inline float mavlink_msg_waypoint_get_param2(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field param3 from waypoint message - * - * @return PARAM3 / For LOITER command waypoints: Orbit to circle around the waypoint, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise. - */ -static inline float mavlink_msg_waypoint_get_param3(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 16); -} - -/** - * @brief Get field param4 from waypoint message - * - * @return PARAM4 / For NAV and LOITER command waypoints: Yaw orientation in degrees, [0..360] 0 = NORTH - */ -static inline float mavlink_msg_waypoint_get_param4(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 20); -} - -/** - * @brief Get field x from waypoint message - * - * @return PARAM5 / local: x position, global: latitude - */ -static inline float mavlink_msg_waypoint_get_x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 24); -} - -/** - * @brief Get field y from waypoint message - * - * @return PARAM6 / y position: global: longitude - */ -static inline float mavlink_msg_waypoint_get_y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 28); -} - -/** - * @brief Get field z from waypoint message - * - * @return PARAM7 / z position: global: altitude - */ -static inline float mavlink_msg_waypoint_get_z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 32); -} - -/** - * @brief Decode a waypoint message into a struct - * - * @param msg The message to decode - * @param waypoint C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_decode(const mavlink_message_t* msg, mavlink_waypoint_t* waypoint) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint->target_system = mavlink_msg_waypoint_get_target_system(msg); - waypoint->target_component = mavlink_msg_waypoint_get_target_component(msg); - waypoint->seq = mavlink_msg_waypoint_get_seq(msg); - waypoint->frame = mavlink_msg_waypoint_get_frame(msg); - waypoint->command = mavlink_msg_waypoint_get_command(msg); - waypoint->current = mavlink_msg_waypoint_get_current(msg); - waypoint->autocontinue = mavlink_msg_waypoint_get_autocontinue(msg); - waypoint->param1 = mavlink_msg_waypoint_get_param1(msg); - waypoint->param2 = mavlink_msg_waypoint_get_param2(msg); - waypoint->param3 = mavlink_msg_waypoint_get_param3(msg); - waypoint->param4 = mavlink_msg_waypoint_get_param4(msg); - waypoint->x = mavlink_msg_waypoint_get_x(msg); - waypoint->y = mavlink_msg_waypoint_get_y(msg); - waypoint->z = mavlink_msg_waypoint_get_z(msg); -#else - memcpy(waypoint, _MAV_PAYLOAD(msg), 36); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_ack.h b/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_ack.h deleted file mode 100644 index 2b3608718..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_ack.h +++ /dev/null @@ -1,188 +0,0 @@ -// MESSAGE WAYPOINT_ACK PACKING - -#define MAVLINK_MSG_ID_WAYPOINT_ACK 47 - -typedef struct __mavlink_waypoint_ack_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - uint8_t type; ///< 0: OK, 1: Error -} mavlink_waypoint_ack_t; - -#define MAVLINK_MSG_ID_WAYPOINT_ACK_LEN 3 -#define MAVLINK_MSG_ID_47_LEN 3 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT_ACK { \ - "WAYPOINT_ACK", \ - 3, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_waypoint_ack_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_waypoint_ack_t, target_component) }, \ - { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_waypoint_ack_t, type) }, \ - } \ -} - - -/** - * @brief Pack a waypoint_ack message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param type 0: OK, 1: Error - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint8_t type) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, type); - - memcpy(_MAV_PAYLOAD(msg), buf, 3); -#else - mavlink_waypoint_ack_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.type = type; - - memcpy(_MAV_PAYLOAD(msg), &packet, 3); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_ACK; - return mavlink_finalize_message(msg, system_id, component_id, 3); -} - -/** - * @brief Pack a waypoint_ack message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param type 0: OK, 1: Error - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint8_t type) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, type); - - memcpy(_MAV_PAYLOAD(msg), buf, 3); -#else - mavlink_waypoint_ack_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.type = type; - - memcpy(_MAV_PAYLOAD(msg), &packet, 3); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_ACK; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3); -} - -/** - * @brief Encode a waypoint_ack struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param waypoint_ack C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_ack_t* waypoint_ack) -{ - return mavlink_msg_waypoint_ack_pack(system_id, component_id, msg, waypoint_ack->target_system, waypoint_ack->target_component, waypoint_ack->type); -} - -/** - * @brief Send a waypoint_ack message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param type 0: OK, 1: Error - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_waypoint_ack_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t type) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, type); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_ACK, buf, 3); -#else - mavlink_waypoint_ack_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.type = type; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_ACK, (const char *)&packet, 3); -#endif -} - -#endif - -// MESSAGE WAYPOINT_ACK UNPACKING - - -/** - * @brief Get field target_system from waypoint_ack message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_waypoint_ack_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from waypoint_ack message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_waypoint_ack_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field type from waypoint_ack message - * - * @return 0: OK, 1: Error - */ -static inline uint8_t mavlink_msg_waypoint_ack_get_type(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Decode a waypoint_ack message into a struct - * - * @param msg The message to decode - * @param waypoint_ack C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_ack_decode(const mavlink_message_t* msg, mavlink_waypoint_ack_t* waypoint_ack) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint_ack->target_system = mavlink_msg_waypoint_ack_get_target_system(msg); - waypoint_ack->target_component = mavlink_msg_waypoint_ack_get_target_component(msg); - waypoint_ack->type = mavlink_msg_waypoint_ack_get_type(msg); -#else - memcpy(waypoint_ack, _MAV_PAYLOAD(msg), 3); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_clear_all.h b/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_clear_all.h deleted file mode 100644 index bca8dcc1f..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_clear_all.h +++ /dev/null @@ -1,166 +0,0 @@ -// MESSAGE WAYPOINT_CLEAR_ALL PACKING - -#define MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL 45 - -typedef struct __mavlink_waypoint_clear_all_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID -} mavlink_waypoint_clear_all_t; - -#define MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL_LEN 2 -#define MAVLINK_MSG_ID_45_LEN 2 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT_CLEAR_ALL { \ - "WAYPOINT_CLEAR_ALL", \ - 2, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_waypoint_clear_all_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_waypoint_clear_all_t, target_component) }, \ - } \ -} - - -/** - * @brief Pack a waypoint_clear_all message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_clear_all_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_waypoint_clear_all_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL; - return mavlink_finalize_message(msg, system_id, component_id, 2); -} - -/** - * @brief Pack a waypoint_clear_all message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_clear_all_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_waypoint_clear_all_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2); -} - -/** - * @brief Encode a waypoint_clear_all struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param waypoint_clear_all C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_clear_all_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_clear_all_t* waypoint_clear_all) -{ - return mavlink_msg_waypoint_clear_all_pack(system_id, component_id, msg, waypoint_clear_all->target_system, waypoint_clear_all->target_component); -} - -/** - * @brief Send a waypoint_clear_all message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_waypoint_clear_all_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL, buf, 2); -#else - mavlink_waypoint_clear_all_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL, (const char *)&packet, 2); -#endif -} - -#endif - -// MESSAGE WAYPOINT_CLEAR_ALL UNPACKING - - -/** - * @brief Get field target_system from waypoint_clear_all message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_waypoint_clear_all_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from waypoint_clear_all message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_waypoint_clear_all_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Decode a waypoint_clear_all message into a struct - * - * @param msg The message to decode - * @param waypoint_clear_all C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_clear_all_decode(const mavlink_message_t* msg, mavlink_waypoint_clear_all_t* waypoint_clear_all) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint_clear_all->target_system = mavlink_msg_waypoint_clear_all_get_target_system(msg); - waypoint_clear_all->target_component = mavlink_msg_waypoint_clear_all_get_target_component(msg); -#else - memcpy(waypoint_clear_all, _MAV_PAYLOAD(msg), 2); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_count.h b/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_count.h deleted file mode 100644 index 73c62f831..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_count.h +++ /dev/null @@ -1,188 +0,0 @@ -// MESSAGE WAYPOINT_COUNT PACKING - -#define MAVLINK_MSG_ID_WAYPOINT_COUNT 44 - -typedef struct __mavlink_waypoint_count_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - uint16_t count; ///< Number of Waypoints in the Sequence -} mavlink_waypoint_count_t; - -#define MAVLINK_MSG_ID_WAYPOINT_COUNT_LEN 4 -#define MAVLINK_MSG_ID_44_LEN 4 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT_COUNT { \ - "WAYPOINT_COUNT", \ - 3, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_waypoint_count_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_waypoint_count_t, target_component) }, \ - { "count", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_waypoint_count_t, count) }, \ - } \ -} - - -/** - * @brief Pack a waypoint_count message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param count Number of Waypoints in the Sequence - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_count_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint16_t count) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint16_t(buf, 2, count); - - memcpy(_MAV_PAYLOAD(msg), buf, 4); -#else - mavlink_waypoint_count_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.count = count; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_COUNT; - return mavlink_finalize_message(msg, system_id, component_id, 4); -} - -/** - * @brief Pack a waypoint_count message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param count Number of Waypoints in the Sequence - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_count_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint16_t count) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint16_t(buf, 2, count); - - memcpy(_MAV_PAYLOAD(msg), buf, 4); -#else - mavlink_waypoint_count_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.count = count; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_COUNT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4); -} - -/** - * @brief Encode a waypoint_count struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param waypoint_count C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_count_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_count_t* waypoint_count) -{ - return mavlink_msg_waypoint_count_pack(system_id, component_id, msg, waypoint_count->target_system, waypoint_count->target_component, waypoint_count->count); -} - -/** - * @brief Send a waypoint_count message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param count Number of Waypoints in the Sequence - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_waypoint_count_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t count) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint16_t(buf, 2, count); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_COUNT, buf, 4); -#else - mavlink_waypoint_count_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.count = count; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_COUNT, (const char *)&packet, 4); -#endif -} - -#endif - -// MESSAGE WAYPOINT_COUNT UNPACKING - - -/** - * @brief Get field target_system from waypoint_count message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_waypoint_count_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from waypoint_count message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_waypoint_count_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field count from waypoint_count message - * - * @return Number of Waypoints in the Sequence - */ -static inline uint16_t mavlink_msg_waypoint_count_get_count(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 2); -} - -/** - * @brief Decode a waypoint_count message into a struct - * - * @param msg The message to decode - * @param waypoint_count C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_count_decode(const mavlink_message_t* msg, mavlink_waypoint_count_t* waypoint_count) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint_count->target_system = mavlink_msg_waypoint_count_get_target_system(msg); - waypoint_count->target_component = mavlink_msg_waypoint_count_get_target_component(msg); - waypoint_count->count = mavlink_msg_waypoint_count_get_count(msg); -#else - memcpy(waypoint_count, _MAV_PAYLOAD(msg), 4); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_current.h b/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_current.h deleted file mode 100644 index 411b86766..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_current.h +++ /dev/null @@ -1,144 +0,0 @@ -// MESSAGE WAYPOINT_CURRENT PACKING - -#define MAVLINK_MSG_ID_WAYPOINT_CURRENT 42 - -typedef struct __mavlink_waypoint_current_t -{ - uint16_t seq; ///< Sequence -} mavlink_waypoint_current_t; - -#define MAVLINK_MSG_ID_WAYPOINT_CURRENT_LEN 2 -#define MAVLINK_MSG_ID_42_LEN 2 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT_CURRENT { \ - "WAYPOINT_CURRENT", \ - 1, \ - { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_waypoint_current_t, seq) }, \ - } \ -} - - -/** - * @brief Pack a waypoint_current message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param seq Sequence - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_current_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint16_t seq) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint16_t(buf, 0, seq); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_waypoint_current_t packet; - packet.seq = seq; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_CURRENT; - return mavlink_finalize_message(msg, system_id, component_id, 2); -} - -/** - * @brief Pack a waypoint_current message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param seq Sequence - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_current_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint16_t seq) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint16_t(buf, 0, seq); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_waypoint_current_t packet; - packet.seq = seq; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_CURRENT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2); -} - -/** - * @brief Encode a waypoint_current struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param waypoint_current C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_current_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_current_t* waypoint_current) -{ - return mavlink_msg_waypoint_current_pack(system_id, component_id, msg, waypoint_current->seq); -} - -/** - * @brief Send a waypoint_current message - * @param chan MAVLink channel to send the message - * - * @param seq Sequence - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_waypoint_current_send(mavlink_channel_t chan, uint16_t seq) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint16_t(buf, 0, seq); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_CURRENT, buf, 2); -#else - mavlink_waypoint_current_t packet; - packet.seq = seq; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_CURRENT, (const char *)&packet, 2); -#endif -} - -#endif - -// MESSAGE WAYPOINT_CURRENT UNPACKING - - -/** - * @brief Get field seq from waypoint_current message - * - * @return Sequence - */ -static inline uint16_t mavlink_msg_waypoint_current_get_seq(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 0); -} - -/** - * @brief Decode a waypoint_current message into a struct - * - * @param msg The message to decode - * @param waypoint_current C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_current_decode(const mavlink_message_t* msg, mavlink_waypoint_current_t* waypoint_current) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint_current->seq = mavlink_msg_waypoint_current_get_seq(msg); -#else - memcpy(waypoint_current, _MAV_PAYLOAD(msg), 2); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_reached.h b/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_reached.h deleted file mode 100644 index 6f291c709..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_reached.h +++ /dev/null @@ -1,144 +0,0 @@ -// MESSAGE WAYPOINT_REACHED PACKING - -#define MAVLINK_MSG_ID_WAYPOINT_REACHED 46 - -typedef struct __mavlink_waypoint_reached_t -{ - uint16_t seq; ///< Sequence -} mavlink_waypoint_reached_t; - -#define MAVLINK_MSG_ID_WAYPOINT_REACHED_LEN 2 -#define MAVLINK_MSG_ID_46_LEN 2 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT_REACHED { \ - "WAYPOINT_REACHED", \ - 1, \ - { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_waypoint_reached_t, seq) }, \ - } \ -} - - -/** - * @brief Pack a waypoint_reached message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param seq Sequence - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_reached_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint16_t seq) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint16_t(buf, 0, seq); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_waypoint_reached_t packet; - packet.seq = seq; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REACHED; - return mavlink_finalize_message(msg, system_id, component_id, 2); -} - -/** - * @brief Pack a waypoint_reached message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param seq Sequence - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_reached_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint16_t seq) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint16_t(buf, 0, seq); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_waypoint_reached_t packet; - packet.seq = seq; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REACHED; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2); -} - -/** - * @brief Encode a waypoint_reached struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param waypoint_reached C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_reached_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_reached_t* waypoint_reached) -{ - return mavlink_msg_waypoint_reached_pack(system_id, component_id, msg, waypoint_reached->seq); -} - -/** - * @brief Send a waypoint_reached message - * @param chan MAVLink channel to send the message - * - * @param seq Sequence - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_waypoint_reached_send(mavlink_channel_t chan, uint16_t seq) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint16_t(buf, 0, seq); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_REACHED, buf, 2); -#else - mavlink_waypoint_reached_t packet; - packet.seq = seq; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_REACHED, (const char *)&packet, 2); -#endif -} - -#endif - -// MESSAGE WAYPOINT_REACHED UNPACKING - - -/** - * @brief Get field seq from waypoint_reached message - * - * @return Sequence - */ -static inline uint16_t mavlink_msg_waypoint_reached_get_seq(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 0); -} - -/** - * @brief Decode a waypoint_reached message into a struct - * - * @param msg The message to decode - * @param waypoint_reached C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_reached_decode(const mavlink_message_t* msg, mavlink_waypoint_reached_t* waypoint_reached) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint_reached->seq = mavlink_msg_waypoint_reached_get_seq(msg); -#else - memcpy(waypoint_reached, _MAV_PAYLOAD(msg), 2); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_request.h b/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_request.h deleted file mode 100644 index e9d616ab1..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_request.h +++ /dev/null @@ -1,188 +0,0 @@ -// MESSAGE WAYPOINT_REQUEST PACKING - -#define MAVLINK_MSG_ID_WAYPOINT_REQUEST 40 - -typedef struct __mavlink_waypoint_request_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - uint16_t seq; ///< Sequence -} mavlink_waypoint_request_t; - -#define MAVLINK_MSG_ID_WAYPOINT_REQUEST_LEN 4 -#define MAVLINK_MSG_ID_40_LEN 4 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST { \ - "WAYPOINT_REQUEST", \ - 3, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_waypoint_request_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_waypoint_request_t, target_component) }, \ - { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_waypoint_request_t, seq) }, \ - } \ -} - - -/** - * @brief Pack a waypoint_request message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_request_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint16_t seq) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint16_t(buf, 2, seq); - - memcpy(_MAV_PAYLOAD(msg), buf, 4); -#else - mavlink_waypoint_request_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.seq = seq; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REQUEST; - return mavlink_finalize_message(msg, system_id, component_id, 4); -} - -/** - * @brief Pack a waypoint_request message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_request_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint16_t seq) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint16_t(buf, 2, seq); - - memcpy(_MAV_PAYLOAD(msg), buf, 4); -#else - mavlink_waypoint_request_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.seq = seq; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REQUEST; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4); -} - -/** - * @brief Encode a waypoint_request struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param waypoint_request C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_request_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_request_t* waypoint_request) -{ - return mavlink_msg_waypoint_request_pack(system_id, component_id, msg, waypoint_request->target_system, waypoint_request->target_component, waypoint_request->seq); -} - -/** - * @brief Send a waypoint_request message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_waypoint_request_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint16_t(buf, 2, seq); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_REQUEST, buf, 4); -#else - mavlink_waypoint_request_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.seq = seq; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_REQUEST, (const char *)&packet, 4); -#endif -} - -#endif - -// MESSAGE WAYPOINT_REQUEST UNPACKING - - -/** - * @brief Get field target_system from waypoint_request message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_waypoint_request_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from waypoint_request message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_waypoint_request_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field seq from waypoint_request message - * - * @return Sequence - */ -static inline uint16_t mavlink_msg_waypoint_request_get_seq(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 2); -} - -/** - * @brief Decode a waypoint_request message into a struct - * - * @param msg The message to decode - * @param waypoint_request C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_request_decode(const mavlink_message_t* msg, mavlink_waypoint_request_t* waypoint_request) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint_request->target_system = mavlink_msg_waypoint_request_get_target_system(msg); - waypoint_request->target_component = mavlink_msg_waypoint_request_get_target_component(msg); - waypoint_request->seq = mavlink_msg_waypoint_request_get_seq(msg); -#else - memcpy(waypoint_request, _MAV_PAYLOAD(msg), 4); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_request_list.h b/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_request_list.h deleted file mode 100644 index caeb62037..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_request_list.h +++ /dev/null @@ -1,166 +0,0 @@ -// MESSAGE WAYPOINT_REQUEST_LIST PACKING - -#define MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST 43 - -typedef struct __mavlink_waypoint_request_list_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID -} mavlink_waypoint_request_list_t; - -#define MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST_LEN 2 -#define MAVLINK_MSG_ID_43_LEN 2 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST_LIST { \ - "WAYPOINT_REQUEST_LIST", \ - 2, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_waypoint_request_list_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_waypoint_request_list_t, target_component) }, \ - } \ -} - - -/** - * @brief Pack a waypoint_request_list message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_request_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_waypoint_request_list_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST; - return mavlink_finalize_message(msg, system_id, component_id, 2); -} - -/** - * @brief Pack a waypoint_request_list message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_request_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_waypoint_request_list_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2); -} - -/** - * @brief Encode a waypoint_request_list struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param waypoint_request_list C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_request_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_request_list_t* waypoint_request_list) -{ - return mavlink_msg_waypoint_request_list_pack(system_id, component_id, msg, waypoint_request_list->target_system, waypoint_request_list->target_component); -} - -/** - * @brief Send a waypoint_request_list message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_waypoint_request_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST, buf, 2); -#else - mavlink_waypoint_request_list_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST, (const char *)&packet, 2); -#endif -} - -#endif - -// MESSAGE WAYPOINT_REQUEST_LIST UNPACKING - - -/** - * @brief Get field target_system from waypoint_request_list message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_waypoint_request_list_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from waypoint_request_list message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_waypoint_request_list_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Decode a waypoint_request_list message into a struct - * - * @param msg The message to decode - * @param waypoint_request_list C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_request_list_decode(const mavlink_message_t* msg, mavlink_waypoint_request_list_t* waypoint_request_list) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint_request_list->target_system = mavlink_msg_waypoint_request_list_get_target_system(msg); - waypoint_request_list->target_component = mavlink_msg_waypoint_request_list_get_target_component(msg); -#else - memcpy(waypoint_request_list, _MAV_PAYLOAD(msg), 2); -#endif -} diff --git a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_set_current.h b/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_set_current.h deleted file mode 100644 index 7a9fd614a..000000000 --- a/src/GCS_MAVLink/include/common/mavlink_msg_waypoint_set_current.h +++ /dev/null @@ -1,188 +0,0 @@ -// MESSAGE WAYPOINT_SET_CURRENT PACKING - -#define MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT 41 - -typedef struct __mavlink_waypoint_set_current_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - uint16_t seq; ///< Sequence -} mavlink_waypoint_set_current_t; - -#define MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT_LEN 4 -#define MAVLINK_MSG_ID_41_LEN 4 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT_SET_CURRENT { \ - "WAYPOINT_SET_CURRENT", \ - 3, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_waypoint_set_current_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_waypoint_set_current_t, target_component) }, \ - { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_waypoint_set_current_t, seq) }, \ - } \ -} - - -/** - * @brief Pack a waypoint_set_current message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_set_current_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint16_t seq) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint16_t(buf, 2, seq); - - memcpy(_MAV_PAYLOAD(msg), buf, 4); -#else - mavlink_waypoint_set_current_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.seq = seq; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT; - return mavlink_finalize_message(msg, system_id, component_id, 4); -} - -/** - * @brief Pack a waypoint_set_current message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_set_current_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint16_t seq) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint16_t(buf, 2, seq); - - memcpy(_MAV_PAYLOAD(msg), buf, 4); -#else - mavlink_waypoint_set_current_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.seq = seq; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4); -} - -/** - * @brief Encode a waypoint_set_current struct into a message - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param waypoint_set_current C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_set_current_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_set_current_t* waypoint_set_current) -{ - return mavlink_msg_waypoint_set_current_pack(system_id, component_id, msg, waypoint_set_current->target_system, waypoint_set_current->target_component, waypoint_set_current->seq); -} - -/** - * @brief Send a waypoint_set_current message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_waypoint_set_current_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint16_t(buf, 2, seq); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT, buf, 4); -#else - mavlink_waypoint_set_current_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.seq = seq; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT, (const char *)&packet, 4); -#endif -} - -#endif - -// MESSAGE WAYPOINT_SET_CURRENT UNPACKING - - -/** - * @brief Get field target_system from waypoint_set_current message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_waypoint_set_current_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from waypoint_set_current message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_waypoint_set_current_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field seq from waypoint_set_current message - * - * @return Sequence - */ -static inline uint16_t mavlink_msg_waypoint_set_current_get_seq(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 2); -} - -/** - * @brief Decode a waypoint_set_current message into a struct - * - * @param msg The message to decode - * @param waypoint_set_current C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_set_current_decode(const mavlink_message_t* msg, mavlink_waypoint_set_current_t* waypoint_set_current) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint_set_current->target_system = mavlink_msg_waypoint_set_current_get_target_system(msg); - waypoint_set_current->target_component = mavlink_msg_waypoint_set_current_get_target_component(msg); - waypoint_set_current->seq = mavlink_msg_waypoint_set_current_get_seq(msg); -#else - memcpy(waypoint_set_current, _MAV_PAYLOAD(msg), 4); -#endif -} diff --git a/src/GCS_MAVLink/include/common/testsuite.h b/src/GCS_MAVLink/include/common/testsuite.h deleted file mode 100644 index b3a94e96e..000000000 --- a/src/GCS_MAVLink/include/common/testsuite.h +++ /dev/null @@ -1,3700 +0,0 @@ -/** @file - * @brief MAVLink comm protocol testsuite generated from common.xml - * @see http://qgroundcontrol.org/mavlink/ - */ -#ifndef COMMON_TESTSUITE_H -#define COMMON_TESTSUITE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef MAVLINK_TEST_ALL -#define MAVLINK_TEST_ALL - -static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg); - -static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - - mavlink_test_common(system_id, component_id, last_msg); -} -#endif - - - - -static void mavlink_test_heartbeat(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_message_t msg; - uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; - uint16_t i; - mavlink_heartbeat_t packet_in = { - 5, - 72, - 2, - }; - mavlink_heartbeat_t packet1, packet2; - memset(&packet1, 0, sizeof(packet1)); - packet1.type = packet_in.type; - packet1.autopilot = packet_in.autopilot; - packet1.mavlink_version = packet_in.mavlink_version; - - - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_heartbeat_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_heartbeat_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_heartbeat_pack(system_id, component_id, &msg , packet1.type , packet1.autopilot ); - mavlink_msg_heartbeat_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_heartbeat_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.autopilot ); - mavlink_msg_heartbeat_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_to_send_buffer(buffer, &msg); - for (i=0; imagic = MAVLINK_STX; - msg->len = length; - msg->sysid = system_id; - msg->compid = component_id; - // One sequence number per component - msg->seq = mavlink_get_channel_status(chan)->current_tx_seq; - mavlink_get_channel_status(chan)->current_tx_seq = mavlink_get_channel_status(chan)->current_tx_seq+1; - checksum = crc_calculate((uint8_t*)&msg->len, length + MAVLINK_CORE_HEADER_LEN); -#if MAVLINK_CRC_EXTRA - crc_accumulate(crc_extra, &checksum); -#endif - mavlink_ck_a(msg) = (uint8_t)(checksum & 0xFF); - mavlink_ck_b(msg) = (uint8_t)(checksum >> 8); - - return length + MAVLINK_NUM_NON_PAYLOAD_BYTES; -} - - -/** - * @brief Finalize a MAVLink message with MAVLINK_COMM_0 as default channel - */ -#if MAVLINK_CRC_EXTRA -MAVLINK_HELPER uint16_t mavlink_finalize_message(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, - uint8_t length, uint8_t crc_extra) -{ - return mavlink_finalize_message_chan(msg, system_id, component_id, MAVLINK_COMM_0, length, crc_extra); -} -#else -MAVLINK_HELPER uint16_t mavlink_finalize_message(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, - uint8_t length) -{ - return mavlink_finalize_message_chan(msg, system_id, component_id, MAVLINK_COMM_0, length); -} -#endif - -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS -MAVLINK_HELPER void _mavlink_send_uart(mavlink_channel_t chan, const char *buf, uint16_t len); - -/** - * @brief Finalize a MAVLink message with channel assignment and send - */ -#if MAVLINK_CRC_EXTRA -MAVLINK_HELPER void _mav_finalize_message_chan_send(mavlink_channel_t chan, uint8_t msgid, const char *packet, - uint8_t length, uint8_t crc_extra) -#else -MAVLINK_HELPER void _mav_finalize_message_chan_send(mavlink_channel_t chan, uint8_t msgid, const char *packet, uint8_t length) -#endif -{ - uint16_t checksum; - uint8_t buf[MAVLINK_NUM_HEADER_BYTES]; - uint8_t ck[2]; - mavlink_status_t *status = mavlink_get_channel_status(chan); - buf[0] = MAVLINK_STX; - buf[1] = length; - buf[2] = status->current_tx_seq; - buf[3] = mavlink_system.sysid; - buf[4] = mavlink_system.compid; - buf[5] = msgid; - status->current_tx_seq++; - checksum = crc_calculate((uint8_t*)&buf[1], MAVLINK_CORE_HEADER_LEN); - crc_accumulate_buffer(&checksum, packet, length); -#if MAVLINK_CRC_EXTRA - crc_accumulate(crc_extra, &checksum); -#endif - ck[0] = (uint8_t)(checksum & 0xFF); - ck[1] = (uint8_t)(checksum >> 8); - - MAVLINK_START_UART_SEND(chan, MAVLINK_NUM_NON_PAYLOAD_BYTES + (uint16_t)length); - _mavlink_send_uart(chan, (const char *)buf, MAVLINK_NUM_HEADER_BYTES); - _mavlink_send_uart(chan, packet, length); - _mavlink_send_uart(chan, (const char *)ck, 2); - MAVLINK_END_UART_SEND(chan, MAVLINK_NUM_NON_PAYLOAD_BYTES + (uint16_t)length); -} -#endif // MAVLINK_USE_CONVENIENCE_FUNCTIONS - -/** - * @brief Pack a message to send it over a serial byte stream - */ -MAVLINK_HELPER uint16_t mavlink_msg_to_send_buffer(uint8_t *buffer, const mavlink_message_t *msg) -{ - memcpy(buffer, (uint8_t *)&msg->magic, MAVLINK_NUM_NON_PAYLOAD_BYTES + (uint16_t)msg->len); - return MAVLINK_NUM_NON_PAYLOAD_BYTES + (uint16_t)msg->len; -} - -union __mavlink_bitfield { - uint8_t uint8; - int8_t int8; - uint16_t uint16; - int16_t int16; - uint32_t uint32; - int32_t int32; -}; - - -MAVLINK_HELPER void mavlink_start_checksum(mavlink_message_t* msg) -{ - crc_init(&msg->checksum); -} - -MAVLINK_HELPER void mavlink_update_checksum(mavlink_message_t* msg, uint8_t c) -{ - crc_accumulate(c, &msg->checksum); -} - -/** - * This is a convenience function which handles the complete MAVLink parsing. - * the function will parse one byte at a time and return the complete packet once - * it could be successfully decoded. Checksum and other failures will be silently - * ignored. - * - * @param chan ID of the current channel. This allows to parse different channels with this function. - * a channel is not a physical message channel like a serial port, but a logic partition of - * the communication streams in this case. COMM_NB is the limit for the number of channels - * on MCU (e.g. ARM7), while COMM_NB_HIGH is the limit for the number of channels in Linux/Windows - * @param c The char to barse - * - * @param returnMsg NULL if no message could be decoded, the message data else - * @return 0 if no message could be decoded, 1 else - * - * A typical use scenario of this function call is: - * - * @code - * #include // For fixed-width uint8_t type - * - * mavlink_message_t msg; - * int chan = 0; - * - * - * while(serial.bytesAvailable > 0) - * { - * uint8_t byte = serial.getNextByte(); - * if (mavlink_parse_char(chan, byte, &msg)) - * { - * printf("Received message with ID %d, sequence: %d from component %d of system %d", msg.msgid, msg.seq, msg.compid, msg.sysid); - * } - * } - * - * - * @endcode - */ -MAVLINK_HELPER uint8_t mavlink_parse_char(uint8_t chan, uint8_t c, mavlink_message_t* r_message, mavlink_status_t* r_mavlink_status) -{ - static mavlink_message_t m_mavlink_message[MAVLINK_COMM_NUM_BUFFERS]; - - /* - default message crc function. You can override this per-system to - put this data in a different memory segment - */ -#if MAVLINK_CRC_EXTRA -#ifndef MAVLINK_MESSAGE_CRC - static const uint8_t mavlink_message_crcs[256] = MAVLINK_MESSAGE_CRCS; -#define MAVLINK_MESSAGE_CRC(msgid) mavlink_message_crcs[msgid] -#endif -#endif - - mavlink_message_t* rxmsg = &m_mavlink_message[chan]; ///< The currently decoded message - mavlink_status_t* status = mavlink_get_channel_status(chan); ///< The current decode status - int bufferIndex = 0; - - status->msg_received = 0; - - switch (status->parse_state) - { - case MAVLINK_PARSE_STATE_UNINIT: - case MAVLINK_PARSE_STATE_IDLE: - if (c == MAVLINK_STX) - { - status->parse_state = MAVLINK_PARSE_STATE_GOT_STX; - rxmsg->len = 0; - mavlink_start_checksum(rxmsg); - } - break; - - case MAVLINK_PARSE_STATE_GOT_STX: - if (status->msg_received - /* Support shorter buffers than the - default maximum packet size */ -#if (MAVLINK_MAX_PAYLOAD_LEN < 255) - || c > MAVLINK_MAX_PAYLOAD_LEN -#endif - ) - { - status->buffer_overrun++; - status->parse_error++; - status->msg_received = 0; - status->parse_state = MAVLINK_PARSE_STATE_IDLE; - } - else - { - // NOT counting STX, LENGTH, SEQ, SYSID, COMPID, MSGID, CRC1 and CRC2 - rxmsg->len = c; - status->packet_idx = 0; - mavlink_update_checksum(rxmsg, c); - status->parse_state = MAVLINK_PARSE_STATE_GOT_LENGTH; - } - break; - - case MAVLINK_PARSE_STATE_GOT_LENGTH: - rxmsg->seq = c; - mavlink_update_checksum(rxmsg, c); - status->parse_state = MAVLINK_PARSE_STATE_GOT_SEQ; - break; - - case MAVLINK_PARSE_STATE_GOT_SEQ: - rxmsg->sysid = c; - mavlink_update_checksum(rxmsg, c); - status->parse_state = MAVLINK_PARSE_STATE_GOT_SYSID; - break; - - case MAVLINK_PARSE_STATE_GOT_SYSID: - rxmsg->compid = c; - mavlink_update_checksum(rxmsg, c); - status->parse_state = MAVLINK_PARSE_STATE_GOT_COMPID; - break; - - case MAVLINK_PARSE_STATE_GOT_COMPID: - rxmsg->msgid = c; - mavlink_update_checksum(rxmsg, c); - if (rxmsg->len == 0) - { - status->parse_state = MAVLINK_PARSE_STATE_GOT_PAYLOAD; - } - else - { - status->parse_state = MAVLINK_PARSE_STATE_GOT_MSGID; - } - break; - - case MAVLINK_PARSE_STATE_GOT_MSGID: - _MAV_PAYLOAD(rxmsg)[status->packet_idx++] = (char)c; - mavlink_update_checksum(rxmsg, c); - if (status->packet_idx == rxmsg->len) - { - status->parse_state = MAVLINK_PARSE_STATE_GOT_PAYLOAD; - } - break; - - case MAVLINK_PARSE_STATE_GOT_PAYLOAD: -#if MAVLINK_CRC_EXTRA - mavlink_update_checksum(rxmsg, MAVLINK_MESSAGE_CRC(rxmsg->msgid)); -#endif - if (c != (rxmsg->checksum & 0xFF)) { - // Check first checksum byte - status->parse_error++; - status->msg_received = 0; - status->parse_state = MAVLINK_PARSE_STATE_IDLE; - if (c == MAVLINK_STX) - { - status->parse_state = MAVLINK_PARSE_STATE_GOT_STX; - rxmsg->len = 0; - mavlink_start_checksum(rxmsg); - } - } - else - { - status->parse_state = MAVLINK_PARSE_STATE_GOT_CRC1; - } - break; - - case MAVLINK_PARSE_STATE_GOT_CRC1: - if (c != (rxmsg->checksum >> 8)) { - // Check second checksum byte - status->parse_error++; - status->msg_received = 0; - status->parse_state = MAVLINK_PARSE_STATE_IDLE; - if (c == MAVLINK_STX) - { - status->parse_state = MAVLINK_PARSE_STATE_GOT_STX; - rxmsg->len = 0; - mavlink_start_checksum(rxmsg); - } - } - else - { - // Successfully got message - status->msg_received = 1; - status->parse_state = MAVLINK_PARSE_STATE_IDLE; - memcpy(r_message, rxmsg, sizeof(mavlink_message_t)); - } - break; - } - - bufferIndex++; - // If a message has been sucessfully decoded, check index - if (status->msg_received == 1) - { - //while(status->current_seq != rxmsg->seq) - //{ - // status->packet_rx_drop_count++; - // status->current_seq++; - //} - status->current_rx_seq = rxmsg->seq; - // Initial condition: If no packet has been received so far, drop count is undefined - if (status->packet_rx_success_count == 0) status->packet_rx_drop_count = 0; - // Count this packet as received - status->packet_rx_success_count++; - } - - r_mavlink_status->current_rx_seq = status->current_rx_seq+1; - r_mavlink_status->packet_rx_success_count = status->packet_rx_success_count; - r_mavlink_status->packet_rx_drop_count = status->parse_error; - status->parse_error = 0; - return status->msg_received; -} - -/** - * @brief Put a bitfield of length 1-32 bit into the buffer - * - * @param b the value to add, will be encoded in the bitfield - * @param bits number of bits to use to encode b, e.g. 1 for boolean, 2, 3, etc. - * @param packet_index the position in the packet (the index of the first byte to use) - * @param bit_index the position in the byte (the index of the first bit to use) - * @param buffer packet buffer to write into - * @return new position of the last used byte in the buffer - */ -MAVLINK_HELPER uint8_t put_bitfield_n_by_index(int32_t b, uint8_t bits, uint8_t packet_index, uint8_t bit_index, uint8_t* r_bit_index, uint8_t* buffer) -{ - uint16_t bits_remain = bits; - // Transform number into network order - int32_t v; - uint8_t i_bit_index, i_byte_index, curr_bits_n; -#if MAVLINK_NEED_BYTE_SWAP - union { - int32_t i; - uint8_t b[4]; - } bin, bout; - bin.i = b; - bout.b[0] = bin.b[3]; - bout.b[1] = bin.b[2]; - bout.b[2] = bin.b[1]; - bout.b[3] = bin.b[0]; - v = bout.i; -#else - v = b; -#endif - - // buffer in - // 01100000 01000000 00000000 11110001 - // buffer out - // 11110001 00000000 01000000 01100000 - - // Existing partly filled byte (four free slots) - // 0111xxxx - - // Mask n free bits - // 00001111 = 2^0 + 2^1 + 2^2 + 2^3 = 2^n - 1 - // = ((uint32_t)(1 << n)) - 1; // = 2^n - 1 - - // Shift n bits into the right position - // out = in >> n; - - // Mask and shift bytes - i_bit_index = bit_index; - i_byte_index = packet_index; - if (bit_index > 0) - { - // If bits were available at start, they were available - // in the byte before the current index - i_byte_index--; - } - - // While bits have not been packed yet - while (bits_remain > 0) - { - // Bits still have to be packed - // there can be more than 8 bits, so - // we might have to pack them into more than one byte - - // First pack everything we can into the current 'open' byte - //curr_bits_n = bits_remain << 3; // Equals bits_remain mod 8 - //FIXME - if (bits_remain <= (uint8_t)(8 - i_bit_index)) - { - // Enough space - curr_bits_n = (uint8_t)bits_remain; - } - else - { - curr_bits_n = (8 - i_bit_index); - } - - // Pack these n bits into the current byte - // Mask out whatever was at that position with ones (xxx11111) - buffer[i_byte_index] &= (0xFF >> (8 - curr_bits_n)); - // Put content to this position, by masking out the non-used part - buffer[i_byte_index] |= ((0x00 << curr_bits_n) & v); - - // Increment the bit index - i_bit_index += curr_bits_n; - - // Now proceed to the next byte, if necessary - bits_remain -= curr_bits_n; - if (bits_remain > 0) - { - // Offer another 8 bits / one byte - i_byte_index++; - i_bit_index = 0; - } - } - - *r_bit_index = i_bit_index; - // If a partly filled byte is present, mark this as consumed - if (i_bit_index != 7) i_byte_index++; - return i_byte_index - packet_index; -} - -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -// To make MAVLink work on your MCU, define comm_send_ch() if you wish -// to send 1 byte at a time, or MAVLINK_SEND_UART_BYTES() to send a -// whole packet at a time - -/* - -#include "mavlink_types.h" - -void comm_send_ch(mavlink_channel_t chan, uint8_t ch) -{ - if (chan == MAVLINK_COMM_0) - { - uart0_transmit(ch); - } - if (chan == MAVLINK_COMM_1) - { - uart1_transmit(ch); - } -} - */ - -MAVLINK_HELPER void _mavlink_send_uart(mavlink_channel_t chan, const char *buf, uint16_t len) -{ -#ifdef MAVLINK_SEND_UART_BYTES - /* this is the more efficient approach, if the platform - defines it */ - MAVLINK_SEND_UART_BYTES(chan, (uint8_t *)buf, len); -#else - /* fallback to one byte at a time */ - uint16_t i; - for (i = 0; i < len; i++) { - comm_send_ch(chan, (uint8_t)buf[i]); - } -#endif -} -#endif // MAVLINK_USE_CONVENIENCE_FUNCTIONS - -#endif /* _MAVLINK_HELPERS_H_ */ diff --git a/src/GCS_MAVLink/include/mavlink_types.h b/src/GCS_MAVLink/include/mavlink_types.h deleted file mode 100644 index 9daeffc63..000000000 --- a/src/GCS_MAVLink/include/mavlink_types.h +++ /dev/null @@ -1,298 +0,0 @@ -#ifndef MAVLINK_TYPES_H_ -#define MAVLINK_TYPES_H_ - -#include "inttypes.h" - -enum MAV_CLASS -{ - MAV_CLASS_GENERIC = 0, ///< Generic autopilot, full support for everything - MAV_CLASS_PIXHAWK = 1, ///< PIXHAWK autopilot, http://pixhawk.ethz.ch - MAV_CLASS_SLUGS = 2, ///< SLUGS autopilot, http://slugsuav.soe.ucsc.edu - MAV_CLASS_ARDUPILOTMEGA = 3, ///< ArduPilotMega / ArduCopter, http://diydrones.com - MAV_CLASS_OPENPILOT = 4, ///< OpenPilot, http://openpilot.org - MAV_CLASS_GENERIC_MISSION_WAYPOINTS_ONLY = 5, ///< Generic autopilot only supporting simple waypoints - MAV_CLASS_GENERIC_MISSION_NAVIGATION_ONLY = 6, ///< Generic autopilot supporting waypoints and other simple navigation commands - MAV_CLASS_GENERIC_MISSION_FULL = 7, ///< Generic autopilot supporting the full mission command set - MAV_CLASS_NONE = 8, ///< No valid autopilot - MAV_CLASS_NB ///< Number of autopilot classes -}; - -enum MAV_ACTION -{ - MAV_ACTION_HOLD = 0, - MAV_ACTION_MOTORS_START = 1, - MAV_ACTION_LAUNCH = 2, - MAV_ACTION_RETURN = 3, - MAV_ACTION_EMCY_LAND = 4, - MAV_ACTION_EMCY_KILL = 5, - MAV_ACTION_CONFIRM_KILL = 6, - MAV_ACTION_CONTINUE = 7, - MAV_ACTION_MOTORS_STOP = 8, - MAV_ACTION_HALT = 9, - MAV_ACTION_SHUTDOWN = 10, - MAV_ACTION_REBOOT = 11, - MAV_ACTION_SET_MANUAL = 12, - MAV_ACTION_SET_AUTO = 13, - MAV_ACTION_STORAGE_READ = 14, - MAV_ACTION_STORAGE_WRITE = 15, - MAV_ACTION_CALIBRATE_RC = 16, - MAV_ACTION_CALIBRATE_GYRO = 17, - MAV_ACTION_CALIBRATE_MAG = 18, - MAV_ACTION_CALIBRATE_ACC = 19, - MAV_ACTION_CALIBRATE_PRESSURE = 20, - MAV_ACTION_REC_START = 21, - MAV_ACTION_REC_PAUSE = 22, - MAV_ACTION_REC_STOP = 23, - MAV_ACTION_TAKEOFF = 24, - MAV_ACTION_NAVIGATE = 25, - MAV_ACTION_LAND = 26, - MAV_ACTION_LOITER = 27, - MAV_ACTION_SET_ORIGIN = 28, - MAV_ACTION_RELAY_ON = 29, - MAV_ACTION_RELAY_OFF = 30, - MAV_ACTION_GET_IMAGE = 31, - MAV_ACTION_VIDEO_START = 32, - MAV_ACTION_VIDEO_STOP = 33, - MAV_ACTION_RESET_MAP = 34, - MAV_ACTION_RESET_PLAN = 35, - MAV_ACTION_DELAY_BEFORE_COMMAND = 36, - MAV_ACTION_ASCEND_AT_RATE = 37, - MAV_ACTION_CHANGE_MODE = 38, - MAV_ACTION_LOITER_MAX_TURNS = 39, - MAV_ACTION_LOITER_MAX_TIME = 40, - MAV_ACTION_START_HILSIM = 41, - MAV_ACTION_STOP_HILSIM = 42, - MAV_ACTION_NB ///< Number of MAV actions -}; - -enum MAV_MODE -{ - MAV_MODE_UNINIT = 0, ///< System is in undefined state - MAV_MODE_LOCKED = 1, ///< Motors are blocked, system is safe - MAV_MODE_MANUAL = 2, ///< System is allowed to be active, under manual (RC) control - MAV_MODE_GUIDED = 3, ///< System is allowed to be active, under autonomous control, manual setpoint - MAV_MODE_AUTO = 4, ///< System is allowed to be active, under autonomous control and navigation - MAV_MODE_TEST1 = 5, ///< Generic test mode, for custom use - MAV_MODE_TEST2 = 6, ///< Generic test mode, for custom use - MAV_MODE_TEST3 = 7, ///< Generic test mode, for custom use - MAV_MODE_READY = 8, ///< System is ready, motors are unblocked, but controllers are inactive - MAV_MODE_RC_TRAINING = 9 ///< System is blocked, only RC valued are read and reported back -}; - -enum MAV_STATE -{ - MAV_STATE_UNINIT = 0, - MAV_STATE_BOOT, - MAV_STATE_CALIBRATING, - MAV_STATE_STANDBY, - MAV_STATE_ACTIVE, - MAV_STATE_CRITICAL, - MAV_STATE_EMERGENCY, - MAV_STATE_HILSIM, - MAV_STATE_POWEROFF -}; - -enum MAV_NAV -{ - MAV_NAV_GROUNDED = 0, - MAV_NAV_LIFTOFF, - MAV_NAV_HOLD, - MAV_NAV_WAYPOINT, - MAV_NAV_VECTOR, - MAV_NAV_RETURNING, - MAV_NAV_LANDING, - MAV_NAV_LOST, - MAV_NAV_LOITER, - MAV_NAV_FREE_DRIFT -}; - -enum MAV_TYPE -{ - MAV_GENERIC = 0, - MAV_FIXED_WING = 1, - MAV_QUADROTOR = 2, - MAV_COAXIAL = 3, - MAV_HELICOPTER = 4, - MAV_GROUND = 5, - OCU = 6, - MAV_AIRSHIP = 7, - MAV_FREE_BALLOON = 8, - MAV_ROCKET = 9, - UGV_GROUND_ROVER = 10, - UGV_SURFACE_SHIP = 11 -}; - -enum MAV_AUTOPILOT_TYPE -{ - MAV_AUTOPILOT_GENERIC = 0, - MAV_AUTOPILOT_PIXHAWK = 1, - MAV_AUTOPILOT_SLUGS = 2, - MAV_AUTOPILOT_ARDUPILOTMEGA = 3, - MAV_AUTOPILOT_NONE = 4 -}; - -enum MAV_COMPONENT -{ - MAV_COMP_ID_GPS, - MAV_COMP_ID_WAYPOINTPLANNER, - MAV_COMP_ID_BLOBTRACKER, - MAV_COMP_ID_PATHPLANNER, - MAV_COMP_ID_AIRSLAM, - MAV_COMP_ID_MAPPER, - MAV_COMP_ID_CAMERA, - MAV_COMP_ID_IMU = 200, - MAV_COMP_ID_IMU_2 = 201, - MAV_COMP_ID_IMU_3 = 202, - MAV_COMP_ID_UDP_BRIDGE = 240, - MAV_COMP_ID_UART_BRIDGE = 241, - MAV_COMP_ID_SYSTEM_CONTROL = 250 -}; - -enum MAV_FRAME -{ - MAV_FRAME_GLOBAL = 0, - MAV_FRAME_LOCAL = 1, - MAV_FRAME_MISSION = 2, - MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, - MAV_FRAME_LOCAL_ENU = 4 -}; - -enum MAVLINK_DATA_STREAM_TYPE -{ - MAVLINK_DATA_STREAM_IMG_JPEG, - MAVLINK_DATA_STREAM_IMG_BMP, - MAVLINK_DATA_STREAM_IMG_RAW8U, - MAVLINK_DATA_STREAM_IMG_RAW32U, - MAVLINK_DATA_STREAM_IMG_PGM, - MAVLINK_DATA_STREAM_IMG_PNG -}; - -#ifndef MAVLINK_MAX_PAYLOAD_LEN -// it is possible to override this, but be careful! -#define MAVLINK_MAX_PAYLOAD_LEN 255 ///< Maximum payload length -#endif - -#define MAVLINK_CORE_HEADER_LEN 5 ///< Length of core header (of the comm. layer): message length (1 byte) + message sequence (1 byte) + message system id (1 byte) + message component id (1 byte) + message type id (1 byte) -#define MAVLINK_NUM_HEADER_BYTES (MAVLINK_CORE_HEADER_LEN + 1) ///< Length of all header bytes, including core and checksum -#define MAVLINK_NUM_CHECKSUM_BYTES 2 -#define MAVLINK_NUM_NON_PAYLOAD_BYTES (MAVLINK_NUM_HEADER_BYTES + MAVLINK_NUM_CHECKSUM_BYTES) - -#define MAVLINK_MAX_PACKET_LEN (MAVLINK_MAX_PAYLOAD_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES) ///< Maximum packet length - -typedef struct param_union { - union { - float param_float; - int32_t param_int32; - uint32_t param_uint32; - }; - uint8_t type; -} mavlink_param_union_t; - -typedef struct __mavlink_system { - uint8_t sysid; ///< Used by the MAVLink message_xx_send() convenience function - uint8_t compid; ///< Used by the MAVLink message_xx_send() convenience function - uint8_t type; ///< Unused, can be used by user to store the system's type - uint8_t state; ///< Unused, can be used by user to store the system's state - uint8_t mode; ///< Unused, can be used by user to store the system's mode - uint8_t nav_mode; ///< Unused, can be used by user to store the system's navigation mode -} mavlink_system_t; - -typedef struct __mavlink_message { - uint16_t checksum; /// sent at end of packet - uint8_t magic; ///< protocol magic marker - uint8_t len; ///< Length of payload - uint8_t seq; ///< Sequence of packet - uint8_t sysid; ///< ID of message sender system/aircraft - uint8_t compid; ///< ID of the message sender component - uint8_t msgid; ///< ID of message in payload - uint64_t payload64[(MAVLINK_MAX_PAYLOAD_LEN+MAVLINK_NUM_CHECKSUM_BYTES+7)/8]; -} mavlink_message_t; - -typedef enum { - MAVLINK_TYPE_CHAR = 0, - MAVLINK_TYPE_UINT8_T = 1, - MAVLINK_TYPE_INT8_T = 2, - MAVLINK_TYPE_UINT16_T = 3, - MAVLINK_TYPE_INT16_T = 4, - MAVLINK_TYPE_UINT32_T = 5, - MAVLINK_TYPE_INT32_T = 6, - MAVLINK_TYPE_UINT64_T = 7, - MAVLINK_TYPE_INT64_T = 8, - MAVLINK_TYPE_FLOAT = 9, - MAVLINK_TYPE_DOUBLE = 10 -} mavlink_message_type_t; - -#define MAVLINK_MAX_FIELDS 64 - -typedef struct __mavlink_field_info { - const char *name; // name of this field - const char *print_format; // printing format hint, or NULL - mavlink_message_type_t type; // type of this field - unsigned array_length; // if non-zero, field is an array - unsigned wire_offset; // offset of each field in the payload - unsigned structure_offset; // offset in a C structure -} mavlink_field_info_t; - -// note that in this structure the order of fields is the order -// in the XML file, not necessary the wire order -typedef struct __mavlink_message_info { - const char *name; // name of the message - unsigned num_fields; // how many fields in this message - mavlink_field_info_t fields[MAVLINK_MAX_FIELDS]; // field information -} mavlink_message_info_t; - -#define _MAV_PAYLOAD(msg) ((char *)(&(msg)->payload64[0])) - -// checksum is immediately after the payload bytes -#define mavlink_ck_a(msg) *(msg->len + (uint8_t *)_MAV_PAYLOAD(msg)) -#define mavlink_ck_b(msg) *((msg->len+(uint16_t)1) + (uint8_t *)_MAV_PAYLOAD(msg)) - -typedef enum { - MAVLINK_COMM_0, - MAVLINK_COMM_1, - MAVLINK_COMM_2, - MAVLINK_COMM_3 -} mavlink_channel_t; - -/* - * applications can set MAVLINK_COMM_NUM_BUFFERS to the maximum number - * of buffers they will use. If more are used, then the result will be - * a stack overrun - */ -#ifndef MAVLINK_COMM_NUM_BUFFERS -#if (defined linux) | (defined __linux) | (defined __MACH__) | (defined _WIN32) -# define MAVLINK_COMM_NUM_BUFFERS 16 -#else -# define MAVLINK_COMM_NUM_BUFFERS 4 -#endif -#endif - -typedef enum { - MAVLINK_PARSE_STATE_UNINIT=0, - MAVLINK_PARSE_STATE_IDLE, - MAVLINK_PARSE_STATE_GOT_STX, - MAVLINK_PARSE_STATE_GOT_SEQ, - MAVLINK_PARSE_STATE_GOT_LENGTH, - MAVLINK_PARSE_STATE_GOT_SYSID, - MAVLINK_PARSE_STATE_GOT_COMPID, - MAVLINK_PARSE_STATE_GOT_MSGID, - MAVLINK_PARSE_STATE_GOT_PAYLOAD, - MAVLINK_PARSE_STATE_GOT_CRC1 -} mavlink_parse_state_t; ///< The state machine for the comm parser - -typedef struct __mavlink_status { - uint8_t msg_received; ///< Number of received messages - uint8_t buffer_overrun; ///< Number of buffer overruns - uint8_t parse_error; ///< Number of parse errors - mavlink_parse_state_t parse_state; ///< Parsing state machine - uint8_t packet_idx; ///< Index in current packet - uint8_t current_rx_seq; ///< Sequence number of last packet received - uint8_t current_tx_seq; ///< Sequence number of last packet sent - uint16_t packet_rx_success_count; ///< Received packets - uint16_t packet_rx_drop_count; ///< Number of packet drops -} mavlink_status_t; - -#define MAVLINK_BIG_ENDIAN 0 -#define MAVLINK_LITTLE_ENDIAN 1 - -#endif /* MAVLINK_TYPES_H_ */ diff --git a/src/GCS_MAVLink/include/protocol.h b/src/GCS_MAVLink/include/protocol.h deleted file mode 100644 index 05195c369..000000000 --- a/src/GCS_MAVLink/include/protocol.h +++ /dev/null @@ -1,319 +0,0 @@ -#ifndef _MAVLINK_PROTOCOL_H_ -#define _MAVLINK_PROTOCOL_H_ - -#include "string.h" -#include "mavlink_types.h" - -/* - If you want MAVLink on a system that is native big-endian, - you need to define NATIVE_BIG_ENDIAN -*/ -#ifdef NATIVE_BIG_ENDIAN -# define MAVLINK_NEED_BYTE_SWAP (MAVLINK_ENDIAN == MAVLINK_LITTLE_ENDIAN) -#else -# define MAVLINK_NEED_BYTE_SWAP (MAVLINK_ENDIAN != MAVLINK_LITTLE_ENDIAN) -#endif - -#ifndef MAVLINK_STACK_BUFFER -#define MAVLINK_STACK_BUFFER 0 -#endif - -#ifndef MAVLINK_AVOID_GCC_STACK_BUG -# define MAVLINK_AVOID_GCC_STACK_BUG defined(__GNUC__) -#endif - -#ifndef MAVLINK_ASSERT -#define MAVLINK_ASSERT(x) -#endif - -#ifndef MAVLINK_START_UART_SEND -#define MAVLINK_START_UART_SEND(chan, length) -#endif - -#ifndef MAVLINK_END_UART_SEND -#define MAVLINK_END_UART_SEND(chan, length) -#endif - -#ifdef MAVLINK_SEPARATE_HELPERS -#define MAVLINK_HELPER -#else -#define MAVLINK_HELPER static inline -#include "mavlink_helpers.h" -#endif // MAVLINK_SEPARATE_HELPERS - -/* always include the prototypes to ensure we don't get out of sync */ -MAVLINK_HELPER mavlink_status_t* mavlink_get_channel_status(uint8_t chan); -#if MAVLINK_CRC_EXTRA -MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, - uint8_t chan, uint8_t length, uint8_t crc_extra); -MAVLINK_HELPER uint16_t mavlink_finalize_message(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, - uint8_t length, uint8_t crc_extra); -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS -MAVLINK_HELPER void _mav_finalize_message_chan_send(mavlink_channel_t chan, uint8_t msgid, const char *packet, - uint8_t length, uint8_t crc_extra); -#endif -#else -MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, - uint8_t chan, uint8_t length); -MAVLINK_HELPER uint16_t mavlink_finalize_message(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, - uint8_t length); -MAVLINK_HELPER void _mav_finalize_message_chan_send(mavlink_channel_t chan, uint8_t msgid, const char *packet, uint8_t length); -#endif // MAVLINK_CRC_EXTRA -MAVLINK_HELPER uint16_t mavlink_msg_to_send_buffer(uint8_t *buffer, const mavlink_message_t *msg); -MAVLINK_HELPER void mavlink_start_checksum(mavlink_message_t* msg); -MAVLINK_HELPER void mavlink_update_checksum(mavlink_message_t* msg, uint8_t c); -MAVLINK_HELPER uint8_t mavlink_parse_char(uint8_t chan, uint8_t c, mavlink_message_t* r_message, mavlink_status_t* r_mavlink_status); -MAVLINK_HELPER uint8_t put_bitfield_n_by_index(int32_t b, uint8_t bits, uint8_t packet_index, uint8_t bit_index, - uint8_t* r_bit_index, uint8_t* buffer); -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS -MAVLINK_HELPER void _mavlink_send_uart(mavlink_channel_t chan, const char *buf, uint16_t len); -#endif - -/** - * @brief Get the required buffer size for this message - */ -static inline uint16_t mavlink_msg_get_send_buffer_length(const mavlink_message_t* msg) -{ - return msg->len + MAVLINK_NUM_NON_PAYLOAD_BYTES; -} - -#if MAVLINK_NEED_BYTE_SWAP -static inline void byte_swap_2(char *dst, const char *src) -{ - dst[0] = src[1]; - dst[1] = src[0]; -} -static inline void byte_swap_4(char *dst, const char *src) -{ - dst[0] = src[3]; - dst[1] = src[2]; - dst[2] = src[1]; - dst[3] = src[0]; -} -static inline void byte_swap_8(char *dst, const char *src) -{ - dst[0] = src[7]; - dst[1] = src[6]; - dst[2] = src[5]; - dst[3] = src[4]; - dst[4] = src[3]; - dst[5] = src[2]; - dst[6] = src[1]; - dst[7] = src[0]; -} -#elif !MAVLINK_ALIGNED_FIELDS -static inline void byte_copy_2(char *dst, const char *src) -{ - dst[0] = src[0]; - dst[1] = src[1]; -} -static inline void byte_copy_4(char *dst, const char *src) -{ - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = src[3]; -} -static inline void byte_copy_8(char *dst, const char *src) -{ - memcpy(dst, src, 8); -} -#endif - -#define _mav_put_uint8_t(buf, wire_offset, b) buf[wire_offset] = (uint8_t)b -#define _mav_put_int8_t(buf, wire_offset, b) buf[wire_offset] = (int8_t)b -#define _mav_put_char(buf, wire_offset, b) buf[wire_offset] = b - -#if MAVLINK_NEED_BYTE_SWAP -#define _mav_put_uint16_t(buf, wire_offset, b) byte_swap_2(&buf[wire_offset], (const char *)&b) -#define _mav_put_int16_t(buf, wire_offset, b) byte_swap_2(&buf[wire_offset], (const char *)&b) -#define _mav_put_uint32_t(buf, wire_offset, b) byte_swap_4(&buf[wire_offset], (const char *)&b) -#define _mav_put_int32_t(buf, wire_offset, b) byte_swap_4(&buf[wire_offset], (const char *)&b) -#define _mav_put_uint64_t(buf, wire_offset, b) byte_swap_8(&buf[wire_offset], (const char *)&b) -#define _mav_put_int64_t(buf, wire_offset, b) byte_swap_8(&buf[wire_offset], (const char *)&b) -#define _mav_put_float(buf, wire_offset, b) byte_swap_4(&buf[wire_offset], (const char *)&b) -#define _mav_put_double(buf, wire_offset, b) byte_swap_8(&buf[wire_offset], (const char *)&b) -#elif !MAVLINK_ALIGNED_FIELDS -#define _mav_put_uint16_t(buf, wire_offset, b) byte_copy_2(&buf[wire_offset], (const char *)&b) -#define _mav_put_int16_t(buf, wire_offset, b) byte_copy_2(&buf[wire_offset], (const char *)&b) -#define _mav_put_uint32_t(buf, wire_offset, b) byte_copy_4(&buf[wire_offset], (const char *)&b) -#define _mav_put_int32_t(buf, wire_offset, b) byte_copy_4(&buf[wire_offset], (const char *)&b) -#define _mav_put_uint64_t(buf, wire_offset, b) byte_copy_8(&buf[wire_offset], (const char *)&b) -#define _mav_put_int64_t(buf, wire_offset, b) byte_copy_8(&buf[wire_offset], (const char *)&b) -#define _mav_put_float(buf, wire_offset, b) byte_copy_4(&buf[wire_offset], (const char *)&b) -#define _mav_put_double(buf, wire_offset, b) byte_copy_8(&buf[wire_offset], (const char *)&b) -#else -#define _mav_put_uint16_t(buf, wire_offset, b) *(uint16_t *)&buf[wire_offset] = b -#define _mav_put_int16_t(buf, wire_offset, b) *(int16_t *)&buf[wire_offset] = b -#define _mav_put_uint32_t(buf, wire_offset, b) *(uint32_t *)&buf[wire_offset] = b -#define _mav_put_int32_t(buf, wire_offset, b) *(int32_t *)&buf[wire_offset] = b -#define _mav_put_uint64_t(buf, wire_offset, b) *(uint64_t *)&buf[wire_offset] = b -#define _mav_put_int64_t(buf, wire_offset, b) *(int64_t *)&buf[wire_offset] = b -#define _mav_put_float(buf, wire_offset, b) *(float *)&buf[wire_offset] = b -#define _mav_put_double(buf, wire_offset, b) *(double *)&buf[wire_offset] = b -#endif - -/* - like memcpy(), but if src is NULL, do a memset to zero - */ -static void mav_array_memcpy(void *dest, const void *src, size_t n) -{ - if (src == NULL) { - memset(dest, 0, n); - } else { - memcpy(dest, src, n); - } -} - -/* - * Place a char array into a buffer - */ -static inline void _mav_put_char_array(char *buf, uint8_t wire_offset, const char *b, uint8_t array_length) -{ - mav_array_memcpy(&buf[wire_offset], b, array_length); -} - -/* - * Place a uint8_t array into a buffer - */ -static inline void _mav_put_uint8_t_array(char *buf, uint8_t wire_offset, const uint8_t *b, uint8_t array_length) -{ - mav_array_memcpy(&buf[wire_offset], b, array_length); -} - -/* - * Place a int8_t array into a buffer - */ -static inline void _mav_put_int8_t_array(char *buf, uint8_t wire_offset, const int8_t *b, uint8_t array_length) -{ - mav_array_memcpy(&buf[wire_offset], b, array_length); -} - -#if MAVLINK_NEED_BYTE_SWAP -#define _MAV_PUT_ARRAY(TYPE, V) \ -static inline void _mav_put_ ## TYPE ##_array(char *buf, uint8_t wire_offset, const TYPE *b, uint8_t array_length) \ -{ \ - if (b == NULL) { \ - memset(&buf[wire_offset], 0, array_length*sizeof(TYPE)); \ - } else { \ - uint16_t i; \ - for (i=0; imsgid = MAVLINK_MSG_ID_AHRS; - return mavlink_finalize_message(msg, system_id, component_id, 28, 127); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AHRS_LEN, MAVLINK_MSG_ID_AHRS_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AHRS_LEN); +#endif } /** @@ -98,7 +105,7 @@ static inline uint16_t mavlink_msg_ahrs_pack_chan(uint8_t system_id, uint8_t com float omegaIx,float omegaIy,float omegaIz,float accel_weight,float renorm_val,float error_rp,float error_yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; + char buf[MAVLINK_MSG_ID_AHRS_LEN]; _mav_put_float(buf, 0, omegaIx); _mav_put_float(buf, 4, omegaIy); _mav_put_float(buf, 8, omegaIz); @@ -107,7 +114,7 @@ static inline uint16_t mavlink_msg_ahrs_pack_chan(uint8_t system_id, uint8_t com _mav_put_float(buf, 20, error_rp); _mav_put_float(buf, 24, error_yaw); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AHRS_LEN); #else mavlink_ahrs_t packet; packet.omegaIx = omegaIx; @@ -118,11 +125,15 @@ static inline uint16_t mavlink_msg_ahrs_pack_chan(uint8_t system_id, uint8_t com packet.error_rp = error_rp; packet.error_yaw = error_yaw; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AHRS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_AHRS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 127); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AHRS_LEN, MAVLINK_MSG_ID_AHRS_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AHRS_LEN); +#endif } /** @@ -155,7 +166,7 @@ static inline uint16_t mavlink_msg_ahrs_encode(uint8_t system_id, uint8_t compon static inline void mavlink_msg_ahrs_send(mavlink_channel_t chan, float omegaIx, float omegaIy, float omegaIz, float accel_weight, float renorm_val, float error_rp, float error_yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; + char buf[MAVLINK_MSG_ID_AHRS_LEN]; _mav_put_float(buf, 0, omegaIx); _mav_put_float(buf, 4, omegaIy); _mav_put_float(buf, 8, omegaIz); @@ -164,7 +175,11 @@ static inline void mavlink_msg_ahrs_send(mavlink_channel_t chan, float omegaIx, _mav_put_float(buf, 20, error_rp); _mav_put_float(buf, 24, error_yaw); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS, buf, 28, 127); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS, buf, MAVLINK_MSG_ID_AHRS_LEN, MAVLINK_MSG_ID_AHRS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS, buf, MAVLINK_MSG_ID_AHRS_LEN); +#endif #else mavlink_ahrs_t packet; packet.omegaIx = omegaIx; @@ -175,7 +190,11 @@ static inline void mavlink_msg_ahrs_send(mavlink_channel_t chan, float omegaIx, packet.error_rp = error_rp; packet.error_yaw = error_yaw; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS, (const char *)&packet, 28, 127); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS, (const char *)&packet, MAVLINK_MSG_ID_AHRS_LEN, MAVLINK_MSG_ID_AHRS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS, (const char *)&packet, MAVLINK_MSG_ID_AHRS_LEN); +#endif #endif } @@ -271,6 +290,6 @@ static inline void mavlink_msg_ahrs_decode(const mavlink_message_t* msg, mavlink ahrs->error_rp = mavlink_msg_ahrs_get_error_rp(msg); ahrs->error_yaw = mavlink_msg_ahrs_get_error_yaw(msg); #else - memcpy(ahrs, _MAV_PAYLOAD(msg), 28); + memcpy(ahrs, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_AHRS_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_ap_adc.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_ap_adc.h index ea640c4fb..c6c762451 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_ap_adc.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_ap_adc.h @@ -15,6 +15,9 @@ typedef struct __mavlink_ap_adc_t #define MAVLINK_MSG_ID_AP_ADC_LEN 12 #define MAVLINK_MSG_ID_153_LEN 12 +#define MAVLINK_MSG_ID_AP_ADC_CRC 188 +#define MAVLINK_MSG_ID_153_CRC 188 + #define MAVLINK_MESSAGE_INFO_AP_ADC { \ @@ -48,7 +51,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack(uint8_t system_id, uint8_t compon uint16_t adc1, uint16_t adc2, uint16_t adc3, uint16_t adc4, uint16_t adc5, uint16_t adc6) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; + char buf[MAVLINK_MSG_ID_AP_ADC_LEN]; _mav_put_uint16_t(buf, 0, adc1); _mav_put_uint16_t(buf, 2, adc2); _mav_put_uint16_t(buf, 4, adc3); @@ -56,7 +59,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack(uint8_t system_id, uint8_t compon _mav_put_uint16_t(buf, 8, adc5); _mav_put_uint16_t(buf, 10, adc6); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AP_ADC_LEN); #else mavlink_ap_adc_t packet; packet.adc1 = adc1; @@ -66,11 +69,15 @@ static inline uint16_t mavlink_msg_ap_adc_pack(uint8_t system_id, uint8_t compon packet.adc5 = adc5; packet.adc6 = adc6; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AP_ADC_LEN); #endif msg->msgid = MAVLINK_MSG_ID_AP_ADC; - return mavlink_finalize_message(msg, system_id, component_id, 12, 188); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AP_ADC_LEN, MAVLINK_MSG_ID_AP_ADC_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AP_ADC_LEN); +#endif } /** @@ -92,7 +99,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack_chan(uint8_t system_id, uint8_t c uint16_t adc1,uint16_t adc2,uint16_t adc3,uint16_t adc4,uint16_t adc5,uint16_t adc6) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; + char buf[MAVLINK_MSG_ID_AP_ADC_LEN]; _mav_put_uint16_t(buf, 0, adc1); _mav_put_uint16_t(buf, 2, adc2); _mav_put_uint16_t(buf, 4, adc3); @@ -100,7 +107,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack_chan(uint8_t system_id, uint8_t c _mav_put_uint16_t(buf, 8, adc5); _mav_put_uint16_t(buf, 10, adc6); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AP_ADC_LEN); #else mavlink_ap_adc_t packet; packet.adc1 = adc1; @@ -110,11 +117,15 @@ static inline uint16_t mavlink_msg_ap_adc_pack_chan(uint8_t system_id, uint8_t c packet.adc5 = adc5; packet.adc6 = adc6; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AP_ADC_LEN); #endif msg->msgid = MAVLINK_MSG_ID_AP_ADC; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 188); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AP_ADC_LEN, MAVLINK_MSG_ID_AP_ADC_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AP_ADC_LEN); +#endif } /** @@ -146,7 +157,7 @@ static inline uint16_t mavlink_msg_ap_adc_encode(uint8_t system_id, uint8_t comp static inline void mavlink_msg_ap_adc_send(mavlink_channel_t chan, uint16_t adc1, uint16_t adc2, uint16_t adc3, uint16_t adc4, uint16_t adc5, uint16_t adc6) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; + char buf[MAVLINK_MSG_ID_AP_ADC_LEN]; _mav_put_uint16_t(buf, 0, adc1); _mav_put_uint16_t(buf, 2, adc2); _mav_put_uint16_t(buf, 4, adc3); @@ -154,7 +165,11 @@ static inline void mavlink_msg_ap_adc_send(mavlink_channel_t chan, uint16_t adc1 _mav_put_uint16_t(buf, 8, adc5); _mav_put_uint16_t(buf, 10, adc6); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AP_ADC, buf, 12, 188); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AP_ADC, buf, MAVLINK_MSG_ID_AP_ADC_LEN, MAVLINK_MSG_ID_AP_ADC_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AP_ADC, buf, MAVLINK_MSG_ID_AP_ADC_LEN); +#endif #else mavlink_ap_adc_t packet; packet.adc1 = adc1; @@ -164,7 +179,11 @@ static inline void mavlink_msg_ap_adc_send(mavlink_channel_t chan, uint16_t adc1 packet.adc5 = adc5; packet.adc6 = adc6; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AP_ADC, (const char *)&packet, 12, 188); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AP_ADC, (const char *)&packet, MAVLINK_MSG_ID_AP_ADC_LEN, MAVLINK_MSG_ID_AP_ADC_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AP_ADC, (const char *)&packet, MAVLINK_MSG_ID_AP_ADC_LEN); +#endif #endif } @@ -249,6 +268,6 @@ static inline void mavlink_msg_ap_adc_decode(const mavlink_message_t* msg, mavli ap_adc->adc5 = mavlink_msg_ap_adc_get_adc5(msg); ap_adc->adc6 = mavlink_msg_ap_adc_get_adc6(msg); #else - memcpy(ap_adc, _MAV_PAYLOAD(msg), 12); + memcpy(ap_adc, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_AP_ADC_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_data16.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_data16.h index 359201c8c..c75358526 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_data16.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_data16.h @@ -12,6 +12,9 @@ typedef struct __mavlink_data16_t #define MAVLINK_MSG_ID_DATA16_LEN 18 #define MAVLINK_MSG_ID_169_LEN 18 +#define MAVLINK_MSG_ID_DATA16_CRC 234 +#define MAVLINK_MSG_ID_169_CRC 234 + #define MAVLINK_MSG_DATA16_FIELD_DATA_LEN 16 #define MAVLINK_MESSAGE_INFO_DATA16 { \ @@ -39,21 +42,25 @@ static inline uint16_t mavlink_msg_data16_pack(uint8_t system_id, uint8_t compon uint8_t type, uint8_t len, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_DATA16_LEN]; _mav_put_uint8_t(buf, 0, type); _mav_put_uint8_t(buf, 1, len); _mav_put_uint8_t_array(buf, 2, data, 16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA16_LEN); #else mavlink_data16_t packet; packet.type = type; packet.len = len; mav_array_memcpy(packet.data, data, sizeof(uint8_t)*16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA16_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DATA16; - return mavlink_finalize_message(msg, system_id, component_id, 18, 234); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA16_LEN, MAVLINK_MSG_ID_DATA16_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA16_LEN); +#endif } /** @@ -72,21 +79,25 @@ static inline uint16_t mavlink_msg_data16_pack_chan(uint8_t system_id, uint8_t c uint8_t type,uint8_t len,const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_DATA16_LEN]; _mav_put_uint8_t(buf, 0, type); _mav_put_uint8_t(buf, 1, len); _mav_put_uint8_t_array(buf, 2, data, 16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA16_LEN); #else mavlink_data16_t packet; packet.type = type; packet.len = len; mav_array_memcpy(packet.data, data, sizeof(uint8_t)*16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA16_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DATA16; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18, 234); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA16_LEN, MAVLINK_MSG_ID_DATA16_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA16_LEN); +#endif } /** @@ -115,17 +126,25 @@ static inline uint16_t mavlink_msg_data16_encode(uint8_t system_id, uint8_t comp static inline void mavlink_msg_data16_send(mavlink_channel_t chan, uint8_t type, uint8_t len, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_DATA16_LEN]; _mav_put_uint8_t(buf, 0, type); _mav_put_uint8_t(buf, 1, len); _mav_put_uint8_t_array(buf, 2, data, 16); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA16, buf, 18, 234); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA16, buf, MAVLINK_MSG_ID_DATA16_LEN, MAVLINK_MSG_ID_DATA16_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA16, buf, MAVLINK_MSG_ID_DATA16_LEN); +#endif #else mavlink_data16_t packet; packet.type = type; packet.len = len; mav_array_memcpy(packet.data, data, sizeof(uint8_t)*16); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA16, (const char *)&packet, 18, 234); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA16, (const char *)&packet, MAVLINK_MSG_ID_DATA16_LEN, MAVLINK_MSG_ID_DATA16_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA16, (const char *)&packet, MAVLINK_MSG_ID_DATA16_LEN); +#endif #endif } @@ -177,6 +196,6 @@ static inline void mavlink_msg_data16_decode(const mavlink_message_t* msg, mavli data16->len = mavlink_msg_data16_get_len(msg); mavlink_msg_data16_get_data(msg, data16->data); #else - memcpy(data16, _MAV_PAYLOAD(msg), 18); + memcpy(data16, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DATA16_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_data32.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_data32.h index a9b3fe28d..46c804a3c 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_data32.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_data32.h @@ -12,6 +12,9 @@ typedef struct __mavlink_data32_t #define MAVLINK_MSG_ID_DATA32_LEN 34 #define MAVLINK_MSG_ID_170_LEN 34 +#define MAVLINK_MSG_ID_DATA32_CRC 73 +#define MAVLINK_MSG_ID_170_CRC 73 + #define MAVLINK_MSG_DATA32_FIELD_DATA_LEN 32 #define MAVLINK_MESSAGE_INFO_DATA32 { \ @@ -39,21 +42,25 @@ static inline uint16_t mavlink_msg_data32_pack(uint8_t system_id, uint8_t compon uint8_t type, uint8_t len, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[34]; + char buf[MAVLINK_MSG_ID_DATA32_LEN]; _mav_put_uint8_t(buf, 0, type); _mav_put_uint8_t(buf, 1, len); _mav_put_uint8_t_array(buf, 2, data, 32); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 34); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA32_LEN); #else mavlink_data32_t packet; packet.type = type; packet.len = len; mav_array_memcpy(packet.data, data, sizeof(uint8_t)*32); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 34); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA32_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DATA32; - return mavlink_finalize_message(msg, system_id, component_id, 34, 73); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA32_LEN, MAVLINK_MSG_ID_DATA32_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA32_LEN); +#endif } /** @@ -72,21 +79,25 @@ static inline uint16_t mavlink_msg_data32_pack_chan(uint8_t system_id, uint8_t c uint8_t type,uint8_t len,const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[34]; + char buf[MAVLINK_MSG_ID_DATA32_LEN]; _mav_put_uint8_t(buf, 0, type); _mav_put_uint8_t(buf, 1, len); _mav_put_uint8_t_array(buf, 2, data, 32); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 34); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA32_LEN); #else mavlink_data32_t packet; packet.type = type; packet.len = len; mav_array_memcpy(packet.data, data, sizeof(uint8_t)*32); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 34); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA32_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DATA32; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 34, 73); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA32_LEN, MAVLINK_MSG_ID_DATA32_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA32_LEN); +#endif } /** @@ -115,17 +126,25 @@ static inline uint16_t mavlink_msg_data32_encode(uint8_t system_id, uint8_t comp static inline void mavlink_msg_data32_send(mavlink_channel_t chan, uint8_t type, uint8_t len, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[34]; + char buf[MAVLINK_MSG_ID_DATA32_LEN]; _mav_put_uint8_t(buf, 0, type); _mav_put_uint8_t(buf, 1, len); _mav_put_uint8_t_array(buf, 2, data, 32); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA32, buf, 34, 73); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA32, buf, MAVLINK_MSG_ID_DATA32_LEN, MAVLINK_MSG_ID_DATA32_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA32, buf, MAVLINK_MSG_ID_DATA32_LEN); +#endif #else mavlink_data32_t packet; packet.type = type; packet.len = len; mav_array_memcpy(packet.data, data, sizeof(uint8_t)*32); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA32, (const char *)&packet, 34, 73); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA32, (const char *)&packet, MAVLINK_MSG_ID_DATA32_LEN, MAVLINK_MSG_ID_DATA32_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA32, (const char *)&packet, MAVLINK_MSG_ID_DATA32_LEN); +#endif #endif } @@ -177,6 +196,6 @@ static inline void mavlink_msg_data32_decode(const mavlink_message_t* msg, mavli data32->len = mavlink_msg_data32_get_len(msg); mavlink_msg_data32_get_data(msg, data32->data); #else - memcpy(data32, _MAV_PAYLOAD(msg), 34); + memcpy(data32, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DATA32_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_data64.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_data64.h index 29dcaa6d8..843084dff 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_data64.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_data64.h @@ -12,6 +12,9 @@ typedef struct __mavlink_data64_t #define MAVLINK_MSG_ID_DATA64_LEN 66 #define MAVLINK_MSG_ID_171_LEN 66 +#define MAVLINK_MSG_ID_DATA64_CRC 181 +#define MAVLINK_MSG_ID_171_CRC 181 + #define MAVLINK_MSG_DATA64_FIELD_DATA_LEN 64 #define MAVLINK_MESSAGE_INFO_DATA64 { \ @@ -39,21 +42,25 @@ static inline uint16_t mavlink_msg_data64_pack(uint8_t system_id, uint8_t compon uint8_t type, uint8_t len, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[66]; + char buf[MAVLINK_MSG_ID_DATA64_LEN]; _mav_put_uint8_t(buf, 0, type); _mav_put_uint8_t(buf, 1, len); _mav_put_uint8_t_array(buf, 2, data, 64); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 66); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA64_LEN); #else mavlink_data64_t packet; packet.type = type; packet.len = len; mav_array_memcpy(packet.data, data, sizeof(uint8_t)*64); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 66); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA64_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DATA64; - return mavlink_finalize_message(msg, system_id, component_id, 66, 181); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA64_LEN, MAVLINK_MSG_ID_DATA64_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA64_LEN); +#endif } /** @@ -72,21 +79,25 @@ static inline uint16_t mavlink_msg_data64_pack_chan(uint8_t system_id, uint8_t c uint8_t type,uint8_t len,const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[66]; + char buf[MAVLINK_MSG_ID_DATA64_LEN]; _mav_put_uint8_t(buf, 0, type); _mav_put_uint8_t(buf, 1, len); _mav_put_uint8_t_array(buf, 2, data, 64); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 66); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA64_LEN); #else mavlink_data64_t packet; packet.type = type; packet.len = len; mav_array_memcpy(packet.data, data, sizeof(uint8_t)*64); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 66); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA64_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DATA64; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 66, 181); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA64_LEN, MAVLINK_MSG_ID_DATA64_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA64_LEN); +#endif } /** @@ -115,17 +126,25 @@ static inline uint16_t mavlink_msg_data64_encode(uint8_t system_id, uint8_t comp static inline void mavlink_msg_data64_send(mavlink_channel_t chan, uint8_t type, uint8_t len, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[66]; + char buf[MAVLINK_MSG_ID_DATA64_LEN]; _mav_put_uint8_t(buf, 0, type); _mav_put_uint8_t(buf, 1, len); _mav_put_uint8_t_array(buf, 2, data, 64); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA64, buf, 66, 181); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA64, buf, MAVLINK_MSG_ID_DATA64_LEN, MAVLINK_MSG_ID_DATA64_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA64, buf, MAVLINK_MSG_ID_DATA64_LEN); +#endif #else mavlink_data64_t packet; packet.type = type; packet.len = len; mav_array_memcpy(packet.data, data, sizeof(uint8_t)*64); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA64, (const char *)&packet, 66, 181); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA64, (const char *)&packet, MAVLINK_MSG_ID_DATA64_LEN, MAVLINK_MSG_ID_DATA64_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA64, (const char *)&packet, MAVLINK_MSG_ID_DATA64_LEN); +#endif #endif } @@ -177,6 +196,6 @@ static inline void mavlink_msg_data64_decode(const mavlink_message_t* msg, mavli data64->len = mavlink_msg_data64_get_len(msg); mavlink_msg_data64_get_data(msg, data64->data); #else - memcpy(data64, _MAV_PAYLOAD(msg), 66); + memcpy(data64, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DATA64_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_data96.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_data96.h index df0821c87..095628865 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_data96.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_data96.h @@ -12,6 +12,9 @@ typedef struct __mavlink_data96_t #define MAVLINK_MSG_ID_DATA96_LEN 98 #define MAVLINK_MSG_ID_172_LEN 98 +#define MAVLINK_MSG_ID_DATA96_CRC 22 +#define MAVLINK_MSG_ID_172_CRC 22 + #define MAVLINK_MSG_DATA96_FIELD_DATA_LEN 96 #define MAVLINK_MESSAGE_INFO_DATA96 { \ @@ -39,21 +42,25 @@ static inline uint16_t mavlink_msg_data96_pack(uint8_t system_id, uint8_t compon uint8_t type, uint8_t len, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[98]; + char buf[MAVLINK_MSG_ID_DATA96_LEN]; _mav_put_uint8_t(buf, 0, type); _mav_put_uint8_t(buf, 1, len); _mav_put_uint8_t_array(buf, 2, data, 96); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 98); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA96_LEN); #else mavlink_data96_t packet; packet.type = type; packet.len = len; mav_array_memcpy(packet.data, data, sizeof(uint8_t)*96); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 98); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA96_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DATA96; - return mavlink_finalize_message(msg, system_id, component_id, 98, 22); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA96_LEN, MAVLINK_MSG_ID_DATA96_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA96_LEN); +#endif } /** @@ -72,21 +79,25 @@ static inline uint16_t mavlink_msg_data96_pack_chan(uint8_t system_id, uint8_t c uint8_t type,uint8_t len,const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[98]; + char buf[MAVLINK_MSG_ID_DATA96_LEN]; _mav_put_uint8_t(buf, 0, type); _mav_put_uint8_t(buf, 1, len); _mav_put_uint8_t_array(buf, 2, data, 96); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 98); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA96_LEN); #else mavlink_data96_t packet; packet.type = type; packet.len = len; mav_array_memcpy(packet.data, data, sizeof(uint8_t)*96); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 98); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA96_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DATA96; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 98, 22); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA96_LEN, MAVLINK_MSG_ID_DATA96_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA96_LEN); +#endif } /** @@ -115,17 +126,25 @@ static inline uint16_t mavlink_msg_data96_encode(uint8_t system_id, uint8_t comp static inline void mavlink_msg_data96_send(mavlink_channel_t chan, uint8_t type, uint8_t len, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[98]; + char buf[MAVLINK_MSG_ID_DATA96_LEN]; _mav_put_uint8_t(buf, 0, type); _mav_put_uint8_t(buf, 1, len); _mav_put_uint8_t_array(buf, 2, data, 96); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA96, buf, 98, 22); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA96, buf, MAVLINK_MSG_ID_DATA96_LEN, MAVLINK_MSG_ID_DATA96_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA96, buf, MAVLINK_MSG_ID_DATA96_LEN); +#endif #else mavlink_data96_t packet; packet.type = type; packet.len = len; mav_array_memcpy(packet.data, data, sizeof(uint8_t)*96); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA96, (const char *)&packet, 98, 22); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA96, (const char *)&packet, MAVLINK_MSG_ID_DATA96_LEN, MAVLINK_MSG_ID_DATA96_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA96, (const char *)&packet, MAVLINK_MSG_ID_DATA96_LEN); +#endif #endif } @@ -177,6 +196,6 @@ static inline void mavlink_msg_data96_decode(const mavlink_message_t* msg, mavli data96->len = mavlink_msg_data96_get_len(msg); mavlink_msg_data96_get_data(msg, data96->data); #else - memcpy(data96, _MAV_PAYLOAD(msg), 98); + memcpy(data96, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DATA96_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_digicam_configure.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_digicam_configure.h index cc49c5025..bcc706a88 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_digicam_configure.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_digicam_configure.h @@ -20,6 +20,9 @@ typedef struct __mavlink_digicam_configure_t #define MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN 15 #define MAVLINK_MSG_ID_154_LEN 15 +#define MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC 84 +#define MAVLINK_MSG_ID_154_CRC 84 + #define MAVLINK_MESSAGE_INFO_DIGICAM_CONFIGURE { \ @@ -63,7 +66,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack(uint8_t system_id, uin uint8_t target_system, uint8_t target_component, uint8_t mode, uint16_t shutter_speed, uint8_t aperture, uint8_t iso, uint8_t exposure_type, uint8_t command_id, uint8_t engine_cut_off, uint8_t extra_param, float extra_value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; + char buf[MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN]; _mav_put_float(buf, 0, extra_value); _mav_put_uint16_t(buf, 4, shutter_speed); _mav_put_uint8_t(buf, 6, target_system); @@ -76,7 +79,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack(uint8_t system_id, uin _mav_put_uint8_t(buf, 13, engine_cut_off); _mav_put_uint8_t(buf, 14, extra_param); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN); #else mavlink_digicam_configure_t packet; packet.extra_value = extra_value; @@ -91,11 +94,15 @@ static inline uint16_t mavlink_msg_digicam_configure_pack(uint8_t system_id, uin packet.engine_cut_off = engine_cut_off; packet.extra_param = extra_param; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE; - return mavlink_finalize_message(msg, system_id, component_id, 15, 84); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN); +#endif } /** @@ -122,7 +129,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack_chan(uint8_t system_id uint8_t target_system,uint8_t target_component,uint8_t mode,uint16_t shutter_speed,uint8_t aperture,uint8_t iso,uint8_t exposure_type,uint8_t command_id,uint8_t engine_cut_off,uint8_t extra_param,float extra_value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; + char buf[MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN]; _mav_put_float(buf, 0, extra_value); _mav_put_uint16_t(buf, 4, shutter_speed); _mav_put_uint8_t(buf, 6, target_system); @@ -135,7 +142,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack_chan(uint8_t system_id _mav_put_uint8_t(buf, 13, engine_cut_off); _mav_put_uint8_t(buf, 14, extra_param); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN); #else mavlink_digicam_configure_t packet; packet.extra_value = extra_value; @@ -150,11 +157,15 @@ static inline uint16_t mavlink_msg_digicam_configure_pack_chan(uint8_t system_id packet.engine_cut_off = engine_cut_off; packet.extra_param = extra_param; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 15, 84); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN); +#endif } /** @@ -191,7 +202,7 @@ static inline uint16_t mavlink_msg_digicam_configure_encode(uint8_t system_id, u static inline void mavlink_msg_digicam_configure_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mode, uint16_t shutter_speed, uint8_t aperture, uint8_t iso, uint8_t exposure_type, uint8_t command_id, uint8_t engine_cut_off, uint8_t extra_param, float extra_value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; + char buf[MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN]; _mav_put_float(buf, 0, extra_value); _mav_put_uint16_t(buf, 4, shutter_speed); _mav_put_uint8_t(buf, 6, target_system); @@ -204,7 +215,11 @@ static inline void mavlink_msg_digicam_configure_send(mavlink_channel_t chan, ui _mav_put_uint8_t(buf, 13, engine_cut_off); _mav_put_uint8_t(buf, 14, extra_param); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, buf, 15, 84); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, buf, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, buf, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN); +#endif #else mavlink_digicam_configure_t packet; packet.extra_value = extra_value; @@ -219,7 +234,11 @@ static inline void mavlink_msg_digicam_configure_send(mavlink_channel_t chan, ui packet.engine_cut_off = engine_cut_off; packet.extra_param = extra_param; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, (const char *)&packet, 15, 84); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, (const char *)&packet, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, (const char *)&packet, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN); +#endif #endif } @@ -359,6 +378,6 @@ static inline void mavlink_msg_digicam_configure_decode(const mavlink_message_t* digicam_configure->engine_cut_off = mavlink_msg_digicam_configure_get_engine_cut_off(msg); digicam_configure->extra_param = mavlink_msg_digicam_configure_get_extra_param(msg); #else - memcpy(digicam_configure, _MAV_PAYLOAD(msg), 15); + memcpy(digicam_configure, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_digicam_control.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_digicam_control.h index a3b4878c4..7fa8cdfef 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_digicam_control.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_digicam_control.h @@ -19,6 +19,9 @@ typedef struct __mavlink_digicam_control_t #define MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN 13 #define MAVLINK_MSG_ID_155_LEN 13 +#define MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC 22 +#define MAVLINK_MSG_ID_155_CRC 22 + #define MAVLINK_MESSAGE_INFO_DIGICAM_CONTROL { \ @@ -60,7 +63,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack(uint8_t system_id, uint8 uint8_t target_system, uint8_t target_component, uint8_t session, uint8_t zoom_pos, int8_t zoom_step, uint8_t focus_lock, uint8_t shot, uint8_t command_id, uint8_t extra_param, float extra_value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[13]; + char buf[MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN]; _mav_put_float(buf, 0, extra_value); _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, target_component); @@ -72,7 +75,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack(uint8_t system_id, uint8 _mav_put_uint8_t(buf, 11, command_id); _mav_put_uint8_t(buf, 12, extra_param); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN); #else mavlink_digicam_control_t packet; packet.extra_value = extra_value; @@ -86,11 +89,15 @@ static inline uint16_t mavlink_msg_digicam_control_pack(uint8_t system_id, uint8 packet.command_id = command_id; packet.extra_param = extra_param; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL; - return mavlink_finalize_message(msg, system_id, component_id, 13, 22); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN); +#endif } /** @@ -116,7 +123,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack_chan(uint8_t system_id, uint8_t target_system,uint8_t target_component,uint8_t session,uint8_t zoom_pos,int8_t zoom_step,uint8_t focus_lock,uint8_t shot,uint8_t command_id,uint8_t extra_param,float extra_value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[13]; + char buf[MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN]; _mav_put_float(buf, 0, extra_value); _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, target_component); @@ -128,7 +135,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack_chan(uint8_t system_id, _mav_put_uint8_t(buf, 11, command_id); _mav_put_uint8_t(buf, 12, extra_param); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN); #else mavlink_digicam_control_t packet; packet.extra_value = extra_value; @@ -142,11 +149,15 @@ static inline uint16_t mavlink_msg_digicam_control_pack_chan(uint8_t system_id, packet.command_id = command_id; packet.extra_param = extra_param; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 13, 22); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN); +#endif } /** @@ -182,7 +193,7 @@ static inline uint16_t mavlink_msg_digicam_control_encode(uint8_t system_id, uin static inline void mavlink_msg_digicam_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t session, uint8_t zoom_pos, int8_t zoom_step, uint8_t focus_lock, uint8_t shot, uint8_t command_id, uint8_t extra_param, float extra_value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[13]; + char buf[MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN]; _mav_put_float(buf, 0, extra_value); _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, target_component); @@ -194,7 +205,11 @@ static inline void mavlink_msg_digicam_control_send(mavlink_channel_t chan, uint _mav_put_uint8_t(buf, 11, command_id); _mav_put_uint8_t(buf, 12, extra_param); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, buf, 13, 22); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, buf, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, buf, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN); +#endif #else mavlink_digicam_control_t packet; packet.extra_value = extra_value; @@ -208,7 +223,11 @@ static inline void mavlink_msg_digicam_control_send(mavlink_channel_t chan, uint packet.command_id = command_id; packet.extra_param = extra_param; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, (const char *)&packet, 13, 22); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN); +#endif #endif } @@ -337,6 +356,6 @@ static inline void mavlink_msg_digicam_control_decode(const mavlink_message_t* m digicam_control->command_id = mavlink_msg_digicam_control_get_command_id(msg); digicam_control->extra_param = mavlink_msg_digicam_control_get_extra_param(msg); #else - memcpy(digicam_control, _MAV_PAYLOAD(msg), 13); + memcpy(digicam_control, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_fetch_point.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_fetch_point.h index c1e405b0a..2cd4fc798 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_fetch_point.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_fetch_point.h @@ -12,6 +12,9 @@ typedef struct __mavlink_fence_fetch_point_t #define MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN 3 #define MAVLINK_MSG_ID_161_LEN 3 +#define MAVLINK_MSG_ID_FENCE_FETCH_POINT_CRC 68 +#define MAVLINK_MSG_ID_161_CRC 68 + #define MAVLINK_MESSAGE_INFO_FENCE_FETCH_POINT { \ @@ -39,23 +42,27 @@ static inline uint16_t mavlink_msg_fence_fetch_point_pack(uint8_t system_id, uin uint8_t target_system, uint8_t target_component, uint8_t idx) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; + char buf[MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, idx); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN); #else mavlink_fence_fetch_point_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.idx = idx; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT; - return mavlink_finalize_message(msg, system_id, component_id, 3, 68); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN); +#endif } /** @@ -74,23 +81,27 @@ static inline uint16_t mavlink_msg_fence_fetch_point_pack_chan(uint8_t system_id uint8_t target_system,uint8_t target_component,uint8_t idx) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; + char buf[MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, idx); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN); #else mavlink_fence_fetch_point_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.idx = idx; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 68); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN); +#endif } /** @@ -119,19 +130,27 @@ static inline uint16_t mavlink_msg_fence_fetch_point_encode(uint8_t system_id, u static inline void mavlink_msg_fence_fetch_point_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; + char buf[MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, idx); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, buf, 3, 68); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, buf, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, buf, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN); +#endif #else mavlink_fence_fetch_point_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.idx = idx; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, (const char *)&packet, 3, 68); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, (const char *)&packet, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, (const char *)&packet, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN); +#endif #endif } @@ -183,6 +202,6 @@ static inline void mavlink_msg_fence_fetch_point_decode(const mavlink_message_t* fence_fetch_point->target_component = mavlink_msg_fence_fetch_point_get_target_component(msg); fence_fetch_point->idx = mavlink_msg_fence_fetch_point_get_idx(msg); #else - memcpy(fence_fetch_point, _MAV_PAYLOAD(msg), 3); + memcpy(fence_fetch_point, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_point.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_point.h index b31319c74..b3c4706ee 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_point.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_point.h @@ -15,6 +15,9 @@ typedef struct __mavlink_fence_point_t #define MAVLINK_MSG_ID_FENCE_POINT_LEN 12 #define MAVLINK_MSG_ID_160_LEN 12 +#define MAVLINK_MSG_ID_FENCE_POINT_CRC 78 +#define MAVLINK_MSG_ID_160_CRC 78 + #define MAVLINK_MESSAGE_INFO_FENCE_POINT { \ @@ -48,7 +51,7 @@ static inline uint16_t mavlink_msg_fence_point_pack(uint8_t system_id, uint8_t c uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, float lat, float lng) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; + char buf[MAVLINK_MSG_ID_FENCE_POINT_LEN]; _mav_put_float(buf, 0, lat); _mav_put_float(buf, 4, lng); _mav_put_uint8_t(buf, 8, target_system); @@ -56,7 +59,7 @@ static inline uint16_t mavlink_msg_fence_point_pack(uint8_t system_id, uint8_t c _mav_put_uint8_t(buf, 10, idx); _mav_put_uint8_t(buf, 11, count); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FENCE_POINT_LEN); #else mavlink_fence_point_t packet; packet.lat = lat; @@ -66,11 +69,15 @@ static inline uint16_t mavlink_msg_fence_point_pack(uint8_t system_id, uint8_t c packet.idx = idx; packet.count = count; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FENCE_POINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_POINT; - return mavlink_finalize_message(msg, system_id, component_id, 12, 78); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FENCE_POINT_LEN, MAVLINK_MSG_ID_FENCE_POINT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FENCE_POINT_LEN); +#endif } /** @@ -92,7 +99,7 @@ static inline uint16_t mavlink_msg_fence_point_pack_chan(uint8_t system_id, uint uint8_t target_system,uint8_t target_component,uint8_t idx,uint8_t count,float lat,float lng) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; + char buf[MAVLINK_MSG_ID_FENCE_POINT_LEN]; _mav_put_float(buf, 0, lat); _mav_put_float(buf, 4, lng); _mav_put_uint8_t(buf, 8, target_system); @@ -100,7 +107,7 @@ static inline uint16_t mavlink_msg_fence_point_pack_chan(uint8_t system_id, uint _mav_put_uint8_t(buf, 10, idx); _mav_put_uint8_t(buf, 11, count); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FENCE_POINT_LEN); #else mavlink_fence_point_t packet; packet.lat = lat; @@ -110,11 +117,15 @@ static inline uint16_t mavlink_msg_fence_point_pack_chan(uint8_t system_id, uint packet.idx = idx; packet.count = count; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FENCE_POINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_POINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 78); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FENCE_POINT_LEN, MAVLINK_MSG_ID_FENCE_POINT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FENCE_POINT_LEN); +#endif } /** @@ -146,7 +157,7 @@ static inline uint16_t mavlink_msg_fence_point_encode(uint8_t system_id, uint8_t static inline void mavlink_msg_fence_point_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, float lat, float lng) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; + char buf[MAVLINK_MSG_ID_FENCE_POINT_LEN]; _mav_put_float(buf, 0, lat); _mav_put_float(buf, 4, lng); _mav_put_uint8_t(buf, 8, target_system); @@ -154,7 +165,11 @@ static inline void mavlink_msg_fence_point_send(mavlink_channel_t chan, uint8_t _mav_put_uint8_t(buf, 10, idx); _mav_put_uint8_t(buf, 11, count); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, buf, 12, 78); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, buf, MAVLINK_MSG_ID_FENCE_POINT_LEN, MAVLINK_MSG_ID_FENCE_POINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, buf, MAVLINK_MSG_ID_FENCE_POINT_LEN); +#endif #else mavlink_fence_point_t packet; packet.lat = lat; @@ -164,7 +179,11 @@ static inline void mavlink_msg_fence_point_send(mavlink_channel_t chan, uint8_t packet.idx = idx; packet.count = count; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, (const char *)&packet, 12, 78); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, (const char *)&packet, MAVLINK_MSG_ID_FENCE_POINT_LEN, MAVLINK_MSG_ID_FENCE_POINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, (const char *)&packet, MAVLINK_MSG_ID_FENCE_POINT_LEN); +#endif #endif } @@ -249,6 +268,6 @@ static inline void mavlink_msg_fence_point_decode(const mavlink_message_t* msg, fence_point->idx = mavlink_msg_fence_point_get_idx(msg); fence_point->count = mavlink_msg_fence_point_get_count(msg); #else - memcpy(fence_point, _MAV_PAYLOAD(msg), 12); + memcpy(fence_point, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_FENCE_POINT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_status.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_status.h index ce3e7ee67..32f2bc03a 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_status.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_status.h @@ -13,6 +13,9 @@ typedef struct __mavlink_fence_status_t #define MAVLINK_MSG_ID_FENCE_STATUS_LEN 8 #define MAVLINK_MSG_ID_162_LEN 8 +#define MAVLINK_MSG_ID_FENCE_STATUS_CRC 189 +#define MAVLINK_MSG_ID_162_CRC 189 + #define MAVLINK_MESSAGE_INFO_FENCE_STATUS { \ @@ -42,13 +45,13 @@ static inline uint16_t mavlink_msg_fence_status_pack(uint8_t system_id, uint8_t uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; + char buf[MAVLINK_MSG_ID_FENCE_STATUS_LEN]; _mav_put_uint32_t(buf, 0, breach_time); _mav_put_uint16_t(buf, 4, breach_count); _mav_put_uint8_t(buf, 6, breach_status); _mav_put_uint8_t(buf, 7, breach_type); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FENCE_STATUS_LEN); #else mavlink_fence_status_t packet; packet.breach_time = breach_time; @@ -56,11 +59,15 @@ static inline uint16_t mavlink_msg_fence_status_pack(uint8_t system_id, uint8_t packet.breach_status = breach_status; packet.breach_type = breach_type; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FENCE_STATUS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS; - return mavlink_finalize_message(msg, system_id, component_id, 8, 189); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FENCE_STATUS_LEN); +#endif } /** @@ -80,13 +87,13 @@ static inline uint16_t mavlink_msg_fence_status_pack_chan(uint8_t system_id, uin uint8_t breach_status,uint16_t breach_count,uint8_t breach_type,uint32_t breach_time) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; + char buf[MAVLINK_MSG_ID_FENCE_STATUS_LEN]; _mav_put_uint32_t(buf, 0, breach_time); _mav_put_uint16_t(buf, 4, breach_count); _mav_put_uint8_t(buf, 6, breach_status); _mav_put_uint8_t(buf, 7, breach_type); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FENCE_STATUS_LEN); #else mavlink_fence_status_t packet; packet.breach_time = breach_time; @@ -94,11 +101,15 @@ static inline uint16_t mavlink_msg_fence_status_pack_chan(uint8_t system_id, uin packet.breach_status = breach_status; packet.breach_type = breach_type; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FENCE_STATUS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8, 189); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FENCE_STATUS_LEN); +#endif } /** @@ -128,13 +139,17 @@ static inline uint16_t mavlink_msg_fence_status_encode(uint8_t system_id, uint8_ static inline void mavlink_msg_fence_status_send(mavlink_channel_t chan, uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; + char buf[MAVLINK_MSG_ID_FENCE_STATUS_LEN]; _mav_put_uint32_t(buf, 0, breach_time); _mav_put_uint16_t(buf, 4, breach_count); _mav_put_uint8_t(buf, 6, breach_status); _mav_put_uint8_t(buf, 7, breach_type); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, buf, 8, 189); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, buf, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, buf, MAVLINK_MSG_ID_FENCE_STATUS_LEN); +#endif #else mavlink_fence_status_t packet; packet.breach_time = breach_time; @@ -142,7 +157,11 @@ static inline void mavlink_msg_fence_status_send(mavlink_channel_t chan, uint8_t packet.breach_status = breach_status; packet.breach_type = breach_type; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, (const char *)&packet, 8, 189); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, (const char *)&packet, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, (const char *)&packet, MAVLINK_MSG_ID_FENCE_STATUS_LEN); +#endif #endif } @@ -205,6 +224,6 @@ static inline void mavlink_msg_fence_status_decode(const mavlink_message_t* msg, fence_status->breach_status = mavlink_msg_fence_status_get_breach_status(msg); fence_status->breach_type = mavlink_msg_fence_status_get_breach_type(msg); #else - memcpy(fence_status, _MAV_PAYLOAD(msg), 8); + memcpy(fence_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_FENCE_STATUS_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_hwstatus.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_hwstatus.h index 952e65951..73870ec0f 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_hwstatus.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_hwstatus.h @@ -11,6 +11,9 @@ typedef struct __mavlink_hwstatus_t #define MAVLINK_MSG_ID_HWSTATUS_LEN 3 #define MAVLINK_MSG_ID_165_LEN 3 +#define MAVLINK_MSG_ID_HWSTATUS_CRC 21 +#define MAVLINK_MSG_ID_165_CRC 21 + #define MAVLINK_MESSAGE_INFO_HWSTATUS { \ @@ -36,21 +39,25 @@ static inline uint16_t mavlink_msg_hwstatus_pack(uint8_t system_id, uint8_t comp uint16_t Vcc, uint8_t I2Cerr) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; + char buf[MAVLINK_MSG_ID_HWSTATUS_LEN]; _mav_put_uint16_t(buf, 0, Vcc); _mav_put_uint8_t(buf, 2, I2Cerr); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HWSTATUS_LEN); #else mavlink_hwstatus_t packet; packet.Vcc = Vcc; packet.I2Cerr = I2Cerr; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HWSTATUS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_HWSTATUS; - return mavlink_finalize_message(msg, system_id, component_id, 3, 21); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HWSTATUS_LEN, MAVLINK_MSG_ID_HWSTATUS_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HWSTATUS_LEN); +#endif } /** @@ -68,21 +75,25 @@ static inline uint16_t mavlink_msg_hwstatus_pack_chan(uint8_t system_id, uint8_t uint16_t Vcc,uint8_t I2Cerr) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; + char buf[MAVLINK_MSG_ID_HWSTATUS_LEN]; _mav_put_uint16_t(buf, 0, Vcc); _mav_put_uint8_t(buf, 2, I2Cerr); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HWSTATUS_LEN); #else mavlink_hwstatus_t packet; packet.Vcc = Vcc; packet.I2Cerr = I2Cerr; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HWSTATUS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_HWSTATUS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 21); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HWSTATUS_LEN, MAVLINK_MSG_ID_HWSTATUS_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HWSTATUS_LEN); +#endif } /** @@ -110,17 +121,25 @@ static inline uint16_t mavlink_msg_hwstatus_encode(uint8_t system_id, uint8_t co static inline void mavlink_msg_hwstatus_send(mavlink_channel_t chan, uint16_t Vcc, uint8_t I2Cerr) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; + char buf[MAVLINK_MSG_ID_HWSTATUS_LEN]; _mav_put_uint16_t(buf, 0, Vcc); _mav_put_uint8_t(buf, 2, I2Cerr); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, buf, 3, 21); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, buf, MAVLINK_MSG_ID_HWSTATUS_LEN, MAVLINK_MSG_ID_HWSTATUS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, buf, MAVLINK_MSG_ID_HWSTATUS_LEN); +#endif #else mavlink_hwstatus_t packet; packet.Vcc = Vcc; packet.I2Cerr = I2Cerr; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, (const char *)&packet, 3, 21); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, (const char *)&packet, MAVLINK_MSG_ID_HWSTATUS_LEN, MAVLINK_MSG_ID_HWSTATUS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, (const char *)&packet, MAVLINK_MSG_ID_HWSTATUS_LEN); +#endif #endif } @@ -161,6 +180,6 @@ static inline void mavlink_msg_hwstatus_decode(const mavlink_message_t* msg, mav hwstatus->Vcc = mavlink_msg_hwstatus_get_Vcc(msg); hwstatus->I2Cerr = mavlink_msg_hwstatus_get_I2Cerr(msg); #else - memcpy(hwstatus, _MAV_PAYLOAD(msg), 3); + memcpy(hwstatus, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HWSTATUS_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_limits_status.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_limits_status.h index 7caac1c5a..f7b04fba7 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_limits_status.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_limits_status.h @@ -18,6 +18,9 @@ typedef struct __mavlink_limits_status_t #define MAVLINK_MSG_ID_LIMITS_STATUS_LEN 22 #define MAVLINK_MSG_ID_167_LEN 22 +#define MAVLINK_MSG_ID_LIMITS_STATUS_CRC 144 +#define MAVLINK_MSG_ID_167_CRC 144 + #define MAVLINK_MESSAGE_INFO_LIMITS_STATUS { \ @@ -57,7 +60,7 @@ static inline uint16_t mavlink_msg_limits_status_pack(uint8_t system_id, uint8_t uint8_t limits_state, uint32_t last_trigger, uint32_t last_action, uint32_t last_recovery, uint32_t last_clear, uint16_t breach_count, uint8_t mods_enabled, uint8_t mods_required, uint8_t mods_triggered) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[22]; + char buf[MAVLINK_MSG_ID_LIMITS_STATUS_LEN]; _mav_put_uint32_t(buf, 0, last_trigger); _mav_put_uint32_t(buf, 4, last_action); _mav_put_uint32_t(buf, 8, last_recovery); @@ -68,7 +71,7 @@ static inline uint16_t mavlink_msg_limits_status_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 20, mods_required); _mav_put_uint8_t(buf, 21, mods_triggered); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LIMITS_STATUS_LEN); #else mavlink_limits_status_t packet; packet.last_trigger = last_trigger; @@ -81,11 +84,15 @@ static inline uint16_t mavlink_msg_limits_status_pack(uint8_t system_id, uint8_t packet.mods_required = mods_required; packet.mods_triggered = mods_triggered; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LIMITS_STATUS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_LIMITS_STATUS; - return mavlink_finalize_message(msg, system_id, component_id, 22, 144); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LIMITS_STATUS_LEN); +#endif } /** @@ -110,7 +117,7 @@ static inline uint16_t mavlink_msg_limits_status_pack_chan(uint8_t system_id, ui uint8_t limits_state,uint32_t last_trigger,uint32_t last_action,uint32_t last_recovery,uint32_t last_clear,uint16_t breach_count,uint8_t mods_enabled,uint8_t mods_required,uint8_t mods_triggered) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[22]; + char buf[MAVLINK_MSG_ID_LIMITS_STATUS_LEN]; _mav_put_uint32_t(buf, 0, last_trigger); _mav_put_uint32_t(buf, 4, last_action); _mav_put_uint32_t(buf, 8, last_recovery); @@ -121,7 +128,7 @@ static inline uint16_t mavlink_msg_limits_status_pack_chan(uint8_t system_id, ui _mav_put_uint8_t(buf, 20, mods_required); _mav_put_uint8_t(buf, 21, mods_triggered); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LIMITS_STATUS_LEN); #else mavlink_limits_status_t packet; packet.last_trigger = last_trigger; @@ -134,11 +141,15 @@ static inline uint16_t mavlink_msg_limits_status_pack_chan(uint8_t system_id, ui packet.mods_required = mods_required; packet.mods_triggered = mods_triggered; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LIMITS_STATUS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_LIMITS_STATUS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 22, 144); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LIMITS_STATUS_LEN); +#endif } /** @@ -173,7 +184,7 @@ static inline uint16_t mavlink_msg_limits_status_encode(uint8_t system_id, uint8 static inline void mavlink_msg_limits_status_send(mavlink_channel_t chan, uint8_t limits_state, uint32_t last_trigger, uint32_t last_action, uint32_t last_recovery, uint32_t last_clear, uint16_t breach_count, uint8_t mods_enabled, uint8_t mods_required, uint8_t mods_triggered) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[22]; + char buf[MAVLINK_MSG_ID_LIMITS_STATUS_LEN]; _mav_put_uint32_t(buf, 0, last_trigger); _mav_put_uint32_t(buf, 4, last_action); _mav_put_uint32_t(buf, 8, last_recovery); @@ -184,7 +195,11 @@ static inline void mavlink_msg_limits_status_send(mavlink_channel_t chan, uint8_ _mav_put_uint8_t(buf, 20, mods_required); _mav_put_uint8_t(buf, 21, mods_triggered); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, buf, 22, 144); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, buf, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, buf, MAVLINK_MSG_ID_LIMITS_STATUS_LEN); +#endif #else mavlink_limits_status_t packet; packet.last_trigger = last_trigger; @@ -197,7 +212,11 @@ static inline void mavlink_msg_limits_status_send(mavlink_channel_t chan, uint8_ packet.mods_required = mods_required; packet.mods_triggered = mods_triggered; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, (const char *)&packet, 22, 144); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_LIMITS_STATUS_LEN); +#endif #endif } @@ -315,6 +334,6 @@ static inline void mavlink_msg_limits_status_decode(const mavlink_message_t* msg limits_status->mods_required = mavlink_msg_limits_status_get_mods_required(msg); limits_status->mods_triggered = mavlink_msg_limits_status_get_mods_triggered(msg); #else - memcpy(limits_status, _MAV_PAYLOAD(msg), 22); + memcpy(limits_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LIMITS_STATUS_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_meminfo.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_meminfo.h index a095a804f..437029eed 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_meminfo.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_meminfo.h @@ -11,6 +11,9 @@ typedef struct __mavlink_meminfo_t #define MAVLINK_MSG_ID_MEMINFO_LEN 4 #define MAVLINK_MSG_ID_152_LEN 4 +#define MAVLINK_MSG_ID_MEMINFO_CRC 208 +#define MAVLINK_MSG_ID_152_CRC 208 + #define MAVLINK_MESSAGE_INFO_MEMINFO { \ @@ -36,21 +39,25 @@ static inline uint16_t mavlink_msg_meminfo_pack(uint8_t system_id, uint8_t compo uint16_t brkval, uint16_t freemem) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; + char buf[MAVLINK_MSG_ID_MEMINFO_LEN]; _mav_put_uint16_t(buf, 0, brkval); _mav_put_uint16_t(buf, 2, freemem); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MEMINFO_LEN); #else mavlink_meminfo_t packet; packet.brkval = brkval; packet.freemem = freemem; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MEMINFO_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MEMINFO; - return mavlink_finalize_message(msg, system_id, component_id, 4, 208); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MEMINFO_LEN, MAVLINK_MSG_ID_MEMINFO_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MEMINFO_LEN); +#endif } /** @@ -68,21 +75,25 @@ static inline uint16_t mavlink_msg_meminfo_pack_chan(uint8_t system_id, uint8_t uint16_t brkval,uint16_t freemem) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; + char buf[MAVLINK_MSG_ID_MEMINFO_LEN]; _mav_put_uint16_t(buf, 0, brkval); _mav_put_uint16_t(buf, 2, freemem); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MEMINFO_LEN); #else mavlink_meminfo_t packet; packet.brkval = brkval; packet.freemem = freemem; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MEMINFO_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MEMINFO; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 208); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MEMINFO_LEN, MAVLINK_MSG_ID_MEMINFO_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MEMINFO_LEN); +#endif } /** @@ -110,17 +121,25 @@ static inline uint16_t mavlink_msg_meminfo_encode(uint8_t system_id, uint8_t com static inline void mavlink_msg_meminfo_send(mavlink_channel_t chan, uint16_t brkval, uint16_t freemem) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; + char buf[MAVLINK_MSG_ID_MEMINFO_LEN]; _mav_put_uint16_t(buf, 0, brkval); _mav_put_uint16_t(buf, 2, freemem); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, buf, 4, 208); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, buf, MAVLINK_MSG_ID_MEMINFO_LEN, MAVLINK_MSG_ID_MEMINFO_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, buf, MAVLINK_MSG_ID_MEMINFO_LEN); +#endif #else mavlink_meminfo_t packet; packet.brkval = brkval; packet.freemem = freemem; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, (const char *)&packet, 4, 208); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, (const char *)&packet, MAVLINK_MSG_ID_MEMINFO_LEN, MAVLINK_MSG_ID_MEMINFO_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, (const char *)&packet, MAVLINK_MSG_ID_MEMINFO_LEN); +#endif #endif } @@ -161,6 +180,6 @@ static inline void mavlink_msg_meminfo_decode(const mavlink_message_t* msg, mavl meminfo->brkval = mavlink_msg_meminfo_get_brkval(msg); meminfo->freemem = mavlink_msg_meminfo_get_freemem(msg); #else - memcpy(meminfo, _MAV_PAYLOAD(msg), 4); + memcpy(meminfo, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MEMINFO_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_configure.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_configure.h index 051a71837..450153c6f 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_configure.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_configure.h @@ -15,6 +15,9 @@ typedef struct __mavlink_mount_configure_t #define MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN 6 #define MAVLINK_MSG_ID_156_LEN 6 +#define MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC 19 +#define MAVLINK_MSG_ID_156_CRC 19 + #define MAVLINK_MESSAGE_INFO_MOUNT_CONFIGURE { \ @@ -48,7 +51,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack(uint8_t system_id, uint8 uint8_t target_system, uint8_t target_component, uint8_t mount_mode, uint8_t stab_roll, uint8_t stab_pitch, uint8_t stab_yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; + char buf[MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, mount_mode); @@ -56,7 +59,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack(uint8_t system_id, uint8 _mav_put_uint8_t(buf, 4, stab_pitch); _mav_put_uint8_t(buf, 5, stab_yaw); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN); #else mavlink_mount_configure_t packet; packet.target_system = target_system; @@ -66,11 +69,15 @@ static inline uint16_t mavlink_msg_mount_configure_pack(uint8_t system_id, uint8 packet.stab_pitch = stab_pitch; packet.stab_yaw = stab_yaw; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; - return mavlink_finalize_message(msg, system_id, component_id, 6, 19); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN); +#endif } /** @@ -92,7 +99,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack_chan(uint8_t system_id, uint8_t target_system,uint8_t target_component,uint8_t mount_mode,uint8_t stab_roll,uint8_t stab_pitch,uint8_t stab_yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; + char buf[MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, mount_mode); @@ -100,7 +107,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack_chan(uint8_t system_id, _mav_put_uint8_t(buf, 4, stab_pitch); _mav_put_uint8_t(buf, 5, stab_yaw); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN); #else mavlink_mount_configure_t packet; packet.target_system = target_system; @@ -110,11 +117,15 @@ static inline uint16_t mavlink_msg_mount_configure_pack_chan(uint8_t system_id, packet.stab_pitch = stab_pitch; packet.stab_yaw = stab_yaw; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 6, 19); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN); +#endif } /** @@ -146,7 +157,7 @@ static inline uint16_t mavlink_msg_mount_configure_encode(uint8_t system_id, uin static inline void mavlink_msg_mount_configure_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mount_mode, uint8_t stab_roll, uint8_t stab_pitch, uint8_t stab_yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; + char buf[MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, mount_mode); @@ -154,7 +165,11 @@ static inline void mavlink_msg_mount_configure_send(mavlink_channel_t chan, uint _mav_put_uint8_t(buf, 4, stab_pitch); _mav_put_uint8_t(buf, 5, stab_yaw); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, buf, 6, 19); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, buf, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, buf, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN); +#endif #else mavlink_mount_configure_t packet; packet.target_system = target_system; @@ -164,7 +179,11 @@ static inline void mavlink_msg_mount_configure_send(mavlink_channel_t chan, uint packet.stab_pitch = stab_pitch; packet.stab_yaw = stab_yaw; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, (const char *)&packet, 6, 19); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, (const char *)&packet, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, (const char *)&packet, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN); +#endif #endif } @@ -249,6 +268,6 @@ static inline void mavlink_msg_mount_configure_decode(const mavlink_message_t* m mount_configure->stab_pitch = mavlink_msg_mount_configure_get_stab_pitch(msg); mount_configure->stab_yaw = mavlink_msg_mount_configure_get_stab_yaw(msg); #else - memcpy(mount_configure, _MAV_PAYLOAD(msg), 6); + memcpy(mount_configure, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_control.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_control.h index a51992299..5b83d7e97 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_control.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_control.h @@ -15,6 +15,9 @@ typedef struct __mavlink_mount_control_t #define MAVLINK_MSG_ID_MOUNT_CONTROL_LEN 15 #define MAVLINK_MSG_ID_157_LEN 15 +#define MAVLINK_MSG_ID_MOUNT_CONTROL_CRC 21 +#define MAVLINK_MSG_ID_157_CRC 21 + #define MAVLINK_MESSAGE_INFO_MOUNT_CONTROL { \ @@ -48,7 +51,7 @@ static inline uint16_t mavlink_msg_mount_control_pack(uint8_t system_id, uint8_t uint8_t target_system, uint8_t target_component, int32_t input_a, int32_t input_b, int32_t input_c, uint8_t save_position) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; + char buf[MAVLINK_MSG_ID_MOUNT_CONTROL_LEN]; _mav_put_int32_t(buf, 0, input_a); _mav_put_int32_t(buf, 4, input_b); _mav_put_int32_t(buf, 8, input_c); @@ -56,7 +59,7 @@ static inline uint16_t mavlink_msg_mount_control_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 13, target_component); _mav_put_uint8_t(buf, 14, save_position); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN); #else mavlink_mount_control_t packet; packet.input_a = input_a; @@ -66,11 +69,15 @@ static inline uint16_t mavlink_msg_mount_control_pack(uint8_t system_id, uint8_t packet.target_component = target_component; packet.save_position = save_position; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; - return mavlink_finalize_message(msg, system_id, component_id, 15, 21); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN); +#endif } /** @@ -92,7 +99,7 @@ static inline uint16_t mavlink_msg_mount_control_pack_chan(uint8_t system_id, ui uint8_t target_system,uint8_t target_component,int32_t input_a,int32_t input_b,int32_t input_c,uint8_t save_position) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; + char buf[MAVLINK_MSG_ID_MOUNT_CONTROL_LEN]; _mav_put_int32_t(buf, 0, input_a); _mav_put_int32_t(buf, 4, input_b); _mav_put_int32_t(buf, 8, input_c); @@ -100,7 +107,7 @@ static inline uint16_t mavlink_msg_mount_control_pack_chan(uint8_t system_id, ui _mav_put_uint8_t(buf, 13, target_component); _mav_put_uint8_t(buf, 14, save_position); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN); #else mavlink_mount_control_t packet; packet.input_a = input_a; @@ -110,11 +117,15 @@ static inline uint16_t mavlink_msg_mount_control_pack_chan(uint8_t system_id, ui packet.target_component = target_component; packet.save_position = save_position; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 15, 21); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN); +#endif } /** @@ -146,7 +157,7 @@ static inline uint16_t mavlink_msg_mount_control_encode(uint8_t system_id, uint8 static inline void mavlink_msg_mount_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int32_t input_a, int32_t input_b, int32_t input_c, uint8_t save_position) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; + char buf[MAVLINK_MSG_ID_MOUNT_CONTROL_LEN]; _mav_put_int32_t(buf, 0, input_a); _mav_put_int32_t(buf, 4, input_b); _mav_put_int32_t(buf, 8, input_c); @@ -154,7 +165,11 @@ static inline void mavlink_msg_mount_control_send(mavlink_channel_t chan, uint8_ _mav_put_uint8_t(buf, 13, target_component); _mav_put_uint8_t(buf, 14, save_position); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONTROL, buf, 15, 21); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONTROL, buf, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONTROL, buf, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN); +#endif #else mavlink_mount_control_t packet; packet.input_a = input_a; @@ -164,7 +179,11 @@ static inline void mavlink_msg_mount_control_send(mavlink_channel_t chan, uint8_ packet.target_component = target_component; packet.save_position = save_position; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONTROL, (const char *)&packet, 15, 21); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN); +#endif #endif } @@ -249,6 +268,6 @@ static inline void mavlink_msg_mount_control_decode(const mavlink_message_t* msg mount_control->target_component = mavlink_msg_mount_control_get_target_component(msg); mount_control->save_position = mavlink_msg_mount_control_get_save_position(msg); #else - memcpy(mount_control, _MAV_PAYLOAD(msg), 15); + memcpy(mount_control, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MOUNT_CONTROL_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_status.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_status.h index edc188ebd..c031db42b 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_status.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_status.h @@ -14,6 +14,9 @@ typedef struct __mavlink_mount_status_t #define MAVLINK_MSG_ID_MOUNT_STATUS_LEN 14 #define MAVLINK_MSG_ID_158_LEN 14 +#define MAVLINK_MSG_ID_MOUNT_STATUS_CRC 134 +#define MAVLINK_MSG_ID_158_CRC 134 + #define MAVLINK_MESSAGE_INFO_MOUNT_STATUS { \ @@ -45,14 +48,14 @@ static inline uint16_t mavlink_msg_mount_status_pack(uint8_t system_id, uint8_t uint8_t target_system, uint8_t target_component, int32_t pointing_a, int32_t pointing_b, int32_t pointing_c) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; + char buf[MAVLINK_MSG_ID_MOUNT_STATUS_LEN]; _mav_put_int32_t(buf, 0, pointing_a); _mav_put_int32_t(buf, 4, pointing_b); _mav_put_int32_t(buf, 8, pointing_c); _mav_put_uint8_t(buf, 12, target_system); _mav_put_uint8_t(buf, 13, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MOUNT_STATUS_LEN); #else mavlink_mount_status_t packet; packet.pointing_a = pointing_a; @@ -61,11 +64,15 @@ static inline uint16_t mavlink_msg_mount_status_pack(uint8_t system_id, uint8_t packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MOUNT_STATUS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_STATUS; - return mavlink_finalize_message(msg, system_id, component_id, 14, 134); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MOUNT_STATUS_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MOUNT_STATUS_LEN); +#endif } /** @@ -86,14 +93,14 @@ static inline uint16_t mavlink_msg_mount_status_pack_chan(uint8_t system_id, uin uint8_t target_system,uint8_t target_component,int32_t pointing_a,int32_t pointing_b,int32_t pointing_c) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; + char buf[MAVLINK_MSG_ID_MOUNT_STATUS_LEN]; _mav_put_int32_t(buf, 0, pointing_a); _mav_put_int32_t(buf, 4, pointing_b); _mav_put_int32_t(buf, 8, pointing_c); _mav_put_uint8_t(buf, 12, target_system); _mav_put_uint8_t(buf, 13, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MOUNT_STATUS_LEN); #else mavlink_mount_status_t packet; packet.pointing_a = pointing_a; @@ -102,11 +109,15 @@ static inline uint16_t mavlink_msg_mount_status_pack_chan(uint8_t system_id, uin packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MOUNT_STATUS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_STATUS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 14, 134); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MOUNT_STATUS_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MOUNT_STATUS_LEN); +#endif } /** @@ -137,14 +148,18 @@ static inline uint16_t mavlink_msg_mount_status_encode(uint8_t system_id, uint8_ static inline void mavlink_msg_mount_status_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int32_t pointing_a, int32_t pointing_b, int32_t pointing_c) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; + char buf[MAVLINK_MSG_ID_MOUNT_STATUS_LEN]; _mav_put_int32_t(buf, 0, pointing_a); _mav_put_int32_t(buf, 4, pointing_b); _mav_put_int32_t(buf, 8, pointing_c); _mav_put_uint8_t(buf, 12, target_system); _mav_put_uint8_t(buf, 13, target_component); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_STATUS, buf, 14, 134); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_STATUS, buf, MAVLINK_MSG_ID_MOUNT_STATUS_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_STATUS, buf, MAVLINK_MSG_ID_MOUNT_STATUS_LEN); +#endif #else mavlink_mount_status_t packet; packet.pointing_a = pointing_a; @@ -153,7 +168,11 @@ static inline void mavlink_msg_mount_status_send(mavlink_channel_t chan, uint8_t packet.target_system = target_system; packet.target_component = target_component; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_STATUS, (const char *)&packet, 14, 134); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_STATUS, (const char *)&packet, MAVLINK_MSG_ID_MOUNT_STATUS_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_STATUS, (const char *)&packet, MAVLINK_MSG_ID_MOUNT_STATUS_LEN); +#endif #endif } @@ -227,6 +246,6 @@ static inline void mavlink_msg_mount_status_decode(const mavlink_message_t* msg, mount_status->target_system = mavlink_msg_mount_status_get_target_system(msg); mount_status->target_component = mavlink_msg_mount_status_get_target_component(msg); #else - memcpy(mount_status, _MAV_PAYLOAD(msg), 14); + memcpy(mount_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MOUNT_STATUS_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_radio.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_radio.h index 0f3d03c0a..e13776993 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_radio.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_radio.h @@ -16,6 +16,9 @@ typedef struct __mavlink_radio_t #define MAVLINK_MSG_ID_RADIO_LEN 9 #define MAVLINK_MSG_ID_166_LEN 9 +#define MAVLINK_MSG_ID_RADIO_CRC 21 +#define MAVLINK_MSG_ID_166_CRC 21 + #define MAVLINK_MESSAGE_INFO_RADIO { \ @@ -51,7 +54,7 @@ static inline uint16_t mavlink_msg_radio_pack(uint8_t system_id, uint8_t compone uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[9]; + char buf[MAVLINK_MSG_ID_RADIO_LEN]; _mav_put_uint16_t(buf, 0, rxerrors); _mav_put_uint16_t(buf, 2, fixed); _mav_put_uint8_t(buf, 4, rssi); @@ -60,7 +63,7 @@ static inline uint16_t mavlink_msg_radio_pack(uint8_t system_id, uint8_t compone _mav_put_uint8_t(buf, 7, noise); _mav_put_uint8_t(buf, 8, remnoise); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RADIO_LEN); #else mavlink_radio_t packet; packet.rxerrors = rxerrors; @@ -71,11 +74,15 @@ static inline uint16_t mavlink_msg_radio_pack(uint8_t system_id, uint8_t compone packet.noise = noise; packet.remnoise = remnoise; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RADIO_LEN); #endif msg->msgid = MAVLINK_MSG_ID_RADIO; - return mavlink_finalize_message(msg, system_id, component_id, 9, 21); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RADIO_LEN); +#endif } /** @@ -98,7 +105,7 @@ static inline uint16_t mavlink_msg_radio_pack_chan(uint8_t system_id, uint8_t co uint8_t rssi,uint8_t remrssi,uint8_t txbuf,uint8_t noise,uint8_t remnoise,uint16_t rxerrors,uint16_t fixed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[9]; + char buf[MAVLINK_MSG_ID_RADIO_LEN]; _mav_put_uint16_t(buf, 0, rxerrors); _mav_put_uint16_t(buf, 2, fixed); _mav_put_uint8_t(buf, 4, rssi); @@ -107,7 +114,7 @@ static inline uint16_t mavlink_msg_radio_pack_chan(uint8_t system_id, uint8_t co _mav_put_uint8_t(buf, 7, noise); _mav_put_uint8_t(buf, 8, remnoise); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RADIO_LEN); #else mavlink_radio_t packet; packet.rxerrors = rxerrors; @@ -118,11 +125,15 @@ static inline uint16_t mavlink_msg_radio_pack_chan(uint8_t system_id, uint8_t co packet.noise = noise; packet.remnoise = remnoise; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RADIO_LEN); #endif msg->msgid = MAVLINK_MSG_ID_RADIO; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 9, 21); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RADIO_LEN); +#endif } /** @@ -155,7 +166,7 @@ static inline uint16_t mavlink_msg_radio_encode(uint8_t system_id, uint8_t compo static inline void mavlink_msg_radio_send(mavlink_channel_t chan, uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[9]; + char buf[MAVLINK_MSG_ID_RADIO_LEN]; _mav_put_uint16_t(buf, 0, rxerrors); _mav_put_uint16_t(buf, 2, fixed); _mav_put_uint8_t(buf, 4, rssi); @@ -164,7 +175,11 @@ static inline void mavlink_msg_radio_send(mavlink_channel_t chan, uint8_t rssi, _mav_put_uint8_t(buf, 7, noise); _mav_put_uint8_t(buf, 8, remnoise); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, buf, 9, 21); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, buf, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, buf, MAVLINK_MSG_ID_RADIO_LEN); +#endif #else mavlink_radio_t packet; packet.rxerrors = rxerrors; @@ -175,7 +190,11 @@ static inline void mavlink_msg_radio_send(mavlink_channel_t chan, uint8_t rssi, packet.noise = noise; packet.remnoise = remnoise; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, (const char *)&packet, 9, 21); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, (const char *)&packet, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, (const char *)&packet, MAVLINK_MSG_ID_RADIO_LEN); +#endif #endif } @@ -271,6 +290,6 @@ static inline void mavlink_msg_radio_decode(const mavlink_message_t* msg, mavlin radio->noise = mavlink_msg_radio_get_noise(msg); radio->remnoise = mavlink_msg_radio_get_remnoise(msg); #else - memcpy(radio, _MAV_PAYLOAD(msg), 9); + memcpy(radio, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RADIO_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_rangefinder.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_rangefinder.h index 2eeeddd59..d88abe36a 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_rangefinder.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_rangefinder.h @@ -11,6 +11,9 @@ typedef struct __mavlink_rangefinder_t #define MAVLINK_MSG_ID_RANGEFINDER_LEN 8 #define MAVLINK_MSG_ID_173_LEN 8 +#define MAVLINK_MSG_ID_RANGEFINDER_CRC 83 +#define MAVLINK_MSG_ID_173_CRC 83 + #define MAVLINK_MESSAGE_INFO_RANGEFINDER { \ @@ -36,21 +39,25 @@ static inline uint16_t mavlink_msg_rangefinder_pack(uint8_t system_id, uint8_t c float distance, float voltage) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; + char buf[MAVLINK_MSG_ID_RANGEFINDER_LEN]; _mav_put_float(buf, 0, distance); _mav_put_float(buf, 4, voltage); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RANGEFINDER_LEN); #else mavlink_rangefinder_t packet; packet.distance = distance; packet.voltage = voltage; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RANGEFINDER_LEN); #endif msg->msgid = MAVLINK_MSG_ID_RANGEFINDER; - return mavlink_finalize_message(msg, system_id, component_id, 8, 83); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RANGEFINDER_LEN, MAVLINK_MSG_ID_RANGEFINDER_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RANGEFINDER_LEN); +#endif } /** @@ -68,21 +75,25 @@ static inline uint16_t mavlink_msg_rangefinder_pack_chan(uint8_t system_id, uint float distance,float voltage) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; + char buf[MAVLINK_MSG_ID_RANGEFINDER_LEN]; _mav_put_float(buf, 0, distance); _mav_put_float(buf, 4, voltage); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RANGEFINDER_LEN); #else mavlink_rangefinder_t packet; packet.distance = distance; packet.voltage = voltage; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RANGEFINDER_LEN); #endif msg->msgid = MAVLINK_MSG_ID_RANGEFINDER; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8, 83); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RANGEFINDER_LEN, MAVLINK_MSG_ID_RANGEFINDER_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RANGEFINDER_LEN); +#endif } /** @@ -110,17 +121,25 @@ static inline uint16_t mavlink_msg_rangefinder_encode(uint8_t system_id, uint8_t static inline void mavlink_msg_rangefinder_send(mavlink_channel_t chan, float distance, float voltage) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; + char buf[MAVLINK_MSG_ID_RANGEFINDER_LEN]; _mav_put_float(buf, 0, distance); _mav_put_float(buf, 4, voltage); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RANGEFINDER, buf, 8, 83); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RANGEFINDER, buf, MAVLINK_MSG_ID_RANGEFINDER_LEN, MAVLINK_MSG_ID_RANGEFINDER_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RANGEFINDER, buf, MAVLINK_MSG_ID_RANGEFINDER_LEN); +#endif #else mavlink_rangefinder_t packet; packet.distance = distance; packet.voltage = voltage; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RANGEFINDER, (const char *)&packet, 8, 83); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RANGEFINDER, (const char *)&packet, MAVLINK_MSG_ID_RANGEFINDER_LEN, MAVLINK_MSG_ID_RANGEFINDER_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RANGEFINDER, (const char *)&packet, MAVLINK_MSG_ID_RANGEFINDER_LEN); +#endif #endif } @@ -161,6 +180,6 @@ static inline void mavlink_msg_rangefinder_decode(const mavlink_message_t* msg, rangefinder->distance = mavlink_msg_rangefinder_get_distance(msg); rangefinder->voltage = mavlink_msg_rangefinder_get_voltage(msg); #else - memcpy(rangefinder, _MAV_PAYLOAD(msg), 8); + memcpy(rangefinder, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RANGEFINDER_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_sensor_offsets.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_sensor_offsets.h index 56fb52d96..d121e48e6 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_sensor_offsets.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_sensor_offsets.h @@ -21,6 +21,9 @@ typedef struct __mavlink_sensor_offsets_t #define MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN 42 #define MAVLINK_MSG_ID_150_LEN 42 +#define MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC 134 +#define MAVLINK_MSG_ID_150_CRC 134 + #define MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS { \ @@ -66,7 +69,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack(uint8_t system_id, uint8_ int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z, float mag_declination, int32_t raw_press, int32_t raw_temp, float gyro_cal_x, float gyro_cal_y, float gyro_cal_z, float accel_cal_x, float accel_cal_y, float accel_cal_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[42]; + char buf[MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN]; _mav_put_float(buf, 0, mag_declination); _mav_put_int32_t(buf, 4, raw_press); _mav_put_int32_t(buf, 8, raw_temp); @@ -80,7 +83,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack(uint8_t system_id, uint8_ _mav_put_int16_t(buf, 38, mag_ofs_y); _mav_put_int16_t(buf, 40, mag_ofs_z); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN); #else mavlink_sensor_offsets_t packet; packet.mag_declination = mag_declination; @@ -96,11 +99,15 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack(uint8_t system_id, uint8_ packet.mag_ofs_y = mag_ofs_y; packet.mag_ofs_z = mag_ofs_z; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; - return mavlink_finalize_message(msg, system_id, component_id, 42, 134); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN); +#endif } /** @@ -128,7 +135,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack_chan(uint8_t system_id, u int16_t mag_ofs_x,int16_t mag_ofs_y,int16_t mag_ofs_z,float mag_declination,int32_t raw_press,int32_t raw_temp,float gyro_cal_x,float gyro_cal_y,float gyro_cal_z,float accel_cal_x,float accel_cal_y,float accel_cal_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[42]; + char buf[MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN]; _mav_put_float(buf, 0, mag_declination); _mav_put_int32_t(buf, 4, raw_press); _mav_put_int32_t(buf, 8, raw_temp); @@ -142,7 +149,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack_chan(uint8_t system_id, u _mav_put_int16_t(buf, 38, mag_ofs_y); _mav_put_int16_t(buf, 40, mag_ofs_z); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN); #else mavlink_sensor_offsets_t packet; packet.mag_declination = mag_declination; @@ -158,11 +165,15 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack_chan(uint8_t system_id, u packet.mag_ofs_y = mag_ofs_y; packet.mag_ofs_z = mag_ofs_z; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 42, 134); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN); +#endif } /** @@ -200,7 +211,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_encode(uint8_t system_id, uint static inline void mavlink_msg_sensor_offsets_send(mavlink_channel_t chan, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z, float mag_declination, int32_t raw_press, int32_t raw_temp, float gyro_cal_x, float gyro_cal_y, float gyro_cal_z, float accel_cal_x, float accel_cal_y, float accel_cal_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[42]; + char buf[MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN]; _mav_put_float(buf, 0, mag_declination); _mav_put_int32_t(buf, 4, raw_press); _mav_put_int32_t(buf, 8, raw_temp); @@ -214,7 +225,11 @@ static inline void mavlink_msg_sensor_offsets_send(mavlink_channel_t chan, int16 _mav_put_int16_t(buf, 38, mag_ofs_y); _mav_put_int16_t(buf, 40, mag_ofs_z); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, buf, 42, 134); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, buf, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, buf, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN); +#endif #else mavlink_sensor_offsets_t packet; packet.mag_declination = mag_declination; @@ -230,7 +245,11 @@ static inline void mavlink_msg_sensor_offsets_send(mavlink_channel_t chan, int16 packet.mag_ofs_y = mag_ofs_y; packet.mag_ofs_z = mag_ofs_z; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, (const char *)&packet, 42, 134); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, (const char *)&packet, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, (const char *)&packet, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN); +#endif #endif } @@ -381,6 +400,6 @@ static inline void mavlink_msg_sensor_offsets_decode(const mavlink_message_t* ms sensor_offsets->mag_ofs_y = mavlink_msg_sensor_offsets_get_mag_ofs_y(msg); sensor_offsets->mag_ofs_z = mavlink_msg_sensor_offsets_get_mag_ofs_z(msg); #else - memcpy(sensor_offsets, _MAV_PAYLOAD(msg), 42); + memcpy(sensor_offsets, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_set_mag_offsets.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_set_mag_offsets.h index 4c13fd186..a59e90649 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_set_mag_offsets.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_set_mag_offsets.h @@ -14,6 +14,9 @@ typedef struct __mavlink_set_mag_offsets_t #define MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN 8 #define MAVLINK_MSG_ID_151_LEN 8 +#define MAVLINK_MSG_ID_SET_MAG_OFFSETS_CRC 219 +#define MAVLINK_MSG_ID_151_CRC 219 + #define MAVLINK_MESSAGE_INFO_SET_MAG_OFFSETS { \ @@ -45,14 +48,14 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack(uint8_t system_id, uint8 uint8_t target_system, uint8_t target_component, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; + char buf[MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN]; _mav_put_int16_t(buf, 0, mag_ofs_x); _mav_put_int16_t(buf, 2, mag_ofs_y); _mav_put_int16_t(buf, 4, mag_ofs_z); _mav_put_uint8_t(buf, 6, target_system); _mav_put_uint8_t(buf, 7, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN); #else mavlink_set_mag_offsets_t packet; packet.mag_ofs_x = mag_ofs_x; @@ -61,11 +64,15 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack(uint8_t system_id, uint8 packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; - return mavlink_finalize_message(msg, system_id, component_id, 8, 219); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN); +#endif } /** @@ -86,14 +93,14 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack_chan(uint8_t system_id, uint8_t target_system,uint8_t target_component,int16_t mag_ofs_x,int16_t mag_ofs_y,int16_t mag_ofs_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; + char buf[MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN]; _mav_put_int16_t(buf, 0, mag_ofs_x); _mav_put_int16_t(buf, 2, mag_ofs_y); _mav_put_int16_t(buf, 4, mag_ofs_z); _mav_put_uint8_t(buf, 6, target_system); _mav_put_uint8_t(buf, 7, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN); #else mavlink_set_mag_offsets_t packet; packet.mag_ofs_x = mag_ofs_x; @@ -102,11 +109,15 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack_chan(uint8_t system_id, packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8, 219); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN); +#endif } /** @@ -137,14 +148,18 @@ static inline uint16_t mavlink_msg_set_mag_offsets_encode(uint8_t system_id, uin static inline void mavlink_msg_set_mag_offsets_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; + char buf[MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN]; _mav_put_int16_t(buf, 0, mag_ofs_x); _mav_put_int16_t(buf, 2, mag_ofs_y); _mav_put_int16_t(buf, 4, mag_ofs_z); _mav_put_uint8_t(buf, 6, target_system); _mav_put_uint8_t(buf, 7, target_component); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS, buf, 8, 219); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS, buf, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS, buf, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN); +#endif #else mavlink_set_mag_offsets_t packet; packet.mag_ofs_x = mag_ofs_x; @@ -153,7 +168,11 @@ static inline void mavlink_msg_set_mag_offsets_send(mavlink_channel_t chan, uint packet.target_system = target_system; packet.target_component = target_component; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS, (const char *)&packet, 8, 219); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS, (const char *)&packet, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS, (const char *)&packet, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN); +#endif #endif } @@ -227,6 +246,6 @@ static inline void mavlink_msg_set_mag_offsets_decode(const mavlink_message_t* m set_mag_offsets->target_system = mavlink_msg_set_mag_offsets_get_target_system(msg); set_mag_offsets->target_component = mavlink_msg_set_mag_offsets_get_target_component(msg); #else - memcpy(set_mag_offsets, _MAV_PAYLOAD(msg), 8); + memcpy(set_mag_offsets, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_simstate.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_simstate.h index 8ee447c77..7373c8bff 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_simstate.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_simstate.h @@ -20,6 +20,9 @@ typedef struct __mavlink_simstate_t #define MAVLINK_MSG_ID_SIMSTATE_LEN 44 #define MAVLINK_MSG_ID_164_LEN 44 +#define MAVLINK_MSG_ID_SIMSTATE_CRC 111 +#define MAVLINK_MSG_ID_164_CRC 111 + #define MAVLINK_MESSAGE_INFO_SIMSTATE { \ @@ -63,7 +66,7 @@ static inline uint16_t mavlink_msg_simstate_pack(uint8_t system_id, uint8_t comp float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lng) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[44]; + char buf[MAVLINK_MSG_ID_SIMSTATE_LEN]; _mav_put_float(buf, 0, roll); _mav_put_float(buf, 4, pitch); _mav_put_float(buf, 8, yaw); @@ -76,7 +79,7 @@ static inline uint16_t mavlink_msg_simstate_pack(uint8_t system_id, uint8_t comp _mav_put_float(buf, 36, lat); _mav_put_float(buf, 40, lng); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 44); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SIMSTATE_LEN); #else mavlink_simstate_t packet; packet.roll = roll; @@ -91,11 +94,15 @@ static inline uint16_t mavlink_msg_simstate_pack(uint8_t system_id, uint8_t comp packet.lat = lat; packet.lng = lng; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 44); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SIMSTATE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SIMSTATE; - return mavlink_finalize_message(msg, system_id, component_id, 44, 111); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SIMSTATE_LEN, MAVLINK_MSG_ID_SIMSTATE_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SIMSTATE_LEN); +#endif } /** @@ -122,7 +129,7 @@ static inline uint16_t mavlink_msg_simstate_pack_chan(uint8_t system_id, uint8_t float roll,float pitch,float yaw,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float lat,float lng) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[44]; + char buf[MAVLINK_MSG_ID_SIMSTATE_LEN]; _mav_put_float(buf, 0, roll); _mav_put_float(buf, 4, pitch); _mav_put_float(buf, 8, yaw); @@ -135,7 +142,7 @@ static inline uint16_t mavlink_msg_simstate_pack_chan(uint8_t system_id, uint8_t _mav_put_float(buf, 36, lat); _mav_put_float(buf, 40, lng); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 44); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SIMSTATE_LEN); #else mavlink_simstate_t packet; packet.roll = roll; @@ -150,11 +157,15 @@ static inline uint16_t mavlink_msg_simstate_pack_chan(uint8_t system_id, uint8_t packet.lat = lat; packet.lng = lng; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 44); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SIMSTATE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SIMSTATE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 44, 111); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SIMSTATE_LEN, MAVLINK_MSG_ID_SIMSTATE_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SIMSTATE_LEN); +#endif } /** @@ -191,7 +202,7 @@ static inline uint16_t mavlink_msg_simstate_encode(uint8_t system_id, uint8_t co static inline void mavlink_msg_simstate_send(mavlink_channel_t chan, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lng) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[44]; + char buf[MAVLINK_MSG_ID_SIMSTATE_LEN]; _mav_put_float(buf, 0, roll); _mav_put_float(buf, 4, pitch); _mav_put_float(buf, 8, yaw); @@ -204,7 +215,11 @@ static inline void mavlink_msg_simstate_send(mavlink_channel_t chan, float roll, _mav_put_float(buf, 36, lat); _mav_put_float(buf, 40, lng); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIMSTATE, buf, 44, 111); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIMSTATE, buf, MAVLINK_MSG_ID_SIMSTATE_LEN, MAVLINK_MSG_ID_SIMSTATE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIMSTATE, buf, MAVLINK_MSG_ID_SIMSTATE_LEN); +#endif #else mavlink_simstate_t packet; packet.roll = roll; @@ -219,7 +234,11 @@ static inline void mavlink_msg_simstate_send(mavlink_channel_t chan, float roll, packet.lat = lat; packet.lng = lng; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIMSTATE, (const char *)&packet, 44, 111); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIMSTATE, (const char *)&packet, MAVLINK_MSG_ID_SIMSTATE_LEN, MAVLINK_MSG_ID_SIMSTATE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIMSTATE, (const char *)&packet, MAVLINK_MSG_ID_SIMSTATE_LEN); +#endif #endif } @@ -359,6 +378,6 @@ static inline void mavlink_msg_simstate_decode(const mavlink_message_t* msg, mav simstate->lat = mavlink_msg_simstate_get_lat(msg); simstate->lng = mavlink_msg_simstate_get_lng(msg); #else - memcpy(simstate, _MAV_PAYLOAD(msg), 44); + memcpy(simstate, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SIMSTATE_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_wind.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_wind.h index e7fa7d1ea..ebdd2949d 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_wind.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_wind.h @@ -12,6 +12,9 @@ typedef struct __mavlink_wind_t #define MAVLINK_MSG_ID_WIND_LEN 12 #define MAVLINK_MSG_ID_168_LEN 12 +#define MAVLINK_MSG_ID_WIND_CRC 1 +#define MAVLINK_MSG_ID_168_CRC 1 + #define MAVLINK_MESSAGE_INFO_WIND { \ @@ -39,23 +42,27 @@ static inline uint16_t mavlink_msg_wind_pack(uint8_t system_id, uint8_t componen float direction, float speed, float speed_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; + char buf[MAVLINK_MSG_ID_WIND_LEN]; _mav_put_float(buf, 0, direction); _mav_put_float(buf, 4, speed); _mav_put_float(buf, 8, speed_z); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WIND_LEN); #else mavlink_wind_t packet; packet.direction = direction; packet.speed = speed; packet.speed_z = speed_z; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WIND_LEN); #endif msg->msgid = MAVLINK_MSG_ID_WIND; - return mavlink_finalize_message(msg, system_id, component_id, 12, 1); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WIND_LEN, MAVLINK_MSG_ID_WIND_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WIND_LEN); +#endif } /** @@ -74,23 +81,27 @@ static inline uint16_t mavlink_msg_wind_pack_chan(uint8_t system_id, uint8_t com float direction,float speed,float speed_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; + char buf[MAVLINK_MSG_ID_WIND_LEN]; _mav_put_float(buf, 0, direction); _mav_put_float(buf, 4, speed); _mav_put_float(buf, 8, speed_z); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WIND_LEN); #else mavlink_wind_t packet; packet.direction = direction; packet.speed = speed; packet.speed_z = speed_z; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WIND_LEN); #endif msg->msgid = MAVLINK_MSG_ID_WIND; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 1); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WIND_LEN, MAVLINK_MSG_ID_WIND_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WIND_LEN); +#endif } /** @@ -119,19 +130,27 @@ static inline uint16_t mavlink_msg_wind_encode(uint8_t system_id, uint8_t compon static inline void mavlink_msg_wind_send(mavlink_channel_t chan, float direction, float speed, float speed_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; + char buf[MAVLINK_MSG_ID_WIND_LEN]; _mav_put_float(buf, 0, direction); _mav_put_float(buf, 4, speed); _mav_put_float(buf, 8, speed_z); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, buf, 12, 1); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, buf, MAVLINK_MSG_ID_WIND_LEN, MAVLINK_MSG_ID_WIND_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, buf, MAVLINK_MSG_ID_WIND_LEN); +#endif #else mavlink_wind_t packet; packet.direction = direction; packet.speed = speed; packet.speed_z = speed_z; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, (const char *)&packet, 12, 1); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, (const char *)&packet, MAVLINK_MSG_ID_WIND_LEN, MAVLINK_MSG_ID_WIND_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, (const char *)&packet, MAVLINK_MSG_ID_WIND_LEN); +#endif #endif } @@ -183,6 +202,6 @@ static inline void mavlink_msg_wind_decode(const mavlink_message_t* msg, mavlink wind->speed = mavlink_msg_wind_get_speed(msg); wind->speed_z = mavlink_msg_wind_get_speed_z(msg); #else - memcpy(wind, _MAV_PAYLOAD(msg), 12); + memcpy(wind, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_WIND_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/ardupilotmega/version.h b/src/GCS_MAVLink/include_v1.0/ardupilotmega/version.h index dc8654c71..cfdc22b01 100644 --- a/src/GCS_MAVLink/include_v1.0/ardupilotmega/version.h +++ b/src/GCS_MAVLink/include_v1.0/ardupilotmega/version.h @@ -5,7 +5,7 @@ #ifndef MAVLINK_VERSION_H #define MAVLINK_VERSION_H -#define MAVLINK_BUILD_DATE "Thu Apr 4 18:57:12 2013" +#define MAVLINK_BUILD_DATE "Mon May 20 23:07:03 2013" #define MAVLINK_WIRE_PROTOCOL_VERSION "1.0" #define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 254 diff --git a/src/GCS_MAVLink/include_v1.0/common/common.h b/src/GCS_MAVLink/include_v1.0/common/common.h index c07e127a3..6f8d006d7 100644 --- a/src/GCS_MAVLink/include_v1.0/common/common.h +++ b/src/GCS_MAVLink/include_v1.0/common/common.h @@ -49,7 +49,8 @@ enum MAV_AUTOPILOT MAV_AUTOPILOT_FP=11, /* FlexiPilot | */ MAV_AUTOPILOT_PX4=12, /* PX4 Autopilot - http://pixhawk.ethz.ch/px4/ | */ MAV_AUTOPILOT_SMACCMPILOT=13, /* SMACCMPilot - http://smaccmpilot.org | */ - MAV_AUTOPILOT_ENUM_END=14, /* | */ + MAV_AUTOPILOT_AUTOQUAD=14, /* AutoQuad -- http://autoquad.org | */ + MAV_AUTOPILOT_ENUM_END=15, /* | */ }; #endif diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_attitude.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_attitude.h index 6db0592f2..0ba416ee1 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_attitude.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_attitude.h @@ -16,6 +16,9 @@ typedef struct __mavlink_attitude_t #define MAVLINK_MSG_ID_ATTITUDE_LEN 28 #define MAVLINK_MSG_ID_30_LEN 28 +#define MAVLINK_MSG_ID_ATTITUDE_CRC 39 +#define MAVLINK_MSG_ID_30_CRC 39 + #define MAVLINK_MESSAGE_INFO_ATTITUDE { \ @@ -51,7 +54,7 @@ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t comp uint32_t time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; + char buf[MAVLINK_MSG_ID_ATTITUDE_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, roll); _mav_put_float(buf, 8, pitch); @@ -60,7 +63,7 @@ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t comp _mav_put_float(buf, 20, pitchspeed); _mav_put_float(buf, 24, yawspeed); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_LEN); #else mavlink_attitude_t packet; packet.time_boot_ms = time_boot_ms; @@ -71,11 +74,15 @@ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t comp packet.pitchspeed = pitchspeed; packet.yawspeed = yawspeed; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_ATTITUDE; - return mavlink_finalize_message(msg, system_id, component_id, 28, 39); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_LEN); +#endif } /** @@ -98,7 +105,7 @@ static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t uint32_t time_boot_ms,float roll,float pitch,float yaw,float rollspeed,float pitchspeed,float yawspeed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; + char buf[MAVLINK_MSG_ID_ATTITUDE_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, roll); _mav_put_float(buf, 8, pitch); @@ -107,7 +114,7 @@ static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t _mav_put_float(buf, 20, pitchspeed); _mav_put_float(buf, 24, yawspeed); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_LEN); #else mavlink_attitude_t packet; packet.time_boot_ms = time_boot_ms; @@ -118,11 +125,15 @@ static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t packet.pitchspeed = pitchspeed; packet.yawspeed = yawspeed; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_ATTITUDE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 39); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_LEN); +#endif } /** @@ -155,7 +166,7 @@ static inline uint16_t mavlink_msg_attitude_encode(uint8_t system_id, uint8_t co static inline void mavlink_msg_attitude_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; + char buf[MAVLINK_MSG_ID_ATTITUDE_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, roll); _mav_put_float(buf, 8, pitch); @@ -164,7 +175,11 @@ static inline void mavlink_msg_attitude_send(mavlink_channel_t chan, uint32_t ti _mav_put_float(buf, 20, pitchspeed); _mav_put_float(buf, 24, yawspeed); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, buf, 28, 39); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, buf, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, buf, MAVLINK_MSG_ID_ATTITUDE_LEN); +#endif #else mavlink_attitude_t packet; packet.time_boot_ms = time_boot_ms; @@ -175,7 +190,11 @@ static inline void mavlink_msg_attitude_send(mavlink_channel_t chan, uint32_t ti packet.pitchspeed = pitchspeed; packet.yawspeed = yawspeed; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)&packet, 28, 39); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_LEN); +#endif #endif } @@ -271,6 +290,6 @@ static inline void mavlink_msg_attitude_decode(const mavlink_message_t* msg, mav attitude->pitchspeed = mavlink_msg_attitude_get_pitchspeed(msg); attitude->yawspeed = mavlink_msg_attitude_get_yawspeed(msg); #else - memcpy(attitude, _MAV_PAYLOAD(msg), 28); + memcpy(attitude, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ATTITUDE_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_attitude_quaternion.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_attitude_quaternion.h index 556048865..611803f2b 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_attitude_quaternion.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_attitude_quaternion.h @@ -17,6 +17,9 @@ typedef struct __mavlink_attitude_quaternion_t #define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN 32 #define MAVLINK_MSG_ID_31_LEN 32 +#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC 246 +#define MAVLINK_MSG_ID_31_CRC 246 + #define MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION { \ @@ -54,7 +57,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack(uint8_t system_id, u uint32_t time_boot_ms, float q1, float q2, float q3, float q4, float rollspeed, float pitchspeed, float yawspeed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; + char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, q1); _mav_put_float(buf, 8, q2); @@ -64,7 +67,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack(uint8_t system_id, u _mav_put_float(buf, 24, pitchspeed); _mav_put_float(buf, 28, yawspeed); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); #else mavlink_attitude_quaternion_t packet; packet.time_boot_ms = time_boot_ms; @@ -76,11 +79,15 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack(uint8_t system_id, u packet.pitchspeed = pitchspeed; packet.yawspeed = yawspeed; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); #endif msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION; - return mavlink_finalize_message(msg, system_id, component_id, 32, 246); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); +#endif } /** @@ -104,7 +111,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack_chan(uint8_t system_ uint32_t time_boot_ms,float q1,float q2,float q3,float q4,float rollspeed,float pitchspeed,float yawspeed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; + char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, q1); _mav_put_float(buf, 8, q2); @@ -114,7 +121,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack_chan(uint8_t system_ _mav_put_float(buf, 24, pitchspeed); _mav_put_float(buf, 28, yawspeed); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); #else mavlink_attitude_quaternion_t packet; packet.time_boot_ms = time_boot_ms; @@ -126,11 +133,15 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack_chan(uint8_t system_ packet.pitchspeed = pitchspeed; packet.yawspeed = yawspeed; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); #endif msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 246); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); +#endif } /** @@ -164,7 +175,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_encode(uint8_t system_id, static inline void mavlink_msg_attitude_quaternion_send(mavlink_channel_t chan, uint32_t time_boot_ms, float q1, float q2, float q3, float q4, float rollspeed, float pitchspeed, float yawspeed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; + char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, q1); _mav_put_float(buf, 8, q2); @@ -174,7 +185,11 @@ static inline void mavlink_msg_attitude_quaternion_send(mavlink_channel_t chan, _mav_put_float(buf, 24, pitchspeed); _mav_put_float(buf, 28, yawspeed); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, buf, 32, 246); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); +#endif #else mavlink_attitude_quaternion_t packet; packet.time_boot_ms = time_boot_ms; @@ -186,7 +201,11 @@ static inline void mavlink_msg_attitude_quaternion_send(mavlink_channel_t chan, packet.pitchspeed = pitchspeed; packet.yawspeed = yawspeed; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)&packet, 32, 246); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); +#endif #endif } @@ -293,6 +312,6 @@ static inline void mavlink_msg_attitude_quaternion_decode(const mavlink_message_ attitude_quaternion->pitchspeed = mavlink_msg_attitude_quaternion_get_pitchspeed(msg); attitude_quaternion->yawspeed = mavlink_msg_attitude_quaternion_get_yawspeed(msg); #else - memcpy(attitude_quaternion, _MAV_PAYLOAD(msg), 32); + memcpy(attitude_quaternion, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_auth_key.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_auth_key.h index baa119fde..030b564c9 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_auth_key.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_auth_key.h @@ -10,6 +10,9 @@ typedef struct __mavlink_auth_key_t #define MAVLINK_MSG_ID_AUTH_KEY_LEN 32 #define MAVLINK_MSG_ID_7_LEN 32 +#define MAVLINK_MSG_ID_AUTH_KEY_CRC 119 +#define MAVLINK_MSG_ID_7_CRC 119 + #define MAVLINK_MSG_AUTH_KEY_FIELD_KEY_LEN 32 #define MAVLINK_MESSAGE_INFO_AUTH_KEY { \ @@ -33,19 +36,23 @@ static inline uint16_t mavlink_msg_auth_key_pack(uint8_t system_id, uint8_t comp const char *key) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; + char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN]; _mav_put_char_array(buf, 0, key, 32); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTH_KEY_LEN); #else mavlink_auth_key_t packet; mav_array_memcpy(packet.key, key, sizeof(char)*32); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTH_KEY_LEN); #endif msg->msgid = MAVLINK_MSG_ID_AUTH_KEY; - return mavlink_finalize_message(msg, system_id, component_id, 32, 119); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUTH_KEY_LEN); +#endif } /** @@ -62,19 +69,23 @@ static inline uint16_t mavlink_msg_auth_key_pack_chan(uint8_t system_id, uint8_t const char *key) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; + char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN]; _mav_put_char_array(buf, 0, key, 32); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTH_KEY_LEN); #else mavlink_auth_key_t packet; mav_array_memcpy(packet.key, key, sizeof(char)*32); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTH_KEY_LEN); #endif msg->msgid = MAVLINK_MSG_ID_AUTH_KEY; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 119); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUTH_KEY_LEN); +#endif } /** @@ -101,15 +112,23 @@ static inline uint16_t mavlink_msg_auth_key_encode(uint8_t system_id, uint8_t co static inline void mavlink_msg_auth_key_send(mavlink_channel_t chan, const char *key) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; + char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN]; _mav_put_char_array(buf, 0, key, 32); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, 32, 119); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_LEN); +#endif #else mavlink_auth_key_t packet; mav_array_memcpy(packet.key, key, sizeof(char)*32); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)&packet, 32, 119); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)&packet, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)&packet, MAVLINK_MSG_ID_AUTH_KEY_LEN); +#endif #endif } @@ -139,6 +158,6 @@ static inline void mavlink_msg_auth_key_decode(const mavlink_message_t* msg, mav #if MAVLINK_NEED_BYTE_SWAP mavlink_msg_auth_key_get_key(msg, auth_key->key); #else - memcpy(auth_key, _MAV_PAYLOAD(msg), 32); + memcpy(auth_key, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_AUTH_KEY_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_battery_status.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_battery_status.h index c78fb4f31..83c815984 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_battery_status.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_battery_status.h @@ -18,6 +18,9 @@ typedef struct __mavlink_battery_status_t #define MAVLINK_MSG_ID_BATTERY_STATUS_LEN 16 #define MAVLINK_MSG_ID_147_LEN 16 +#define MAVLINK_MSG_ID_BATTERY_STATUS_CRC 42 +#define MAVLINK_MSG_ID_147_CRC 42 + #define MAVLINK_MESSAGE_INFO_BATTERY_STATUS { \ @@ -57,7 +60,7 @@ static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_ uint8_t accu_id, uint16_t voltage_cell_1, uint16_t voltage_cell_2, uint16_t voltage_cell_3, uint16_t voltage_cell_4, uint16_t voltage_cell_5, uint16_t voltage_cell_6, int16_t current_battery, int8_t battery_remaining) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; + char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN]; _mav_put_uint16_t(buf, 0, voltage_cell_1); _mav_put_uint16_t(buf, 2, voltage_cell_2); _mav_put_uint16_t(buf, 4, voltage_cell_3); @@ -68,7 +71,7 @@ static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_ _mav_put_uint8_t(buf, 14, accu_id); _mav_put_int8_t(buf, 15, battery_remaining); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); #else mavlink_battery_status_t packet; packet.voltage_cell_1 = voltage_cell_1; @@ -81,11 +84,15 @@ static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_ packet.accu_id = accu_id; packet.battery_remaining = battery_remaining; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_BATTERY_STATUS; - return mavlink_finalize_message(msg, system_id, component_id, 16, 42); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); +#endif } /** @@ -110,7 +117,7 @@ static inline uint16_t mavlink_msg_battery_status_pack_chan(uint8_t system_id, u uint8_t accu_id,uint16_t voltage_cell_1,uint16_t voltage_cell_2,uint16_t voltage_cell_3,uint16_t voltage_cell_4,uint16_t voltage_cell_5,uint16_t voltage_cell_6,int16_t current_battery,int8_t battery_remaining) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; + char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN]; _mav_put_uint16_t(buf, 0, voltage_cell_1); _mav_put_uint16_t(buf, 2, voltage_cell_2); _mav_put_uint16_t(buf, 4, voltage_cell_3); @@ -121,7 +128,7 @@ static inline uint16_t mavlink_msg_battery_status_pack_chan(uint8_t system_id, u _mav_put_uint8_t(buf, 14, accu_id); _mav_put_int8_t(buf, 15, battery_remaining); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); #else mavlink_battery_status_t packet; packet.voltage_cell_1 = voltage_cell_1; @@ -134,11 +141,15 @@ static inline uint16_t mavlink_msg_battery_status_pack_chan(uint8_t system_id, u packet.accu_id = accu_id; packet.battery_remaining = battery_remaining; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_BATTERY_STATUS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 16, 42); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); +#endif } /** @@ -173,7 +184,7 @@ static inline uint16_t mavlink_msg_battery_status_encode(uint8_t system_id, uint static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8_t accu_id, uint16_t voltage_cell_1, uint16_t voltage_cell_2, uint16_t voltage_cell_3, uint16_t voltage_cell_4, uint16_t voltage_cell_5, uint16_t voltage_cell_6, int16_t current_battery, int8_t battery_remaining) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; + char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN]; _mav_put_uint16_t(buf, 0, voltage_cell_1); _mav_put_uint16_t(buf, 2, voltage_cell_2); _mav_put_uint16_t(buf, 4, voltage_cell_3); @@ -184,7 +195,11 @@ static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8 _mav_put_uint8_t(buf, 14, accu_id); _mav_put_int8_t(buf, 15, battery_remaining); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, 16, 42); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); +#endif #else mavlink_battery_status_t packet; packet.voltage_cell_1 = voltage_cell_1; @@ -197,7 +212,11 @@ static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8 packet.accu_id = accu_id; packet.battery_remaining = battery_remaining; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)&packet, 16, 42); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)&packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)&packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); +#endif #endif } @@ -315,6 +334,6 @@ static inline void mavlink_msg_battery_status_decode(const mavlink_message_t* ms battery_status->accu_id = mavlink_msg_battery_status_get_accu_id(msg); battery_status->battery_remaining = mavlink_msg_battery_status_get_battery_remaining(msg); #else - memcpy(battery_status, _MAV_PAYLOAD(msg), 16); + memcpy(battery_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_BATTERY_STATUS_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_change_operator_control.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_change_operator_control.h index a55851008..c7195dfca 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_change_operator_control.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_change_operator_control.h @@ -13,6 +13,9 @@ typedef struct __mavlink_change_operator_control_t #define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN 28 #define MAVLINK_MSG_ID_5_LEN 28 +#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC 217 +#define MAVLINK_MSG_ID_5_CRC 217 + #define MAVLINK_MSG_CHANGE_OPERATOR_CONTROL_FIELD_PASSKEY_LEN 25 #define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL { \ @@ -42,23 +45,27 @@ static inline uint16_t mavlink_msg_change_operator_control_pack(uint8_t system_i uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; + char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, control_request); _mav_put_uint8_t(buf, 2, version); _mav_put_char_array(buf, 3, passkey, 25); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); #else mavlink_change_operator_control_t packet; packet.target_system = target_system; packet.control_request = control_request; packet.version = version; mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); #endif msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL; - return mavlink_finalize_message(msg, system_id, component_id, 28, 217); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); +#endif } /** @@ -78,23 +85,27 @@ static inline uint16_t mavlink_msg_change_operator_control_pack_chan(uint8_t sys uint8_t target_system,uint8_t control_request,uint8_t version,const char *passkey) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; + char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, control_request); _mav_put_uint8_t(buf, 2, version); _mav_put_char_array(buf, 3, passkey, 25); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); #else mavlink_change_operator_control_t packet; packet.target_system = target_system; packet.control_request = control_request; packet.version = version; mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); #endif msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 217); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); +#endif } /** @@ -124,19 +135,27 @@ static inline uint16_t mavlink_msg_change_operator_control_encode(uint8_t system static inline void mavlink_msg_change_operator_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; + char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, control_request); _mav_put_uint8_t(buf, 2, version); _mav_put_char_array(buf, 3, passkey, 25); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, buf, 28, 217); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); +#endif #else mavlink_change_operator_control_t packet; packet.target_system = target_system; packet.control_request = control_request; packet.version = version; mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)&packet, 28, 217); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); +#endif #endif } @@ -199,6 +218,6 @@ static inline void mavlink_msg_change_operator_control_decode(const mavlink_mess change_operator_control->version = mavlink_msg_change_operator_control_get_version(msg); mavlink_msg_change_operator_control_get_passkey(msg, change_operator_control->passkey); #else - memcpy(change_operator_control, _MAV_PAYLOAD(msg), 28); + memcpy(change_operator_control, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_change_operator_control_ack.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_change_operator_control_ack.h index 1d89a0f78..5cf98e77f 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_change_operator_control_ack.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_change_operator_control_ack.h @@ -12,6 +12,9 @@ typedef struct __mavlink_change_operator_control_ack_t #define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN 3 #define MAVLINK_MSG_ID_6_LEN 3 +#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC 104 +#define MAVLINK_MSG_ID_6_CRC 104 + #define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK { \ @@ -39,23 +42,27 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_pack(uint8_t syst uint8_t gcs_system_id, uint8_t control_request, uint8_t ack) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; + char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN]; _mav_put_uint8_t(buf, 0, gcs_system_id); _mav_put_uint8_t(buf, 1, control_request); _mav_put_uint8_t(buf, 2, ack); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); #else mavlink_change_operator_control_ack_t packet; packet.gcs_system_id = gcs_system_id; packet.control_request = control_request; packet.ack = ack; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); #endif msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK; - return mavlink_finalize_message(msg, system_id, component_id, 3, 104); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); +#endif } /** @@ -74,23 +81,27 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_pack_chan(uint8_t uint8_t gcs_system_id,uint8_t control_request,uint8_t ack) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; + char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN]; _mav_put_uint8_t(buf, 0, gcs_system_id); _mav_put_uint8_t(buf, 1, control_request); _mav_put_uint8_t(buf, 2, ack); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); #else mavlink_change_operator_control_ack_t packet; packet.gcs_system_id = gcs_system_id; packet.control_request = control_request; packet.ack = ack; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); #endif msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 104); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); +#endif } /** @@ -119,19 +130,27 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_encode(uint8_t sy static inline void mavlink_msg_change_operator_control_ack_send(mavlink_channel_t chan, uint8_t gcs_system_id, uint8_t control_request, uint8_t ack) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; + char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN]; _mav_put_uint8_t(buf, 0, gcs_system_id); _mav_put_uint8_t(buf, 1, control_request); _mav_put_uint8_t(buf, 2, ack); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, buf, 3, 104); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); +#endif #else mavlink_change_operator_control_ack_t packet; packet.gcs_system_id = gcs_system_id; packet.control_request = control_request; packet.ack = ack; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)&packet, 3, 104); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)&packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)&packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); +#endif #endif } @@ -183,6 +202,6 @@ static inline void mavlink_msg_change_operator_control_ack_decode(const mavlink_ change_operator_control_ack->control_request = mavlink_msg_change_operator_control_ack_get_control_request(msg); change_operator_control_ack->ack = mavlink_msg_change_operator_control_ack_get_ack(msg); #else - memcpy(change_operator_control_ack, _MAV_PAYLOAD(msg), 3); + memcpy(change_operator_control_ack, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_command_ack.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_command_ack.h index df6e9b9e3..82c2835de 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_command_ack.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_command_ack.h @@ -11,6 +11,9 @@ typedef struct __mavlink_command_ack_t #define MAVLINK_MSG_ID_COMMAND_ACK_LEN 3 #define MAVLINK_MSG_ID_77_LEN 3 +#define MAVLINK_MSG_ID_COMMAND_ACK_CRC 143 +#define MAVLINK_MSG_ID_77_CRC 143 + #define MAVLINK_MESSAGE_INFO_COMMAND_ACK { \ @@ -36,21 +39,25 @@ static inline uint16_t mavlink_msg_command_ack_pack(uint8_t system_id, uint8_t c uint16_t command, uint8_t result) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; + char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN]; _mav_put_uint16_t(buf, 0, command); _mav_put_uint8_t(buf, 2, result); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_ACK_LEN); #else mavlink_command_ack_t packet; packet.command = command; packet.result = result; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_ACK_LEN); #endif msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK; - return mavlink_finalize_message(msg, system_id, component_id, 3, 143); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_ACK_LEN); +#endif } /** @@ -68,21 +75,25 @@ static inline uint16_t mavlink_msg_command_ack_pack_chan(uint8_t system_id, uint uint16_t command,uint8_t result) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; + char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN]; _mav_put_uint16_t(buf, 0, command); _mav_put_uint8_t(buf, 2, result); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_ACK_LEN); #else mavlink_command_ack_t packet; packet.command = command; packet.result = result; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_ACK_LEN); #endif msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 143); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_ACK_LEN); +#endif } /** @@ -110,17 +121,25 @@ static inline uint16_t mavlink_msg_command_ack_encode(uint8_t system_id, uint8_t static inline void mavlink_msg_command_ack_send(mavlink_channel_t chan, uint16_t command, uint8_t result) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; + char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN]; _mav_put_uint16_t(buf, 0, command); _mav_put_uint8_t(buf, 2, result); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, 3, 143); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, MAVLINK_MSG_ID_COMMAND_ACK_LEN); +#endif #else mavlink_command_ack_t packet; packet.command = command; packet.result = result; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)&packet, 3, 143); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_ACK_LEN); +#endif #endif } @@ -161,6 +180,6 @@ static inline void mavlink_msg_command_ack_decode(const mavlink_message_t* msg, command_ack->command = mavlink_msg_command_ack_get_command(msg); command_ack->result = mavlink_msg_command_ack_get_result(msg); #else - memcpy(command_ack, _MAV_PAYLOAD(msg), 3); + memcpy(command_ack, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_COMMAND_ACK_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_command_long.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_command_long.h index 54ca77eaa..5c44c6284 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_command_long.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_command_long.h @@ -20,6 +20,9 @@ typedef struct __mavlink_command_long_t #define MAVLINK_MSG_ID_COMMAND_LONG_LEN 33 #define MAVLINK_MSG_ID_76_LEN 33 +#define MAVLINK_MSG_ID_COMMAND_LONG_CRC 152 +#define MAVLINK_MSG_ID_76_CRC 152 + #define MAVLINK_MESSAGE_INFO_COMMAND_LONG { \ @@ -63,7 +66,7 @@ static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[33]; + char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN]; _mav_put_float(buf, 0, param1); _mav_put_float(buf, 4, param2); _mav_put_float(buf, 8, param3); @@ -76,7 +79,7 @@ static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 31, target_component); _mav_put_uint8_t(buf, 32, confirmation); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN); #else mavlink_command_long_t packet; packet.param1 = param1; @@ -91,11 +94,15 @@ static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t packet.target_component = target_component; packet.confirmation = confirmation; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN); #endif msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG; - return mavlink_finalize_message(msg, system_id, component_id, 33, 152); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_LONG_LEN); +#endif } /** @@ -122,7 +129,7 @@ static inline uint16_t mavlink_msg_command_long_pack_chan(uint8_t system_id, uin uint8_t target_system,uint8_t target_component,uint16_t command,uint8_t confirmation,float param1,float param2,float param3,float param4,float param5,float param6,float param7) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[33]; + char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN]; _mav_put_float(buf, 0, param1); _mav_put_float(buf, 4, param2); _mav_put_float(buf, 8, param3); @@ -135,7 +142,7 @@ static inline uint16_t mavlink_msg_command_long_pack_chan(uint8_t system_id, uin _mav_put_uint8_t(buf, 31, target_component); _mav_put_uint8_t(buf, 32, confirmation); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN); #else mavlink_command_long_t packet; packet.param1 = param1; @@ -150,11 +157,15 @@ static inline uint16_t mavlink_msg_command_long_pack_chan(uint8_t system_id, uin packet.target_component = target_component; packet.confirmation = confirmation; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN); #endif msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 33, 152); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_LONG_LEN); +#endif } /** @@ -191,7 +202,7 @@ static inline uint16_t mavlink_msg_command_long_encode(uint8_t system_id, uint8_ static inline void mavlink_msg_command_long_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[33]; + char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN]; _mav_put_float(buf, 0, param1); _mav_put_float(buf, 4, param2); _mav_put_float(buf, 8, param3); @@ -204,7 +215,11 @@ static inline void mavlink_msg_command_long_send(mavlink_channel_t chan, uint8_t _mav_put_uint8_t(buf, 31, target_component); _mav_put_uint8_t(buf, 32, confirmation); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, 33, 152); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN); +#endif #else mavlink_command_long_t packet; packet.param1 = param1; @@ -219,7 +234,11 @@ static inline void mavlink_msg_command_long_send(mavlink_channel_t chan, uint8_t packet.target_component = target_component; packet.confirmation = confirmation; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)&packet, 33, 152); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN); +#endif #endif } @@ -359,6 +378,6 @@ static inline void mavlink_msg_command_long_decode(const mavlink_message_t* msg, command_long->target_component = mavlink_msg_command_long_get_target_component(msg); command_long->confirmation = mavlink_msg_command_long_get_confirmation(msg); #else - memcpy(command_long, _MAV_PAYLOAD(msg), 33); + memcpy(command_long, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_COMMAND_LONG_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_data_stream.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_data_stream.h index e5ec29045..782ea9f26 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_data_stream.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_data_stream.h @@ -12,6 +12,9 @@ typedef struct __mavlink_data_stream_t #define MAVLINK_MSG_ID_DATA_STREAM_LEN 4 #define MAVLINK_MSG_ID_67_LEN 4 +#define MAVLINK_MSG_ID_DATA_STREAM_CRC 21 +#define MAVLINK_MSG_ID_67_CRC 21 + #define MAVLINK_MESSAGE_INFO_DATA_STREAM { \ @@ -39,23 +42,27 @@ static inline uint16_t mavlink_msg_data_stream_pack(uint8_t system_id, uint8_t c uint8_t stream_id, uint16_t message_rate, uint8_t on_off) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; + char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN]; _mav_put_uint16_t(buf, 0, message_rate); _mav_put_uint8_t(buf, 2, stream_id); _mav_put_uint8_t(buf, 3, on_off); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_STREAM_LEN); #else mavlink_data_stream_t packet; packet.message_rate = message_rate; packet.stream_id = stream_id; packet.on_off = on_off; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_STREAM_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DATA_STREAM; - return mavlink_finalize_message(msg, system_id, component_id, 4, 21); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_STREAM_LEN); +#endif } /** @@ -74,23 +81,27 @@ static inline uint16_t mavlink_msg_data_stream_pack_chan(uint8_t system_id, uint uint8_t stream_id,uint16_t message_rate,uint8_t on_off) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; + char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN]; _mav_put_uint16_t(buf, 0, message_rate); _mav_put_uint8_t(buf, 2, stream_id); _mav_put_uint8_t(buf, 3, on_off); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_STREAM_LEN); #else mavlink_data_stream_t packet; packet.message_rate = message_rate; packet.stream_id = stream_id; packet.on_off = on_off; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_STREAM_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DATA_STREAM; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 21); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_STREAM_LEN); +#endif } /** @@ -119,19 +130,27 @@ static inline uint16_t mavlink_msg_data_stream_encode(uint8_t system_id, uint8_t static inline void mavlink_msg_data_stream_send(mavlink_channel_t chan, uint8_t stream_id, uint16_t message_rate, uint8_t on_off) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; + char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN]; _mav_put_uint16_t(buf, 0, message_rate); _mav_put_uint8_t(buf, 2, stream_id); _mav_put_uint8_t(buf, 3, on_off); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, 4, 21); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_LEN); +#endif #else mavlink_data_stream_t packet; packet.message_rate = message_rate; packet.stream_id = stream_id; packet.on_off = on_off; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)&packet, 4, 21); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)&packet, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)&packet, MAVLINK_MSG_ID_DATA_STREAM_LEN); +#endif #endif } @@ -183,6 +202,6 @@ static inline void mavlink_msg_data_stream_decode(const mavlink_message_t* msg, data_stream->stream_id = mavlink_msg_data_stream_get_stream_id(msg); data_stream->on_off = mavlink_msg_data_stream_get_on_off(msg); #else - memcpy(data_stream, _MAV_PAYLOAD(msg), 4); + memcpy(data_stream, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DATA_STREAM_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_debug.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_debug.h index 5ff88e6a8..a11161918 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_debug.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_debug.h @@ -12,6 +12,9 @@ typedef struct __mavlink_debug_t #define MAVLINK_MSG_ID_DEBUG_LEN 9 #define MAVLINK_MSG_ID_254_LEN 9 +#define MAVLINK_MSG_ID_DEBUG_CRC 46 +#define MAVLINK_MSG_ID_254_CRC 46 + #define MAVLINK_MESSAGE_INFO_DEBUG { \ @@ -39,23 +42,27 @@ static inline uint16_t mavlink_msg_debug_pack(uint8_t system_id, uint8_t compone uint32_t time_boot_ms, uint8_t ind, float value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[9]; + char buf[MAVLINK_MSG_ID_DEBUG_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, value); _mav_put_uint8_t(buf, 8, ind); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_LEN); #else mavlink_debug_t packet; packet.time_boot_ms = time_boot_ms; packet.value = value; packet.ind = ind; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DEBUG; - return mavlink_finalize_message(msg, system_id, component_id, 9, 46); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEBUG_LEN); +#endif } /** @@ -74,23 +81,27 @@ static inline uint16_t mavlink_msg_debug_pack_chan(uint8_t system_id, uint8_t co uint32_t time_boot_ms,uint8_t ind,float value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[9]; + char buf[MAVLINK_MSG_ID_DEBUG_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, value); _mav_put_uint8_t(buf, 8, ind); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_LEN); #else mavlink_debug_t packet; packet.time_boot_ms = time_boot_ms; packet.value = value; packet.ind = ind; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DEBUG; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 9, 46); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEBUG_LEN); +#endif } /** @@ -119,19 +130,27 @@ static inline uint16_t mavlink_msg_debug_encode(uint8_t system_id, uint8_t compo static inline void mavlink_msg_debug_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t ind, float value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[9]; + char buf[MAVLINK_MSG_ID_DEBUG_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, value); _mav_put_uint8_t(buf, 8, ind); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, 9, 46); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, MAVLINK_MSG_ID_DEBUG_LEN); +#endif #else mavlink_debug_t packet; packet.time_boot_ms = time_boot_ms; packet.value = value; packet.ind = ind; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)&packet, 9, 46); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_LEN); +#endif #endif } @@ -183,6 +202,6 @@ static inline void mavlink_msg_debug_decode(const mavlink_message_t* msg, mavlin debug->value = mavlink_msg_debug_get_value(msg); debug->ind = mavlink_msg_debug_get_ind(msg); #else - memcpy(debug, _MAV_PAYLOAD(msg), 9); + memcpy(debug, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DEBUG_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_debug_vect.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_debug_vect.h index 0b443a061..5ee4e323a 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_debug_vect.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_debug_vect.h @@ -14,6 +14,9 @@ typedef struct __mavlink_debug_vect_t #define MAVLINK_MSG_ID_DEBUG_VECT_LEN 30 #define MAVLINK_MSG_ID_250_LEN 30 +#define MAVLINK_MSG_ID_DEBUG_VECT_CRC 49 +#define MAVLINK_MSG_ID_250_CRC 49 + #define MAVLINK_MSG_DEBUG_VECT_FIELD_NAME_LEN 10 #define MAVLINK_MESSAGE_INFO_DEBUG_VECT { \ @@ -45,13 +48,13 @@ static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t co const char *name, uint64_t time_usec, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[30]; + char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, x); _mav_put_float(buf, 12, y); _mav_put_float(buf, 16, z); _mav_put_char_array(buf, 20, name, 10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN); #else mavlink_debug_vect_t packet; packet.time_usec = time_usec; @@ -59,11 +62,15 @@ static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t co packet.y = y; packet.z = z; mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT; - return mavlink_finalize_message(msg, system_id, component_id, 30, 49); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEBUG_VECT_LEN); +#endif } /** @@ -84,13 +91,13 @@ static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8 const char *name,uint64_t time_usec,float x,float y,float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[30]; + char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, x); _mav_put_float(buf, 12, y); _mav_put_float(buf, 16, z); _mav_put_char_array(buf, 20, name, 10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN); #else mavlink_debug_vect_t packet; packet.time_usec = time_usec; @@ -98,11 +105,15 @@ static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8 packet.y = y; packet.z = z; mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 30, 49); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEBUG_VECT_LEN); +#endif } /** @@ -133,13 +144,17 @@ static inline uint16_t mavlink_msg_debug_vect_encode(uint8_t system_id, uint8_t static inline void mavlink_msg_debug_vect_send(mavlink_channel_t chan, const char *name, uint64_t time_usec, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[30]; + char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, x); _mav_put_float(buf, 12, y); _mav_put_float(buf, 16, z); _mav_put_char_array(buf, 20, name, 10); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, 30, 49); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN); +#endif #else mavlink_debug_vect_t packet; packet.time_usec = time_usec; @@ -147,7 +162,11 @@ static inline void mavlink_msg_debug_vect_send(mavlink_channel_t chan, const cha packet.y = y; packet.z = z; mav_array_memcpy(packet.name, name, sizeof(char)*10); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)&packet, 30, 49); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN); +#endif #endif } @@ -221,6 +240,6 @@ static inline void mavlink_msg_debug_vect_decode(const mavlink_message_t* msg, m debug_vect->z = mavlink_msg_debug_vect_get_z(msg); mavlink_msg_debug_vect_get_name(msg, debug_vect->name); #else - memcpy(debug_vect, _MAV_PAYLOAD(msg), 30); + memcpy(debug_vect, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DEBUG_VECT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_file_transfer_dir_list.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_file_transfer_dir_list.h index 27f5a91db..c026419a2 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_file_transfer_dir_list.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_file_transfer_dir_list.h @@ -12,6 +12,9 @@ typedef struct __mavlink_file_transfer_dir_list_t #define MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN 249 #define MAVLINK_MSG_ID_111_LEN 249 +#define MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_CRC 93 +#define MAVLINK_MSG_ID_111_CRC 93 + #define MAVLINK_MSG_FILE_TRANSFER_DIR_LIST_FIELD_DIR_PATH_LEN 240 #define MAVLINK_MESSAGE_INFO_FILE_TRANSFER_DIR_LIST { \ @@ -39,21 +42,25 @@ static inline uint16_t mavlink_msg_file_transfer_dir_list_pack(uint8_t system_id uint64_t transfer_uid, const char *dir_path, uint8_t flags) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[249]; + char buf[MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN]; _mav_put_uint64_t(buf, 0, transfer_uid); _mav_put_uint8_t(buf, 248, flags); _mav_put_char_array(buf, 8, dir_path, 240); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 249); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN); #else mavlink_file_transfer_dir_list_t packet; packet.transfer_uid = transfer_uid; packet.flags = flags; mav_array_memcpy(packet.dir_path, dir_path, sizeof(char)*240); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 249); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST; - return mavlink_finalize_message(msg, system_id, component_id, 249, 93); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN); +#endif } /** @@ -72,21 +79,25 @@ static inline uint16_t mavlink_msg_file_transfer_dir_list_pack_chan(uint8_t syst uint64_t transfer_uid,const char *dir_path,uint8_t flags) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[249]; + char buf[MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN]; _mav_put_uint64_t(buf, 0, transfer_uid); _mav_put_uint8_t(buf, 248, flags); _mav_put_char_array(buf, 8, dir_path, 240); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 249); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN); #else mavlink_file_transfer_dir_list_t packet; packet.transfer_uid = transfer_uid; packet.flags = flags; mav_array_memcpy(packet.dir_path, dir_path, sizeof(char)*240); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 249); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 249, 93); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN); +#endif } /** @@ -115,17 +126,25 @@ static inline uint16_t mavlink_msg_file_transfer_dir_list_encode(uint8_t system_ static inline void mavlink_msg_file_transfer_dir_list_send(mavlink_channel_t chan, uint64_t transfer_uid, const char *dir_path, uint8_t flags) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[249]; + char buf[MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN]; _mav_put_uint64_t(buf, 0, transfer_uid); _mav_put_uint8_t(buf, 248, flags); _mav_put_char_array(buf, 8, dir_path, 240); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST, buf, 249, 93); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST, buf, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST, buf, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN); +#endif #else mavlink_file_transfer_dir_list_t packet; packet.transfer_uid = transfer_uid; packet.flags = flags; mav_array_memcpy(packet.dir_path, dir_path, sizeof(char)*240); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST, (const char *)&packet, 249, 93); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST, (const char *)&packet, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST, (const char *)&packet, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN); +#endif #endif } @@ -177,6 +196,6 @@ static inline void mavlink_msg_file_transfer_dir_list_decode(const mavlink_messa mavlink_msg_file_transfer_dir_list_get_dir_path(msg, file_transfer_dir_list->dir_path); file_transfer_dir_list->flags = mavlink_msg_file_transfer_dir_list_get_flags(msg); #else - memcpy(file_transfer_dir_list, _MAV_PAYLOAD(msg), 249); + memcpy(file_transfer_dir_list, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_file_transfer_res.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_file_transfer_res.h index f7035ec9e..86d407d66 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_file_transfer_res.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_file_transfer_res.h @@ -11,6 +11,9 @@ typedef struct __mavlink_file_transfer_res_t #define MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN 9 #define MAVLINK_MSG_ID_112_LEN 9 +#define MAVLINK_MSG_ID_FILE_TRANSFER_RES_CRC 124 +#define MAVLINK_MSG_ID_112_CRC 124 + #define MAVLINK_MESSAGE_INFO_FILE_TRANSFER_RES { \ @@ -36,21 +39,25 @@ static inline uint16_t mavlink_msg_file_transfer_res_pack(uint8_t system_id, uin uint64_t transfer_uid, uint8_t result) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[9]; + char buf[MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN]; _mav_put_uint64_t(buf, 0, transfer_uid); _mav_put_uint8_t(buf, 8, result); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN); #else mavlink_file_transfer_res_t packet; packet.transfer_uid = transfer_uid; packet.result = result; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN); #endif msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_RES; - return mavlink_finalize_message(msg, system_id, component_id, 9, 124); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_RES_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN); +#endif } /** @@ -68,21 +75,25 @@ static inline uint16_t mavlink_msg_file_transfer_res_pack_chan(uint8_t system_id uint64_t transfer_uid,uint8_t result) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[9]; + char buf[MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN]; _mav_put_uint64_t(buf, 0, transfer_uid); _mav_put_uint8_t(buf, 8, result); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN); #else mavlink_file_transfer_res_t packet; packet.transfer_uid = transfer_uid; packet.result = result; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN); #endif msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_RES; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 9, 124); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_RES_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN); +#endif } /** @@ -110,17 +121,25 @@ static inline uint16_t mavlink_msg_file_transfer_res_encode(uint8_t system_id, u static inline void mavlink_msg_file_transfer_res_send(mavlink_channel_t chan, uint64_t transfer_uid, uint8_t result) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[9]; + char buf[MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN]; _mav_put_uint64_t(buf, 0, transfer_uid); _mav_put_uint8_t(buf, 8, result); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_RES, buf, 9, 124); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_RES, buf, MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_RES_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_RES, buf, MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN); +#endif #else mavlink_file_transfer_res_t packet; packet.transfer_uid = transfer_uid; packet.result = result; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_RES, (const char *)&packet, 9, 124); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_RES, (const char *)&packet, MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_RES_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_RES, (const char *)&packet, MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN); +#endif #endif } @@ -161,6 +180,6 @@ static inline void mavlink_msg_file_transfer_res_decode(const mavlink_message_t* file_transfer_res->transfer_uid = mavlink_msg_file_transfer_res_get_transfer_uid(msg); file_transfer_res->result = mavlink_msg_file_transfer_res_get_result(msg); #else - memcpy(file_transfer_res, _MAV_PAYLOAD(msg), 9); + memcpy(file_transfer_res, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_file_transfer_start.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_file_transfer_start.h index 5eaa9b220..24bf25413 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_file_transfer_start.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_file_transfer_start.h @@ -14,6 +14,9 @@ typedef struct __mavlink_file_transfer_start_t #define MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN 254 #define MAVLINK_MSG_ID_110_LEN 254 +#define MAVLINK_MSG_ID_FILE_TRANSFER_START_CRC 235 +#define MAVLINK_MSG_ID_110_CRC 235 + #define MAVLINK_MSG_FILE_TRANSFER_START_FIELD_DEST_PATH_LEN 240 #define MAVLINK_MESSAGE_INFO_FILE_TRANSFER_START { \ @@ -45,13 +48,13 @@ static inline uint16_t mavlink_msg_file_transfer_start_pack(uint8_t system_id, u uint64_t transfer_uid, const char *dest_path, uint8_t direction, uint32_t file_size, uint8_t flags) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[254]; + char buf[MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN]; _mav_put_uint64_t(buf, 0, transfer_uid); _mav_put_uint32_t(buf, 8, file_size); _mav_put_uint8_t(buf, 252, direction); _mav_put_uint8_t(buf, 253, flags); _mav_put_char_array(buf, 12, dest_path, 240); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 254); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN); #else mavlink_file_transfer_start_t packet; packet.transfer_uid = transfer_uid; @@ -59,11 +62,15 @@ static inline uint16_t mavlink_msg_file_transfer_start_pack(uint8_t system_id, u packet.direction = direction; packet.flags = flags; mav_array_memcpy(packet.dest_path, dest_path, sizeof(char)*240); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 254); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN); #endif msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_START; - return mavlink_finalize_message(msg, system_id, component_id, 254, 235); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_START_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN); +#endif } /** @@ -84,13 +91,13 @@ static inline uint16_t mavlink_msg_file_transfer_start_pack_chan(uint8_t system_ uint64_t transfer_uid,const char *dest_path,uint8_t direction,uint32_t file_size,uint8_t flags) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[254]; + char buf[MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN]; _mav_put_uint64_t(buf, 0, transfer_uid); _mav_put_uint32_t(buf, 8, file_size); _mav_put_uint8_t(buf, 252, direction); _mav_put_uint8_t(buf, 253, flags); _mav_put_char_array(buf, 12, dest_path, 240); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 254); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN); #else mavlink_file_transfer_start_t packet; packet.transfer_uid = transfer_uid; @@ -98,11 +105,15 @@ static inline uint16_t mavlink_msg_file_transfer_start_pack_chan(uint8_t system_ packet.direction = direction; packet.flags = flags; mav_array_memcpy(packet.dest_path, dest_path, sizeof(char)*240); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 254); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN); #endif msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_START; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 254, 235); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_START_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN); +#endif } /** @@ -133,13 +144,17 @@ static inline uint16_t mavlink_msg_file_transfer_start_encode(uint8_t system_id, static inline void mavlink_msg_file_transfer_start_send(mavlink_channel_t chan, uint64_t transfer_uid, const char *dest_path, uint8_t direction, uint32_t file_size, uint8_t flags) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[254]; + char buf[MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN]; _mav_put_uint64_t(buf, 0, transfer_uid); _mav_put_uint32_t(buf, 8, file_size); _mav_put_uint8_t(buf, 252, direction); _mav_put_uint8_t(buf, 253, flags); _mav_put_char_array(buf, 12, dest_path, 240); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_START, buf, 254, 235); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_START, buf, MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_START_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_START, buf, MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN); +#endif #else mavlink_file_transfer_start_t packet; packet.transfer_uid = transfer_uid; @@ -147,7 +162,11 @@ static inline void mavlink_msg_file_transfer_start_send(mavlink_channel_t chan, packet.direction = direction; packet.flags = flags; mav_array_memcpy(packet.dest_path, dest_path, sizeof(char)*240); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_START, (const char *)&packet, 254, 235); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_START, (const char *)&packet, MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_START_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_START, (const char *)&packet, MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN); +#endif #endif } @@ -221,6 +240,6 @@ static inline void mavlink_msg_file_transfer_start_decode(const mavlink_message_ file_transfer_start->direction = mavlink_msg_file_transfer_start_get_direction(msg); file_transfer_start->flags = mavlink_msg_file_transfer_start_get_flags(msg); #else - memcpy(file_transfer_start, _MAV_PAYLOAD(msg), 254); + memcpy(file_transfer_start, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_position_int.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_position_int.h index 780f562c5..11ab97ee4 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_position_int.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_position_int.h @@ -18,6 +18,9 @@ typedef struct __mavlink_global_position_int_t #define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN 28 #define MAVLINK_MSG_ID_33_LEN 28 +#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC 104 +#define MAVLINK_MSG_ID_33_CRC 104 + #define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT { \ @@ -57,7 +60,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, u uint32_t time_boot_ms, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, int16_t vx, int16_t vy, int16_t vz, uint16_t hdg) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; + char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_int32_t(buf, 4, lat); _mav_put_int32_t(buf, 8, lon); @@ -68,7 +71,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, u _mav_put_int16_t(buf, 24, vz); _mav_put_uint16_t(buf, 26, hdg); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); #else mavlink_global_position_int_t packet; packet.time_boot_ms = time_boot_ms; @@ -81,11 +84,15 @@ static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, u packet.vz = vz; packet.hdg = hdg; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT; - return mavlink_finalize_message(msg, system_id, component_id, 28, 104); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); +#endif } /** @@ -110,7 +117,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_ uint32_t time_boot_ms,int32_t lat,int32_t lon,int32_t alt,int32_t relative_alt,int16_t vx,int16_t vy,int16_t vz,uint16_t hdg) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; + char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_int32_t(buf, 4, lat); _mav_put_int32_t(buf, 8, lon); @@ -121,7 +128,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_ _mav_put_int16_t(buf, 24, vz); _mav_put_uint16_t(buf, 26, hdg); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); #else mavlink_global_position_int_t packet; packet.time_boot_ms = time_boot_ms; @@ -134,11 +141,15 @@ static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_ packet.vz = vz; packet.hdg = hdg; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 104); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); +#endif } /** @@ -173,7 +184,7 @@ static inline uint16_t mavlink_msg_global_position_int_encode(uint8_t system_id, static inline void mavlink_msg_global_position_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, int16_t vx, int16_t vy, int16_t vz, uint16_t hdg) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; + char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_int32_t(buf, 4, lat); _mav_put_int32_t(buf, 8, lon); @@ -184,7 +195,11 @@ static inline void mavlink_msg_global_position_int_send(mavlink_channel_t chan, _mav_put_int16_t(buf, 24, vz); _mav_put_uint16_t(buf, 26, hdg); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, buf, 28, 104); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); +#endif #else mavlink_global_position_int_t packet; packet.time_boot_ms = time_boot_ms; @@ -197,7 +212,11 @@ static inline void mavlink_msg_global_position_int_send(mavlink_channel_t chan, packet.vz = vz; packet.hdg = hdg; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)&packet, 28, 104); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); +#endif #endif } @@ -315,6 +334,6 @@ static inline void mavlink_msg_global_position_int_decode(const mavlink_message_ global_position_int->vz = mavlink_msg_global_position_int_get_vz(msg); global_position_int->hdg = mavlink_msg_global_position_int_get_hdg(msg); #else - memcpy(global_position_int, _MAV_PAYLOAD(msg), 28); + memcpy(global_position_int, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_position_setpoint_int.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_position_setpoint_int.h index 853b85dae..8153628aa 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_position_setpoint_int.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_position_setpoint_int.h @@ -4,9 +4,9 @@ typedef struct __mavlink_global_position_setpoint_int_t { - int32_t latitude; ///< WGS84 Latitude position in degrees * 1E7 - int32_t longitude; ///< WGS84 Longitude position in degrees * 1E7 - int32_t altitude; ///< WGS84 Altitude in meters * 1000 (positive for up) + int32_t latitude; ///< Latitude (WGS84), in degrees * 1E7 + int32_t longitude; ///< Longitude (WGS84), in degrees * 1E7 + int32_t altitude; ///< Altitude (WGS84), in meters * 1000 (positive for up) int16_t yaw; ///< Desired yaw angle in degrees * 100 uint8_t coordinate_frame; ///< Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT } mavlink_global_position_setpoint_int_t; @@ -14,6 +14,9 @@ typedef struct __mavlink_global_position_setpoint_int_t #define MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN 15 #define MAVLINK_MSG_ID_52_LEN 15 +#define MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_CRC 141 +#define MAVLINK_MSG_ID_52_CRC 141 + #define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_SETPOINT_INT { \ @@ -35,9 +38,9 @@ typedef struct __mavlink_global_position_setpoint_int_t * @param msg The MAVLink message to compress the data into * * @param coordinate_frame Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT - * @param latitude WGS84 Latitude position in degrees * 1E7 - * @param longitude WGS84 Longitude position in degrees * 1E7 - * @param altitude WGS84 Altitude in meters * 1000 (positive for up) + * @param latitude Latitude (WGS84), in degrees * 1E7 + * @param longitude Longitude (WGS84), in degrees * 1E7 + * @param altitude Altitude (WGS84), in meters * 1000 (positive for up) * @param yaw Desired yaw angle in degrees * 100 * @return length of the message in bytes (excluding serial stream start sign) */ @@ -45,14 +48,14 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_pack(uint8_t sys uint8_t coordinate_frame, int32_t latitude, int32_t longitude, int32_t altitude, int16_t yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; + char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN]; _mav_put_int32_t(buf, 0, latitude); _mav_put_int32_t(buf, 4, longitude); _mav_put_int32_t(buf, 8, altitude); _mav_put_int16_t(buf, 12, yaw); _mav_put_uint8_t(buf, 14, coordinate_frame); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN); #else mavlink_global_position_setpoint_int_t packet; packet.latitude = latitude; @@ -61,11 +64,15 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_pack(uint8_t sys packet.yaw = yaw; packet.coordinate_frame = coordinate_frame; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT; - return mavlink_finalize_message(msg, system_id, component_id, 15, 141); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN); +#endif } /** @@ -75,9 +82,9 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_pack(uint8_t sys * @param chan The MAVLink channel this message was sent over * @param msg The MAVLink message to compress the data into * @param coordinate_frame Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT - * @param latitude WGS84 Latitude position in degrees * 1E7 - * @param longitude WGS84 Longitude position in degrees * 1E7 - * @param altitude WGS84 Altitude in meters * 1000 (positive for up) + * @param latitude Latitude (WGS84), in degrees * 1E7 + * @param longitude Longitude (WGS84), in degrees * 1E7 + * @param altitude Altitude (WGS84), in meters * 1000 (positive for up) * @param yaw Desired yaw angle in degrees * 100 * @return length of the message in bytes (excluding serial stream start sign) */ @@ -86,14 +93,14 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_pack_chan(uint8_ uint8_t coordinate_frame,int32_t latitude,int32_t longitude,int32_t altitude,int16_t yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; + char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN]; _mav_put_int32_t(buf, 0, latitude); _mav_put_int32_t(buf, 4, longitude); _mav_put_int32_t(buf, 8, altitude); _mav_put_int16_t(buf, 12, yaw); _mav_put_uint8_t(buf, 14, coordinate_frame); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN); #else mavlink_global_position_setpoint_int_t packet; packet.latitude = latitude; @@ -102,11 +109,15 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_pack_chan(uint8_ packet.yaw = yaw; packet.coordinate_frame = coordinate_frame; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 15, 141); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN); +#endif } /** @@ -127,9 +138,9 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_encode(uint8_t s * @param chan MAVLink channel to send the message * * @param coordinate_frame Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT - * @param latitude WGS84 Latitude position in degrees * 1E7 - * @param longitude WGS84 Longitude position in degrees * 1E7 - * @param altitude WGS84 Altitude in meters * 1000 (positive for up) + * @param latitude Latitude (WGS84), in degrees * 1E7 + * @param longitude Longitude (WGS84), in degrees * 1E7 + * @param altitude Altitude (WGS84), in meters * 1000 (positive for up) * @param yaw Desired yaw angle in degrees * 100 */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -137,14 +148,18 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_encode(uint8_t s static inline void mavlink_msg_global_position_setpoint_int_send(mavlink_channel_t chan, uint8_t coordinate_frame, int32_t latitude, int32_t longitude, int32_t altitude, int16_t yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; + char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN]; _mav_put_int32_t(buf, 0, latitude); _mav_put_int32_t(buf, 4, longitude); _mav_put_int32_t(buf, 8, altitude); _mav_put_int16_t(buf, 12, yaw); _mav_put_uint8_t(buf, 14, coordinate_frame); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT, buf, 15, 141); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN); +#endif #else mavlink_global_position_setpoint_int_t packet; packet.latitude = latitude; @@ -153,7 +168,11 @@ static inline void mavlink_msg_global_position_setpoint_int_send(mavlink_channel packet.yaw = yaw; packet.coordinate_frame = coordinate_frame; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT, (const char *)&packet, 15, 141); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN); +#endif #endif } @@ -175,7 +194,7 @@ static inline uint8_t mavlink_msg_global_position_setpoint_int_get_coordinate_fr /** * @brief Get field latitude from global_position_setpoint_int message * - * @return WGS84 Latitude position in degrees * 1E7 + * @return Latitude (WGS84), in degrees * 1E7 */ static inline int32_t mavlink_msg_global_position_setpoint_int_get_latitude(const mavlink_message_t* msg) { @@ -185,7 +204,7 @@ static inline int32_t mavlink_msg_global_position_setpoint_int_get_latitude(cons /** * @brief Get field longitude from global_position_setpoint_int message * - * @return WGS84 Longitude position in degrees * 1E7 + * @return Longitude (WGS84), in degrees * 1E7 */ static inline int32_t mavlink_msg_global_position_setpoint_int_get_longitude(const mavlink_message_t* msg) { @@ -195,7 +214,7 @@ static inline int32_t mavlink_msg_global_position_setpoint_int_get_longitude(con /** * @brief Get field altitude from global_position_setpoint_int message * - * @return WGS84 Altitude in meters * 1000 (positive for up) + * @return Altitude (WGS84), in meters * 1000 (positive for up) */ static inline int32_t mavlink_msg_global_position_setpoint_int_get_altitude(const mavlink_message_t* msg) { @@ -227,6 +246,6 @@ static inline void mavlink_msg_global_position_setpoint_int_decode(const mavlink global_position_setpoint_int->yaw = mavlink_msg_global_position_setpoint_int_get_yaw(msg); global_position_setpoint_int->coordinate_frame = mavlink_msg_global_position_setpoint_int_get_coordinate_frame(msg); #else - memcpy(global_position_setpoint_int, _MAV_PAYLOAD(msg), 15); + memcpy(global_position_setpoint_int, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_vision_position_estimate.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_vision_position_estimate.h index a911fe25e..b388fa24a 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_vision_position_estimate.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_vision_position_estimate.h @@ -16,6 +16,9 @@ typedef struct __mavlink_global_vision_position_estimate_t #define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN 32 #define MAVLINK_MSG_ID_101_LEN 32 +#define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC 102 +#define MAVLINK_MSG_ID_101_CRC 102 + #define MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE { \ @@ -51,7 +54,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; + char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN]; _mav_put_uint64_t(buf, 0, usec); _mav_put_float(buf, 8, x); _mav_put_float(buf, 12, y); @@ -60,7 +63,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t _mav_put_float(buf, 24, pitch); _mav_put_float(buf, 28, yaw); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); #else mavlink_global_vision_position_estimate_t packet; packet.usec = usec; @@ -71,11 +74,15 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t packet.pitch = pitch; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE; - return mavlink_finalize_message(msg, system_id, component_id, 32, 102); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); +#endif } /** @@ -98,7 +105,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack_chan(uin uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; + char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN]; _mav_put_uint64_t(buf, 0, usec); _mav_put_float(buf, 8, x); _mav_put_float(buf, 12, y); @@ -107,7 +114,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack_chan(uin _mav_put_float(buf, 24, pitch); _mav_put_float(buf, 28, yaw); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); #else mavlink_global_vision_position_estimate_t packet; packet.usec = usec; @@ -118,11 +125,15 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack_chan(uin packet.pitch = pitch; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 102); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); +#endif } /** @@ -155,7 +166,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_encode(uint8_ static inline void mavlink_msg_global_vision_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; + char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN]; _mav_put_uint64_t(buf, 0, usec); _mav_put_float(buf, 8, x); _mav_put_float(buf, 12, y); @@ -164,7 +175,11 @@ static inline void mavlink_msg_global_vision_position_estimate_send(mavlink_chan _mav_put_float(buf, 24, pitch); _mav_put_float(buf, 28, yaw); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, 32, 102); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); +#endif #else mavlink_global_vision_position_estimate_t packet; packet.usec = usec; @@ -175,7 +190,11 @@ static inline void mavlink_msg_global_vision_position_estimate_send(mavlink_chan packet.pitch = pitch; packet.yaw = yaw; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)&packet, 32, 102); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); +#endif #endif } @@ -271,6 +290,6 @@ static inline void mavlink_msg_global_vision_position_estimate_decode(const mavl global_vision_position_estimate->pitch = mavlink_msg_global_vision_position_estimate_get_pitch(msg); global_vision_position_estimate->yaw = mavlink_msg_global_vision_position_estimate_get_yaw(msg); #else - memcpy(global_vision_position_estimate, _MAV_PAYLOAD(msg), 32); + memcpy(global_vision_position_estimate, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_global_origin.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_global_origin.h index 2084718b5..bd09cb753 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_global_origin.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_global_origin.h @@ -4,14 +4,17 @@ typedef struct __mavlink_gps_global_origin_t { - int32_t latitude; ///< Latitude (WGS84), expressed as * 1E7 - int32_t longitude; ///< Longitude (WGS84), expressed as * 1E7 - int32_t altitude; ///< Altitude(WGS84), expressed as * 1000 + int32_t latitude; ///< Latitude (WGS84), in degrees * 1E7 + int32_t longitude; ///< Longitude (WGS84), in degrees * 1E7 + int32_t altitude; ///< Altitude (WGS84), in meters * 1000 (positive for up) } mavlink_gps_global_origin_t; #define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN 12 #define MAVLINK_MSG_ID_49_LEN 12 +#define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC 39 +#define MAVLINK_MSG_ID_49_CRC 39 + #define MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN { \ @@ -30,32 +33,36 @@ typedef struct __mavlink_gps_global_origin_t * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param latitude Latitude (WGS84), expressed as * 1E7 - * @param longitude Longitude (WGS84), expressed as * 1E7 - * @param altitude Altitude(WGS84), expressed as * 1000 + * @param latitude Latitude (WGS84), in degrees * 1E7 + * @param longitude Longitude (WGS84), in degrees * 1E7 + * @param altitude Altitude (WGS84), in meters * 1000 (positive for up) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_global_origin_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, int32_t latitude, int32_t longitude, int32_t altitude) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; + char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN]; _mav_put_int32_t(buf, 0, latitude); _mav_put_int32_t(buf, 4, longitude); _mav_put_int32_t(buf, 8, altitude); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); #else mavlink_gps_global_origin_t packet; packet.latitude = latitude; packet.longitude = longitude; packet.altitude = altitude; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); #endif msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN; - return mavlink_finalize_message(msg, system_id, component_id, 12, 39); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); +#endif } /** @@ -64,9 +71,9 @@ static inline uint16_t mavlink_msg_gps_global_origin_pack(uint8_t system_id, uin * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message was sent over * @param msg The MAVLink message to compress the data into - * @param latitude Latitude (WGS84), expressed as * 1E7 - * @param longitude Longitude (WGS84), expressed as * 1E7 - * @param altitude Altitude(WGS84), expressed as * 1000 + * @param latitude Latitude (WGS84), in degrees * 1E7 + * @param longitude Longitude (WGS84), in degrees * 1E7 + * @param altitude Altitude (WGS84), in meters * 1000 (positive for up) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_global_origin_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -74,23 +81,27 @@ static inline uint16_t mavlink_msg_gps_global_origin_pack_chan(uint8_t system_id int32_t latitude,int32_t longitude,int32_t altitude) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; + char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN]; _mav_put_int32_t(buf, 0, latitude); _mav_put_int32_t(buf, 4, longitude); _mav_put_int32_t(buf, 8, altitude); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); #else mavlink_gps_global_origin_t packet; packet.latitude = latitude; packet.longitude = longitude; packet.altitude = altitude; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); #endif msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 39); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); +#endif } /** @@ -110,28 +121,36 @@ static inline uint16_t mavlink_msg_gps_global_origin_encode(uint8_t system_id, u * @brief Send a gps_global_origin message * @param chan MAVLink channel to send the message * - * @param latitude Latitude (WGS84), expressed as * 1E7 - * @param longitude Longitude (WGS84), expressed as * 1E7 - * @param altitude Altitude(WGS84), expressed as * 1000 + * @param latitude Latitude (WGS84), in degrees * 1E7 + * @param longitude Longitude (WGS84), in degrees * 1E7 + * @param altitude Altitude (WGS84), in meters * 1000 (positive for up) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS static inline void mavlink_msg_gps_global_origin_send(mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; + char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN]; _mav_put_int32_t(buf, 0, latitude); _mav_put_int32_t(buf, 4, longitude); _mav_put_int32_t(buf, 8, altitude); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, buf, 12, 39); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); +#endif #else mavlink_gps_global_origin_t packet; packet.latitude = latitude; packet.longitude = longitude; packet.altitude = altitude; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)&packet, 12, 39); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)&packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)&packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); +#endif #endif } @@ -143,7 +162,7 @@ static inline void mavlink_msg_gps_global_origin_send(mavlink_channel_t chan, in /** * @brief Get field latitude from gps_global_origin message * - * @return Latitude (WGS84), expressed as * 1E7 + * @return Latitude (WGS84), in degrees * 1E7 */ static inline int32_t mavlink_msg_gps_global_origin_get_latitude(const mavlink_message_t* msg) { @@ -153,7 +172,7 @@ static inline int32_t mavlink_msg_gps_global_origin_get_latitude(const mavlink_m /** * @brief Get field longitude from gps_global_origin message * - * @return Longitude (WGS84), expressed as * 1E7 + * @return Longitude (WGS84), in degrees * 1E7 */ static inline int32_t mavlink_msg_gps_global_origin_get_longitude(const mavlink_message_t* msg) { @@ -163,7 +182,7 @@ static inline int32_t mavlink_msg_gps_global_origin_get_longitude(const mavlink_ /** * @brief Get field altitude from gps_global_origin message * - * @return Altitude(WGS84), expressed as * 1000 + * @return Altitude (WGS84), in meters * 1000 (positive for up) */ static inline int32_t mavlink_msg_gps_global_origin_get_altitude(const mavlink_message_t* msg) { @@ -183,6 +202,6 @@ static inline void mavlink_msg_gps_global_origin_decode(const mavlink_message_t* gps_global_origin->longitude = mavlink_msg_gps_global_origin_get_longitude(msg); gps_global_origin->altitude = mavlink_msg_gps_global_origin_get_altitude(msg); #else - memcpy(gps_global_origin, _MAV_PAYLOAD(msg), 12); + memcpy(gps_global_origin, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_raw_int.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_raw_int.h index 57ec97376..2136b65ee 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_raw_int.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_raw_int.h @@ -5,9 +5,9 @@ typedef struct __mavlink_gps_raw_int_t { uint64_t time_usec; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - int32_t lat; ///< Latitude in 1E7 degrees - int32_t lon; ///< Longitude in 1E7 degrees - int32_t alt; ///< Altitude in 1E3 meters (millimeters) above MSL + int32_t lat; ///< Latitude (WGS84), in degrees * 1E7 + int32_t lon; ///< Longitude (WGS84), in degrees * 1E7 + int32_t alt; ///< Altitude (WGS84), in meters * 1000 (positive for up) uint16_t eph; ///< GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 uint16_t epv; ///< GPS VDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 uint16_t vel; ///< GPS ground speed (m/s * 100). If unknown, set to: 65535 @@ -19,6 +19,9 @@ typedef struct __mavlink_gps_raw_int_t #define MAVLINK_MSG_ID_GPS_RAW_INT_LEN 30 #define MAVLINK_MSG_ID_24_LEN 30 +#define MAVLINK_MSG_ID_GPS_RAW_INT_CRC 24 +#define MAVLINK_MSG_ID_24_CRC 24 + #define MAVLINK_MESSAGE_INFO_GPS_RAW_INT { \ @@ -46,9 +49,9 @@ typedef struct __mavlink_gps_raw_int_t * * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - * @param lat Latitude in 1E7 degrees - * @param lon Longitude in 1E7 degrees - * @param alt Altitude in 1E3 meters (millimeters) above MSL + * @param lat Latitude (WGS84), in degrees * 1E7 + * @param lon Longitude (WGS84), in degrees * 1E7 + * @param alt Altitude (WGS84), in meters * 1000 (positive for up) * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 * @param epv GPS VDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 * @param vel GPS ground speed (m/s * 100). If unknown, set to: 65535 @@ -60,7 +63,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t c uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[30]; + char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_int32_t(buf, 8, lat); _mav_put_int32_t(buf, 12, lon); @@ -72,7 +75,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t c _mav_put_uint8_t(buf, 28, fix_type); _mav_put_uint8_t(buf, 29, satellites_visible); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); #else mavlink_gps_raw_int_t packet; packet.time_usec = time_usec; @@ -86,11 +89,15 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t c packet.fix_type = fix_type; packet.satellites_visible = satellites_visible; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT; - return mavlink_finalize_message(msg, system_id, component_id, 30, 24); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); +#endif } /** @@ -101,9 +108,9 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t c * @param msg The MAVLink message to compress the data into * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - * @param lat Latitude in 1E7 degrees - * @param lon Longitude in 1E7 degrees - * @param alt Altitude in 1E3 meters (millimeters) above MSL + * @param lat Latitude (WGS84), in degrees * 1E7 + * @param lon Longitude (WGS84), in degrees * 1E7 + * @param alt Altitude (WGS84), in meters * 1000 (positive for up) * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 * @param epv GPS VDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 * @param vel GPS ground speed (m/s * 100). If unknown, set to: 65535 @@ -116,7 +123,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint uint64_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,uint16_t cog,uint8_t satellites_visible) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[30]; + char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_int32_t(buf, 8, lat); _mav_put_int32_t(buf, 12, lon); @@ -128,7 +135,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint _mav_put_uint8_t(buf, 28, fix_type); _mav_put_uint8_t(buf, 29, satellites_visible); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); #else mavlink_gps_raw_int_t packet; packet.time_usec = time_usec; @@ -142,11 +149,15 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint packet.fix_type = fix_type; packet.satellites_visible = satellites_visible; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 30, 24); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); +#endif } /** @@ -168,9 +179,9 @@ static inline uint16_t mavlink_msg_gps_raw_int_encode(uint8_t system_id, uint8_t * * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - * @param lat Latitude in 1E7 degrees - * @param lon Longitude in 1E7 degrees - * @param alt Altitude in 1E3 meters (millimeters) above MSL + * @param lat Latitude (WGS84), in degrees * 1E7 + * @param lon Longitude (WGS84), in degrees * 1E7 + * @param alt Altitude (WGS84), in meters * 1000 (positive for up) * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 * @param epv GPS VDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 * @param vel GPS ground speed (m/s * 100). If unknown, set to: 65535 @@ -182,7 +193,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_encode(uint8_t system_id, uint8_t static inline void mavlink_msg_gps_raw_int_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[30]; + char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_int32_t(buf, 8, lat); _mav_put_int32_t(buf, 12, lon); @@ -194,7 +205,11 @@ static inline void mavlink_msg_gps_raw_int_send(mavlink_channel_t chan, uint64_t _mav_put_uint8_t(buf, 28, fix_type); _mav_put_uint8_t(buf, 29, satellites_visible); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, 30, 24); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); +#endif #else mavlink_gps_raw_int_t packet; packet.time_usec = time_usec; @@ -208,7 +223,11 @@ static inline void mavlink_msg_gps_raw_int_send(mavlink_channel_t chan, uint64_t packet.fix_type = fix_type; packet.satellites_visible = satellites_visible; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)&packet, 30, 24); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)&packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)&packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); +#endif #endif } @@ -240,7 +259,7 @@ static inline uint8_t mavlink_msg_gps_raw_int_get_fix_type(const mavlink_message /** * @brief Get field lat from gps_raw_int message * - * @return Latitude in 1E7 degrees + * @return Latitude (WGS84), in degrees * 1E7 */ static inline int32_t mavlink_msg_gps_raw_int_get_lat(const mavlink_message_t* msg) { @@ -250,7 +269,7 @@ static inline int32_t mavlink_msg_gps_raw_int_get_lat(const mavlink_message_t* m /** * @brief Get field lon from gps_raw_int message * - * @return Longitude in 1E7 degrees + * @return Longitude (WGS84), in degrees * 1E7 */ static inline int32_t mavlink_msg_gps_raw_int_get_lon(const mavlink_message_t* msg) { @@ -260,7 +279,7 @@ static inline int32_t mavlink_msg_gps_raw_int_get_lon(const mavlink_message_t* m /** * @brief Get field alt from gps_raw_int message * - * @return Altitude in 1E3 meters (millimeters) above MSL + * @return Altitude (WGS84), in meters * 1000 (positive for up) */ static inline int32_t mavlink_msg_gps_raw_int_get_alt(const mavlink_message_t* msg) { @@ -337,6 +356,6 @@ static inline void mavlink_msg_gps_raw_int_decode(const mavlink_message_t* msg, gps_raw_int->fix_type = mavlink_msg_gps_raw_int_get_fix_type(msg); gps_raw_int->satellites_visible = mavlink_msg_gps_raw_int_get_satellites_visible(msg); #else - memcpy(gps_raw_int, _MAV_PAYLOAD(msg), 30); + memcpy(gps_raw_int, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GPS_RAW_INT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_status.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_status.h index bd3257f88..cd6dde700 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_status.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_status.h @@ -15,6 +15,9 @@ typedef struct __mavlink_gps_status_t #define MAVLINK_MSG_ID_GPS_STATUS_LEN 101 #define MAVLINK_MSG_ID_25_LEN 101 +#define MAVLINK_MSG_ID_GPS_STATUS_CRC 23 +#define MAVLINK_MSG_ID_25_CRC 23 + #define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_PRN_LEN 20 #define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_USED_LEN 20 #define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_ELEVATION_LEN 20 @@ -52,14 +55,14 @@ static inline uint16_t mavlink_msg_gps_status_pack(uint8_t system_id, uint8_t co uint8_t satellites_visible, const uint8_t *satellite_prn, const uint8_t *satellite_used, const uint8_t *satellite_elevation, const uint8_t *satellite_azimuth, const uint8_t *satellite_snr) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[101]; + char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN]; _mav_put_uint8_t(buf, 0, satellites_visible); _mav_put_uint8_t_array(buf, 1, satellite_prn, 20); _mav_put_uint8_t_array(buf, 21, satellite_used, 20); _mav_put_uint8_t_array(buf, 41, satellite_elevation, 20); _mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20); _mav_put_uint8_t_array(buf, 81, satellite_snr, 20); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 101); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_STATUS_LEN); #else mavlink_gps_status_t packet; packet.satellites_visible = satellites_visible; @@ -68,11 +71,15 @@ static inline uint16_t mavlink_msg_gps_status_pack(uint8_t system_id, uint8_t co mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20); mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20); mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 101); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_STATUS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_GPS_STATUS; - return mavlink_finalize_message(msg, system_id, component_id, 101, 23); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_STATUS_LEN); +#endif } /** @@ -94,14 +101,14 @@ static inline uint16_t mavlink_msg_gps_status_pack_chan(uint8_t system_id, uint8 uint8_t satellites_visible,const uint8_t *satellite_prn,const uint8_t *satellite_used,const uint8_t *satellite_elevation,const uint8_t *satellite_azimuth,const uint8_t *satellite_snr) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[101]; + char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN]; _mav_put_uint8_t(buf, 0, satellites_visible); _mav_put_uint8_t_array(buf, 1, satellite_prn, 20); _mav_put_uint8_t_array(buf, 21, satellite_used, 20); _mav_put_uint8_t_array(buf, 41, satellite_elevation, 20); _mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20); _mav_put_uint8_t_array(buf, 81, satellite_snr, 20); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 101); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_STATUS_LEN); #else mavlink_gps_status_t packet; packet.satellites_visible = satellites_visible; @@ -110,11 +117,15 @@ static inline uint16_t mavlink_msg_gps_status_pack_chan(uint8_t system_id, uint8 mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20); mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20); mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 101); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_STATUS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_GPS_STATUS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 101, 23); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_STATUS_LEN); +#endif } /** @@ -146,14 +157,18 @@ static inline uint16_t mavlink_msg_gps_status_encode(uint8_t system_id, uint8_t static inline void mavlink_msg_gps_status_send(mavlink_channel_t chan, uint8_t satellites_visible, const uint8_t *satellite_prn, const uint8_t *satellite_used, const uint8_t *satellite_elevation, const uint8_t *satellite_azimuth, const uint8_t *satellite_snr) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[101]; + char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN]; _mav_put_uint8_t(buf, 0, satellites_visible); _mav_put_uint8_t_array(buf, 1, satellite_prn, 20); _mav_put_uint8_t_array(buf, 21, satellite_used, 20); _mav_put_uint8_t_array(buf, 41, satellite_elevation, 20); _mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20); _mav_put_uint8_t_array(buf, 81, satellite_snr, 20); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, buf, 101, 23); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, buf, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, buf, MAVLINK_MSG_ID_GPS_STATUS_LEN); +#endif #else mavlink_gps_status_t packet; packet.satellites_visible = satellites_visible; @@ -162,7 +177,11 @@ static inline void mavlink_msg_gps_status_send(mavlink_channel_t chan, uint8_t s mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20); mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20); mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)&packet, 101, 23); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_GPS_STATUS_LEN); +#endif #endif } @@ -247,6 +266,6 @@ static inline void mavlink_msg_gps_status_decode(const mavlink_message_t* msg, m mavlink_msg_gps_status_get_satellite_azimuth(msg, gps_status->satellite_azimuth); mavlink_msg_gps_status_get_satellite_snr(msg, gps_status->satellite_snr); #else - memcpy(gps_status, _MAV_PAYLOAD(msg), 101); + memcpy(gps_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GPS_STATUS_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_heartbeat.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_heartbeat.h index 599ea0bc5..b2f0b65d0 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_heartbeat.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_heartbeat.h @@ -15,6 +15,9 @@ typedef struct __mavlink_heartbeat_t #define MAVLINK_MSG_ID_HEARTBEAT_LEN 9 #define MAVLINK_MSG_ID_0_LEN 9 +#define MAVLINK_MSG_ID_HEARTBEAT_CRC 50 +#define MAVLINK_MSG_ID_0_CRC 50 + #define MAVLINK_MESSAGE_INFO_HEARTBEAT { \ @@ -47,7 +50,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t com uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[9]; + char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN]; _mav_put_uint32_t(buf, 0, custom_mode); _mav_put_uint8_t(buf, 4, type); _mav_put_uint8_t(buf, 5, autopilot); @@ -55,7 +58,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t com _mav_put_uint8_t(buf, 7, system_status); _mav_put_uint8_t(buf, 8, 3); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HEARTBEAT_LEN); #else mavlink_heartbeat_t packet; packet.custom_mode = custom_mode; @@ -65,11 +68,15 @@ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t com packet.system_status = system_status; packet.mavlink_version = 3; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HEARTBEAT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_HEARTBEAT; - return mavlink_finalize_message(msg, system_id, component_id, 9, 50); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HEARTBEAT_LEN); +#endif } /** @@ -90,7 +97,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_ uint8_t type,uint8_t autopilot,uint8_t base_mode,uint32_t custom_mode,uint8_t system_status) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[9]; + char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN]; _mav_put_uint32_t(buf, 0, custom_mode); _mav_put_uint8_t(buf, 4, type); _mav_put_uint8_t(buf, 5, autopilot); @@ -98,7 +105,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_ _mav_put_uint8_t(buf, 7, system_status); _mav_put_uint8_t(buf, 8, 3); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HEARTBEAT_LEN); #else mavlink_heartbeat_t packet; packet.custom_mode = custom_mode; @@ -108,11 +115,15 @@ static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_ packet.system_status = system_status; packet.mavlink_version = 3; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HEARTBEAT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_HEARTBEAT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 9, 50); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HEARTBEAT_LEN); +#endif } /** @@ -143,7 +154,7 @@ static inline uint16_t mavlink_msg_heartbeat_encode(uint8_t system_id, uint8_t c static inline void mavlink_msg_heartbeat_send(mavlink_channel_t chan, uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[9]; + char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN]; _mav_put_uint32_t(buf, 0, custom_mode); _mav_put_uint8_t(buf, 4, type); _mav_put_uint8_t(buf, 5, autopilot); @@ -151,7 +162,11 @@ static inline void mavlink_msg_heartbeat_send(mavlink_channel_t chan, uint8_t ty _mav_put_uint8_t(buf, 7, system_status); _mav_put_uint8_t(buf, 8, 3); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, 9, 50); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, MAVLINK_MSG_ID_HEARTBEAT_LEN); +#endif #else mavlink_heartbeat_t packet; packet.custom_mode = custom_mode; @@ -161,7 +176,11 @@ static inline void mavlink_msg_heartbeat_send(mavlink_channel_t chan, uint8_t ty packet.system_status = system_status; packet.mavlink_version = 3; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)&packet, 9, 50); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)&packet, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)&packet, MAVLINK_MSG_ID_HEARTBEAT_LEN); +#endif #endif } @@ -246,6 +265,6 @@ static inline void mavlink_msg_heartbeat_decode(const mavlink_message_t* msg, ma heartbeat->system_status = mavlink_msg_heartbeat_get_system_status(msg); heartbeat->mavlink_version = mavlink_msg_heartbeat_get_mavlink_version(msg); #else - memcpy(heartbeat, _MAV_PAYLOAD(msg), 9); + memcpy(heartbeat, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HEARTBEAT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_highres_imu.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_highres_imu.h index 9714c698f..6e7492ea6 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_highres_imu.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_highres_imu.h @@ -24,6 +24,9 @@ typedef struct __mavlink_highres_imu_t #define MAVLINK_MSG_ID_HIGHRES_IMU_LEN 62 #define MAVLINK_MSG_ID_105_LEN 62 +#define MAVLINK_MSG_ID_HIGHRES_IMU_CRC 93 +#define MAVLINK_MSG_ID_105_CRC 93 + #define MAVLINK_MESSAGE_INFO_HIGHRES_IMU { \ @@ -75,7 +78,7 @@ static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t c uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[62]; + char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, xacc); _mav_put_float(buf, 12, yacc); @@ -92,7 +95,7 @@ static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t c _mav_put_float(buf, 56, temperature); _mav_put_uint16_t(buf, 60, fields_updated); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 62); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); #else mavlink_highres_imu_t packet; packet.time_usec = time_usec; @@ -111,11 +114,15 @@ static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t c packet.temperature = temperature; packet.fields_updated = fields_updated; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 62); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); #endif msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU; - return mavlink_finalize_message(msg, system_id, component_id, 62, 93); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); +#endif } /** @@ -146,7 +153,7 @@ static inline uint16_t mavlink_msg_highres_imu_pack_chan(uint8_t system_id, uint uint64_t time_usec,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float xmag,float ymag,float zmag,float abs_pressure,float diff_pressure,float pressure_alt,float temperature,uint16_t fields_updated) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[62]; + char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, xacc); _mav_put_float(buf, 12, yacc); @@ -163,7 +170,7 @@ static inline uint16_t mavlink_msg_highres_imu_pack_chan(uint8_t system_id, uint _mav_put_float(buf, 56, temperature); _mav_put_uint16_t(buf, 60, fields_updated); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 62); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); #else mavlink_highres_imu_t packet; packet.time_usec = time_usec; @@ -182,11 +189,15 @@ static inline uint16_t mavlink_msg_highres_imu_pack_chan(uint8_t system_id, uint packet.temperature = temperature; packet.fields_updated = fields_updated; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 62); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); #endif msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 62, 93); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); +#endif } /** @@ -227,7 +238,7 @@ static inline uint16_t mavlink_msg_highres_imu_encode(uint8_t system_id, uint8_t static inline void mavlink_msg_highres_imu_send(mavlink_channel_t chan, uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[62]; + char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, xacc); _mav_put_float(buf, 12, yacc); @@ -244,7 +255,11 @@ static inline void mavlink_msg_highres_imu_send(mavlink_channel_t chan, uint64_t _mav_put_float(buf, 56, temperature); _mav_put_uint16_t(buf, 60, fields_updated); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, 62, 93); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); +#endif #else mavlink_highres_imu_t packet; packet.time_usec = time_usec; @@ -263,7 +278,11 @@ static inline void mavlink_msg_highres_imu_send(mavlink_channel_t chan, uint64_t packet.temperature = temperature; packet.fields_updated = fields_updated; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)&packet, 62, 93); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)&packet, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)&packet, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); +#endif #endif } @@ -447,6 +466,6 @@ static inline void mavlink_msg_highres_imu_decode(const mavlink_message_t* msg, highres_imu->temperature = mavlink_msg_highres_imu_get_temperature(msg); highres_imu->fields_updated = mavlink_msg_highres_imu_get_fields_updated(msg); #else - memcpy(highres_imu, _MAV_PAYLOAD(msg), 62); + memcpy(highres_imu, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HIGHRES_IMU_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_controls.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_controls.h index 41a9bc949..3319d3fd2 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_controls.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_controls.h @@ -20,6 +20,9 @@ typedef struct __mavlink_hil_controls_t #define MAVLINK_MSG_ID_HIL_CONTROLS_LEN 42 #define MAVLINK_MSG_ID_91_LEN 42 +#define MAVLINK_MSG_ID_HIL_CONTROLS_CRC 63 +#define MAVLINK_MSG_ID_91_CRC 63 + #define MAVLINK_MESSAGE_INFO_HIL_CONTROLS { \ @@ -63,7 +66,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t uint64_t time_usec, float roll_ailerons, float pitch_elevator, float yaw_rudder, float throttle, float aux1, float aux2, float aux3, float aux4, uint8_t mode, uint8_t nav_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[42]; + char buf[MAVLINK_MSG_ID_HIL_CONTROLS_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, roll_ailerons); _mav_put_float(buf, 12, pitch_elevator); @@ -76,7 +79,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 40, mode); _mav_put_uint8_t(buf, 41, nav_mode); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); #else mavlink_hil_controls_t packet; packet.time_usec = time_usec; @@ -91,11 +94,15 @@ static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t packet.mode = mode; packet.nav_mode = nav_mode; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS; - return mavlink_finalize_message(msg, system_id, component_id, 42, 63); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); +#endif } /** @@ -122,7 +129,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack_chan(uint8_t system_id, uin uint64_t time_usec,float roll_ailerons,float pitch_elevator,float yaw_rudder,float throttle,float aux1,float aux2,float aux3,float aux4,uint8_t mode,uint8_t nav_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[42]; + char buf[MAVLINK_MSG_ID_HIL_CONTROLS_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, roll_ailerons); _mav_put_float(buf, 12, pitch_elevator); @@ -135,7 +142,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack_chan(uint8_t system_id, uin _mav_put_uint8_t(buf, 40, mode); _mav_put_uint8_t(buf, 41, nav_mode); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); #else mavlink_hil_controls_t packet; packet.time_usec = time_usec; @@ -150,11 +157,15 @@ static inline uint16_t mavlink_msg_hil_controls_pack_chan(uint8_t system_id, uin packet.mode = mode; packet.nav_mode = nav_mode; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 42, 63); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); +#endif } /** @@ -191,7 +202,7 @@ static inline uint16_t mavlink_msg_hil_controls_encode(uint8_t system_id, uint8_ static inline void mavlink_msg_hil_controls_send(mavlink_channel_t chan, uint64_t time_usec, float roll_ailerons, float pitch_elevator, float yaw_rudder, float throttle, float aux1, float aux2, float aux3, float aux4, uint8_t mode, uint8_t nav_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[42]; + char buf[MAVLINK_MSG_ID_HIL_CONTROLS_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, roll_ailerons); _mav_put_float(buf, 12, pitch_elevator); @@ -204,7 +215,11 @@ static inline void mavlink_msg_hil_controls_send(mavlink_channel_t chan, uint64_ _mav_put_uint8_t(buf, 40, mode); _mav_put_uint8_t(buf, 41, nav_mode); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, buf, 42, 63); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, buf, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, buf, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); +#endif #else mavlink_hil_controls_t packet; packet.time_usec = time_usec; @@ -219,7 +234,11 @@ static inline void mavlink_msg_hil_controls_send(mavlink_channel_t chan, uint64_ packet.mode = mode; packet.nav_mode = nav_mode; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, (const char *)&packet, 42, 63); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, (const char *)&packet, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, (const char *)&packet, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); +#endif #endif } @@ -359,6 +378,6 @@ static inline void mavlink_msg_hil_controls_decode(const mavlink_message_t* msg, hil_controls->mode = mavlink_msg_hil_controls_get_mode(msg); hil_controls->nav_mode = mavlink_msg_hil_controls_get_nav_mode(msg); #else - memcpy(hil_controls, _MAV_PAYLOAD(msg), 42); + memcpy(hil_controls, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HIL_CONTROLS_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_rc_inputs_raw.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_rc_inputs_raw.h index 7ac0853d3..f2435dde8 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_rc_inputs_raw.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_rc_inputs_raw.h @@ -23,6 +23,9 @@ typedef struct __mavlink_hil_rc_inputs_raw_t #define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN 33 #define MAVLINK_MSG_ID_92_LEN 33 +#define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC 54 +#define MAVLINK_MSG_ID_92_CRC 54 + #define MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW { \ @@ -72,7 +75,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uin uint64_t time_usec, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[33]; + char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_uint16_t(buf, 8, chan1_raw); _mav_put_uint16_t(buf, 10, chan2_raw); @@ -88,7 +91,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uin _mav_put_uint16_t(buf, 30, chan12_raw); _mav_put_uint8_t(buf, 32, rssi); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); #else mavlink_hil_rc_inputs_raw_t packet; packet.time_usec = time_usec; @@ -106,11 +109,15 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uin packet.chan12_raw = chan12_raw; packet.rssi = rssi; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); #endif msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW; - return mavlink_finalize_message(msg, system_id, component_id, 33, 54); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); +#endif } /** @@ -140,7 +147,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack_chan(uint8_t system_id uint64_t time_usec,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw,uint16_t chan9_raw,uint16_t chan10_raw,uint16_t chan11_raw,uint16_t chan12_raw,uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[33]; + char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_uint16_t(buf, 8, chan1_raw); _mav_put_uint16_t(buf, 10, chan2_raw); @@ -156,7 +163,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack_chan(uint8_t system_id _mav_put_uint16_t(buf, 30, chan12_raw); _mav_put_uint8_t(buf, 32, rssi); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); #else mavlink_hil_rc_inputs_raw_t packet; packet.time_usec = time_usec; @@ -174,11 +181,15 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack_chan(uint8_t system_id packet.chan12_raw = chan12_raw; packet.rssi = rssi; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); #endif msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 33, 54); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); +#endif } /** @@ -218,7 +229,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_encode(uint8_t system_id, u static inline void mavlink_msg_hil_rc_inputs_raw_send(mavlink_channel_t chan, uint64_t time_usec, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[33]; + char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_uint16_t(buf, 8, chan1_raw); _mav_put_uint16_t(buf, 10, chan2_raw); @@ -234,7 +245,11 @@ static inline void mavlink_msg_hil_rc_inputs_raw_send(mavlink_channel_t chan, ui _mav_put_uint16_t(buf, 30, chan12_raw); _mav_put_uint8_t(buf, 32, rssi); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, buf, 33, 54); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); +#endif #else mavlink_hil_rc_inputs_raw_t packet; packet.time_usec = time_usec; @@ -252,7 +267,11 @@ static inline void mavlink_msg_hil_rc_inputs_raw_send(mavlink_channel_t chan, ui packet.chan12_raw = chan12_raw; packet.rssi = rssi; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)&packet, 33, 54); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)&packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)&packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); +#endif #endif } @@ -425,6 +444,6 @@ static inline void mavlink_msg_hil_rc_inputs_raw_decode(const mavlink_message_t* hil_rc_inputs_raw->chan12_raw = mavlink_msg_hil_rc_inputs_raw_get_chan12_raw(msg); hil_rc_inputs_raw->rssi = mavlink_msg_hil_rc_inputs_raw_get_rssi(msg); #else - memcpy(hil_rc_inputs_raw, _MAV_PAYLOAD(msg), 33); + memcpy(hil_rc_inputs_raw, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_state.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_state.h index 144781295..a27f19cde 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_state.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_state.h @@ -25,6 +25,9 @@ typedef struct __mavlink_hil_state_t #define MAVLINK_MSG_ID_HIL_STATE_LEN 56 #define MAVLINK_MSG_ID_90_LEN 56 +#define MAVLINK_MSG_ID_HIL_STATE_CRC 183 +#define MAVLINK_MSG_ID_90_CRC 183 + #define MAVLINK_MESSAGE_INFO_HIL_STATE { \ @@ -78,7 +81,7 @@ static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t com uint64_t time_usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, int16_t xacc, int16_t yacc, int16_t zacc) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[56]; + char buf[MAVLINK_MSG_ID_HIL_STATE_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, roll); _mav_put_float(buf, 12, pitch); @@ -96,7 +99,7 @@ static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t com _mav_put_int16_t(buf, 52, yacc); _mav_put_int16_t(buf, 54, zacc); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 56); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_STATE_LEN); #else mavlink_hil_state_t packet; packet.time_usec = time_usec; @@ -116,11 +119,15 @@ static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t com packet.yacc = yacc; packet.zacc = zacc; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 56); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_STATE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_HIL_STATE; - return mavlink_finalize_message(msg, system_id, component_id, 56, 183); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_STATE_LEN); +#endif } /** @@ -152,7 +159,7 @@ static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_ uint64_t time_usec,float roll,float pitch,float yaw,float rollspeed,float pitchspeed,float yawspeed,int32_t lat,int32_t lon,int32_t alt,int16_t vx,int16_t vy,int16_t vz,int16_t xacc,int16_t yacc,int16_t zacc) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[56]; + char buf[MAVLINK_MSG_ID_HIL_STATE_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, roll); _mav_put_float(buf, 12, pitch); @@ -170,7 +177,7 @@ static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_ _mav_put_int16_t(buf, 52, yacc); _mav_put_int16_t(buf, 54, zacc); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 56); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_STATE_LEN); #else mavlink_hil_state_t packet; packet.time_usec = time_usec; @@ -190,11 +197,15 @@ static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_ packet.yacc = yacc; packet.zacc = zacc; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 56); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_STATE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_HIL_STATE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 56, 183); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_STATE_LEN); +#endif } /** @@ -236,7 +247,7 @@ static inline uint16_t mavlink_msg_hil_state_encode(uint8_t system_id, uint8_t c static inline void mavlink_msg_hil_state_send(mavlink_channel_t chan, uint64_t time_usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, int16_t xacc, int16_t yacc, int16_t zacc) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[56]; + char buf[MAVLINK_MSG_ID_HIL_STATE_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, roll); _mav_put_float(buf, 12, pitch); @@ -254,7 +265,11 @@ static inline void mavlink_msg_hil_state_send(mavlink_channel_t chan, uint64_t t _mav_put_int16_t(buf, 52, yacc); _mav_put_int16_t(buf, 54, zacc); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, 56, 183); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, MAVLINK_MSG_ID_HIL_STATE_LEN); +#endif #else mavlink_hil_state_t packet; packet.time_usec = time_usec; @@ -274,7 +289,11 @@ static inline void mavlink_msg_hil_state_send(mavlink_channel_t chan, uint64_t t packet.yacc = yacc; packet.zacc = zacc; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)&packet, 56, 183); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)&packet, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)&packet, MAVLINK_MSG_ID_HIL_STATE_LEN); +#endif #endif } @@ -469,6 +488,6 @@ static inline void mavlink_msg_hil_state_decode(const mavlink_message_t* msg, ma hil_state->yacc = mavlink_msg_hil_state_get_yacc(msg); hil_state->zacc = mavlink_msg_hil_state_get_zacc(msg); #else - memcpy(hil_state, _MAV_PAYLOAD(msg), 56); + memcpy(hil_state, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HIL_STATE_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_ned.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_ned.h index fe0a791fc..56723f3d7 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_ned.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_ned.h @@ -16,6 +16,9 @@ typedef struct __mavlink_local_position_ned_t #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN 28 #define MAVLINK_MSG_ID_32_LEN 28 +#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC 185 +#define MAVLINK_MSG_ID_32_CRC 185 + #define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED { \ @@ -51,7 +54,7 @@ static inline uint16_t mavlink_msg_local_position_ned_pack(uint8_t system_id, ui uint32_t time_boot_ms, float x, float y, float z, float vx, float vy, float vz) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, x); _mav_put_float(buf, 8, y); @@ -60,7 +63,7 @@ static inline uint16_t mavlink_msg_local_position_ned_pack(uint8_t system_id, ui _mav_put_float(buf, 20, vy); _mav_put_float(buf, 24, vz); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); #else mavlink_local_position_ned_t packet; packet.time_boot_ms = time_boot_ms; @@ -71,11 +74,15 @@ static inline uint16_t mavlink_msg_local_position_ned_pack(uint8_t system_id, ui packet.vy = vy; packet.vz = vz; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); #endif msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED; - return mavlink_finalize_message(msg, system_id, component_id, 28, 185); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); +#endif } /** @@ -98,7 +105,7 @@ static inline uint16_t mavlink_msg_local_position_ned_pack_chan(uint8_t system_i uint32_t time_boot_ms,float x,float y,float z,float vx,float vy,float vz) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, x); _mav_put_float(buf, 8, y); @@ -107,7 +114,7 @@ static inline uint16_t mavlink_msg_local_position_ned_pack_chan(uint8_t system_i _mav_put_float(buf, 20, vy); _mav_put_float(buf, 24, vz); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); #else mavlink_local_position_ned_t packet; packet.time_boot_ms = time_boot_ms; @@ -118,11 +125,15 @@ static inline uint16_t mavlink_msg_local_position_ned_pack_chan(uint8_t system_i packet.vy = vy; packet.vz = vz; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); #endif msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 185); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); +#endif } /** @@ -155,7 +166,7 @@ static inline uint16_t mavlink_msg_local_position_ned_encode(uint8_t system_id, static inline void mavlink_msg_local_position_ned_send(mavlink_channel_t chan, uint32_t time_boot_ms, float x, float y, float z, float vx, float vy, float vz) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, x); _mav_put_float(buf, 8, y); @@ -164,7 +175,11 @@ static inline void mavlink_msg_local_position_ned_send(mavlink_channel_t chan, u _mav_put_float(buf, 20, vy); _mav_put_float(buf, 24, vz); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, buf, 28, 185); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); +#endif #else mavlink_local_position_ned_t packet; packet.time_boot_ms = time_boot_ms; @@ -175,7 +190,11 @@ static inline void mavlink_msg_local_position_ned_send(mavlink_channel_t chan, u packet.vy = vy; packet.vz = vz; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)&packet, 28, 185); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); +#endif #endif } @@ -271,6 +290,6 @@ static inline void mavlink_msg_local_position_ned_decode(const mavlink_message_t local_position_ned->vy = mavlink_msg_local_position_ned_get_vy(msg); local_position_ned->vz = mavlink_msg_local_position_ned_get_vz(msg); #else - memcpy(local_position_ned, _MAV_PAYLOAD(msg), 28); + memcpy(local_position_ned, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_ned_system_global_offset.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_ned_system_global_offset.h index ac1941db0..c206a2906 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_ned_system_global_offset.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_ned_system_global_offset.h @@ -16,6 +16,9 @@ typedef struct __mavlink_local_position_ned_system_global_offset_t #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN 28 #define MAVLINK_MSG_ID_89_LEN 28 +#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC 231 +#define MAVLINK_MSG_ID_89_CRC 231 + #define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET { \ @@ -51,7 +54,7 @@ static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack( uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, x); _mav_put_float(buf, 8, y); @@ -60,7 +63,7 @@ static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack( _mav_put_float(buf, 20, pitch); _mav_put_float(buf, 24, yaw); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); #else mavlink_local_position_ned_system_global_offset_t packet; packet.time_boot_ms = time_boot_ms; @@ -71,11 +74,15 @@ static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack( packet.pitch = pitch; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); #endif msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET; - return mavlink_finalize_message(msg, system_id, component_id, 28, 231); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); +#endif } /** @@ -98,7 +105,7 @@ static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack_ uint32_t time_boot_ms,float x,float y,float z,float roll,float pitch,float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, x); _mav_put_float(buf, 8, y); @@ -107,7 +114,7 @@ static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack_ _mav_put_float(buf, 20, pitch); _mav_put_float(buf, 24, yaw); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); #else mavlink_local_position_ned_system_global_offset_t packet; packet.time_boot_ms = time_boot_ms; @@ -118,11 +125,15 @@ static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack_ packet.pitch = pitch; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); #endif msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 231); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); +#endif } /** @@ -155,7 +166,7 @@ static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_encod static inline void mavlink_msg_local_position_ned_system_global_offset_send(mavlink_channel_t chan, uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, x); _mav_put_float(buf, 8, y); @@ -164,7 +175,11 @@ static inline void mavlink_msg_local_position_ned_system_global_offset_send(mavl _mav_put_float(buf, 20, pitch); _mav_put_float(buf, 24, yaw); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, buf, 28, 231); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); +#endif #else mavlink_local_position_ned_system_global_offset_t packet; packet.time_boot_ms = time_boot_ms; @@ -175,7 +190,11 @@ static inline void mavlink_msg_local_position_ned_system_global_offset_send(mavl packet.pitch = pitch; packet.yaw = yaw; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)&packet, 28, 231); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); +#endif #endif } @@ -271,6 +290,6 @@ static inline void mavlink_msg_local_position_ned_system_global_offset_decode(co local_position_ned_system_global_offset->pitch = mavlink_msg_local_position_ned_system_global_offset_get_pitch(msg); local_position_ned_system_global_offset->yaw = mavlink_msg_local_position_ned_system_global_offset_get_yaw(msg); #else - memcpy(local_position_ned_system_global_offset, _MAV_PAYLOAD(msg), 28); + memcpy(local_position_ned_system_global_offset, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_setpoint.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_setpoint.h index 9ab87d0da..96f35fe62 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_setpoint.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_setpoint.h @@ -14,6 +14,9 @@ typedef struct __mavlink_local_position_setpoint_t #define MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN 17 #define MAVLINK_MSG_ID_51_LEN 17 +#define MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_CRC 223 +#define MAVLINK_MSG_ID_51_CRC 223 + #define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT { \ @@ -45,14 +48,14 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack(uint8_t system_i uint8_t coordinate_frame, float x, float y, float z, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[17]; + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN]; _mav_put_float(buf, 0, x); _mav_put_float(buf, 4, y); _mav_put_float(buf, 8, z); _mav_put_float(buf, 12, yaw); _mav_put_uint8_t(buf, 16, coordinate_frame); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 17); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN); #else mavlink_local_position_setpoint_t packet; packet.x = x; @@ -61,11 +64,15 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack(uint8_t system_i packet.yaw = yaw; packet.coordinate_frame = coordinate_frame; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 17); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT; - return mavlink_finalize_message(msg, system_id, component_id, 17, 223); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN); +#endif } /** @@ -86,14 +93,14 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack_chan(uint8_t sys uint8_t coordinate_frame,float x,float y,float z,float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[17]; + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN]; _mav_put_float(buf, 0, x); _mav_put_float(buf, 4, y); _mav_put_float(buf, 8, z); _mav_put_float(buf, 12, yaw); _mav_put_uint8_t(buf, 16, coordinate_frame); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 17); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN); #else mavlink_local_position_setpoint_t packet; packet.x = x; @@ -102,11 +109,15 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack_chan(uint8_t sys packet.yaw = yaw; packet.coordinate_frame = coordinate_frame; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 17); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 17, 223); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN); +#endif } /** @@ -137,14 +148,18 @@ static inline uint16_t mavlink_msg_local_position_setpoint_encode(uint8_t system static inline void mavlink_msg_local_position_setpoint_send(mavlink_channel_t chan, uint8_t coordinate_frame, float x, float y, float z, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[17]; + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN]; _mav_put_float(buf, 0, x); _mav_put_float(buf, 4, y); _mav_put_float(buf, 8, z); _mav_put_float(buf, 12, yaw); _mav_put_uint8_t(buf, 16, coordinate_frame); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT, buf, 17, 223); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT, buf, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT, buf, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN); +#endif #else mavlink_local_position_setpoint_t packet; packet.x = x; @@ -153,7 +168,11 @@ static inline void mavlink_msg_local_position_setpoint_send(mavlink_channel_t ch packet.yaw = yaw; packet.coordinate_frame = coordinate_frame; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT, (const char *)&packet, 17, 223); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN); +#endif #endif } @@ -227,6 +246,6 @@ static inline void mavlink_msg_local_position_setpoint_decode(const mavlink_mess local_position_setpoint->yaw = mavlink_msg_local_position_setpoint_get_yaw(msg); local_position_setpoint->coordinate_frame = mavlink_msg_local_position_setpoint_get_coordinate_frame(msg); #else - memcpy(local_position_setpoint, _MAV_PAYLOAD(msg), 17); + memcpy(local_position_setpoint, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_manual_control.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_manual_control.h index 96b3d3040..c9e4a4f8a 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_manual_control.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_manual_control.h @@ -15,6 +15,9 @@ typedef struct __mavlink_manual_control_t #define MAVLINK_MSG_ID_MANUAL_CONTROL_LEN 11 #define MAVLINK_MSG_ID_69_LEN 11 +#define MAVLINK_MSG_ID_MANUAL_CONTROL_CRC 243 +#define MAVLINK_MSG_ID_69_CRC 243 + #define MAVLINK_MESSAGE_INFO_MANUAL_CONTROL { \ @@ -48,7 +51,7 @@ static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_ uint8_t target, int16_t x, int16_t y, int16_t z, int16_t r, uint16_t buttons) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[11]; + char buf[MAVLINK_MSG_ID_MANUAL_CONTROL_LEN]; _mav_put_int16_t(buf, 0, x); _mav_put_int16_t(buf, 2, y); _mav_put_int16_t(buf, 4, z); @@ -56,7 +59,7 @@ static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_ _mav_put_uint16_t(buf, 8, buttons); _mav_put_uint8_t(buf, 10, target); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 11); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); #else mavlink_manual_control_t packet; packet.x = x; @@ -66,11 +69,15 @@ static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_ packet.buttons = buttons; packet.target = target; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 11); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL; - return mavlink_finalize_message(msg, system_id, component_id, 11, 243); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); +#endif } /** @@ -92,7 +99,7 @@ static inline uint16_t mavlink_msg_manual_control_pack_chan(uint8_t system_id, u uint8_t target,int16_t x,int16_t y,int16_t z,int16_t r,uint16_t buttons) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[11]; + char buf[MAVLINK_MSG_ID_MANUAL_CONTROL_LEN]; _mav_put_int16_t(buf, 0, x); _mav_put_int16_t(buf, 2, y); _mav_put_int16_t(buf, 4, z); @@ -100,7 +107,7 @@ static inline uint16_t mavlink_msg_manual_control_pack_chan(uint8_t system_id, u _mav_put_uint16_t(buf, 8, buttons); _mav_put_uint8_t(buf, 10, target); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 11); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); #else mavlink_manual_control_t packet; packet.x = x; @@ -110,11 +117,15 @@ static inline uint16_t mavlink_msg_manual_control_pack_chan(uint8_t system_id, u packet.buttons = buttons; packet.target = target; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 11); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 11, 243); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); +#endif } /** @@ -146,7 +157,7 @@ static inline uint16_t mavlink_msg_manual_control_encode(uint8_t system_id, uint static inline void mavlink_msg_manual_control_send(mavlink_channel_t chan, uint8_t target, int16_t x, int16_t y, int16_t z, int16_t r, uint16_t buttons) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[11]; + char buf[MAVLINK_MSG_ID_MANUAL_CONTROL_LEN]; _mav_put_int16_t(buf, 0, x); _mav_put_int16_t(buf, 2, y); _mav_put_int16_t(buf, 4, z); @@ -154,7 +165,11 @@ static inline void mavlink_msg_manual_control_send(mavlink_channel_t chan, uint8 _mav_put_uint16_t(buf, 8, buttons); _mav_put_uint8_t(buf, 10, target); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, 11, 243); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); +#endif #else mavlink_manual_control_t packet; packet.x = x; @@ -164,7 +179,11 @@ static inline void mavlink_msg_manual_control_send(mavlink_channel_t chan, uint8 packet.buttons = buttons; packet.target = target; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)&packet, 11, 243); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); +#endif #endif } @@ -249,6 +268,6 @@ static inline void mavlink_msg_manual_control_decode(const mavlink_message_t* ms manual_control->buttons = mavlink_msg_manual_control_get_buttons(msg); manual_control->target = mavlink_msg_manual_control_get_target(msg); #else - memcpy(manual_control, _MAV_PAYLOAD(msg), 11); + memcpy(manual_control, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_manual_setpoint.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_manual_setpoint.h index 71db380a1..d59e21292 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_manual_setpoint.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_manual_setpoint.h @@ -16,6 +16,9 @@ typedef struct __mavlink_manual_setpoint_t #define MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN 22 #define MAVLINK_MSG_ID_81_LEN 22 +#define MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC 106 +#define MAVLINK_MSG_ID_81_CRC 106 + #define MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT { \ @@ -51,7 +54,7 @@ static inline uint16_t mavlink_msg_manual_setpoint_pack(uint8_t system_id, uint8 uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust, uint8_t mode_switch, uint8_t manual_override_switch) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[22]; + char buf[MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, roll); _mav_put_float(buf, 8, pitch); @@ -60,7 +63,7 @@ static inline uint16_t mavlink_msg_manual_setpoint_pack(uint8_t system_id, uint8 _mav_put_uint8_t(buf, 20, mode_switch); _mav_put_uint8_t(buf, 21, manual_override_switch); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); #else mavlink_manual_setpoint_t packet; packet.time_boot_ms = time_boot_ms; @@ -71,11 +74,15 @@ static inline uint16_t mavlink_msg_manual_setpoint_pack(uint8_t system_id, uint8 packet.mode_switch = mode_switch; packet.manual_override_switch = manual_override_switch; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MANUAL_SETPOINT; - return mavlink_finalize_message(msg, system_id, component_id, 22, 106); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); +#endif } /** @@ -98,7 +105,7 @@ static inline uint16_t mavlink_msg_manual_setpoint_pack_chan(uint8_t system_id, uint32_t time_boot_ms,float roll,float pitch,float yaw,float thrust,uint8_t mode_switch,uint8_t manual_override_switch) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[22]; + char buf[MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, roll); _mav_put_float(buf, 8, pitch); @@ -107,7 +114,7 @@ static inline uint16_t mavlink_msg_manual_setpoint_pack_chan(uint8_t system_id, _mav_put_uint8_t(buf, 20, mode_switch); _mav_put_uint8_t(buf, 21, manual_override_switch); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); #else mavlink_manual_setpoint_t packet; packet.time_boot_ms = time_boot_ms; @@ -118,11 +125,15 @@ static inline uint16_t mavlink_msg_manual_setpoint_pack_chan(uint8_t system_id, packet.mode_switch = mode_switch; packet.manual_override_switch = manual_override_switch; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MANUAL_SETPOINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 22, 106); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); +#endif } /** @@ -155,7 +166,7 @@ static inline uint16_t mavlink_msg_manual_setpoint_encode(uint8_t system_id, uin static inline void mavlink_msg_manual_setpoint_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust, uint8_t mode_switch, uint8_t manual_override_switch) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[22]; + char buf[MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, roll); _mav_put_float(buf, 8, pitch); @@ -164,7 +175,11 @@ static inline void mavlink_msg_manual_setpoint_send(mavlink_channel_t chan, uint _mav_put_uint8_t(buf, 20, mode_switch); _mav_put_uint8_t(buf, 21, manual_override_switch); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, buf, 22, 106); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); +#endif #else mavlink_manual_setpoint_t packet; packet.time_boot_ms = time_boot_ms; @@ -175,7 +190,11 @@ static inline void mavlink_msg_manual_setpoint_send(mavlink_channel_t chan, uint packet.mode_switch = mode_switch; packet.manual_override_switch = manual_override_switch; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)&packet, 22, 106); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); +#endif #endif } @@ -271,6 +290,6 @@ static inline void mavlink_msg_manual_setpoint_decode(const mavlink_message_t* m manual_setpoint->mode_switch = mavlink_msg_manual_setpoint_get_mode_switch(msg); manual_setpoint->manual_override_switch = mavlink_msg_manual_setpoint_get_manual_override_switch(msg); #else - memcpy(manual_setpoint, _MAV_PAYLOAD(msg), 22); + memcpy(manual_setpoint, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_memory_vect.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_memory_vect.h index a61c13019..f8ae21b05 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_memory_vect.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_memory_vect.h @@ -13,6 +13,9 @@ typedef struct __mavlink_memory_vect_t #define MAVLINK_MSG_ID_MEMORY_VECT_LEN 36 #define MAVLINK_MSG_ID_249_LEN 36 +#define MAVLINK_MSG_ID_MEMORY_VECT_CRC 204 +#define MAVLINK_MSG_ID_249_CRC 204 + #define MAVLINK_MSG_MEMORY_VECT_FIELD_VALUE_LEN 32 #define MAVLINK_MESSAGE_INFO_MEMORY_VECT { \ @@ -42,23 +45,27 @@ static inline uint16_t mavlink_msg_memory_vect_pack(uint8_t system_id, uint8_t c uint16_t address, uint8_t ver, uint8_t type, const int8_t *value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; + char buf[MAVLINK_MSG_ID_MEMORY_VECT_LEN]; _mav_put_uint16_t(buf, 0, address); _mav_put_uint8_t(buf, 2, ver); _mav_put_uint8_t(buf, 3, type); _mav_put_int8_t_array(buf, 4, value, 32); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MEMORY_VECT_LEN); #else mavlink_memory_vect_t packet; packet.address = address; packet.ver = ver; packet.type = type; mav_array_memcpy(packet.value, value, sizeof(int8_t)*32); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MEMORY_VECT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MEMORY_VECT; - return mavlink_finalize_message(msg, system_id, component_id, 36, 204); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MEMORY_VECT_LEN); +#endif } /** @@ -78,23 +85,27 @@ static inline uint16_t mavlink_msg_memory_vect_pack_chan(uint8_t system_id, uint uint16_t address,uint8_t ver,uint8_t type,const int8_t *value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; + char buf[MAVLINK_MSG_ID_MEMORY_VECT_LEN]; _mav_put_uint16_t(buf, 0, address); _mav_put_uint8_t(buf, 2, ver); _mav_put_uint8_t(buf, 3, type); _mav_put_int8_t_array(buf, 4, value, 32); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MEMORY_VECT_LEN); #else mavlink_memory_vect_t packet; packet.address = address; packet.ver = ver; packet.type = type; mav_array_memcpy(packet.value, value, sizeof(int8_t)*32); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MEMORY_VECT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MEMORY_VECT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 36, 204); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MEMORY_VECT_LEN); +#endif } /** @@ -124,19 +135,27 @@ static inline uint16_t mavlink_msg_memory_vect_encode(uint8_t system_id, uint8_t static inline void mavlink_msg_memory_vect_send(mavlink_channel_t chan, uint16_t address, uint8_t ver, uint8_t type, const int8_t *value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; + char buf[MAVLINK_MSG_ID_MEMORY_VECT_LEN]; _mav_put_uint16_t(buf, 0, address); _mav_put_uint8_t(buf, 2, ver); _mav_put_uint8_t(buf, 3, type); _mav_put_int8_t_array(buf, 4, value, 32); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, buf, 36, 204); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, buf, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, buf, MAVLINK_MSG_ID_MEMORY_VECT_LEN); +#endif #else mavlink_memory_vect_t packet; packet.address = address; packet.ver = ver; packet.type = type; mav_array_memcpy(packet.value, value, sizeof(int8_t)*32); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, (const char *)&packet, 36, 204); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, (const char *)&packet, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, (const char *)&packet, MAVLINK_MSG_ID_MEMORY_VECT_LEN); +#endif #endif } @@ -199,6 +218,6 @@ static inline void mavlink_msg_memory_vect_decode(const mavlink_message_t* msg, memory_vect->type = mavlink_msg_memory_vect_get_type(msg); mavlink_msg_memory_vect_get_value(msg, memory_vect->value); #else - memcpy(memory_vect, _MAV_PAYLOAD(msg), 36); + memcpy(memory_vect, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MEMORY_VECT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_ack.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_ack.h index 92eca79d1..32825647f 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_ack.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_ack.h @@ -12,6 +12,9 @@ typedef struct __mavlink_mission_ack_t #define MAVLINK_MSG_ID_MISSION_ACK_LEN 3 #define MAVLINK_MSG_ID_47_LEN 3 +#define MAVLINK_MSG_ID_MISSION_ACK_CRC 153 +#define MAVLINK_MSG_ID_47_CRC 153 + #define MAVLINK_MESSAGE_INFO_MISSION_ACK { \ @@ -39,23 +42,27 @@ static inline uint16_t mavlink_msg_mission_ack_pack(uint8_t system_id, uint8_t c uint8_t target_system, uint8_t target_component, uint8_t type) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; + char buf[MAVLINK_MSG_ID_MISSION_ACK_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, type); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ACK_LEN); #else mavlink_mission_ack_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.type = type; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ACK_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_ACK; - return mavlink_finalize_message(msg, system_id, component_id, 3, 153); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ACK_LEN); +#endif } /** @@ -74,23 +81,27 @@ static inline uint16_t mavlink_msg_mission_ack_pack_chan(uint8_t system_id, uint uint8_t target_system,uint8_t target_component,uint8_t type) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; + char buf[MAVLINK_MSG_ID_MISSION_ACK_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, type); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ACK_LEN); #else mavlink_mission_ack_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.type = type; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ACK_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_ACK; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 153); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ACK_LEN); +#endif } /** @@ -119,19 +130,27 @@ static inline uint16_t mavlink_msg_mission_ack_encode(uint8_t system_id, uint8_t static inline void mavlink_msg_mission_ack_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t type) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; + char buf[MAVLINK_MSG_ID_MISSION_ACK_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, type); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, buf, 3, 153); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, buf, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, buf, MAVLINK_MSG_ID_MISSION_ACK_LEN); +#endif #else mavlink_mission_ack_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.type = type; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, (const char *)&packet, 3, 153); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ACK_LEN); +#endif #endif } @@ -183,6 +202,6 @@ static inline void mavlink_msg_mission_ack_decode(const mavlink_message_t* msg, mission_ack->target_component = mavlink_msg_mission_ack_get_target_component(msg); mission_ack->type = mavlink_msg_mission_ack_get_type(msg); #else - memcpy(mission_ack, _MAV_PAYLOAD(msg), 3); + memcpy(mission_ack, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_ACK_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_clear_all.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_clear_all.h index 602852f7e..06d2ac2e7 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_clear_all.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_clear_all.h @@ -11,6 +11,9 @@ typedef struct __mavlink_mission_clear_all_t #define MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN 2 #define MAVLINK_MSG_ID_45_LEN 2 +#define MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC 232 +#define MAVLINK_MSG_ID_45_CRC 232 + #define MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL { \ @@ -36,21 +39,25 @@ static inline uint16_t mavlink_msg_mission_clear_all_pack(uint8_t system_id, uin uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; + char buf[MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); #else mavlink_mission_clear_all_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL; - return mavlink_finalize_message(msg, system_id, component_id, 2, 232); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); +#endif } /** @@ -68,21 +75,25 @@ static inline uint16_t mavlink_msg_mission_clear_all_pack_chan(uint8_t system_id uint8_t target_system,uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; + char buf[MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); #else mavlink_mission_clear_all_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 232); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); +#endif } /** @@ -110,17 +121,25 @@ static inline uint16_t mavlink_msg_mission_clear_all_encode(uint8_t system_id, u static inline void mavlink_msg_mission_clear_all_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; + char buf[MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, buf, 2, 232); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); +#endif #else mavlink_mission_clear_all_t packet; packet.target_system = target_system; packet.target_component = target_component; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)&packet, 2, 232); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)&packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)&packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); +#endif #endif } @@ -161,6 +180,6 @@ static inline void mavlink_msg_mission_clear_all_decode(const mavlink_message_t* mission_clear_all->target_system = mavlink_msg_mission_clear_all_get_target_system(msg); mission_clear_all->target_component = mavlink_msg_mission_clear_all_get_target_component(msg); #else - memcpy(mission_clear_all, _MAV_PAYLOAD(msg), 2); + memcpy(mission_clear_all, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_count.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_count.h index 61d8b221c..b28cec6f6 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_count.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_count.h @@ -12,6 +12,9 @@ typedef struct __mavlink_mission_count_t #define MAVLINK_MSG_ID_MISSION_COUNT_LEN 4 #define MAVLINK_MSG_ID_44_LEN 4 +#define MAVLINK_MSG_ID_MISSION_COUNT_CRC 221 +#define MAVLINK_MSG_ID_44_CRC 221 + #define MAVLINK_MESSAGE_INFO_MISSION_COUNT { \ @@ -39,23 +42,27 @@ static inline uint16_t mavlink_msg_mission_count_pack(uint8_t system_id, uint8_t uint8_t target_system, uint8_t target_component, uint16_t count) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; + char buf[MAVLINK_MSG_ID_MISSION_COUNT_LEN]; _mav_put_uint16_t(buf, 0, count); _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_COUNT_LEN); #else mavlink_mission_count_t packet; packet.count = count; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_COUNT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT; - return mavlink_finalize_message(msg, system_id, component_id, 4, 221); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_COUNT_LEN); +#endif } /** @@ -74,23 +81,27 @@ static inline uint16_t mavlink_msg_mission_count_pack_chan(uint8_t system_id, ui uint8_t target_system,uint8_t target_component,uint16_t count) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; + char buf[MAVLINK_MSG_ID_MISSION_COUNT_LEN]; _mav_put_uint16_t(buf, 0, count); _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_COUNT_LEN); #else mavlink_mission_count_t packet; packet.count = count; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_COUNT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 221); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_COUNT_LEN); +#endif } /** @@ -119,19 +130,27 @@ static inline uint16_t mavlink_msg_mission_count_encode(uint8_t system_id, uint8 static inline void mavlink_msg_mission_count_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t count) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; + char buf[MAVLINK_MSG_ID_MISSION_COUNT_LEN]; _mav_put_uint16_t(buf, 0, count); _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, buf, 4, 221); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, buf, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, buf, MAVLINK_MSG_ID_MISSION_COUNT_LEN); +#endif #else mavlink_mission_count_t packet; packet.count = count; packet.target_system = target_system; packet.target_component = target_component; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, (const char *)&packet, 4, 221); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_COUNT_LEN); +#endif #endif } @@ -183,6 +202,6 @@ static inline void mavlink_msg_mission_count_decode(const mavlink_message_t* msg mission_count->target_system = mavlink_msg_mission_count_get_target_system(msg); mission_count->target_component = mavlink_msg_mission_count_get_target_component(msg); #else - memcpy(mission_count, _MAV_PAYLOAD(msg), 4); + memcpy(mission_count, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_COUNT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_current.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_current.h index 99370f835..5bf0899be 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_current.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_current.h @@ -10,6 +10,9 @@ typedef struct __mavlink_mission_current_t #define MAVLINK_MSG_ID_MISSION_CURRENT_LEN 2 #define MAVLINK_MSG_ID_42_LEN 2 +#define MAVLINK_MSG_ID_MISSION_CURRENT_CRC 28 +#define MAVLINK_MSG_ID_42_CRC 28 + #define MAVLINK_MESSAGE_INFO_MISSION_CURRENT { \ @@ -33,19 +36,23 @@ static inline uint16_t mavlink_msg_mission_current_pack(uint8_t system_id, uint8 uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; + char buf[MAVLINK_MSG_ID_MISSION_CURRENT_LEN]; _mav_put_uint16_t(buf, 0, seq); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); #else mavlink_mission_current_t packet; packet.seq = seq; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT; - return mavlink_finalize_message(msg, system_id, component_id, 2, 28); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); +#endif } /** @@ -62,19 +69,23 @@ static inline uint16_t mavlink_msg_mission_current_pack_chan(uint8_t system_id, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; + char buf[MAVLINK_MSG_ID_MISSION_CURRENT_LEN]; _mav_put_uint16_t(buf, 0, seq); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); #else mavlink_mission_current_t packet; packet.seq = seq; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 28); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); +#endif } /** @@ -101,15 +112,23 @@ static inline uint16_t mavlink_msg_mission_current_encode(uint8_t system_id, uin static inline void mavlink_msg_mission_current_send(mavlink_channel_t chan, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; + char buf[MAVLINK_MSG_ID_MISSION_CURRENT_LEN]; _mav_put_uint16_t(buf, 0, seq); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, buf, 2, 28); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, buf, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, buf, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); +#endif #else mavlink_mission_current_t packet; packet.seq = seq; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)&packet, 2, 28); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); +#endif #endif } @@ -139,6 +158,6 @@ static inline void mavlink_msg_mission_current_decode(const mavlink_message_t* m #if MAVLINK_NEED_BYTE_SWAP mission_current->seq = mavlink_msg_mission_current_get_seq(msg); #else - memcpy(mission_current, _MAV_PAYLOAD(msg), 2); + memcpy(mission_current, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_CURRENT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_item.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_item.h index d2c66d4da..ed9d6e4af 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_item.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_item.h @@ -23,6 +23,9 @@ typedef struct __mavlink_mission_item_t #define MAVLINK_MSG_ID_MISSION_ITEM_LEN 37 #define MAVLINK_MSG_ID_39_LEN 37 +#define MAVLINK_MSG_ID_MISSION_ITEM_CRC 254 +#define MAVLINK_MSG_ID_39_CRC 254 + #define MAVLINK_MESSAGE_INFO_MISSION_ITEM { \ @@ -72,7 +75,7 @@ static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[37]; + char buf[MAVLINK_MSG_ID_MISSION_ITEM_LEN]; _mav_put_float(buf, 0, param1); _mav_put_float(buf, 4, param2); _mav_put_float(buf, 8, param3); @@ -88,7 +91,7 @@ static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 35, current); _mav_put_uint8_t(buf, 36, autocontinue); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 37); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_LEN); #else mavlink_mission_item_t packet; packet.param1 = param1; @@ -106,11 +109,15 @@ static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t packet.current = current; packet.autocontinue = autocontinue; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 37); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM; - return mavlink_finalize_message(msg, system_id, component_id, 37, 254); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_LEN); +#endif } /** @@ -140,7 +147,7 @@ static inline uint16_t mavlink_msg_mission_item_pack_chan(uint8_t system_id, uin uint8_t target_system,uint8_t target_component,uint16_t seq,uint8_t frame,uint16_t command,uint8_t current,uint8_t autocontinue,float param1,float param2,float param3,float param4,float x,float y,float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[37]; + char buf[MAVLINK_MSG_ID_MISSION_ITEM_LEN]; _mav_put_float(buf, 0, param1); _mav_put_float(buf, 4, param2); _mav_put_float(buf, 8, param3); @@ -156,7 +163,7 @@ static inline uint16_t mavlink_msg_mission_item_pack_chan(uint8_t system_id, uin _mav_put_uint8_t(buf, 35, current); _mav_put_uint8_t(buf, 36, autocontinue); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 37); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_LEN); #else mavlink_mission_item_t packet; packet.param1 = param1; @@ -174,11 +181,15 @@ static inline uint16_t mavlink_msg_mission_item_pack_chan(uint8_t system_id, uin packet.current = current; packet.autocontinue = autocontinue; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 37); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 37, 254); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_LEN); +#endif } /** @@ -218,7 +229,7 @@ static inline uint16_t mavlink_msg_mission_item_encode(uint8_t system_id, uint8_ static inline void mavlink_msg_mission_item_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[37]; + char buf[MAVLINK_MSG_ID_MISSION_ITEM_LEN]; _mav_put_float(buf, 0, param1); _mav_put_float(buf, 4, param2); _mav_put_float(buf, 8, param3); @@ -234,7 +245,11 @@ static inline void mavlink_msg_mission_item_send(mavlink_channel_t chan, uint8_t _mav_put_uint8_t(buf, 35, current); _mav_put_uint8_t(buf, 36, autocontinue); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, buf, 37, 254); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, buf, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, buf, MAVLINK_MSG_ID_MISSION_ITEM_LEN); +#endif #else mavlink_mission_item_t packet; packet.param1 = param1; @@ -252,7 +267,11 @@ static inline void mavlink_msg_mission_item_send(mavlink_channel_t chan, uint8_t packet.current = current; packet.autocontinue = autocontinue; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, (const char *)&packet, 37, 254); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_LEN); +#endif #endif } @@ -425,6 +444,6 @@ static inline void mavlink_msg_mission_item_decode(const mavlink_message_t* msg, mission_item->current = mavlink_msg_mission_item_get_current(msg); mission_item->autocontinue = mavlink_msg_mission_item_get_autocontinue(msg); #else - memcpy(mission_item, _MAV_PAYLOAD(msg), 37); + memcpy(mission_item, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_ITEM_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_item_reached.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_item_reached.h index 171f9857e..3f8a51a13 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_item_reached.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_item_reached.h @@ -10,6 +10,9 @@ typedef struct __mavlink_mission_item_reached_t #define MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN 2 #define MAVLINK_MSG_ID_46_LEN 2 +#define MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC 11 +#define MAVLINK_MSG_ID_46_CRC 11 + #define MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED { \ @@ -33,19 +36,23 @@ static inline uint16_t mavlink_msg_mission_item_reached_pack(uint8_t system_id, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; + char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN]; _mav_put_uint16_t(buf, 0, seq); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); #else mavlink_mission_item_reached_t packet; packet.seq = seq; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED; - return mavlink_finalize_message(msg, system_id, component_id, 2, 11); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); +#endif } /** @@ -62,19 +69,23 @@ static inline uint16_t mavlink_msg_mission_item_reached_pack_chan(uint8_t system uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; + char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN]; _mav_put_uint16_t(buf, 0, seq); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); #else mavlink_mission_item_reached_t packet; packet.seq = seq; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 11); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); +#endif } /** @@ -101,15 +112,23 @@ static inline uint16_t mavlink_msg_mission_item_reached_encode(uint8_t system_id static inline void mavlink_msg_mission_item_reached_send(mavlink_channel_t chan, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; + char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN]; _mav_put_uint16_t(buf, 0, seq); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, 2, 11); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); +#endif #else mavlink_mission_item_reached_t packet; packet.seq = seq; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)&packet, 2, 11); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); +#endif #endif } @@ -139,6 +158,6 @@ static inline void mavlink_msg_mission_item_reached_decode(const mavlink_message #if MAVLINK_NEED_BYTE_SWAP mission_item_reached->seq = mavlink_msg_mission_item_reached_get_seq(msg); #else - memcpy(mission_item_reached, _MAV_PAYLOAD(msg), 2); + memcpy(mission_item_reached, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request.h index cde0a0cfb..0ced17614 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request.h @@ -12,6 +12,9 @@ typedef struct __mavlink_mission_request_t #define MAVLINK_MSG_ID_MISSION_REQUEST_LEN 4 #define MAVLINK_MSG_ID_40_LEN 4 +#define MAVLINK_MSG_ID_MISSION_REQUEST_CRC 230 +#define MAVLINK_MSG_ID_40_CRC 230 + #define MAVLINK_MESSAGE_INFO_MISSION_REQUEST { \ @@ -39,23 +42,27 @@ static inline uint16_t mavlink_msg_mission_request_pack(uint8_t system_id, uint8 uint8_t target_system, uint8_t target_component, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LEN]; _mav_put_uint16_t(buf, 0, seq); _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); #else mavlink_mission_request_t packet; packet.seq = seq; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST; - return mavlink_finalize_message(msg, system_id, component_id, 4, 230); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); +#endif } /** @@ -74,23 +81,27 @@ static inline uint16_t mavlink_msg_mission_request_pack_chan(uint8_t system_id, uint8_t target_system,uint8_t target_component,uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LEN]; _mav_put_uint16_t(buf, 0, seq); _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); #else mavlink_mission_request_t packet; packet.seq = seq; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 230); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); +#endif } /** @@ -119,19 +130,27 @@ static inline uint16_t mavlink_msg_mission_request_encode(uint8_t system_id, uin static inline void mavlink_msg_mission_request_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LEN]; _mav_put_uint16_t(buf, 0, seq); _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, buf, 4, 230); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); +#endif #else mavlink_mission_request_t packet; packet.seq = seq; packet.target_system = target_system; packet.target_component = target_component; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, (const char *)&packet, 4, 230); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); +#endif #endif } @@ -183,6 +202,6 @@ static inline void mavlink_msg_mission_request_decode(const mavlink_message_t* m mission_request->target_system = mavlink_msg_mission_request_get_target_system(msg); mission_request->target_component = mavlink_msg_mission_request_get_target_component(msg); #else - memcpy(mission_request, _MAV_PAYLOAD(msg), 4); + memcpy(mission_request, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_REQUEST_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request_list.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request_list.h index 1ada635b5..391df7f4d 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request_list.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request_list.h @@ -11,6 +11,9 @@ typedef struct __mavlink_mission_request_list_t #define MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN 2 #define MAVLINK_MSG_ID_43_LEN 2 +#define MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC 132 +#define MAVLINK_MSG_ID_43_CRC 132 + #define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST { \ @@ -36,21 +39,25 @@ static inline uint16_t mavlink_msg_mission_request_list_pack(uint8_t system_id, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); #else mavlink_mission_request_list_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST; - return mavlink_finalize_message(msg, system_id, component_id, 2, 132); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); +#endif } /** @@ -68,21 +75,25 @@ static inline uint16_t mavlink_msg_mission_request_list_pack_chan(uint8_t system uint8_t target_system,uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); #else mavlink_mission_request_list_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 132); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); +#endif } /** @@ -110,17 +121,25 @@ static inline uint16_t mavlink_msg_mission_request_list_encode(uint8_t system_id static inline void mavlink_msg_mission_request_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, buf, 2, 132); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); +#endif #else mavlink_mission_request_list_t packet; packet.target_system = target_system; packet.target_component = target_component; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)&packet, 2, 132); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); +#endif #endif } @@ -161,6 +180,6 @@ static inline void mavlink_msg_mission_request_list_decode(const mavlink_message mission_request_list->target_system = mavlink_msg_mission_request_list_get_target_system(msg); mission_request_list->target_component = mavlink_msg_mission_request_list_get_target_component(msg); #else - memcpy(mission_request_list, _MAV_PAYLOAD(msg), 2); + memcpy(mission_request_list, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request_partial_list.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request_partial_list.h index 76fd43bef..d5a1c6939 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request_partial_list.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request_partial_list.h @@ -13,6 +13,9 @@ typedef struct __mavlink_mission_request_partial_list_t #define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN 6 #define MAVLINK_MSG_ID_37_LEN 6 +#define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC 212 +#define MAVLINK_MSG_ID_37_CRC 212 + #define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST { \ @@ -42,13 +45,13 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack(uint8_t sys uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN]; _mav_put_int16_t(buf, 0, start_index); _mav_put_int16_t(buf, 2, end_index); _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); #else mavlink_mission_request_partial_list_t packet; packet.start_index = start_index; @@ -56,11 +59,15 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack(uint8_t sys packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; - return mavlink_finalize_message(msg, system_id, component_id, 6, 212); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); +#endif } /** @@ -80,13 +87,13 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack_chan(uint8_ uint8_t target_system,uint8_t target_component,int16_t start_index,int16_t end_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN]; _mav_put_int16_t(buf, 0, start_index); _mav_put_int16_t(buf, 2, end_index); _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); #else mavlink_mission_request_partial_list_t packet; packet.start_index = start_index; @@ -94,11 +101,15 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack_chan(uint8_ packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 6, 212); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); +#endif } /** @@ -128,13 +139,17 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_encode(uint8_t s static inline void mavlink_msg_mission_request_partial_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN]; _mav_put_int16_t(buf, 0, start_index); _mav_put_int16_t(buf, 2, end_index); _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, target_component); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, buf, 6, 212); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); +#endif #else mavlink_mission_request_partial_list_t packet; packet.start_index = start_index; @@ -142,7 +157,11 @@ static inline void mavlink_msg_mission_request_partial_list_send(mavlink_channel packet.target_system = target_system; packet.target_component = target_component; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)&packet, 6, 212); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); +#endif #endif } @@ -205,6 +224,6 @@ static inline void mavlink_msg_mission_request_partial_list_decode(const mavlink mission_request_partial_list->target_system = mavlink_msg_mission_request_partial_list_get_target_system(msg); mission_request_partial_list->target_component = mavlink_msg_mission_request_partial_list_get_target_component(msg); #else - memcpy(mission_request_partial_list, _MAV_PAYLOAD(msg), 6); + memcpy(mission_request_partial_list, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_set_current.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_set_current.h index de0dbcd75..2e145aa3e 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_set_current.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_set_current.h @@ -12,6 +12,9 @@ typedef struct __mavlink_mission_set_current_t #define MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN 4 #define MAVLINK_MSG_ID_41_LEN 4 +#define MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC 28 +#define MAVLINK_MSG_ID_41_CRC 28 + #define MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT { \ @@ -39,23 +42,27 @@ static inline uint16_t mavlink_msg_mission_set_current_pack(uint8_t system_id, u uint8_t target_system, uint8_t target_component, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; + char buf[MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN]; _mav_put_uint16_t(buf, 0, seq); _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); #else mavlink_mission_set_current_t packet; packet.seq = seq; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT; - return mavlink_finalize_message(msg, system_id, component_id, 4, 28); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); +#endif } /** @@ -74,23 +81,27 @@ static inline uint16_t mavlink_msg_mission_set_current_pack_chan(uint8_t system_ uint8_t target_system,uint8_t target_component,uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; + char buf[MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN]; _mav_put_uint16_t(buf, 0, seq); _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); #else mavlink_mission_set_current_t packet; packet.seq = seq; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 28); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); +#endif } /** @@ -119,19 +130,27 @@ static inline uint16_t mavlink_msg_mission_set_current_encode(uint8_t system_id, static inline void mavlink_msg_mission_set_current_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; + char buf[MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN]; _mav_put_uint16_t(buf, 0, seq); _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, buf, 4, 28); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); +#endif #else mavlink_mission_set_current_t packet; packet.seq = seq; packet.target_system = target_system; packet.target_component = target_component; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, (const char *)&packet, 4, 28); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); +#endif #endif } @@ -183,6 +202,6 @@ static inline void mavlink_msg_mission_set_current_decode(const mavlink_message_ mission_set_current->target_system = mavlink_msg_mission_set_current_get_target_system(msg); mission_set_current->target_component = mavlink_msg_mission_set_current_get_target_component(msg); #else - memcpy(mission_set_current, _MAV_PAYLOAD(msg), 4); + memcpy(mission_set_current, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_write_partial_list.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_write_partial_list.h index 0e77569cf..6342f6038 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_write_partial_list.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_write_partial_list.h @@ -13,6 +13,9 @@ typedef struct __mavlink_mission_write_partial_list_t #define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN 6 #define MAVLINK_MSG_ID_38_LEN 6 +#define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC 9 +#define MAVLINK_MSG_ID_38_CRC 9 + #define MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST { \ @@ -42,13 +45,13 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack(uint8_t syste uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; + char buf[MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN]; _mav_put_int16_t(buf, 0, start_index); _mav_put_int16_t(buf, 2, end_index); _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); #else mavlink_mission_write_partial_list_t packet; packet.start_index = start_index; @@ -56,11 +59,15 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack(uint8_t syste packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST; - return mavlink_finalize_message(msg, system_id, component_id, 6, 9); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); +#endif } /** @@ -80,13 +87,13 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack_chan(uint8_t uint8_t target_system,uint8_t target_component,int16_t start_index,int16_t end_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; + char buf[MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN]; _mav_put_int16_t(buf, 0, start_index); _mav_put_int16_t(buf, 2, end_index); _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); #else mavlink_mission_write_partial_list_t packet; packet.start_index = start_index; @@ -94,11 +101,15 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack_chan(uint8_t packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 6, 9); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); +#endif } /** @@ -128,13 +139,17 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_encode(uint8_t sys static inline void mavlink_msg_mission_write_partial_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; + char buf[MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN]; _mav_put_int16_t(buf, 0, start_index); _mav_put_int16_t(buf, 2, end_index); _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, target_component); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, buf, 6, 9); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); +#endif #else mavlink_mission_write_partial_list_t packet; packet.start_index = start_index; @@ -142,7 +157,11 @@ static inline void mavlink_msg_mission_write_partial_list_send(mavlink_channel_t packet.target_system = target_system; packet.target_component = target_component; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)&packet, 6, 9); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); +#endif #endif } @@ -205,6 +224,6 @@ static inline void mavlink_msg_mission_write_partial_list_decode(const mavlink_m mission_write_partial_list->target_system = mavlink_msg_mission_write_partial_list_get_target_system(msg); mission_write_partial_list->target_component = mavlink_msg_mission_write_partial_list_get_target_component(msg); #else - memcpy(mission_write_partial_list, _MAV_PAYLOAD(msg), 6); + memcpy(mission_write_partial_list, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_named_value_float.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_named_value_float.h index 23a819e2c..a9d28a3d0 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_named_value_float.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_named_value_float.h @@ -12,6 +12,9 @@ typedef struct __mavlink_named_value_float_t #define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN 18 #define MAVLINK_MSG_ID_251_LEN 18 +#define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC 170 +#define MAVLINK_MSG_ID_251_CRC 170 + #define MAVLINK_MSG_NAMED_VALUE_FLOAT_FIELD_NAME_LEN 10 #define MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT { \ @@ -39,21 +42,25 @@ static inline uint16_t mavlink_msg_named_value_float_pack(uint8_t system_id, uin uint32_t time_boot_ms, const char *name, float value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, value); _mav_put_char_array(buf, 8, name, 10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); #else mavlink_named_value_float_t packet; packet.time_boot_ms = time_boot_ms; packet.value = value; mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; - return mavlink_finalize_message(msg, system_id, component_id, 18, 170); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); +#endif } /** @@ -72,21 +79,25 @@ static inline uint16_t mavlink_msg_named_value_float_pack_chan(uint8_t system_id uint32_t time_boot_ms,const char *name,float value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, value); _mav_put_char_array(buf, 8, name, 10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); #else mavlink_named_value_float_t packet; packet.time_boot_ms = time_boot_ms; packet.value = value; mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18, 170); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); +#endif } /** @@ -115,17 +126,25 @@ static inline uint16_t mavlink_msg_named_value_float_encode(uint8_t system_id, u static inline void mavlink_msg_named_value_float_send(mavlink_channel_t chan, uint32_t time_boot_ms, const char *name, float value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, value); _mav_put_char_array(buf, 8, name, 10); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, buf, 18, 170); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); +#endif #else mavlink_named_value_float_t packet; packet.time_boot_ms = time_boot_ms; packet.value = value; mav_array_memcpy(packet.name, name, sizeof(char)*10); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)&packet, 18, 170); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)&packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)&packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); +#endif #endif } @@ -177,6 +196,6 @@ static inline void mavlink_msg_named_value_float_decode(const mavlink_message_t* named_value_float->value = mavlink_msg_named_value_float_get_value(msg); mavlink_msg_named_value_float_get_name(msg, named_value_float->name); #else - memcpy(named_value_float, _MAV_PAYLOAD(msg), 18); + memcpy(named_value_float, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_named_value_int.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_named_value_int.h index 3c67dff03..ea53ea888 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_named_value_int.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_named_value_int.h @@ -12,6 +12,9 @@ typedef struct __mavlink_named_value_int_t #define MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN 18 #define MAVLINK_MSG_ID_252_LEN 18 +#define MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC 44 +#define MAVLINK_MSG_ID_252_CRC 44 + #define MAVLINK_MSG_NAMED_VALUE_INT_FIELD_NAME_LEN 10 #define MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT { \ @@ -39,21 +42,25 @@ static inline uint16_t mavlink_msg_named_value_int_pack(uint8_t system_id, uint8 uint32_t time_boot_ms, const char *name, int32_t value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_int32_t(buf, 4, value); _mav_put_char_array(buf, 8, name, 10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); #else mavlink_named_value_int_t packet; packet.time_boot_ms = time_boot_ms; packet.value = value; mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT; - return mavlink_finalize_message(msg, system_id, component_id, 18, 44); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); +#endif } /** @@ -72,21 +79,25 @@ static inline uint16_t mavlink_msg_named_value_int_pack_chan(uint8_t system_id, uint32_t time_boot_ms,const char *name,int32_t value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_int32_t(buf, 4, value); _mav_put_char_array(buf, 8, name, 10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); #else mavlink_named_value_int_t packet; packet.time_boot_ms = time_boot_ms; packet.value = value; mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18, 44); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); +#endif } /** @@ -115,17 +126,25 @@ static inline uint16_t mavlink_msg_named_value_int_encode(uint8_t system_id, uin static inline void mavlink_msg_named_value_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, const char *name, int32_t value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_int32_t(buf, 4, value); _mav_put_char_array(buf, 8, name, 10); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, buf, 18, 44); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); +#endif #else mavlink_named_value_int_t packet; packet.time_boot_ms = time_boot_ms; packet.value = value; mav_array_memcpy(packet.name, name, sizeof(char)*10); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)&packet, 18, 44); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)&packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)&packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); +#endif #endif } @@ -177,6 +196,6 @@ static inline void mavlink_msg_named_value_int_decode(const mavlink_message_t* m named_value_int->value = mavlink_msg_named_value_int_get_value(msg); mavlink_msg_named_value_int_get_name(msg, named_value_int->name); #else - memcpy(named_value_int, _MAV_PAYLOAD(msg), 18); + memcpy(named_value_int, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_nav_controller_output.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_nav_controller_output.h index 028afdabc..e9fa0f522 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_nav_controller_output.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_nav_controller_output.h @@ -17,6 +17,9 @@ typedef struct __mavlink_nav_controller_output_t #define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN 26 #define MAVLINK_MSG_ID_62_LEN 26 +#define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC 183 +#define MAVLINK_MSG_ID_62_CRC 183 + #define MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT { \ @@ -54,7 +57,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id, float nav_roll, float nav_pitch, int16_t nav_bearing, int16_t target_bearing, uint16_t wp_dist, float alt_error, float aspd_error, float xtrack_error) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; + char buf[MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN]; _mav_put_float(buf, 0, nav_roll); _mav_put_float(buf, 4, nav_pitch); _mav_put_float(buf, 8, alt_error); @@ -64,7 +67,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id, _mav_put_int16_t(buf, 22, target_bearing); _mav_put_uint16_t(buf, 24, wp_dist); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); #else mavlink_nav_controller_output_t packet; packet.nav_roll = nav_roll; @@ -76,11 +79,15 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id, packet.target_bearing = target_bearing; packet.wp_dist = wp_dist; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT; - return mavlink_finalize_message(msg, system_id, component_id, 26, 183); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); +#endif } /** @@ -104,7 +111,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack_chan(uint8_t syste float nav_roll,float nav_pitch,int16_t nav_bearing,int16_t target_bearing,uint16_t wp_dist,float alt_error,float aspd_error,float xtrack_error) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; + char buf[MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN]; _mav_put_float(buf, 0, nav_roll); _mav_put_float(buf, 4, nav_pitch); _mav_put_float(buf, 8, alt_error); @@ -114,7 +121,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack_chan(uint8_t syste _mav_put_int16_t(buf, 22, target_bearing); _mav_put_uint16_t(buf, 24, wp_dist); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); #else mavlink_nav_controller_output_t packet; packet.nav_roll = nav_roll; @@ -126,11 +133,15 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack_chan(uint8_t syste packet.target_bearing = target_bearing; packet.wp_dist = wp_dist; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 26, 183); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); +#endif } /** @@ -164,7 +175,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_encode(uint8_t system_i static inline void mavlink_msg_nav_controller_output_send(mavlink_channel_t chan, float nav_roll, float nav_pitch, int16_t nav_bearing, int16_t target_bearing, uint16_t wp_dist, float alt_error, float aspd_error, float xtrack_error) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; + char buf[MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN]; _mav_put_float(buf, 0, nav_roll); _mav_put_float(buf, 4, nav_pitch); _mav_put_float(buf, 8, alt_error); @@ -174,7 +185,11 @@ static inline void mavlink_msg_nav_controller_output_send(mavlink_channel_t chan _mav_put_int16_t(buf, 22, target_bearing); _mav_put_uint16_t(buf, 24, wp_dist); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, buf, 26, 183); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); +#endif #else mavlink_nav_controller_output_t packet; packet.nav_roll = nav_roll; @@ -186,7 +201,11 @@ static inline void mavlink_msg_nav_controller_output_send(mavlink_channel_t chan packet.target_bearing = target_bearing; packet.wp_dist = wp_dist; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, (const char *)&packet, 26, 183); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, (const char *)&packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, (const char *)&packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); +#endif #endif } @@ -293,6 +312,6 @@ static inline void mavlink_msg_nav_controller_output_decode(const mavlink_messag nav_controller_output->target_bearing = mavlink_msg_nav_controller_output_get_target_bearing(msg); nav_controller_output->wp_dist = mavlink_msg_nav_controller_output_get_wp_dist(msg); #else - memcpy(nav_controller_output, _MAV_PAYLOAD(msg), 26); + memcpy(nav_controller_output, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_omnidirectional_flow.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_omnidirectional_flow.h index 9bb1e3369..c0e765a44 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_omnidirectional_flow.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_omnidirectional_flow.h @@ -15,6 +15,9 @@ typedef struct __mavlink_omnidirectional_flow_t #define MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN 54 #define MAVLINK_MSG_ID_106_LEN 54 +#define MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_CRC 211 +#define MAVLINK_MSG_ID_106_CRC 211 + #define MAVLINK_MSG_OMNIDIRECTIONAL_FLOW_FIELD_LEFT_LEN 10 #define MAVLINK_MSG_OMNIDIRECTIONAL_FLOW_FIELD_RIGHT_LEN 10 @@ -49,14 +52,14 @@ static inline uint16_t mavlink_msg_omnidirectional_flow_pack(uint8_t system_id, uint64_t time_usec, uint8_t sensor_id, const int16_t *left, const int16_t *right, uint8_t quality, float front_distance_m) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[54]; + char buf[MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, front_distance_m); _mav_put_uint8_t(buf, 52, sensor_id); _mav_put_uint8_t(buf, 53, quality); _mav_put_int16_t_array(buf, 12, left, 10); _mav_put_int16_t_array(buf, 32, right, 10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 54); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN); #else mavlink_omnidirectional_flow_t packet; packet.time_usec = time_usec; @@ -65,11 +68,15 @@ static inline uint16_t mavlink_msg_omnidirectional_flow_pack(uint8_t system_id, packet.quality = quality; mav_array_memcpy(packet.left, left, sizeof(int16_t)*10); mav_array_memcpy(packet.right, right, sizeof(int16_t)*10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 54); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN); #endif msg->msgid = MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW; - return mavlink_finalize_message(msg, system_id, component_id, 54, 211); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN); +#endif } /** @@ -91,14 +98,14 @@ static inline uint16_t mavlink_msg_omnidirectional_flow_pack_chan(uint8_t system uint64_t time_usec,uint8_t sensor_id,const int16_t *left,const int16_t *right,uint8_t quality,float front_distance_m) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[54]; + char buf[MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, front_distance_m); _mav_put_uint8_t(buf, 52, sensor_id); _mav_put_uint8_t(buf, 53, quality); _mav_put_int16_t_array(buf, 12, left, 10); _mav_put_int16_t_array(buf, 32, right, 10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 54); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN); #else mavlink_omnidirectional_flow_t packet; packet.time_usec = time_usec; @@ -107,11 +114,15 @@ static inline uint16_t mavlink_msg_omnidirectional_flow_pack_chan(uint8_t system packet.quality = quality; mav_array_memcpy(packet.left, left, sizeof(int16_t)*10); mav_array_memcpy(packet.right, right, sizeof(int16_t)*10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 54); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN); #endif msg->msgid = MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 54, 211); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN); +#endif } /** @@ -143,14 +154,18 @@ static inline uint16_t mavlink_msg_omnidirectional_flow_encode(uint8_t system_id static inline void mavlink_msg_omnidirectional_flow_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, const int16_t *left, const int16_t *right, uint8_t quality, float front_distance_m) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[54]; + char buf[MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, front_distance_m); _mav_put_uint8_t(buf, 52, sensor_id); _mav_put_uint8_t(buf, 53, quality); _mav_put_int16_t_array(buf, 12, left, 10); _mav_put_int16_t_array(buf, 32, right, 10); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW, buf, 54, 211); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW, buf, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW, buf, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN); +#endif #else mavlink_omnidirectional_flow_t packet; packet.time_usec = time_usec; @@ -159,7 +174,11 @@ static inline void mavlink_msg_omnidirectional_flow_send(mavlink_channel_t chan, packet.quality = quality; mav_array_memcpy(packet.left, left, sizeof(int16_t)*10); mav_array_memcpy(packet.right, right, sizeof(int16_t)*10); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW, (const char *)&packet, 54, 211); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW, (const char *)&packet, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW, (const char *)&packet, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN); +#endif #endif } @@ -244,6 +263,6 @@ static inline void mavlink_msg_omnidirectional_flow_decode(const mavlink_message omnidirectional_flow->sensor_id = mavlink_msg_omnidirectional_flow_get_sensor_id(msg); omnidirectional_flow->quality = mavlink_msg_omnidirectional_flow_get_quality(msg); #else - memcpy(omnidirectional_flow, _MAV_PAYLOAD(msg), 54); + memcpy(omnidirectional_flow, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_optical_flow.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_optical_flow.h index b277cab51..e01dc5e79 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_optical_flow.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_optical_flow.h @@ -17,6 +17,9 @@ typedef struct __mavlink_optical_flow_t #define MAVLINK_MSG_ID_OPTICAL_FLOW_LEN 26 #define MAVLINK_MSG_ID_100_LEN 26 +#define MAVLINK_MSG_ID_OPTICAL_FLOW_CRC 175 +#define MAVLINK_MSG_ID_100_CRC 175 + #define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW { \ @@ -54,7 +57,7 @@ static inline uint16_t mavlink_msg_optical_flow_pack(uint8_t system_id, uint8_t uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, float flow_comp_m_x, float flow_comp_m_y, uint8_t quality, float ground_distance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; + char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, flow_comp_m_x); _mav_put_float(buf, 12, flow_comp_m_y); @@ -64,7 +67,7 @@ static inline uint16_t mavlink_msg_optical_flow_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 24, sensor_id); _mav_put_uint8_t(buf, 25, quality); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); #else mavlink_optical_flow_t packet; packet.time_usec = time_usec; @@ -76,11 +79,15 @@ static inline uint16_t mavlink_msg_optical_flow_pack(uint8_t system_id, uint8_t packet.sensor_id = sensor_id; packet.quality = quality; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); #endif msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW; - return mavlink_finalize_message(msg, system_id, component_id, 26, 175); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); +#endif } /** @@ -104,7 +111,7 @@ static inline uint16_t mavlink_msg_optical_flow_pack_chan(uint8_t system_id, uin uint64_t time_usec,uint8_t sensor_id,int16_t flow_x,int16_t flow_y,float flow_comp_m_x,float flow_comp_m_y,uint8_t quality,float ground_distance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; + char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, flow_comp_m_x); _mav_put_float(buf, 12, flow_comp_m_y); @@ -114,7 +121,7 @@ static inline uint16_t mavlink_msg_optical_flow_pack_chan(uint8_t system_id, uin _mav_put_uint8_t(buf, 24, sensor_id); _mav_put_uint8_t(buf, 25, quality); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); #else mavlink_optical_flow_t packet; packet.time_usec = time_usec; @@ -126,11 +133,15 @@ static inline uint16_t mavlink_msg_optical_flow_pack_chan(uint8_t system_id, uin packet.sensor_id = sensor_id; packet.quality = quality; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); #endif msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 26, 175); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); +#endif } /** @@ -164,7 +175,7 @@ static inline uint16_t mavlink_msg_optical_flow_encode(uint8_t system_id, uint8_ static inline void mavlink_msg_optical_flow_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, float flow_comp_m_x, float flow_comp_m_y, uint8_t quality, float ground_distance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; + char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_float(buf, 8, flow_comp_m_x); _mav_put_float(buf, 12, flow_comp_m_y); @@ -174,7 +185,11 @@ static inline void mavlink_msg_optical_flow_send(mavlink_channel_t chan, uint64_ _mav_put_uint8_t(buf, 24, sensor_id); _mav_put_uint8_t(buf, 25, quality); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, 26, 175); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); +#endif #else mavlink_optical_flow_t packet; packet.time_usec = time_usec; @@ -186,7 +201,11 @@ static inline void mavlink_msg_optical_flow_send(mavlink_channel_t chan, uint64_ packet.sensor_id = sensor_id; packet.quality = quality; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)&packet, 26, 175); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)&packet, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)&packet, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); +#endif #endif } @@ -293,6 +312,6 @@ static inline void mavlink_msg_optical_flow_decode(const mavlink_message_t* msg, optical_flow->sensor_id = mavlink_msg_optical_flow_get_sensor_id(msg); optical_flow->quality = mavlink_msg_optical_flow_get_quality(msg); #else - memcpy(optical_flow, _MAV_PAYLOAD(msg), 26); + memcpy(optical_flow, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_request_list.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_request_list.h index 125df80c8..da61181b2 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_request_list.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_request_list.h @@ -11,6 +11,9 @@ typedef struct __mavlink_param_request_list_t #define MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN 2 #define MAVLINK_MSG_ID_21_LEN 2 +#define MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC 159 +#define MAVLINK_MSG_ID_21_CRC 159 + #define MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST { \ @@ -36,21 +39,25 @@ static inline uint16_t mavlink_msg_param_request_list_pack(uint8_t system_id, ui uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; + char buf[MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); #else mavlink_param_request_list_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST; - return mavlink_finalize_message(msg, system_id, component_id, 2, 159); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); +#endif } /** @@ -68,21 +75,25 @@ static inline uint16_t mavlink_msg_param_request_list_pack_chan(uint8_t system_i uint8_t target_system,uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; + char buf[MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); #else mavlink_param_request_list_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 159); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); +#endif } /** @@ -110,17 +121,25 @@ static inline uint16_t mavlink_msg_param_request_list_encode(uint8_t system_id, static inline void mavlink_msg_param_request_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; + char buf[MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, buf, 2, 159); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, buf, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, buf, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); +#endif #else mavlink_param_request_list_t packet; packet.target_system = target_system; packet.target_component = target_component; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, (const char *)&packet, 2, 159); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); +#endif #endif } @@ -161,6 +180,6 @@ static inline void mavlink_msg_param_request_list_decode(const mavlink_message_t param_request_list->target_system = mavlink_msg_param_request_list_get_target_system(msg); param_request_list->target_component = mavlink_msg_param_request_list_get_target_component(msg); #else - memcpy(param_request_list, _MAV_PAYLOAD(msg), 2); + memcpy(param_request_list, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_request_read.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_request_read.h index dba528df9..6b1568026 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_request_read.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_request_read.h @@ -13,6 +13,9 @@ typedef struct __mavlink_param_request_read_t #define MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN 20 #define MAVLINK_MSG_ID_20_LEN 20 +#define MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC 214 +#define MAVLINK_MSG_ID_20_CRC 214 + #define MAVLINK_MSG_PARAM_REQUEST_READ_FIELD_PARAM_ID_LEN 16 #define MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ { \ @@ -42,23 +45,27 @@ static inline uint16_t mavlink_msg_param_request_read_pack(uint8_t system_id, ui uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN]; _mav_put_int16_t(buf, 0, param_index); _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); _mav_put_char_array(buf, 4, param_id, 16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); #else mavlink_param_request_read_t packet; packet.param_index = param_index; packet.target_system = target_system; packet.target_component = target_component; mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; - return mavlink_finalize_message(msg, system_id, component_id, 20, 214); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); +#endif } /** @@ -78,23 +85,27 @@ static inline uint16_t mavlink_msg_param_request_read_pack_chan(uint8_t system_i uint8_t target_system,uint8_t target_component,const char *param_id,int16_t param_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN]; _mav_put_int16_t(buf, 0, param_index); _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); _mav_put_char_array(buf, 4, param_id, 16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); #else mavlink_param_request_read_t packet; packet.param_index = param_index; packet.target_system = target_system; packet.target_component = target_component; mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 20, 214); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); +#endif } /** @@ -124,19 +135,27 @@ static inline uint16_t mavlink_msg_param_request_read_encode(uint8_t system_id, static inline void mavlink_msg_param_request_read_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN]; _mav_put_int16_t(buf, 0, param_index); _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); _mav_put_char_array(buf, 4, param_id, 16); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, buf, 20, 214); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, buf, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, buf, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); +#endif #else mavlink_param_request_read_t packet; packet.param_index = param_index; packet.target_system = target_system; packet.target_component = target_component; mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, (const char *)&packet, 20, 214); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, (const char *)&packet, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, (const char *)&packet, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); +#endif #endif } @@ -199,6 +218,6 @@ static inline void mavlink_msg_param_request_read_decode(const mavlink_message_t param_request_read->target_component = mavlink_msg_param_request_read_get_target_component(msg); mavlink_msg_param_request_read_get_param_id(msg, param_request_read->param_id); #else - memcpy(param_request_read, _MAV_PAYLOAD(msg), 20); + memcpy(param_request_read, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_set.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_set.h index 8f00f22e9..66b0f6629 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_set.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_set.h @@ -14,6 +14,9 @@ typedef struct __mavlink_param_set_t #define MAVLINK_MSG_ID_PARAM_SET_LEN 23 #define MAVLINK_MSG_ID_23_LEN 23 +#define MAVLINK_MSG_ID_PARAM_SET_CRC 168 +#define MAVLINK_MSG_ID_23_CRC 168 + #define MAVLINK_MSG_PARAM_SET_FIELD_PARAM_ID_LEN 16 #define MAVLINK_MESSAGE_INFO_PARAM_SET { \ @@ -45,13 +48,13 @@ static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t com uint8_t target_system, uint8_t target_component, const char *param_id, float param_value, uint8_t param_type) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[23]; + char buf[MAVLINK_MSG_ID_PARAM_SET_LEN]; _mav_put_float(buf, 0, param_value); _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, target_component); _mav_put_uint8_t(buf, 22, param_type); _mav_put_char_array(buf, 6, param_id, 16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 23); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_SET_LEN); #else mavlink_param_set_t packet; packet.param_value = param_value; @@ -59,11 +62,15 @@ static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t com packet.target_component = target_component; packet.param_type = param_type; mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 23); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_SET_LEN); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_SET; - return mavlink_finalize_message(msg, system_id, component_id, 23, 168); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_SET_LEN); +#endif } /** @@ -84,13 +91,13 @@ static inline uint16_t mavlink_msg_param_set_pack_chan(uint8_t system_id, uint8_ uint8_t target_system,uint8_t target_component,const char *param_id,float param_value,uint8_t param_type) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[23]; + char buf[MAVLINK_MSG_ID_PARAM_SET_LEN]; _mav_put_float(buf, 0, param_value); _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, target_component); _mav_put_uint8_t(buf, 22, param_type); _mav_put_char_array(buf, 6, param_id, 16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 23); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_SET_LEN); #else mavlink_param_set_t packet; packet.param_value = param_value; @@ -98,11 +105,15 @@ static inline uint16_t mavlink_msg_param_set_pack_chan(uint8_t system_id, uint8_ packet.target_component = target_component; packet.param_type = param_type; mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 23); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_SET_LEN); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_SET; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 23, 168); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_SET_LEN); +#endif } /** @@ -133,13 +144,17 @@ static inline uint16_t mavlink_msg_param_set_encode(uint8_t system_id, uint8_t c static inline void mavlink_msg_param_set_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const char *param_id, float param_value, uint8_t param_type) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[23]; + char buf[MAVLINK_MSG_ID_PARAM_SET_LEN]; _mav_put_float(buf, 0, param_value); _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, target_component); _mav_put_uint8_t(buf, 22, param_type); _mav_put_char_array(buf, 6, param_id, 16); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, buf, 23, 168); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, buf, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, buf, MAVLINK_MSG_ID_PARAM_SET_LEN); +#endif #else mavlink_param_set_t packet; packet.param_value = param_value; @@ -147,7 +162,11 @@ static inline void mavlink_msg_param_set_send(mavlink_channel_t chan, uint8_t ta packet.target_component = target_component; packet.param_type = param_type; mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, (const char *)&packet, 23, 168); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, (const char *)&packet, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, (const char *)&packet, MAVLINK_MSG_ID_PARAM_SET_LEN); +#endif #endif } @@ -221,6 +240,6 @@ static inline void mavlink_msg_param_set_decode(const mavlink_message_t* msg, ma mavlink_msg_param_set_get_param_id(msg, param_set->param_id); param_set->param_type = mavlink_msg_param_set_get_param_type(msg); #else - memcpy(param_set, _MAV_PAYLOAD(msg), 23); + memcpy(param_set, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_PARAM_SET_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_value.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_value.h index 03a631984..599139374 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_value.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_value.h @@ -14,6 +14,9 @@ typedef struct __mavlink_param_value_t #define MAVLINK_MSG_ID_PARAM_VALUE_LEN 25 #define MAVLINK_MSG_ID_22_LEN 25 +#define MAVLINK_MSG_ID_PARAM_VALUE_CRC 220 +#define MAVLINK_MSG_ID_22_CRC 220 + #define MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN 16 #define MAVLINK_MESSAGE_INFO_PARAM_VALUE { \ @@ -45,13 +48,13 @@ static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t c const char *param_id, float param_value, uint8_t param_type, uint16_t param_count, uint16_t param_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[25]; + char buf[MAVLINK_MSG_ID_PARAM_VALUE_LEN]; _mav_put_float(buf, 0, param_value); _mav_put_uint16_t(buf, 4, param_count); _mav_put_uint16_t(buf, 6, param_index); _mav_put_uint8_t(buf, 24, param_type); _mav_put_char_array(buf, 8, param_id, 16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_VALUE_LEN); #else mavlink_param_value_t packet; packet.param_value = param_value; @@ -59,11 +62,15 @@ static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t c packet.param_index = param_index; packet.param_type = param_type; mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_VALUE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE; - return mavlink_finalize_message(msg, system_id, component_id, 25, 220); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_VALUE_LEN); +#endif } /** @@ -84,13 +91,13 @@ static inline uint16_t mavlink_msg_param_value_pack_chan(uint8_t system_id, uint const char *param_id,float param_value,uint8_t param_type,uint16_t param_count,uint16_t param_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[25]; + char buf[MAVLINK_MSG_ID_PARAM_VALUE_LEN]; _mav_put_float(buf, 0, param_value); _mav_put_uint16_t(buf, 4, param_count); _mav_put_uint16_t(buf, 6, param_index); _mav_put_uint8_t(buf, 24, param_type); _mav_put_char_array(buf, 8, param_id, 16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_VALUE_LEN); #else mavlink_param_value_t packet; packet.param_value = param_value; @@ -98,11 +105,15 @@ static inline uint16_t mavlink_msg_param_value_pack_chan(uint8_t system_id, uint packet.param_index = param_index; packet.param_type = param_type; mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_VALUE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 25, 220); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_VALUE_LEN); +#endif } /** @@ -133,13 +144,17 @@ static inline uint16_t mavlink_msg_param_value_encode(uint8_t system_id, uint8_t static inline void mavlink_msg_param_value_send(mavlink_channel_t chan, const char *param_id, float param_value, uint8_t param_type, uint16_t param_count, uint16_t param_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[25]; + char buf[MAVLINK_MSG_ID_PARAM_VALUE_LEN]; _mav_put_float(buf, 0, param_value); _mav_put_uint16_t(buf, 4, param_count); _mav_put_uint16_t(buf, 6, param_index); _mav_put_uint8_t(buf, 24, param_type); _mav_put_char_array(buf, 8, param_id, 16); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, buf, 25, 220); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, buf, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, buf, MAVLINK_MSG_ID_PARAM_VALUE_LEN); +#endif #else mavlink_param_value_t packet; packet.param_value = param_value; @@ -147,7 +162,11 @@ static inline void mavlink_msg_param_value_send(mavlink_channel_t chan, const ch packet.param_index = param_index; packet.param_type = param_type; mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, (const char *)&packet, 25, 220); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, (const char *)&packet, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, (const char *)&packet, MAVLINK_MSG_ID_PARAM_VALUE_LEN); +#endif #endif } @@ -221,6 +240,6 @@ static inline void mavlink_msg_param_value_decode(const mavlink_message_t* msg, mavlink_msg_param_value_get_param_id(msg, param_value->param_id); param_value->param_type = mavlink_msg_param_value_get_param_type(msg); #else - memcpy(param_value, _MAV_PAYLOAD(msg), 25); + memcpy(param_value, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_PARAM_VALUE_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_ping.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_ping.h index 3ed1b9d7c..5a4c50907 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_ping.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_ping.h @@ -13,6 +13,9 @@ typedef struct __mavlink_ping_t #define MAVLINK_MSG_ID_PING_LEN 14 #define MAVLINK_MSG_ID_4_LEN 14 +#define MAVLINK_MSG_ID_PING_CRC 237 +#define MAVLINK_MSG_ID_4_CRC 237 + #define MAVLINK_MESSAGE_INFO_PING { \ @@ -42,13 +45,13 @@ static inline uint16_t mavlink_msg_ping_pack(uint8_t system_id, uint8_t componen uint64_t time_usec, uint32_t seq, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; + char buf[MAVLINK_MSG_ID_PING_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_uint32_t(buf, 8, seq); _mav_put_uint8_t(buf, 12, target_system); _mav_put_uint8_t(buf, 13, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PING_LEN); #else mavlink_ping_t packet; packet.time_usec = time_usec; @@ -56,11 +59,15 @@ static inline uint16_t mavlink_msg_ping_pack(uint8_t system_id, uint8_t componen packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PING_LEN); #endif msg->msgid = MAVLINK_MSG_ID_PING; - return mavlink_finalize_message(msg, system_id, component_id, 14, 237); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PING_LEN); +#endif } /** @@ -80,13 +87,13 @@ static inline uint16_t mavlink_msg_ping_pack_chan(uint8_t system_id, uint8_t com uint64_t time_usec,uint32_t seq,uint8_t target_system,uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; + char buf[MAVLINK_MSG_ID_PING_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_uint32_t(buf, 8, seq); _mav_put_uint8_t(buf, 12, target_system); _mav_put_uint8_t(buf, 13, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PING_LEN); #else mavlink_ping_t packet; packet.time_usec = time_usec; @@ -94,11 +101,15 @@ static inline uint16_t mavlink_msg_ping_pack_chan(uint8_t system_id, uint8_t com packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PING_LEN); #endif msg->msgid = MAVLINK_MSG_ID_PING; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 14, 237); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PING_LEN); +#endif } /** @@ -128,13 +139,17 @@ static inline uint16_t mavlink_msg_ping_encode(uint8_t system_id, uint8_t compon static inline void mavlink_msg_ping_send(mavlink_channel_t chan, uint64_t time_usec, uint32_t seq, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; + char buf[MAVLINK_MSG_ID_PING_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_uint32_t(buf, 8, seq); _mav_put_uint8_t(buf, 12, target_system); _mav_put_uint8_t(buf, 13, target_component); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, buf, 14, 237); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, buf, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, buf, MAVLINK_MSG_ID_PING_LEN); +#endif #else mavlink_ping_t packet; packet.time_usec = time_usec; @@ -142,7 +157,11 @@ static inline void mavlink_msg_ping_send(mavlink_channel_t chan, uint64_t time_u packet.target_system = target_system; packet.target_component = target_component; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (const char *)&packet, 14, 237); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (const char *)&packet, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (const char *)&packet, MAVLINK_MSG_ID_PING_LEN); +#endif #endif } @@ -205,6 +224,6 @@ static inline void mavlink_msg_ping_decode(const mavlink_message_t* msg, mavlink ping->target_system = mavlink_msg_ping_get_target_system(msg); ping->target_component = mavlink_msg_ping_get_target_component(msg); #else - memcpy(ping, _MAV_PAYLOAD(msg), 14); + memcpy(ping, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_PING_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_raw_imu.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_raw_imu.h index 1c1d48388..ce8863647 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_raw_imu.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_raw_imu.h @@ -19,6 +19,9 @@ typedef struct __mavlink_raw_imu_t #define MAVLINK_MSG_ID_RAW_IMU_LEN 26 #define MAVLINK_MSG_ID_27_LEN 26 +#define MAVLINK_MSG_ID_RAW_IMU_CRC 144 +#define MAVLINK_MSG_ID_27_CRC 144 + #define MAVLINK_MESSAGE_INFO_RAW_IMU { \ @@ -60,7 +63,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack(uint8_t system_id, uint8_t compo uint64_t time_usec, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; + char buf[MAVLINK_MSG_ID_RAW_IMU_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_int16_t(buf, 8, xacc); _mav_put_int16_t(buf, 10, yacc); @@ -72,7 +75,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack(uint8_t system_id, uint8_t compo _mav_put_int16_t(buf, 22, ymag); _mav_put_int16_t(buf, 24, zmag); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RAW_IMU_LEN); #else mavlink_raw_imu_t packet; packet.time_usec = time_usec; @@ -86,11 +89,15 @@ static inline uint16_t mavlink_msg_raw_imu_pack(uint8_t system_id, uint8_t compo packet.ymag = ymag; packet.zmag = zmag; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RAW_IMU_LEN); #endif msg->msgid = MAVLINK_MSG_ID_RAW_IMU; - return mavlink_finalize_message(msg, system_id, component_id, 26, 144); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RAW_IMU_LEN); +#endif } /** @@ -116,7 +123,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack_chan(uint8_t system_id, uint8_t uint64_t time_usec,int16_t xacc,int16_t yacc,int16_t zacc,int16_t xgyro,int16_t ygyro,int16_t zgyro,int16_t xmag,int16_t ymag,int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; + char buf[MAVLINK_MSG_ID_RAW_IMU_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_int16_t(buf, 8, xacc); _mav_put_int16_t(buf, 10, yacc); @@ -128,7 +135,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack_chan(uint8_t system_id, uint8_t _mav_put_int16_t(buf, 22, ymag); _mav_put_int16_t(buf, 24, zmag); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RAW_IMU_LEN); #else mavlink_raw_imu_t packet; packet.time_usec = time_usec; @@ -142,11 +149,15 @@ static inline uint16_t mavlink_msg_raw_imu_pack_chan(uint8_t system_id, uint8_t packet.ymag = ymag; packet.zmag = zmag; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RAW_IMU_LEN); #endif msg->msgid = MAVLINK_MSG_ID_RAW_IMU; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 26, 144); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RAW_IMU_LEN); +#endif } /** @@ -182,7 +193,7 @@ static inline uint16_t mavlink_msg_raw_imu_encode(uint8_t system_id, uint8_t com static inline void mavlink_msg_raw_imu_send(mavlink_channel_t chan, uint64_t time_usec, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[26]; + char buf[MAVLINK_MSG_ID_RAW_IMU_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_int16_t(buf, 8, xacc); _mav_put_int16_t(buf, 10, yacc); @@ -194,7 +205,11 @@ static inline void mavlink_msg_raw_imu_send(mavlink_channel_t chan, uint64_t tim _mav_put_int16_t(buf, 22, ymag); _mav_put_int16_t(buf, 24, zmag); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, buf, 26, 144); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, buf, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, buf, MAVLINK_MSG_ID_RAW_IMU_LEN); +#endif #else mavlink_raw_imu_t packet; packet.time_usec = time_usec; @@ -208,7 +223,11 @@ static inline void mavlink_msg_raw_imu_send(mavlink_channel_t chan, uint64_t tim packet.ymag = ymag; packet.zmag = zmag; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, (const char *)&packet, 26, 144); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, (const char *)&packet, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, (const char *)&packet, MAVLINK_MSG_ID_RAW_IMU_LEN); +#endif #endif } @@ -337,6 +356,6 @@ static inline void mavlink_msg_raw_imu_decode(const mavlink_message_t* msg, mavl raw_imu->ymag = mavlink_msg_raw_imu_get_ymag(msg); raw_imu->zmag = mavlink_msg_raw_imu_get_zmag(msg); #else - memcpy(raw_imu, _MAV_PAYLOAD(msg), 26); + memcpy(raw_imu, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RAW_IMU_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_raw_pressure.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_raw_pressure.h index f3e4e8404..dcc2cbe06 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_raw_pressure.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_raw_pressure.h @@ -14,6 +14,9 @@ typedef struct __mavlink_raw_pressure_t #define MAVLINK_MSG_ID_RAW_PRESSURE_LEN 16 #define MAVLINK_MSG_ID_28_LEN 16 +#define MAVLINK_MSG_ID_RAW_PRESSURE_CRC 67 +#define MAVLINK_MSG_ID_28_CRC 67 + #define MAVLINK_MESSAGE_INFO_RAW_PRESSURE { \ @@ -45,14 +48,14 @@ static inline uint16_t mavlink_msg_raw_pressure_pack(uint8_t system_id, uint8_t uint64_t time_usec, int16_t press_abs, int16_t press_diff1, int16_t press_diff2, int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; + char buf[MAVLINK_MSG_ID_RAW_PRESSURE_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_int16_t(buf, 8, press_abs); _mav_put_int16_t(buf, 10, press_diff1); _mav_put_int16_t(buf, 12, press_diff2); _mav_put_int16_t(buf, 14, temperature); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); #else mavlink_raw_pressure_t packet; packet.time_usec = time_usec; @@ -61,11 +64,15 @@ static inline uint16_t mavlink_msg_raw_pressure_pack(uint8_t system_id, uint8_t packet.press_diff2 = press_diff2; packet.temperature = temperature; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE; - return mavlink_finalize_message(msg, system_id, component_id, 16, 67); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); +#endif } /** @@ -86,14 +93,14 @@ static inline uint16_t mavlink_msg_raw_pressure_pack_chan(uint8_t system_id, uin uint64_t time_usec,int16_t press_abs,int16_t press_diff1,int16_t press_diff2,int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; + char buf[MAVLINK_MSG_ID_RAW_PRESSURE_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_int16_t(buf, 8, press_abs); _mav_put_int16_t(buf, 10, press_diff1); _mav_put_int16_t(buf, 12, press_diff2); _mav_put_int16_t(buf, 14, temperature); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); #else mavlink_raw_pressure_t packet; packet.time_usec = time_usec; @@ -102,11 +109,15 @@ static inline uint16_t mavlink_msg_raw_pressure_pack_chan(uint8_t system_id, uin packet.press_diff2 = press_diff2; packet.temperature = temperature; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 16, 67); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); +#endif } /** @@ -137,14 +148,18 @@ static inline uint16_t mavlink_msg_raw_pressure_encode(uint8_t system_id, uint8_ static inline void mavlink_msg_raw_pressure_send(mavlink_channel_t chan, uint64_t time_usec, int16_t press_abs, int16_t press_diff1, int16_t press_diff2, int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; + char buf[MAVLINK_MSG_ID_RAW_PRESSURE_LEN]; _mav_put_uint64_t(buf, 0, time_usec); _mav_put_int16_t(buf, 8, press_abs); _mav_put_int16_t(buf, 10, press_diff1); _mav_put_int16_t(buf, 12, press_diff2); _mav_put_int16_t(buf, 14, temperature); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, buf, 16, 67); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, buf, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, buf, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); +#endif #else mavlink_raw_pressure_t packet; packet.time_usec = time_usec; @@ -153,7 +168,11 @@ static inline void mavlink_msg_raw_pressure_send(mavlink_channel_t chan, uint64_ packet.press_diff2 = press_diff2; packet.temperature = temperature; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, (const char *)&packet, 16, 67); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, (const char *)&packet, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, (const char *)&packet, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); +#endif #endif } @@ -227,6 +246,6 @@ static inline void mavlink_msg_raw_pressure_decode(const mavlink_message_t* msg, raw_pressure->press_diff2 = mavlink_msg_raw_pressure_get_press_diff2(msg); raw_pressure->temperature = mavlink_msg_raw_pressure_get_temperature(msg); #else - memcpy(raw_pressure, _MAV_PAYLOAD(msg), 16); + memcpy(raw_pressure, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RAW_PRESSURE_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_override.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_override.h index d719c7fca..9854a190c 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_override.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_override.h @@ -19,6 +19,9 @@ typedef struct __mavlink_rc_channels_override_t #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN 18 #define MAVLINK_MSG_ID_70_LEN 18 +#define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC 124 +#define MAVLINK_MSG_ID_70_CRC 124 + #define MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE { \ @@ -60,7 +63,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id, uint8_t target_system, uint8_t target_component, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN]; _mav_put_uint16_t(buf, 0, chan1_raw); _mav_put_uint16_t(buf, 2, chan2_raw); _mav_put_uint16_t(buf, 4, chan3_raw); @@ -72,7 +75,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id, _mav_put_uint8_t(buf, 16, target_system); _mav_put_uint8_t(buf, 17, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); #else mavlink_rc_channels_override_t packet; packet.chan1_raw = chan1_raw; @@ -86,11 +89,15 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id, packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE; - return mavlink_finalize_message(msg, system_id, component_id, 18, 124); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); +#endif } /** @@ -116,7 +123,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system uint8_t target_system,uint8_t target_component,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN]; _mav_put_uint16_t(buf, 0, chan1_raw); _mav_put_uint16_t(buf, 2, chan2_raw); _mav_put_uint16_t(buf, 4, chan3_raw); @@ -128,7 +135,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system _mav_put_uint8_t(buf, 16, target_system); _mav_put_uint8_t(buf, 17, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); #else mavlink_rc_channels_override_t packet; packet.chan1_raw = chan1_raw; @@ -142,11 +149,15 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18, 124); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); +#endif } /** @@ -182,7 +193,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_encode(uint8_t system_id static inline void mavlink_msg_rc_channels_override_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN]; _mav_put_uint16_t(buf, 0, chan1_raw); _mav_put_uint16_t(buf, 2, chan2_raw); _mav_put_uint16_t(buf, 4, chan3_raw); @@ -194,7 +205,11 @@ static inline void mavlink_msg_rc_channels_override_send(mavlink_channel_t chan, _mav_put_uint8_t(buf, 16, target_system); _mav_put_uint8_t(buf, 17, target_component); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, 18, 124); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); +#endif #else mavlink_rc_channels_override_t packet; packet.chan1_raw = chan1_raw; @@ -208,7 +223,11 @@ static inline void mavlink_msg_rc_channels_override_send(mavlink_channel_t chan, packet.target_system = target_system; packet.target_component = target_component; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)&packet, 18, 124); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); +#endif #endif } @@ -337,6 +356,6 @@ static inline void mavlink_msg_rc_channels_override_decode(const mavlink_message rc_channels_override->target_system = mavlink_msg_rc_channels_override_get_target_system(msg); rc_channels_override->target_component = mavlink_msg_rc_channels_override_get_target_component(msg); #else - memcpy(rc_channels_override, _MAV_PAYLOAD(msg), 18); + memcpy(rc_channels_override, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_raw.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_raw.h index a4d40da38..4c1315bed 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_raw.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_raw.h @@ -20,6 +20,9 @@ typedef struct __mavlink_rc_channels_raw_t #define MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN 22 #define MAVLINK_MSG_ID_35_LEN 22 +#define MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC 244 +#define MAVLINK_MSG_ID_35_CRC 244 + #define MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW { \ @@ -63,7 +66,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8 uint32_t time_boot_ms, uint8_t port, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[22]; + char buf[MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_uint16_t(buf, 4, chan1_raw); _mav_put_uint16_t(buf, 6, chan2_raw); @@ -76,7 +79,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8 _mav_put_uint8_t(buf, 20, port); _mav_put_uint8_t(buf, 21, rssi); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); #else mavlink_rc_channels_raw_t packet; packet.time_boot_ms = time_boot_ms; @@ -91,11 +94,15 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8 packet.port = port; packet.rssi = rssi; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW; - return mavlink_finalize_message(msg, system_id, component_id, 22, 244); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); +#endif } /** @@ -122,7 +129,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id, uint32_t time_boot_ms,uint8_t port,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw,uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[22]; + char buf[MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_uint16_t(buf, 4, chan1_raw); _mav_put_uint16_t(buf, 6, chan2_raw); @@ -135,7 +142,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id, _mav_put_uint8_t(buf, 20, port); _mav_put_uint8_t(buf, 21, rssi); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); #else mavlink_rc_channels_raw_t packet; packet.time_boot_ms = time_boot_ms; @@ -150,11 +157,15 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id, packet.port = port; packet.rssi = rssi; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 22, 244); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); +#endif } /** @@ -191,7 +202,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_encode(uint8_t system_id, uin static inline void mavlink_msg_rc_channels_raw_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t port, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[22]; + char buf[MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_uint16_t(buf, 4, chan1_raw); _mav_put_uint16_t(buf, 6, chan2_raw); @@ -204,7 +215,11 @@ static inline void mavlink_msg_rc_channels_raw_send(mavlink_channel_t chan, uint _mav_put_uint8_t(buf, 20, port); _mav_put_uint8_t(buf, 21, rssi); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, buf, 22, 244); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); +#endif #else mavlink_rc_channels_raw_t packet; packet.time_boot_ms = time_boot_ms; @@ -219,7 +234,11 @@ static inline void mavlink_msg_rc_channels_raw_send(mavlink_channel_t chan, uint packet.port = port; packet.rssi = rssi; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, (const char *)&packet, 22, 244); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); +#endif #endif } @@ -359,6 +378,6 @@ static inline void mavlink_msg_rc_channels_raw_decode(const mavlink_message_t* m rc_channels_raw->port = mavlink_msg_rc_channels_raw_get_port(msg); rc_channels_raw->rssi = mavlink_msg_rc_channels_raw_get_rssi(msg); #else - memcpy(rc_channels_raw, _MAV_PAYLOAD(msg), 22); + memcpy(rc_channels_raw, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_scaled.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_scaled.h index dd21d4162..be6322bcd 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_scaled.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_scaled.h @@ -20,6 +20,9 @@ typedef struct __mavlink_rc_channels_scaled_t #define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN 22 #define MAVLINK_MSG_ID_34_LEN 22 +#define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC 237 +#define MAVLINK_MSG_ID_34_CRC 237 + #define MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED { \ @@ -63,7 +66,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, ui uint32_t time_boot_ms, uint8_t port, int16_t chan1_scaled, int16_t chan2_scaled, int16_t chan3_scaled, int16_t chan4_scaled, int16_t chan5_scaled, int16_t chan6_scaled, int16_t chan7_scaled, int16_t chan8_scaled, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[22]; + char buf[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_int16_t(buf, 4, chan1_scaled); _mav_put_int16_t(buf, 6, chan2_scaled); @@ -76,7 +79,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, ui _mav_put_uint8_t(buf, 20, port); _mav_put_uint8_t(buf, 21, rssi); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); #else mavlink_rc_channels_scaled_t packet; packet.time_boot_ms = time_boot_ms; @@ -91,11 +94,15 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, ui packet.port = port; packet.rssi = rssi; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED; - return mavlink_finalize_message(msg, system_id, component_id, 22, 237); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); +#endif } /** @@ -122,7 +129,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_i uint32_t time_boot_ms,uint8_t port,int16_t chan1_scaled,int16_t chan2_scaled,int16_t chan3_scaled,int16_t chan4_scaled,int16_t chan5_scaled,int16_t chan6_scaled,int16_t chan7_scaled,int16_t chan8_scaled,uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[22]; + char buf[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_int16_t(buf, 4, chan1_scaled); _mav_put_int16_t(buf, 6, chan2_scaled); @@ -135,7 +142,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_i _mav_put_uint8_t(buf, 20, port); _mav_put_uint8_t(buf, 21, rssi); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); #else mavlink_rc_channels_scaled_t packet; packet.time_boot_ms = time_boot_ms; @@ -150,11 +157,15 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_i packet.port = port; packet.rssi = rssi; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 22, 237); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); +#endif } /** @@ -191,7 +202,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_encode(uint8_t system_id, static inline void mavlink_msg_rc_channels_scaled_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t port, int16_t chan1_scaled, int16_t chan2_scaled, int16_t chan3_scaled, int16_t chan4_scaled, int16_t chan5_scaled, int16_t chan6_scaled, int16_t chan7_scaled, int16_t chan8_scaled, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[22]; + char buf[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_int16_t(buf, 4, chan1_scaled); _mav_put_int16_t(buf, 6, chan2_scaled); @@ -204,7 +215,11 @@ static inline void mavlink_msg_rc_channels_scaled_send(mavlink_channel_t chan, u _mav_put_uint8_t(buf, 20, port); _mav_put_uint8_t(buf, 21, rssi); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, buf, 22, 237); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); +#endif #else mavlink_rc_channels_scaled_t packet; packet.time_boot_ms = time_boot_ms; @@ -219,7 +234,11 @@ static inline void mavlink_msg_rc_channels_scaled_send(mavlink_channel_t chan, u packet.port = port; packet.rssi = rssi; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, (const char *)&packet, 22, 237); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); +#endif #endif } @@ -359,6 +378,6 @@ static inline void mavlink_msg_rc_channels_scaled_decode(const mavlink_message_t rc_channels_scaled->port = mavlink_msg_rc_channels_scaled_get_port(msg); rc_channels_scaled->rssi = mavlink_msg_rc_channels_scaled_get_rssi(msg); #else - memcpy(rc_channels_scaled, _MAV_PAYLOAD(msg), 22); + memcpy(rc_channels_scaled, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_request_data_stream.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_request_data_stream.h index d8653ad10..ee21d1fe0 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_request_data_stream.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_request_data_stream.h @@ -14,6 +14,9 @@ typedef struct __mavlink_request_data_stream_t #define MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN 6 #define MAVLINK_MSG_ID_66_LEN 6 +#define MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC 148 +#define MAVLINK_MSG_ID_66_CRC 148 + #define MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM { \ @@ -45,14 +48,14 @@ static inline uint16_t mavlink_msg_request_data_stream_pack(uint8_t system_id, u uint8_t target_system, uint8_t target_component, uint8_t req_stream_id, uint16_t req_message_rate, uint8_t start_stop) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; + char buf[MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN]; _mav_put_uint16_t(buf, 0, req_message_rate); _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); _mav_put_uint8_t(buf, 4, req_stream_id); _mav_put_uint8_t(buf, 5, start_stop); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); #else mavlink_request_data_stream_t packet; packet.req_message_rate = req_message_rate; @@ -61,11 +64,15 @@ static inline uint16_t mavlink_msg_request_data_stream_pack(uint8_t system_id, u packet.req_stream_id = req_stream_id; packet.start_stop = start_stop; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); #endif msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM; - return mavlink_finalize_message(msg, system_id, component_id, 6, 148); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); +#endif } /** @@ -86,14 +93,14 @@ static inline uint16_t mavlink_msg_request_data_stream_pack_chan(uint8_t system_ uint8_t target_system,uint8_t target_component,uint8_t req_stream_id,uint16_t req_message_rate,uint8_t start_stop) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; + char buf[MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN]; _mav_put_uint16_t(buf, 0, req_message_rate); _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); _mav_put_uint8_t(buf, 4, req_stream_id); _mav_put_uint8_t(buf, 5, start_stop); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); #else mavlink_request_data_stream_t packet; packet.req_message_rate = req_message_rate; @@ -102,11 +109,15 @@ static inline uint16_t mavlink_msg_request_data_stream_pack_chan(uint8_t system_ packet.req_stream_id = req_stream_id; packet.start_stop = start_stop; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); #endif msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 6, 148); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); +#endif } /** @@ -137,14 +148,18 @@ static inline uint16_t mavlink_msg_request_data_stream_encode(uint8_t system_id, static inline void mavlink_msg_request_data_stream_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t req_stream_id, uint16_t req_message_rate, uint8_t start_stop) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; + char buf[MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN]; _mav_put_uint16_t(buf, 0, req_message_rate); _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); _mav_put_uint8_t(buf, 4, req_stream_id); _mav_put_uint8_t(buf, 5, start_stop); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, buf, 6, 148); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, buf, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, buf, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); +#endif #else mavlink_request_data_stream_t packet; packet.req_message_rate = req_message_rate; @@ -153,7 +168,11 @@ static inline void mavlink_msg_request_data_stream_send(mavlink_channel_t chan, packet.req_stream_id = req_stream_id; packet.start_stop = start_stop; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, (const char *)&packet, 6, 148); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, (const char *)&packet, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, (const char *)&packet, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); +#endif #endif } @@ -227,6 +246,6 @@ static inline void mavlink_msg_request_data_stream_decode(const mavlink_message_ request_data_stream->req_stream_id = mavlink_msg_request_data_stream_get_req_stream_id(msg); request_data_stream->start_stop = mavlink_msg_request_data_stream_get_start_stop(msg); #else - memcpy(request_data_stream, _MAV_PAYLOAD(msg), 6); + memcpy(request_data_stream, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint.h index 47772e004..a7e9df94b 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint.h @@ -14,6 +14,9 @@ typedef struct __mavlink_roll_pitch_yaw_rates_thrust_setpoint_t #define MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN 20 #define MAVLINK_MSG_ID_80_LEN 20 +#define MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_CRC 127 +#define MAVLINK_MSG_ID_80_CRC 127 + #define MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT { \ @@ -45,14 +48,14 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_pack(uin uint32_t time_boot_ms, float roll_rate, float pitch_rate, float yaw_rate, float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, roll_rate); _mav_put_float(buf, 8, pitch_rate); _mav_put_float(buf, 12, yaw_rate); _mav_put_float(buf, 16, thrust); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN); #else mavlink_roll_pitch_yaw_rates_thrust_setpoint_t packet; packet.time_boot_ms = time_boot_ms; @@ -61,11 +64,15 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_pack(uin packet.yaw_rate = yaw_rate; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT; - return mavlink_finalize_message(msg, system_id, component_id, 20, 127); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN); +#endif } /** @@ -86,14 +93,14 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_pack_cha uint32_t time_boot_ms,float roll_rate,float pitch_rate,float yaw_rate,float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, roll_rate); _mav_put_float(buf, 8, pitch_rate); _mav_put_float(buf, 12, yaw_rate); _mav_put_float(buf, 16, thrust); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN); #else mavlink_roll_pitch_yaw_rates_thrust_setpoint_t packet; packet.time_boot_ms = time_boot_ms; @@ -102,11 +109,15 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_pack_cha packet.yaw_rate = yaw_rate; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 20, 127); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN); +#endif } /** @@ -137,14 +148,18 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_encode(u static inline void mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll_rate, float pitch_rate, float yaw_rate, float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, roll_rate); _mav_put_float(buf, 8, pitch_rate); _mav_put_float(buf, 12, yaw_rate); _mav_put_float(buf, 16, thrust); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, buf, 20, 127); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN); +#endif #else mavlink_roll_pitch_yaw_rates_thrust_setpoint_t packet; packet.time_boot_ms = time_boot_ms; @@ -153,7 +168,11 @@ static inline void mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_send(mavlink packet.yaw_rate = yaw_rate; packet.thrust = thrust; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, (const char *)&packet, 20, 127); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN); +#endif #endif } @@ -227,6 +246,6 @@ static inline void mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_decode(const roll_pitch_yaw_rates_thrust_setpoint->yaw_rate = mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_yaw_rate(msg); roll_pitch_yaw_rates_thrust_setpoint->thrust = mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_thrust(msg); #else - memcpy(roll_pitch_yaw_rates_thrust_setpoint, _MAV_PAYLOAD(msg), 20); + memcpy(roll_pitch_yaw_rates_thrust_setpoint, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h index 5751badc3..517797655 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h @@ -14,6 +14,9 @@ typedef struct __mavlink_roll_pitch_yaw_speed_thrust_setpoint_t #define MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN 20 #define MAVLINK_MSG_ID_59_LEN 20 +#define MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_CRC 238 +#define MAVLINK_MSG_ID_59_CRC 238 + #define MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT { \ @@ -45,14 +48,14 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack(uin uint32_t time_boot_ms, float roll_speed, float pitch_speed, float yaw_speed, float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, roll_speed); _mav_put_float(buf, 8, pitch_speed); _mav_put_float(buf, 12, yaw_speed); _mav_put_float(buf, 16, thrust); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN); #else mavlink_roll_pitch_yaw_speed_thrust_setpoint_t packet; packet.time_boot_ms = time_boot_ms; @@ -61,11 +64,15 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack(uin packet.yaw_speed = yaw_speed; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT; - return mavlink_finalize_message(msg, system_id, component_id, 20, 238); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN); +#endif } /** @@ -86,14 +93,14 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack_cha uint32_t time_boot_ms,float roll_speed,float pitch_speed,float yaw_speed,float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, roll_speed); _mav_put_float(buf, 8, pitch_speed); _mav_put_float(buf, 12, yaw_speed); _mav_put_float(buf, 16, thrust); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN); #else mavlink_roll_pitch_yaw_speed_thrust_setpoint_t packet; packet.time_boot_ms = time_boot_ms; @@ -102,11 +109,15 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack_cha packet.yaw_speed = yaw_speed; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 20, 238); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN); +#endif } /** @@ -137,14 +148,18 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_encode(u static inline void mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll_speed, float pitch_speed, float yaw_speed, float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, roll_speed); _mav_put_float(buf, 8, pitch_speed); _mav_put_float(buf, 12, yaw_speed); _mav_put_float(buf, 16, thrust); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, buf, 20, 238); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN); +#endif #else mavlink_roll_pitch_yaw_speed_thrust_setpoint_t packet; packet.time_boot_ms = time_boot_ms; @@ -153,7 +168,11 @@ static inline void mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_send(mavlink packet.yaw_speed = yaw_speed; packet.thrust = thrust; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, (const char *)&packet, 20, 238); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN); +#endif #endif } @@ -227,6 +246,6 @@ static inline void mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_decode(const roll_pitch_yaw_speed_thrust_setpoint->yaw_speed = mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_get_yaw_speed(msg); roll_pitch_yaw_speed_thrust_setpoint->thrust = mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_get_thrust(msg); #else - memcpy(roll_pitch_yaw_speed_thrust_setpoint, _MAV_PAYLOAD(msg), 20); + memcpy(roll_pitch_yaw_speed_thrust_setpoint, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h index a9f6ad0ca..aee036022 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h @@ -14,6 +14,9 @@ typedef struct __mavlink_roll_pitch_yaw_thrust_setpoint_t #define MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN 20 #define MAVLINK_MSG_ID_58_LEN 20 +#define MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_CRC 239 +#define MAVLINK_MSG_ID_58_CRC 239 + #define MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT { \ @@ -45,14 +48,14 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack(uint8_t s uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, roll); _mav_put_float(buf, 8, pitch); _mav_put_float(buf, 12, yaw); _mav_put_float(buf, 16, thrust); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN); #else mavlink_roll_pitch_yaw_thrust_setpoint_t packet; packet.time_boot_ms = time_boot_ms; @@ -61,11 +64,15 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack(uint8_t s packet.yaw = yaw; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT; - return mavlink_finalize_message(msg, system_id, component_id, 20, 239); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN); +#endif } /** @@ -86,14 +93,14 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack_chan(uint uint32_t time_boot_ms,float roll,float pitch,float yaw,float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, roll); _mav_put_float(buf, 8, pitch); _mav_put_float(buf, 12, yaw); _mav_put_float(buf, 16, thrust); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN); #else mavlink_roll_pitch_yaw_thrust_setpoint_t packet; packet.time_boot_ms = time_boot_ms; @@ -102,11 +109,15 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack_chan(uint packet.yaw = yaw; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 20, 239); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN); +#endif } /** @@ -137,14 +148,18 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_encode(uint8_t static inline void mavlink_msg_roll_pitch_yaw_thrust_setpoint_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, roll); _mav_put_float(buf, 8, pitch); _mav_put_float(buf, 12, yaw); _mav_put_float(buf, 16, thrust); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT, buf, 20, 239); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT, buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT, buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN); +#endif #else mavlink_roll_pitch_yaw_thrust_setpoint_t packet; packet.time_boot_ms = time_boot_ms; @@ -153,7 +168,11 @@ static inline void mavlink_msg_roll_pitch_yaw_thrust_setpoint_send(mavlink_chann packet.yaw = yaw; packet.thrust = thrust; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT, (const char *)&packet, 20, 239); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN); +#endif #endif } @@ -227,6 +246,6 @@ static inline void mavlink_msg_roll_pitch_yaw_thrust_setpoint_decode(const mavli roll_pitch_yaw_thrust_setpoint->yaw = mavlink_msg_roll_pitch_yaw_thrust_setpoint_get_yaw(msg); roll_pitch_yaw_thrust_setpoint->thrust = mavlink_msg_roll_pitch_yaw_thrust_setpoint_get_thrust(msg); #else - memcpy(roll_pitch_yaw_thrust_setpoint, _MAV_PAYLOAD(msg), 20); + memcpy(roll_pitch_yaw_thrust_setpoint, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_safety_allowed_area.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_safety_allowed_area.h index aae6fd206..100fabf16 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_safety_allowed_area.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_safety_allowed_area.h @@ -16,6 +16,9 @@ typedef struct __mavlink_safety_allowed_area_t #define MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN 25 #define MAVLINK_MSG_ID_55_LEN 25 +#define MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC 3 +#define MAVLINK_MSG_ID_55_CRC 3 + #define MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA { \ @@ -51,7 +54,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, u uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[25]; + char buf[MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN]; _mav_put_float(buf, 0, p1x); _mav_put_float(buf, 4, p1y); _mav_put_float(buf, 8, p1z); @@ -60,7 +63,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, u _mav_put_float(buf, 20, p2z); _mav_put_uint8_t(buf, 24, frame); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); #else mavlink_safety_allowed_area_t packet; packet.p1x = p1x; @@ -71,11 +74,15 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, u packet.p2z = p2z; packet.frame = frame; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; - return mavlink_finalize_message(msg, system_id, component_id, 25, 3); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); +#endif } /** @@ -98,7 +105,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack_chan(uint8_t system_ uint8_t frame,float p1x,float p1y,float p1z,float p2x,float p2y,float p2z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[25]; + char buf[MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN]; _mav_put_float(buf, 0, p1x); _mav_put_float(buf, 4, p1y); _mav_put_float(buf, 8, p1z); @@ -107,7 +114,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack_chan(uint8_t system_ _mav_put_float(buf, 20, p2z); _mav_put_uint8_t(buf, 24, frame); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); #else mavlink_safety_allowed_area_t packet; packet.p1x = p1x; @@ -118,11 +125,15 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack_chan(uint8_t system_ packet.p2z = p2z; packet.frame = frame; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 25, 3); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); +#endif } /** @@ -155,7 +166,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_encode(uint8_t system_id, static inline void mavlink_msg_safety_allowed_area_send(mavlink_channel_t chan, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[25]; + char buf[MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN]; _mav_put_float(buf, 0, p1x); _mav_put_float(buf, 4, p1y); _mav_put_float(buf, 8, p1z); @@ -164,7 +175,11 @@ static inline void mavlink_msg_safety_allowed_area_send(mavlink_channel_t chan, _mav_put_float(buf, 20, p2z); _mav_put_uint8_t(buf, 24, frame); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, buf, 25, 3); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); +#endif #else mavlink_safety_allowed_area_t packet; packet.p1x = p1x; @@ -175,7 +190,11 @@ static inline void mavlink_msg_safety_allowed_area_send(mavlink_channel_t chan, packet.p2z = p2z; packet.frame = frame; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, (const char *)&packet, 25, 3); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, (const char *)&packet, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, (const char *)&packet, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); +#endif #endif } @@ -271,6 +290,6 @@ static inline void mavlink_msg_safety_allowed_area_decode(const mavlink_message_ safety_allowed_area->p2z = mavlink_msg_safety_allowed_area_get_p2z(msg); safety_allowed_area->frame = mavlink_msg_safety_allowed_area_get_frame(msg); #else - memcpy(safety_allowed_area, _MAV_PAYLOAD(msg), 25); + memcpy(safety_allowed_area, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_safety_set_allowed_area.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_safety_set_allowed_area.h index 8fb410c2d..d365b7aed 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_safety_set_allowed_area.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_safety_set_allowed_area.h @@ -18,6 +18,9 @@ typedef struct __mavlink_safety_set_allowed_area_t #define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN 27 #define MAVLINK_MSG_ID_54_LEN 27 +#define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC 15 +#define MAVLINK_MSG_ID_54_CRC 15 + #define MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA { \ @@ -57,7 +60,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_i uint8_t target_system, uint8_t target_component, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[27]; + char buf[MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN]; _mav_put_float(buf, 0, p1x); _mav_put_float(buf, 4, p1y); _mav_put_float(buf, 8, p1z); @@ -68,7 +71,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_i _mav_put_uint8_t(buf, 25, target_component); _mav_put_uint8_t(buf, 26, frame); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 27); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); #else mavlink_safety_set_allowed_area_t packet; packet.p1x = p1x; @@ -81,11 +84,15 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_i packet.target_component = target_component; packet.frame = frame; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 27); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA; - return mavlink_finalize_message(msg, system_id, component_id, 27, 15); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); +#endif } /** @@ -110,7 +117,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_chan(uint8_t sys uint8_t target_system,uint8_t target_component,uint8_t frame,float p1x,float p1y,float p1z,float p2x,float p2y,float p2z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[27]; + char buf[MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN]; _mav_put_float(buf, 0, p1x); _mav_put_float(buf, 4, p1y); _mav_put_float(buf, 8, p1z); @@ -121,7 +128,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_chan(uint8_t sys _mav_put_uint8_t(buf, 25, target_component); _mav_put_uint8_t(buf, 26, frame); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 27); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); #else mavlink_safety_set_allowed_area_t packet; packet.p1x = p1x; @@ -134,11 +141,15 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_chan(uint8_t sys packet.target_component = target_component; packet.frame = frame; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 27); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 27, 15); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); +#endif } /** @@ -173,7 +184,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_encode(uint8_t system static inline void mavlink_msg_safety_set_allowed_area_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[27]; + char buf[MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN]; _mav_put_float(buf, 0, p1x); _mav_put_float(buf, 4, p1y); _mav_put_float(buf, 8, p1z); @@ -184,7 +195,11 @@ static inline void mavlink_msg_safety_set_allowed_area_send(mavlink_channel_t ch _mav_put_uint8_t(buf, 25, target_component); _mav_put_uint8_t(buf, 26, frame); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, buf, 27, 15); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); +#endif #else mavlink_safety_set_allowed_area_t packet; packet.p1x = p1x; @@ -197,7 +212,11 @@ static inline void mavlink_msg_safety_set_allowed_area_send(mavlink_channel_t ch packet.target_component = target_component; packet.frame = frame; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, (const char *)&packet, 27, 15); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, (const char *)&packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, (const char *)&packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); +#endif #endif } @@ -315,6 +334,6 @@ static inline void mavlink_msg_safety_set_allowed_area_decode(const mavlink_mess safety_set_allowed_area->target_component = mavlink_msg_safety_set_allowed_area_get_target_component(msg); safety_set_allowed_area->frame = mavlink_msg_safety_set_allowed_area_get_frame(msg); #else - memcpy(safety_set_allowed_area, _MAV_PAYLOAD(msg), 27); + memcpy(safety_set_allowed_area, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_scaled_imu.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_scaled_imu.h index 8ff098f39..2751ddfe7 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_scaled_imu.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_scaled_imu.h @@ -19,6 +19,9 @@ typedef struct __mavlink_scaled_imu_t #define MAVLINK_MSG_ID_SCALED_IMU_LEN 22 #define MAVLINK_MSG_ID_26_LEN 22 +#define MAVLINK_MSG_ID_SCALED_IMU_CRC 170 +#define MAVLINK_MSG_ID_26_CRC 170 + #define MAVLINK_MESSAGE_INFO_SCALED_IMU { \ @@ -60,7 +63,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack(uint8_t system_id, uint8_t co uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[22]; + char buf[MAVLINK_MSG_ID_SCALED_IMU_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_int16_t(buf, 4, xacc); _mav_put_int16_t(buf, 6, yacc); @@ -72,7 +75,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack(uint8_t system_id, uint8_t co _mav_put_int16_t(buf, 18, ymag); _mav_put_int16_t(buf, 20, zmag); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_IMU_LEN); #else mavlink_scaled_imu_t packet; packet.time_boot_ms = time_boot_ms; @@ -86,11 +89,15 @@ static inline uint16_t mavlink_msg_scaled_imu_pack(uint8_t system_id, uint8_t co packet.ymag = ymag; packet.zmag = zmag; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_IMU_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SCALED_IMU; - return mavlink_finalize_message(msg, system_id, component_id, 22, 170); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_IMU_LEN); +#endif } /** @@ -116,7 +123,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack_chan(uint8_t system_id, uint8 uint32_t time_boot_ms,int16_t xacc,int16_t yacc,int16_t zacc,int16_t xgyro,int16_t ygyro,int16_t zgyro,int16_t xmag,int16_t ymag,int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[22]; + char buf[MAVLINK_MSG_ID_SCALED_IMU_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_int16_t(buf, 4, xacc); _mav_put_int16_t(buf, 6, yacc); @@ -128,7 +135,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack_chan(uint8_t system_id, uint8 _mav_put_int16_t(buf, 18, ymag); _mav_put_int16_t(buf, 20, zmag); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_IMU_LEN); #else mavlink_scaled_imu_t packet; packet.time_boot_ms = time_boot_ms; @@ -142,11 +149,15 @@ static inline uint16_t mavlink_msg_scaled_imu_pack_chan(uint8_t system_id, uint8 packet.ymag = ymag; packet.zmag = zmag; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_IMU_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SCALED_IMU; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 22, 170); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_IMU_LEN); +#endif } /** @@ -182,7 +193,7 @@ static inline uint16_t mavlink_msg_scaled_imu_encode(uint8_t system_id, uint8_t static inline void mavlink_msg_scaled_imu_send(mavlink_channel_t chan, uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[22]; + char buf[MAVLINK_MSG_ID_SCALED_IMU_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_int16_t(buf, 4, xacc); _mav_put_int16_t(buf, 6, yacc); @@ -194,7 +205,11 @@ static inline void mavlink_msg_scaled_imu_send(mavlink_channel_t chan, uint32_t _mav_put_int16_t(buf, 18, ymag); _mav_put_int16_t(buf, 20, zmag); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, buf, 22, 170); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, buf, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, buf, MAVLINK_MSG_ID_SCALED_IMU_LEN); +#endif #else mavlink_scaled_imu_t packet; packet.time_boot_ms = time_boot_ms; @@ -208,7 +223,11 @@ static inline void mavlink_msg_scaled_imu_send(mavlink_channel_t chan, uint32_t packet.ymag = ymag; packet.zmag = zmag; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, (const char *)&packet, 22, 170); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, (const char *)&packet, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, (const char *)&packet, MAVLINK_MSG_ID_SCALED_IMU_LEN); +#endif #endif } @@ -337,6 +356,6 @@ static inline void mavlink_msg_scaled_imu_decode(const mavlink_message_t* msg, m scaled_imu->ymag = mavlink_msg_scaled_imu_get_ymag(msg); scaled_imu->zmag = mavlink_msg_scaled_imu_get_zmag(msg); #else - memcpy(scaled_imu, _MAV_PAYLOAD(msg), 22); + memcpy(scaled_imu, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SCALED_IMU_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_scaled_pressure.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_scaled_pressure.h index d9ddcd47f..f54e28195 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_scaled_pressure.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_scaled_pressure.h @@ -13,6 +13,9 @@ typedef struct __mavlink_scaled_pressure_t #define MAVLINK_MSG_ID_SCALED_PRESSURE_LEN 14 #define MAVLINK_MSG_ID_29_LEN 14 +#define MAVLINK_MSG_ID_SCALED_PRESSURE_CRC 115 +#define MAVLINK_MSG_ID_29_CRC 115 + #define MAVLINK_MESSAGE_INFO_SCALED_PRESSURE { \ @@ -42,13 +45,13 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8 uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; + char buf[MAVLINK_MSG_ID_SCALED_PRESSURE_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, press_abs); _mav_put_float(buf, 8, press_diff); _mav_put_int16_t(buf, 12, temperature); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); #else mavlink_scaled_pressure_t packet; packet.time_boot_ms = time_boot_ms; @@ -56,11 +59,15 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8 packet.press_diff = press_diff; packet.temperature = temperature; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE; - return mavlink_finalize_message(msg, system_id, component_id, 14, 115); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); +#endif } /** @@ -80,13 +87,13 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack_chan(uint8_t system_id, uint32_t time_boot_ms,float press_abs,float press_diff,int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; + char buf[MAVLINK_MSG_ID_SCALED_PRESSURE_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, press_abs); _mav_put_float(buf, 8, press_diff); _mav_put_int16_t(buf, 12, temperature); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); #else mavlink_scaled_pressure_t packet; packet.time_boot_ms = time_boot_ms; @@ -94,11 +101,15 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack_chan(uint8_t system_id, packet.press_diff = press_diff; packet.temperature = temperature; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 14, 115); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); +#endif } /** @@ -128,13 +139,17 @@ static inline uint16_t mavlink_msg_scaled_pressure_encode(uint8_t system_id, uin static inline void mavlink_msg_scaled_pressure_send(mavlink_channel_t chan, uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; + char buf[MAVLINK_MSG_ID_SCALED_PRESSURE_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_float(buf, 4, press_abs); _mav_put_float(buf, 8, press_diff); _mav_put_int16_t(buf, 12, temperature); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, buf, 14, 115); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, buf, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, buf, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); +#endif #else mavlink_scaled_pressure_t packet; packet.time_boot_ms = time_boot_ms; @@ -142,7 +157,11 @@ static inline void mavlink_msg_scaled_pressure_send(mavlink_channel_t chan, uint packet.press_diff = press_diff; packet.temperature = temperature; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, (const char *)&packet, 14, 115); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, (const char *)&packet, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, (const char *)&packet, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); +#endif #endif } @@ -205,6 +224,6 @@ static inline void mavlink_msg_scaled_pressure_decode(const mavlink_message_t* m scaled_pressure->press_diff = mavlink_msg_scaled_pressure_get_press_diff(msg); scaled_pressure->temperature = mavlink_msg_scaled_pressure_get_temperature(msg); #else - memcpy(scaled_pressure, _MAV_PAYLOAD(msg), 14); + memcpy(scaled_pressure, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_servo_output_raw.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_servo_output_raw.h index 45c94d8b9..10bdcbc8c 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_servo_output_raw.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_servo_output_raw.h @@ -19,6 +19,9 @@ typedef struct __mavlink_servo_output_raw_t #define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN 21 #define MAVLINK_MSG_ID_36_LEN 21 +#define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC 222 +#define MAVLINK_MSG_ID_36_CRC 222 + #define MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW { \ @@ -60,7 +63,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint uint32_t time_usec, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[21]; + char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN]; _mav_put_uint32_t(buf, 0, time_usec); _mav_put_uint16_t(buf, 4, servo1_raw); _mav_put_uint16_t(buf, 6, servo2_raw); @@ -72,7 +75,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint _mav_put_uint16_t(buf, 18, servo8_raw); _mav_put_uint8_t(buf, 20, port); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); #else mavlink_servo_output_raw_t packet; packet.time_usec = time_usec; @@ -86,11 +89,15 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint packet.servo8_raw = servo8_raw; packet.port = port; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW; - return mavlink_finalize_message(msg, system_id, component_id, 21, 222); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); +#endif } /** @@ -116,7 +123,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id, uint32_t time_usec,uint8_t port,uint16_t servo1_raw,uint16_t servo2_raw,uint16_t servo3_raw,uint16_t servo4_raw,uint16_t servo5_raw,uint16_t servo6_raw,uint16_t servo7_raw,uint16_t servo8_raw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[21]; + char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN]; _mav_put_uint32_t(buf, 0, time_usec); _mav_put_uint16_t(buf, 4, servo1_raw); _mav_put_uint16_t(buf, 6, servo2_raw); @@ -128,7 +135,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id, _mav_put_uint16_t(buf, 18, servo8_raw); _mav_put_uint8_t(buf, 20, port); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); #else mavlink_servo_output_raw_t packet; packet.time_usec = time_usec; @@ -142,11 +149,15 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id, packet.servo8_raw = servo8_raw; packet.port = port; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 21, 222); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); +#endif } /** @@ -182,7 +193,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_encode(uint8_t system_id, ui static inline void mavlink_msg_servo_output_raw_send(mavlink_channel_t chan, uint32_t time_usec, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[21]; + char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN]; _mav_put_uint32_t(buf, 0, time_usec); _mav_put_uint16_t(buf, 4, servo1_raw); _mav_put_uint16_t(buf, 6, servo2_raw); @@ -194,7 +205,11 @@ static inline void mavlink_msg_servo_output_raw_send(mavlink_channel_t chan, uin _mav_put_uint16_t(buf, 18, servo8_raw); _mav_put_uint8_t(buf, 20, port); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, 21, 222); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); +#endif #else mavlink_servo_output_raw_t packet; packet.time_usec = time_usec; @@ -208,7 +223,11 @@ static inline void mavlink_msg_servo_output_raw_send(mavlink_channel_t chan, uin packet.servo8_raw = servo8_raw; packet.port = port; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)&packet, 21, 222); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)&packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)&packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); +#endif #endif } @@ -337,6 +356,6 @@ static inline void mavlink_msg_servo_output_raw_decode(const mavlink_message_t* servo_output_raw->servo8_raw = mavlink_msg_servo_output_raw_get_servo8_raw(msg); servo_output_raw->port = mavlink_msg_servo_output_raw_get_port(msg); #else - memcpy(servo_output_raw, _MAV_PAYLOAD(msg), 21); + memcpy(servo_output_raw, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_global_position_setpoint_int.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_global_position_setpoint_int.h index 5b706fb50..0364b4241 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_global_position_setpoint_int.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_global_position_setpoint_int.h @@ -4,9 +4,9 @@ typedef struct __mavlink_set_global_position_setpoint_int_t { - int32_t latitude; ///< WGS84 Latitude position in degrees * 1E7 - int32_t longitude; ///< WGS84 Longitude position in degrees * 1E7 - int32_t altitude; ///< WGS84 Altitude in meters * 1000 (positive for up) + int32_t latitude; ///< Latitude (WGS84), in degrees * 1E7 + int32_t longitude; ///< Longitude (WGS84), in degrees * 1E7 + int32_t altitude; ///< Altitude (WGS84), in meters * 1000 (positive for up) int16_t yaw; ///< Desired yaw angle in degrees * 100 uint8_t coordinate_frame; ///< Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT } mavlink_set_global_position_setpoint_int_t; @@ -14,6 +14,9 @@ typedef struct __mavlink_set_global_position_setpoint_int_t #define MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN 15 #define MAVLINK_MSG_ID_53_LEN 15 +#define MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_CRC 33 +#define MAVLINK_MSG_ID_53_CRC 33 + #define MAVLINK_MESSAGE_INFO_SET_GLOBAL_POSITION_SETPOINT_INT { \ @@ -35,9 +38,9 @@ typedef struct __mavlink_set_global_position_setpoint_int_t * @param msg The MAVLink message to compress the data into * * @param coordinate_frame Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT - * @param latitude WGS84 Latitude position in degrees * 1E7 - * @param longitude WGS84 Longitude position in degrees * 1E7 - * @param altitude WGS84 Altitude in meters * 1000 (positive for up) + * @param latitude Latitude (WGS84), in degrees * 1E7 + * @param longitude Longitude (WGS84), in degrees * 1E7 + * @param altitude Altitude (WGS84), in meters * 1000 (positive for up) * @param yaw Desired yaw angle in degrees * 100 * @return length of the message in bytes (excluding serial stream start sign) */ @@ -45,14 +48,14 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_pack(uint8_t uint8_t coordinate_frame, int32_t latitude, int32_t longitude, int32_t altitude, int16_t yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; + char buf[MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN]; _mav_put_int32_t(buf, 0, latitude); _mav_put_int32_t(buf, 4, longitude); _mav_put_int32_t(buf, 8, altitude); _mav_put_int16_t(buf, 12, yaw); _mav_put_uint8_t(buf, 14, coordinate_frame); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN); #else mavlink_set_global_position_setpoint_int_t packet; packet.latitude = latitude; @@ -61,11 +64,15 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_pack(uint8_t packet.yaw = yaw; packet.coordinate_frame = coordinate_frame; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT; - return mavlink_finalize_message(msg, system_id, component_id, 15, 33); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN); +#endif } /** @@ -75,9 +82,9 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_pack(uint8_t * @param chan The MAVLink channel this message was sent over * @param msg The MAVLink message to compress the data into * @param coordinate_frame Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT - * @param latitude WGS84 Latitude position in degrees * 1E7 - * @param longitude WGS84 Longitude position in degrees * 1E7 - * @param altitude WGS84 Altitude in meters * 1000 (positive for up) + * @param latitude Latitude (WGS84), in degrees * 1E7 + * @param longitude Longitude (WGS84), in degrees * 1E7 + * @param altitude Altitude (WGS84), in meters * 1000 (positive for up) * @param yaw Desired yaw angle in degrees * 100 * @return length of the message in bytes (excluding serial stream start sign) */ @@ -86,14 +93,14 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_pack_chan(ui uint8_t coordinate_frame,int32_t latitude,int32_t longitude,int32_t altitude,int16_t yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; + char buf[MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN]; _mav_put_int32_t(buf, 0, latitude); _mav_put_int32_t(buf, 4, longitude); _mav_put_int32_t(buf, 8, altitude); _mav_put_int16_t(buf, 12, yaw); _mav_put_uint8_t(buf, 14, coordinate_frame); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN); #else mavlink_set_global_position_setpoint_int_t packet; packet.latitude = latitude; @@ -102,11 +109,15 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_pack_chan(ui packet.yaw = yaw; packet.coordinate_frame = coordinate_frame; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 15, 33); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN); +#endif } /** @@ -127,9 +138,9 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_encode(uint8 * @param chan MAVLink channel to send the message * * @param coordinate_frame Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT - * @param latitude WGS84 Latitude position in degrees * 1E7 - * @param longitude WGS84 Longitude position in degrees * 1E7 - * @param altitude WGS84 Altitude in meters * 1000 (positive for up) + * @param latitude Latitude (WGS84), in degrees * 1E7 + * @param longitude Longitude (WGS84), in degrees * 1E7 + * @param altitude Altitude (WGS84), in meters * 1000 (positive for up) * @param yaw Desired yaw angle in degrees * 100 */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -137,14 +148,18 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_encode(uint8 static inline void mavlink_msg_set_global_position_setpoint_int_send(mavlink_channel_t chan, uint8_t coordinate_frame, int32_t latitude, int32_t longitude, int32_t altitude, int16_t yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[15]; + char buf[MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN]; _mav_put_int32_t(buf, 0, latitude); _mav_put_int32_t(buf, 4, longitude); _mav_put_int32_t(buf, 8, altitude); _mav_put_int16_t(buf, 12, yaw); _mav_put_uint8_t(buf, 14, coordinate_frame); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT, buf, 15, 33); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT, buf, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT, buf, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN); +#endif #else mavlink_set_global_position_setpoint_int_t packet; packet.latitude = latitude; @@ -153,7 +168,11 @@ static inline void mavlink_msg_set_global_position_setpoint_int_send(mavlink_cha packet.yaw = yaw; packet.coordinate_frame = coordinate_frame; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT, (const char *)&packet, 15, 33); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT, (const char *)&packet, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT, (const char *)&packet, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN); +#endif #endif } @@ -175,7 +194,7 @@ static inline uint8_t mavlink_msg_set_global_position_setpoint_int_get_coordinat /** * @brief Get field latitude from set_global_position_setpoint_int message * - * @return WGS84 Latitude position in degrees * 1E7 + * @return Latitude (WGS84), in degrees * 1E7 */ static inline int32_t mavlink_msg_set_global_position_setpoint_int_get_latitude(const mavlink_message_t* msg) { @@ -185,7 +204,7 @@ static inline int32_t mavlink_msg_set_global_position_setpoint_int_get_latitude( /** * @brief Get field longitude from set_global_position_setpoint_int message * - * @return WGS84 Longitude position in degrees * 1E7 + * @return Longitude (WGS84), in degrees * 1E7 */ static inline int32_t mavlink_msg_set_global_position_setpoint_int_get_longitude(const mavlink_message_t* msg) { @@ -195,7 +214,7 @@ static inline int32_t mavlink_msg_set_global_position_setpoint_int_get_longitude /** * @brief Get field altitude from set_global_position_setpoint_int message * - * @return WGS84 Altitude in meters * 1000 (positive for up) + * @return Altitude (WGS84), in meters * 1000 (positive for up) */ static inline int32_t mavlink_msg_set_global_position_setpoint_int_get_altitude(const mavlink_message_t* msg) { @@ -227,6 +246,6 @@ static inline void mavlink_msg_set_global_position_setpoint_int_decode(const mav set_global_position_setpoint_int->yaw = mavlink_msg_set_global_position_setpoint_int_get_yaw(msg); set_global_position_setpoint_int->coordinate_frame = mavlink_msg_set_global_position_setpoint_int_get_coordinate_frame(msg); #else - memcpy(set_global_position_setpoint_int, _MAV_PAYLOAD(msg), 15); + memcpy(set_global_position_setpoint_int, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_gps_global_origin.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_gps_global_origin.h index af404b110..e3cd4f441 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_gps_global_origin.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_gps_global_origin.h @@ -4,15 +4,18 @@ typedef struct __mavlink_set_gps_global_origin_t { - int32_t latitude; ///< global position * 1E7 - int32_t longitude; ///< global position * 1E7 - int32_t altitude; ///< global position * 1000 + int32_t latitude; ///< Latitude (WGS84), in degrees * 1E7 + int32_t longitude; ///< Longitude (WGS84, in degrees * 1E7 + int32_t altitude; ///< Altitude (WGS84), in meters * 1000 (positive for up) uint8_t target_system; ///< System ID } mavlink_set_gps_global_origin_t; #define MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN 13 #define MAVLINK_MSG_ID_48_LEN 13 +#define MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC 41 +#define MAVLINK_MSG_ID_48_CRC 41 + #define MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN { \ @@ -33,22 +36,22 @@ typedef struct __mavlink_set_gps_global_origin_t * @param msg The MAVLink message to compress the data into * * @param target_system System ID - * @param latitude global position * 1E7 - * @param longitude global position * 1E7 - * @param altitude global position * 1000 + * @param latitude Latitude (WGS84), in degrees * 1E7 + * @param longitude Longitude (WGS84, in degrees * 1E7 + * @param altitude Altitude (WGS84), in meters * 1000 (positive for up) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_gps_global_origin_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[13]; + char buf[MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN]; _mav_put_int32_t(buf, 0, latitude); _mav_put_int32_t(buf, 4, longitude); _mav_put_int32_t(buf, 8, altitude); _mav_put_uint8_t(buf, 12, target_system); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); #else mavlink_set_gps_global_origin_t packet; packet.latitude = latitude; @@ -56,11 +59,15 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack(uint8_t system_id, packet.altitude = altitude; packet.target_system = target_system; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN; - return mavlink_finalize_message(msg, system_id, component_id, 13, 41); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); +#endif } /** @@ -70,9 +77,9 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack(uint8_t system_id, * @param chan The MAVLink channel this message was sent over * @param msg The MAVLink message to compress the data into * @param target_system System ID - * @param latitude global position * 1E7 - * @param longitude global position * 1E7 - * @param altitude global position * 1000 + * @param latitude Latitude (WGS84), in degrees * 1E7 + * @param longitude Longitude (WGS84, in degrees * 1E7 + * @param altitude Altitude (WGS84), in meters * 1000 (positive for up) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_gps_global_origin_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -80,13 +87,13 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack_chan(uint8_t syste uint8_t target_system,int32_t latitude,int32_t longitude,int32_t altitude) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[13]; + char buf[MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN]; _mav_put_int32_t(buf, 0, latitude); _mav_put_int32_t(buf, 4, longitude); _mav_put_int32_t(buf, 8, altitude); _mav_put_uint8_t(buf, 12, target_system); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); #else mavlink_set_gps_global_origin_t packet; packet.latitude = latitude; @@ -94,11 +101,15 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack_chan(uint8_t syste packet.altitude = altitude; packet.target_system = target_system; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 13, 41); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); +#endif } /** @@ -119,22 +130,26 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_encode(uint8_t system_i * @param chan MAVLink channel to send the message * * @param target_system System ID - * @param latitude global position * 1E7 - * @param longitude global position * 1E7 - * @param altitude global position * 1000 + * @param latitude Latitude (WGS84), in degrees * 1E7 + * @param longitude Longitude (WGS84, in degrees * 1E7 + * @param altitude Altitude (WGS84), in meters * 1000 (positive for up) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS static inline void mavlink_msg_set_gps_global_origin_send(mavlink_channel_t chan, uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[13]; + char buf[MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN]; _mav_put_int32_t(buf, 0, latitude); _mav_put_int32_t(buf, 4, longitude); _mav_put_int32_t(buf, 8, altitude); _mav_put_uint8_t(buf, 12, target_system); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, buf, 13, 41); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); +#endif #else mavlink_set_gps_global_origin_t packet; packet.latitude = latitude; @@ -142,7 +157,11 @@ static inline void mavlink_msg_set_gps_global_origin_send(mavlink_channel_t chan packet.altitude = altitude; packet.target_system = target_system; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, (const char *)&packet, 13, 41); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, (const char *)&packet, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, (const char *)&packet, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); +#endif #endif } @@ -164,7 +183,7 @@ static inline uint8_t mavlink_msg_set_gps_global_origin_get_target_system(const /** * @brief Get field latitude from set_gps_global_origin message * - * @return global position * 1E7 + * @return Latitude (WGS84), in degrees * 1E7 */ static inline int32_t mavlink_msg_set_gps_global_origin_get_latitude(const mavlink_message_t* msg) { @@ -174,7 +193,7 @@ static inline int32_t mavlink_msg_set_gps_global_origin_get_latitude(const mavli /** * @brief Get field longitude from set_gps_global_origin message * - * @return global position * 1E7 + * @return Longitude (WGS84, in degrees * 1E7 */ static inline int32_t mavlink_msg_set_gps_global_origin_get_longitude(const mavlink_message_t* msg) { @@ -184,7 +203,7 @@ static inline int32_t mavlink_msg_set_gps_global_origin_get_longitude(const mavl /** * @brief Get field altitude from set_gps_global_origin message * - * @return global position * 1000 + * @return Altitude (WGS84), in meters * 1000 (positive for up) */ static inline int32_t mavlink_msg_set_gps_global_origin_get_altitude(const mavlink_message_t* msg) { @@ -205,6 +224,6 @@ static inline void mavlink_msg_set_gps_global_origin_decode(const mavlink_messag set_gps_global_origin->altitude = mavlink_msg_set_gps_global_origin_get_altitude(msg); set_gps_global_origin->target_system = mavlink_msg_set_gps_global_origin_get_target_system(msg); #else - memcpy(set_gps_global_origin, _MAV_PAYLOAD(msg), 13); + memcpy(set_gps_global_origin, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_local_position_setpoint.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_local_position_setpoint.h index 233e07d65..b92c0560e 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_local_position_setpoint.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_local_position_setpoint.h @@ -16,6 +16,9 @@ typedef struct __mavlink_set_local_position_setpoint_t #define MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN 19 #define MAVLINK_MSG_ID_50_LEN 19 +#define MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_CRC 214 +#define MAVLINK_MSG_ID_50_CRC 214 + #define MAVLINK_MESSAGE_INFO_SET_LOCAL_POSITION_SETPOINT { \ @@ -51,7 +54,7 @@ static inline uint16_t mavlink_msg_set_local_position_setpoint_pack(uint8_t syst uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, float x, float y, float z, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[19]; + char buf[MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN]; _mav_put_float(buf, 0, x); _mav_put_float(buf, 4, y); _mav_put_float(buf, 8, z); @@ -60,7 +63,7 @@ static inline uint16_t mavlink_msg_set_local_position_setpoint_pack(uint8_t syst _mav_put_uint8_t(buf, 17, target_component); _mav_put_uint8_t(buf, 18, coordinate_frame); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 19); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN); #else mavlink_set_local_position_setpoint_t packet; packet.x = x; @@ -71,11 +74,15 @@ static inline uint16_t mavlink_msg_set_local_position_setpoint_pack(uint8_t syst packet.target_component = target_component; packet.coordinate_frame = coordinate_frame; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 19); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT; - return mavlink_finalize_message(msg, system_id, component_id, 19, 214); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN); +#endif } /** @@ -98,7 +105,7 @@ static inline uint16_t mavlink_msg_set_local_position_setpoint_pack_chan(uint8_t uint8_t target_system,uint8_t target_component,uint8_t coordinate_frame,float x,float y,float z,float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[19]; + char buf[MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN]; _mav_put_float(buf, 0, x); _mav_put_float(buf, 4, y); _mav_put_float(buf, 8, z); @@ -107,7 +114,7 @@ static inline uint16_t mavlink_msg_set_local_position_setpoint_pack_chan(uint8_t _mav_put_uint8_t(buf, 17, target_component); _mav_put_uint8_t(buf, 18, coordinate_frame); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 19); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN); #else mavlink_set_local_position_setpoint_t packet; packet.x = x; @@ -118,11 +125,15 @@ static inline uint16_t mavlink_msg_set_local_position_setpoint_pack_chan(uint8_t packet.target_component = target_component; packet.coordinate_frame = coordinate_frame; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 19); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 19, 214); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN); +#endif } /** @@ -155,7 +166,7 @@ static inline uint16_t mavlink_msg_set_local_position_setpoint_encode(uint8_t sy static inline void mavlink_msg_set_local_position_setpoint_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, float x, float y, float z, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[19]; + char buf[MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN]; _mav_put_float(buf, 0, x); _mav_put_float(buf, 4, y); _mav_put_float(buf, 8, z); @@ -164,7 +175,11 @@ static inline void mavlink_msg_set_local_position_setpoint_send(mavlink_channel_ _mav_put_uint8_t(buf, 17, target_component); _mav_put_uint8_t(buf, 18, coordinate_frame); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT, buf, 19, 214); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT, buf, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT, buf, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN); +#endif #else mavlink_set_local_position_setpoint_t packet; packet.x = x; @@ -175,7 +190,11 @@ static inline void mavlink_msg_set_local_position_setpoint_send(mavlink_channel_ packet.target_component = target_component; packet.coordinate_frame = coordinate_frame; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT, (const char *)&packet, 19, 214); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN); +#endif #endif } @@ -271,6 +290,6 @@ static inline void mavlink_msg_set_local_position_setpoint_decode(const mavlink_ set_local_position_setpoint->target_component = mavlink_msg_set_local_position_setpoint_get_target_component(msg); set_local_position_setpoint->coordinate_frame = mavlink_msg_set_local_position_setpoint_get_coordinate_frame(msg); #else - memcpy(set_local_position_setpoint, _MAV_PAYLOAD(msg), 19); + memcpy(set_local_position_setpoint, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_mode.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_mode.h index fec21ab13..08ec73309 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_mode.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_mode.h @@ -12,6 +12,9 @@ typedef struct __mavlink_set_mode_t #define MAVLINK_MSG_ID_SET_MODE_LEN 6 #define MAVLINK_MSG_ID_11_LEN 6 +#define MAVLINK_MSG_ID_SET_MODE_CRC 89 +#define MAVLINK_MSG_ID_11_CRC 89 + #define MAVLINK_MESSAGE_INFO_SET_MODE { \ @@ -39,23 +42,27 @@ static inline uint16_t mavlink_msg_set_mode_pack(uint8_t system_id, uint8_t comp uint8_t target_system, uint8_t base_mode, uint32_t custom_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; + char buf[MAVLINK_MSG_ID_SET_MODE_LEN]; _mav_put_uint32_t(buf, 0, custom_mode); _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, base_mode); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_MODE_LEN); #else mavlink_set_mode_t packet; packet.custom_mode = custom_mode; packet.target_system = target_system; packet.base_mode = base_mode; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_MODE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_MODE; - return mavlink_finalize_message(msg, system_id, component_id, 6, 89); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_MODE_LEN); +#endif } /** @@ -74,23 +81,27 @@ static inline uint16_t mavlink_msg_set_mode_pack_chan(uint8_t system_id, uint8_t uint8_t target_system,uint8_t base_mode,uint32_t custom_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; + char buf[MAVLINK_MSG_ID_SET_MODE_LEN]; _mav_put_uint32_t(buf, 0, custom_mode); _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, base_mode); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_MODE_LEN); #else mavlink_set_mode_t packet; packet.custom_mode = custom_mode; packet.target_system = target_system; packet.base_mode = base_mode; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_MODE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_MODE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 6, 89); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_MODE_LEN); +#endif } /** @@ -119,19 +130,27 @@ static inline uint16_t mavlink_msg_set_mode_encode(uint8_t system_id, uint8_t co static inline void mavlink_msg_set_mode_send(mavlink_channel_t chan, uint8_t target_system, uint8_t base_mode, uint32_t custom_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[6]; + char buf[MAVLINK_MSG_ID_SET_MODE_LEN]; _mav_put_uint32_t(buf, 0, custom_mode); _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, base_mode); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, buf, 6, 89); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, buf, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, buf, MAVLINK_MSG_ID_SET_MODE_LEN); +#endif #else mavlink_set_mode_t packet; packet.custom_mode = custom_mode; packet.target_system = target_system; packet.base_mode = base_mode; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, (const char *)&packet, 6, 89); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, (const char *)&packet, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, (const char *)&packet, MAVLINK_MSG_ID_SET_MODE_LEN); +#endif #endif } @@ -183,6 +202,6 @@ static inline void mavlink_msg_set_mode_decode(const mavlink_message_t* msg, mav set_mode->target_system = mavlink_msg_set_mode_get_target_system(msg); set_mode->base_mode = mavlink_msg_set_mode_get_base_mode(msg); #else - memcpy(set_mode, _MAV_PAYLOAD(msg), 6); + memcpy(set_mode, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_MODE_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_quad_motors_setpoint.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_quad_motors_setpoint.h index 40ff8998e..b79114e1a 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_quad_motors_setpoint.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_quad_motors_setpoint.h @@ -14,6 +14,9 @@ typedef struct __mavlink_set_quad_motors_setpoint_t #define MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN 9 #define MAVLINK_MSG_ID_60_LEN 9 +#define MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_CRC 30 +#define MAVLINK_MSG_ID_60_CRC 30 + #define MAVLINK_MESSAGE_INFO_SET_QUAD_MOTORS_SETPOINT { \ @@ -45,14 +48,14 @@ static inline uint16_t mavlink_msg_set_quad_motors_setpoint_pack(uint8_t system_ uint8_t target_system, uint16_t motor_front_nw, uint16_t motor_right_ne, uint16_t motor_back_se, uint16_t motor_left_sw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[9]; + char buf[MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN]; _mav_put_uint16_t(buf, 0, motor_front_nw); _mav_put_uint16_t(buf, 2, motor_right_ne); _mav_put_uint16_t(buf, 4, motor_back_se); _mav_put_uint16_t(buf, 6, motor_left_sw); _mav_put_uint8_t(buf, 8, target_system); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN); #else mavlink_set_quad_motors_setpoint_t packet; packet.motor_front_nw = motor_front_nw; @@ -61,11 +64,15 @@ static inline uint16_t mavlink_msg_set_quad_motors_setpoint_pack(uint8_t system_ packet.motor_left_sw = motor_left_sw; packet.target_system = target_system; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT; - return mavlink_finalize_message(msg, system_id, component_id, 9, 30); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN); +#endif } /** @@ -86,14 +93,14 @@ static inline uint16_t mavlink_msg_set_quad_motors_setpoint_pack_chan(uint8_t sy uint8_t target_system,uint16_t motor_front_nw,uint16_t motor_right_ne,uint16_t motor_back_se,uint16_t motor_left_sw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[9]; + char buf[MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN]; _mav_put_uint16_t(buf, 0, motor_front_nw); _mav_put_uint16_t(buf, 2, motor_right_ne); _mav_put_uint16_t(buf, 4, motor_back_se); _mav_put_uint16_t(buf, 6, motor_left_sw); _mav_put_uint8_t(buf, 8, target_system); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN); #else mavlink_set_quad_motors_setpoint_t packet; packet.motor_front_nw = motor_front_nw; @@ -102,11 +109,15 @@ static inline uint16_t mavlink_msg_set_quad_motors_setpoint_pack_chan(uint8_t sy packet.motor_left_sw = motor_left_sw; packet.target_system = target_system; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 9, 30); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN); +#endif } /** @@ -137,14 +148,18 @@ static inline uint16_t mavlink_msg_set_quad_motors_setpoint_encode(uint8_t syste static inline void mavlink_msg_set_quad_motors_setpoint_send(mavlink_channel_t chan, uint8_t target_system, uint16_t motor_front_nw, uint16_t motor_right_ne, uint16_t motor_back_se, uint16_t motor_left_sw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[9]; + char buf[MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN]; _mav_put_uint16_t(buf, 0, motor_front_nw); _mav_put_uint16_t(buf, 2, motor_right_ne); _mav_put_uint16_t(buf, 4, motor_back_se); _mav_put_uint16_t(buf, 6, motor_left_sw); _mav_put_uint8_t(buf, 8, target_system); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT, buf, 9, 30); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT, buf, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT, buf, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN); +#endif #else mavlink_set_quad_motors_setpoint_t packet; packet.motor_front_nw = motor_front_nw; @@ -153,7 +168,11 @@ static inline void mavlink_msg_set_quad_motors_setpoint_send(mavlink_channel_t c packet.motor_left_sw = motor_left_sw; packet.target_system = target_system; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT, (const char *)&packet, 9, 30); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN); +#endif #endif } @@ -227,6 +246,6 @@ static inline void mavlink_msg_set_quad_motors_setpoint_decode(const mavlink_mes set_quad_motors_setpoint->motor_left_sw = mavlink_msg_set_quad_motors_setpoint_get_motor_left_sw(msg); set_quad_motors_setpoint->target_system = mavlink_msg_set_quad_motors_setpoint_get_target_system(msg); #else - memcpy(set_quad_motors_setpoint, _MAV_PAYLOAD(msg), 9); + memcpy(set_quad_motors_setpoint, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust.h index 75a1420a1..06223845f 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust.h @@ -18,6 +18,9 @@ typedef struct __mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t #define MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN 46 #define MAVLINK_MSG_ID_63_LEN 46 +#define MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_CRC 130 +#define MAVLINK_MSG_ID_63_CRC 130 + #define MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_ROLL_LEN 4 #define MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_PITCH_LEN 4 #define MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_YAW_LEN 4 @@ -63,7 +66,7 @@ static inline uint16_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_pack uint8_t group, uint8_t mode, const uint8_t *led_red, const uint8_t *led_blue, const uint8_t *led_green, const int16_t *roll, const int16_t *pitch, const int16_t *yaw, const uint16_t *thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[46]; + char buf[MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN]; _mav_put_uint8_t(buf, 32, group); _mav_put_uint8_t(buf, 33, mode); _mav_put_int16_t_array(buf, 0, roll, 4); @@ -73,7 +76,7 @@ static inline uint16_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_pack _mav_put_uint8_t_array(buf, 34, led_red, 4); _mav_put_uint8_t_array(buf, 38, led_blue, 4); _mav_put_uint8_t_array(buf, 42, led_green, 4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 46); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN); #else mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t packet; packet.group = group; @@ -85,11 +88,15 @@ static inline uint16_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_pack mav_array_memcpy(packet.led_red, led_red, sizeof(uint8_t)*4); mav_array_memcpy(packet.led_blue, led_blue, sizeof(uint8_t)*4); mav_array_memcpy(packet.led_green, led_green, sizeof(uint8_t)*4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 46); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST; - return mavlink_finalize_message(msg, system_id, component_id, 46, 130); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN); +#endif } /** @@ -114,7 +121,7 @@ static inline uint16_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_pack uint8_t group,uint8_t mode,const uint8_t *led_red,const uint8_t *led_blue,const uint8_t *led_green,const int16_t *roll,const int16_t *pitch,const int16_t *yaw,const uint16_t *thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[46]; + char buf[MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN]; _mav_put_uint8_t(buf, 32, group); _mav_put_uint8_t(buf, 33, mode); _mav_put_int16_t_array(buf, 0, roll, 4); @@ -124,7 +131,7 @@ static inline uint16_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_pack _mav_put_uint8_t_array(buf, 34, led_red, 4); _mav_put_uint8_t_array(buf, 38, led_blue, 4); _mav_put_uint8_t_array(buf, 42, led_green, 4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 46); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN); #else mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t packet; packet.group = group; @@ -136,11 +143,15 @@ static inline uint16_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_pack mav_array_memcpy(packet.led_red, led_red, sizeof(uint8_t)*4); mav_array_memcpy(packet.led_blue, led_blue, sizeof(uint8_t)*4); mav_array_memcpy(packet.led_green, led_green, sizeof(uint8_t)*4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 46); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 46, 130); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN); +#endif } /** @@ -175,7 +186,7 @@ static inline uint16_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_enco static inline void mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_send(mavlink_channel_t chan, uint8_t group, uint8_t mode, const uint8_t *led_red, const uint8_t *led_blue, const uint8_t *led_green, const int16_t *roll, const int16_t *pitch, const int16_t *yaw, const uint16_t *thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[46]; + char buf[MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN]; _mav_put_uint8_t(buf, 32, group); _mav_put_uint8_t(buf, 33, mode); _mav_put_int16_t_array(buf, 0, roll, 4); @@ -185,7 +196,11 @@ static inline void mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_send(mav _mav_put_uint8_t_array(buf, 34, led_red, 4); _mav_put_uint8_t_array(buf, 38, led_blue, 4); _mav_put_uint8_t_array(buf, 42, led_green, 4); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST, buf, 46, 130); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST, buf, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST, buf, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN); +#endif #else mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t packet; packet.group = group; @@ -197,7 +212,11 @@ static inline void mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_send(mav mav_array_memcpy(packet.led_red, led_red, sizeof(uint8_t)*4); mav_array_memcpy(packet.led_blue, led_blue, sizeof(uint8_t)*4); mav_array_memcpy(packet.led_green, led_green, sizeof(uint8_t)*4); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST, (const char *)&packet, 46, 130); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST, (const char *)&packet, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST, (const char *)&packet, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN); +#endif #endif } @@ -315,6 +334,6 @@ static inline void mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_decode(c mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_led_blue(msg, set_quad_swarm_led_roll_pitch_yaw_thrust->led_blue); mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_led_green(msg, set_quad_swarm_led_roll_pitch_yaw_thrust->led_green); #else - memcpy(set_quad_swarm_led_roll_pitch_yaw_thrust, _MAV_PAYLOAD(msg), 46); + memcpy(set_quad_swarm_led_roll_pitch_yaw_thrust, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust.h index 35c5db18c..6c62b3530 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust.h @@ -15,6 +15,9 @@ typedef struct __mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t #define MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN 34 #define MAVLINK_MSG_ID_61_LEN 34 +#define MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_CRC 240 +#define MAVLINK_MSG_ID_61_CRC 240 + #define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_ROLL_LEN 4 #define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_PITCH_LEN 4 #define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_YAW_LEN 4 @@ -51,14 +54,14 @@ static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack(uin uint8_t group, uint8_t mode, const int16_t *roll, const int16_t *pitch, const int16_t *yaw, const uint16_t *thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[34]; + char buf[MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN]; _mav_put_uint8_t(buf, 32, group); _mav_put_uint8_t(buf, 33, mode); _mav_put_int16_t_array(buf, 0, roll, 4); _mav_put_int16_t_array(buf, 8, pitch, 4); _mav_put_int16_t_array(buf, 16, yaw, 4); _mav_put_uint16_t_array(buf, 24, thrust, 4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 34); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN); #else mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t packet; packet.group = group; @@ -67,11 +70,15 @@ static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack(uin mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*4); mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*4); mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 34); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST; - return mavlink_finalize_message(msg, system_id, component_id, 34, 240); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN); +#endif } /** @@ -93,14 +100,14 @@ static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack_cha uint8_t group,uint8_t mode,const int16_t *roll,const int16_t *pitch,const int16_t *yaw,const uint16_t *thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[34]; + char buf[MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN]; _mav_put_uint8_t(buf, 32, group); _mav_put_uint8_t(buf, 33, mode); _mav_put_int16_t_array(buf, 0, roll, 4); _mav_put_int16_t_array(buf, 8, pitch, 4); _mav_put_int16_t_array(buf, 16, yaw, 4); _mav_put_uint16_t_array(buf, 24, thrust, 4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 34); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN); #else mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t packet; packet.group = group; @@ -109,11 +116,15 @@ static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack_cha mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*4); mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*4); mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 34); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 34, 240); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN); +#endif } /** @@ -145,14 +156,18 @@ static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_encode(u static inline void mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_send(mavlink_channel_t chan, uint8_t group, uint8_t mode, const int16_t *roll, const int16_t *pitch, const int16_t *yaw, const uint16_t *thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[34]; + char buf[MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN]; _mav_put_uint8_t(buf, 32, group); _mav_put_uint8_t(buf, 33, mode); _mav_put_int16_t_array(buf, 0, roll, 4); _mav_put_int16_t_array(buf, 8, pitch, 4); _mav_put_int16_t_array(buf, 16, yaw, 4); _mav_put_uint16_t_array(buf, 24, thrust, 4); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, buf, 34, 240); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, buf, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, buf, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN); +#endif #else mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t packet; packet.group = group; @@ -161,7 +176,11 @@ static inline void mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_send(mavlink mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*4); mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*4); mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*4); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, (const char *)&packet, 34, 240); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, (const char *)&packet, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, (const char *)&packet, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN); +#endif #endif } @@ -246,6 +265,6 @@ static inline void mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_decode(const set_quad_swarm_roll_pitch_yaw_thrust->group = mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_group(msg); set_quad_swarm_roll_pitch_yaw_thrust->mode = mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_mode(msg); #else - memcpy(set_quad_swarm_roll_pitch_yaw_thrust, _MAV_PAYLOAD(msg), 34); + memcpy(set_quad_swarm_roll_pitch_yaw_thrust, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h index b79a7e9f2..c379a75d9 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h @@ -15,6 +15,9 @@ typedef struct __mavlink_set_roll_pitch_yaw_speed_thrust_t #define MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN 18 #define MAVLINK_MSG_ID_57_LEN 18 +#define MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_CRC 24 +#define MAVLINK_MSG_ID_57_CRC 24 + #define MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST { \ @@ -48,7 +51,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack(uint8_t uint8_t target_system, uint8_t target_component, float roll_speed, float pitch_speed, float yaw_speed, float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN]; _mav_put_float(buf, 0, roll_speed); _mav_put_float(buf, 4, pitch_speed); _mav_put_float(buf, 8, yaw_speed); @@ -56,7 +59,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack(uint8_t _mav_put_uint8_t(buf, 16, target_system); _mav_put_uint8_t(buf, 17, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN); #else mavlink_set_roll_pitch_yaw_speed_thrust_t packet; packet.roll_speed = roll_speed; @@ -66,11 +69,15 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack(uint8_t packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST; - return mavlink_finalize_message(msg, system_id, component_id, 18, 24); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN); +#endif } /** @@ -92,7 +99,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack_chan(uin uint8_t target_system,uint8_t target_component,float roll_speed,float pitch_speed,float yaw_speed,float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN]; _mav_put_float(buf, 0, roll_speed); _mav_put_float(buf, 4, pitch_speed); _mav_put_float(buf, 8, yaw_speed); @@ -100,7 +107,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack_chan(uin _mav_put_uint8_t(buf, 16, target_system); _mav_put_uint8_t(buf, 17, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN); #else mavlink_set_roll_pitch_yaw_speed_thrust_t packet; packet.roll_speed = roll_speed; @@ -110,11 +117,15 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack_chan(uin packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18, 24); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN); +#endif } /** @@ -146,7 +157,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_encode(uint8_ static inline void mavlink_msg_set_roll_pitch_yaw_speed_thrust_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float roll_speed, float pitch_speed, float yaw_speed, float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN]; _mav_put_float(buf, 0, roll_speed); _mav_put_float(buf, 4, pitch_speed); _mav_put_float(buf, 8, yaw_speed); @@ -154,7 +165,11 @@ static inline void mavlink_msg_set_roll_pitch_yaw_speed_thrust_send(mavlink_chan _mav_put_uint8_t(buf, 16, target_system); _mav_put_uint8_t(buf, 17, target_component); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST, buf, 18, 24); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST, buf, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST, buf, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN); +#endif #else mavlink_set_roll_pitch_yaw_speed_thrust_t packet; packet.roll_speed = roll_speed; @@ -164,7 +179,11 @@ static inline void mavlink_msg_set_roll_pitch_yaw_speed_thrust_send(mavlink_chan packet.target_system = target_system; packet.target_component = target_component; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST, (const char *)&packet, 18, 24); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST, (const char *)&packet, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST, (const char *)&packet, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN); +#endif #endif } @@ -249,6 +268,6 @@ static inline void mavlink_msg_set_roll_pitch_yaw_speed_thrust_decode(const mavl set_roll_pitch_yaw_speed_thrust->target_system = mavlink_msg_set_roll_pitch_yaw_speed_thrust_get_target_system(msg); set_roll_pitch_yaw_speed_thrust->target_component = mavlink_msg_set_roll_pitch_yaw_speed_thrust_get_target_component(msg); #else - memcpy(set_roll_pitch_yaw_speed_thrust, _MAV_PAYLOAD(msg), 18); + memcpy(set_roll_pitch_yaw_speed_thrust, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_roll_pitch_yaw_thrust.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_roll_pitch_yaw_thrust.h index 8cd573a26..146891eaf 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_roll_pitch_yaw_thrust.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_roll_pitch_yaw_thrust.h @@ -15,6 +15,9 @@ typedef struct __mavlink_set_roll_pitch_yaw_thrust_t #define MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN 18 #define MAVLINK_MSG_ID_56_LEN 18 +#define MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_CRC 100 +#define MAVLINK_MSG_ID_56_CRC 100 + #define MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST { \ @@ -48,7 +51,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack(uint8_t system uint8_t target_system, uint8_t target_component, float roll, float pitch, float yaw, float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN]; _mav_put_float(buf, 0, roll); _mav_put_float(buf, 4, pitch); _mav_put_float(buf, 8, yaw); @@ -56,7 +59,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack(uint8_t system _mav_put_uint8_t(buf, 16, target_system); _mav_put_uint8_t(buf, 17, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN); #else mavlink_set_roll_pitch_yaw_thrust_t packet; packet.roll = roll; @@ -66,11 +69,15 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack(uint8_t system packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST; - return mavlink_finalize_message(msg, system_id, component_id, 18, 100); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN); +#endif } /** @@ -92,7 +99,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack_chan(uint8_t s uint8_t target_system,uint8_t target_component,float roll,float pitch,float yaw,float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN]; _mav_put_float(buf, 0, roll); _mav_put_float(buf, 4, pitch); _mav_put_float(buf, 8, yaw); @@ -100,7 +107,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack_chan(uint8_t s _mav_put_uint8_t(buf, 16, target_system); _mav_put_uint8_t(buf, 17, target_component); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN); #else mavlink_set_roll_pitch_yaw_thrust_t packet; packet.roll = roll; @@ -110,11 +117,15 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack_chan(uint8_t s packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18, 100); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN); +#endif } /** @@ -146,7 +157,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_encode(uint8_t syst static inline void mavlink_msg_set_roll_pitch_yaw_thrust_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float roll, float pitch, float yaw, float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; + char buf[MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN]; _mav_put_float(buf, 0, roll); _mav_put_float(buf, 4, pitch); _mav_put_float(buf, 8, yaw); @@ -154,7 +165,11 @@ static inline void mavlink_msg_set_roll_pitch_yaw_thrust_send(mavlink_channel_t _mav_put_uint8_t(buf, 16, target_system); _mav_put_uint8_t(buf, 17, target_component); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST, buf, 18, 100); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST, buf, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST, buf, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN); +#endif #else mavlink_set_roll_pitch_yaw_thrust_t packet; packet.roll = roll; @@ -164,7 +179,11 @@ static inline void mavlink_msg_set_roll_pitch_yaw_thrust_send(mavlink_channel_t packet.target_system = target_system; packet.target_component = target_component; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST, (const char *)&packet, 18, 100); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST, (const char *)&packet, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST, (const char *)&packet, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN); +#endif #endif } @@ -249,6 +268,6 @@ static inline void mavlink_msg_set_roll_pitch_yaw_thrust_decode(const mavlink_me set_roll_pitch_yaw_thrust->target_system = mavlink_msg_set_roll_pitch_yaw_thrust_get_target_system(msg); set_roll_pitch_yaw_thrust->target_component = mavlink_msg_set_roll_pitch_yaw_thrust_get_target_component(msg); #else - memcpy(set_roll_pitch_yaw_thrust, _MAV_PAYLOAD(msg), 18); + memcpy(set_roll_pitch_yaw_thrust, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_setpoint_6dof.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_setpoint_6dof.h index fec38a6a4..f352617a2 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_setpoint_6dof.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_setpoint_6dof.h @@ -16,6 +16,9 @@ typedef struct __mavlink_setpoint_6dof_t #define MAVLINK_MSG_ID_SETPOINT_6DOF_LEN 25 #define MAVLINK_MSG_ID_149_LEN 25 +#define MAVLINK_MSG_ID_SETPOINT_6DOF_CRC 15 +#define MAVLINK_MSG_ID_149_CRC 15 + #define MAVLINK_MESSAGE_INFO_SETPOINT_6DOF { \ @@ -51,7 +54,7 @@ static inline uint16_t mavlink_msg_setpoint_6dof_pack(uint8_t system_id, uint8_t uint8_t target_system, float trans_x, float trans_y, float trans_z, float rot_x, float rot_y, float rot_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[25]; + char buf[MAVLINK_MSG_ID_SETPOINT_6DOF_LEN]; _mav_put_float(buf, 0, trans_x); _mav_put_float(buf, 4, trans_y); _mav_put_float(buf, 8, trans_z); @@ -60,7 +63,7 @@ static inline uint16_t mavlink_msg_setpoint_6dof_pack(uint8_t system_id, uint8_t _mav_put_float(buf, 20, rot_z); _mav_put_uint8_t(buf, 24, target_system); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SETPOINT_6DOF_LEN); #else mavlink_setpoint_6dof_t packet; packet.trans_x = trans_x; @@ -71,11 +74,15 @@ static inline uint16_t mavlink_msg_setpoint_6dof_pack(uint8_t system_id, uint8_t packet.rot_z = rot_z; packet.target_system = target_system; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SETPOINT_6DOF_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SETPOINT_6DOF; - return mavlink_finalize_message(msg, system_id, component_id, 25, 15); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SETPOINT_6DOF_LEN, MAVLINK_MSG_ID_SETPOINT_6DOF_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SETPOINT_6DOF_LEN); +#endif } /** @@ -98,7 +105,7 @@ static inline uint16_t mavlink_msg_setpoint_6dof_pack_chan(uint8_t system_id, ui uint8_t target_system,float trans_x,float trans_y,float trans_z,float rot_x,float rot_y,float rot_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[25]; + char buf[MAVLINK_MSG_ID_SETPOINT_6DOF_LEN]; _mav_put_float(buf, 0, trans_x); _mav_put_float(buf, 4, trans_y); _mav_put_float(buf, 8, trans_z); @@ -107,7 +114,7 @@ static inline uint16_t mavlink_msg_setpoint_6dof_pack_chan(uint8_t system_id, ui _mav_put_float(buf, 20, rot_z); _mav_put_uint8_t(buf, 24, target_system); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SETPOINT_6DOF_LEN); #else mavlink_setpoint_6dof_t packet; packet.trans_x = trans_x; @@ -118,11 +125,15 @@ static inline uint16_t mavlink_msg_setpoint_6dof_pack_chan(uint8_t system_id, ui packet.rot_z = rot_z; packet.target_system = target_system; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SETPOINT_6DOF_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SETPOINT_6DOF; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 25, 15); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SETPOINT_6DOF_LEN, MAVLINK_MSG_ID_SETPOINT_6DOF_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SETPOINT_6DOF_LEN); +#endif } /** @@ -155,7 +166,7 @@ static inline uint16_t mavlink_msg_setpoint_6dof_encode(uint8_t system_id, uint8 static inline void mavlink_msg_setpoint_6dof_send(mavlink_channel_t chan, uint8_t target_system, float trans_x, float trans_y, float trans_z, float rot_x, float rot_y, float rot_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[25]; + char buf[MAVLINK_MSG_ID_SETPOINT_6DOF_LEN]; _mav_put_float(buf, 0, trans_x); _mav_put_float(buf, 4, trans_y); _mav_put_float(buf, 8, trans_z); @@ -164,7 +175,11 @@ static inline void mavlink_msg_setpoint_6dof_send(mavlink_channel_t chan, uint8_ _mav_put_float(buf, 20, rot_z); _mav_put_uint8_t(buf, 24, target_system); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SETPOINT_6DOF, buf, 25, 15); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SETPOINT_6DOF, buf, MAVLINK_MSG_ID_SETPOINT_6DOF_LEN, MAVLINK_MSG_ID_SETPOINT_6DOF_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SETPOINT_6DOF, buf, MAVLINK_MSG_ID_SETPOINT_6DOF_LEN); +#endif #else mavlink_setpoint_6dof_t packet; packet.trans_x = trans_x; @@ -175,7 +190,11 @@ static inline void mavlink_msg_setpoint_6dof_send(mavlink_channel_t chan, uint8_ packet.rot_z = rot_z; packet.target_system = target_system; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SETPOINT_6DOF, (const char *)&packet, 25, 15); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SETPOINT_6DOF, (const char *)&packet, MAVLINK_MSG_ID_SETPOINT_6DOF_LEN, MAVLINK_MSG_ID_SETPOINT_6DOF_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SETPOINT_6DOF, (const char *)&packet, MAVLINK_MSG_ID_SETPOINT_6DOF_LEN); +#endif #endif } @@ -271,6 +290,6 @@ static inline void mavlink_msg_setpoint_6dof_decode(const mavlink_message_t* msg setpoint_6dof->rot_z = mavlink_msg_setpoint_6dof_get_rot_z(msg); setpoint_6dof->target_system = mavlink_msg_setpoint_6dof_get_target_system(msg); #else - memcpy(setpoint_6dof, _MAV_PAYLOAD(msg), 25); + memcpy(setpoint_6dof, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SETPOINT_6DOF_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_setpoint_8dof.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_setpoint_8dof.h index bc761be08..d7622b696 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_setpoint_8dof.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_setpoint_8dof.h @@ -18,6 +18,9 @@ typedef struct __mavlink_setpoint_8dof_t #define MAVLINK_MSG_ID_SETPOINT_8DOF_LEN 33 #define MAVLINK_MSG_ID_148_LEN 33 +#define MAVLINK_MSG_ID_SETPOINT_8DOF_CRC 241 +#define MAVLINK_MSG_ID_148_CRC 241 + #define MAVLINK_MESSAGE_INFO_SETPOINT_8DOF { \ @@ -57,7 +60,7 @@ static inline uint16_t mavlink_msg_setpoint_8dof_pack(uint8_t system_id, uint8_t uint8_t target_system, float val1, float val2, float val3, float val4, float val5, float val6, float val7, float val8) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[33]; + char buf[MAVLINK_MSG_ID_SETPOINT_8DOF_LEN]; _mav_put_float(buf, 0, val1); _mav_put_float(buf, 4, val2); _mav_put_float(buf, 8, val3); @@ -68,7 +71,7 @@ static inline uint16_t mavlink_msg_setpoint_8dof_pack(uint8_t system_id, uint8_t _mav_put_float(buf, 28, val8); _mav_put_uint8_t(buf, 32, target_system); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SETPOINT_8DOF_LEN); #else mavlink_setpoint_8dof_t packet; packet.val1 = val1; @@ -81,11 +84,15 @@ static inline uint16_t mavlink_msg_setpoint_8dof_pack(uint8_t system_id, uint8_t packet.val8 = val8; packet.target_system = target_system; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SETPOINT_8DOF_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SETPOINT_8DOF; - return mavlink_finalize_message(msg, system_id, component_id, 33, 241); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SETPOINT_8DOF_LEN, MAVLINK_MSG_ID_SETPOINT_8DOF_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SETPOINT_8DOF_LEN); +#endif } /** @@ -110,7 +117,7 @@ static inline uint16_t mavlink_msg_setpoint_8dof_pack_chan(uint8_t system_id, ui uint8_t target_system,float val1,float val2,float val3,float val4,float val5,float val6,float val7,float val8) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[33]; + char buf[MAVLINK_MSG_ID_SETPOINT_8DOF_LEN]; _mav_put_float(buf, 0, val1); _mav_put_float(buf, 4, val2); _mav_put_float(buf, 8, val3); @@ -121,7 +128,7 @@ static inline uint16_t mavlink_msg_setpoint_8dof_pack_chan(uint8_t system_id, ui _mav_put_float(buf, 28, val8); _mav_put_uint8_t(buf, 32, target_system); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SETPOINT_8DOF_LEN); #else mavlink_setpoint_8dof_t packet; packet.val1 = val1; @@ -134,11 +141,15 @@ static inline uint16_t mavlink_msg_setpoint_8dof_pack_chan(uint8_t system_id, ui packet.val8 = val8; packet.target_system = target_system; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SETPOINT_8DOF_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SETPOINT_8DOF; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 33, 241); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SETPOINT_8DOF_LEN, MAVLINK_MSG_ID_SETPOINT_8DOF_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SETPOINT_8DOF_LEN); +#endif } /** @@ -173,7 +184,7 @@ static inline uint16_t mavlink_msg_setpoint_8dof_encode(uint8_t system_id, uint8 static inline void mavlink_msg_setpoint_8dof_send(mavlink_channel_t chan, uint8_t target_system, float val1, float val2, float val3, float val4, float val5, float val6, float val7, float val8) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[33]; + char buf[MAVLINK_MSG_ID_SETPOINT_8DOF_LEN]; _mav_put_float(buf, 0, val1); _mav_put_float(buf, 4, val2); _mav_put_float(buf, 8, val3); @@ -184,7 +195,11 @@ static inline void mavlink_msg_setpoint_8dof_send(mavlink_channel_t chan, uint8_ _mav_put_float(buf, 28, val8); _mav_put_uint8_t(buf, 32, target_system); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SETPOINT_8DOF, buf, 33, 241); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SETPOINT_8DOF, buf, MAVLINK_MSG_ID_SETPOINT_8DOF_LEN, MAVLINK_MSG_ID_SETPOINT_8DOF_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SETPOINT_8DOF, buf, MAVLINK_MSG_ID_SETPOINT_8DOF_LEN); +#endif #else mavlink_setpoint_8dof_t packet; packet.val1 = val1; @@ -197,7 +212,11 @@ static inline void mavlink_msg_setpoint_8dof_send(mavlink_channel_t chan, uint8_ packet.val8 = val8; packet.target_system = target_system; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SETPOINT_8DOF, (const char *)&packet, 33, 241); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SETPOINT_8DOF, (const char *)&packet, MAVLINK_MSG_ID_SETPOINT_8DOF_LEN, MAVLINK_MSG_ID_SETPOINT_8DOF_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SETPOINT_8DOF, (const char *)&packet, MAVLINK_MSG_ID_SETPOINT_8DOF_LEN); +#endif #endif } @@ -315,6 +334,6 @@ static inline void mavlink_msg_setpoint_8dof_decode(const mavlink_message_t* msg setpoint_8dof->val8 = mavlink_msg_setpoint_8dof_get_val8(msg); setpoint_8dof->target_system = mavlink_msg_setpoint_8dof_get_target_system(msg); #else - memcpy(setpoint_8dof, _MAV_PAYLOAD(msg), 33); + memcpy(setpoint_8dof, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SETPOINT_8DOF_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_state_correction.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_state_correction.h index 0f4f1f5e2..8a002fc11 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_state_correction.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_state_correction.h @@ -18,6 +18,9 @@ typedef struct __mavlink_state_correction_t #define MAVLINK_MSG_ID_STATE_CORRECTION_LEN 36 #define MAVLINK_MSG_ID_64_LEN 36 +#define MAVLINK_MSG_ID_STATE_CORRECTION_CRC 130 +#define MAVLINK_MSG_ID_64_CRC 130 + #define MAVLINK_MESSAGE_INFO_STATE_CORRECTION { \ @@ -57,7 +60,7 @@ static inline uint16_t mavlink_msg_state_correction_pack(uint8_t system_id, uint float xErr, float yErr, float zErr, float rollErr, float pitchErr, float yawErr, float vxErr, float vyErr, float vzErr) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; + char buf[MAVLINK_MSG_ID_STATE_CORRECTION_LEN]; _mav_put_float(buf, 0, xErr); _mav_put_float(buf, 4, yErr); _mav_put_float(buf, 8, zErr); @@ -68,7 +71,7 @@ static inline uint16_t mavlink_msg_state_correction_pack(uint8_t system_id, uint _mav_put_float(buf, 28, vyErr); _mav_put_float(buf, 32, vzErr); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_STATE_CORRECTION_LEN); #else mavlink_state_correction_t packet; packet.xErr = xErr; @@ -81,11 +84,15 @@ static inline uint16_t mavlink_msg_state_correction_pack(uint8_t system_id, uint packet.vyErr = vyErr; packet.vzErr = vzErr; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_STATE_CORRECTION_LEN); #endif msg->msgid = MAVLINK_MSG_ID_STATE_CORRECTION; - return mavlink_finalize_message(msg, system_id, component_id, 36, 130); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_STATE_CORRECTION_LEN, MAVLINK_MSG_ID_STATE_CORRECTION_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_STATE_CORRECTION_LEN); +#endif } /** @@ -110,7 +117,7 @@ static inline uint16_t mavlink_msg_state_correction_pack_chan(uint8_t system_id, float xErr,float yErr,float zErr,float rollErr,float pitchErr,float yawErr,float vxErr,float vyErr,float vzErr) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; + char buf[MAVLINK_MSG_ID_STATE_CORRECTION_LEN]; _mav_put_float(buf, 0, xErr); _mav_put_float(buf, 4, yErr); _mav_put_float(buf, 8, zErr); @@ -121,7 +128,7 @@ static inline uint16_t mavlink_msg_state_correction_pack_chan(uint8_t system_id, _mav_put_float(buf, 28, vyErr); _mav_put_float(buf, 32, vzErr); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_STATE_CORRECTION_LEN); #else mavlink_state_correction_t packet; packet.xErr = xErr; @@ -134,11 +141,15 @@ static inline uint16_t mavlink_msg_state_correction_pack_chan(uint8_t system_id, packet.vyErr = vyErr; packet.vzErr = vzErr; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_STATE_CORRECTION_LEN); #endif msg->msgid = MAVLINK_MSG_ID_STATE_CORRECTION; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 36, 130); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_STATE_CORRECTION_LEN, MAVLINK_MSG_ID_STATE_CORRECTION_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_STATE_CORRECTION_LEN); +#endif } /** @@ -173,7 +184,7 @@ static inline uint16_t mavlink_msg_state_correction_encode(uint8_t system_id, ui static inline void mavlink_msg_state_correction_send(mavlink_channel_t chan, float xErr, float yErr, float zErr, float rollErr, float pitchErr, float yawErr, float vxErr, float vyErr, float vzErr) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; + char buf[MAVLINK_MSG_ID_STATE_CORRECTION_LEN]; _mav_put_float(buf, 0, xErr); _mav_put_float(buf, 4, yErr); _mav_put_float(buf, 8, zErr); @@ -184,7 +195,11 @@ static inline void mavlink_msg_state_correction_send(mavlink_channel_t chan, flo _mav_put_float(buf, 28, vyErr); _mav_put_float(buf, 32, vzErr); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATE_CORRECTION, buf, 36, 130); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATE_CORRECTION, buf, MAVLINK_MSG_ID_STATE_CORRECTION_LEN, MAVLINK_MSG_ID_STATE_CORRECTION_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATE_CORRECTION, buf, MAVLINK_MSG_ID_STATE_CORRECTION_LEN); +#endif #else mavlink_state_correction_t packet; packet.xErr = xErr; @@ -197,7 +212,11 @@ static inline void mavlink_msg_state_correction_send(mavlink_channel_t chan, flo packet.vyErr = vyErr; packet.vzErr = vzErr; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATE_CORRECTION, (const char *)&packet, 36, 130); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATE_CORRECTION, (const char *)&packet, MAVLINK_MSG_ID_STATE_CORRECTION_LEN, MAVLINK_MSG_ID_STATE_CORRECTION_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATE_CORRECTION, (const char *)&packet, MAVLINK_MSG_ID_STATE_CORRECTION_LEN); +#endif #endif } @@ -315,6 +334,6 @@ static inline void mavlink_msg_state_correction_decode(const mavlink_message_t* state_correction->vyErr = mavlink_msg_state_correction_get_vyErr(msg); state_correction->vzErr = mavlink_msg_state_correction_get_vzErr(msg); #else - memcpy(state_correction, _MAV_PAYLOAD(msg), 36); + memcpy(state_correction, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_STATE_CORRECTION_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_statustext.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_statustext.h index 7c65d448f..103486863 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_statustext.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_statustext.h @@ -11,6 +11,9 @@ typedef struct __mavlink_statustext_t #define MAVLINK_MSG_ID_STATUSTEXT_LEN 51 #define MAVLINK_MSG_ID_253_LEN 51 +#define MAVLINK_MSG_ID_STATUSTEXT_CRC 83 +#define MAVLINK_MSG_ID_253_CRC 83 + #define MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN 50 #define MAVLINK_MESSAGE_INFO_STATUSTEXT { \ @@ -36,19 +39,23 @@ static inline uint16_t mavlink_msg_statustext_pack(uint8_t system_id, uint8_t co uint8_t severity, const char *text) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[51]; + char buf[MAVLINK_MSG_ID_STATUSTEXT_LEN]; _mav_put_uint8_t(buf, 0, severity); _mav_put_char_array(buf, 1, text, 50); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 51); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_STATUSTEXT_LEN); #else mavlink_statustext_t packet; packet.severity = severity; mav_array_memcpy(packet.text, text, sizeof(char)*50); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 51); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_STATUSTEXT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_STATUSTEXT; - return mavlink_finalize_message(msg, system_id, component_id, 51, 83); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_STATUSTEXT_LEN); +#endif } /** @@ -66,19 +73,23 @@ static inline uint16_t mavlink_msg_statustext_pack_chan(uint8_t system_id, uint8 uint8_t severity,const char *text) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[51]; + char buf[MAVLINK_MSG_ID_STATUSTEXT_LEN]; _mav_put_uint8_t(buf, 0, severity); _mav_put_char_array(buf, 1, text, 50); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 51); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_STATUSTEXT_LEN); #else mavlink_statustext_t packet; packet.severity = severity; mav_array_memcpy(packet.text, text, sizeof(char)*50); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 51); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_STATUSTEXT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_STATUSTEXT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 51, 83); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_STATUSTEXT_LEN); +#endif } /** @@ -106,15 +117,23 @@ static inline uint16_t mavlink_msg_statustext_encode(uint8_t system_id, uint8_t static inline void mavlink_msg_statustext_send(mavlink_channel_t chan, uint8_t severity, const char *text) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[51]; + char buf[MAVLINK_MSG_ID_STATUSTEXT_LEN]; _mav_put_uint8_t(buf, 0, severity); _mav_put_char_array(buf, 1, text, 50); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, buf, 51, 83); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, buf, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, buf, MAVLINK_MSG_ID_STATUSTEXT_LEN); +#endif #else mavlink_statustext_t packet; packet.severity = severity; mav_array_memcpy(packet.text, text, sizeof(char)*50); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (const char *)&packet, 51, 83); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (const char *)&packet, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (const char *)&packet, MAVLINK_MSG_ID_STATUSTEXT_LEN); +#endif #endif } @@ -155,6 +174,6 @@ static inline void mavlink_msg_statustext_decode(const mavlink_message_t* msg, m statustext->severity = mavlink_msg_statustext_get_severity(msg); mavlink_msg_statustext_get_text(msg, statustext->text); #else - memcpy(statustext, _MAV_PAYLOAD(msg), 51); + memcpy(statustext, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_STATUSTEXT_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_sys_status.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_sys_status.h index ef09a652f..916bc4f07 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_sys_status.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_sys_status.h @@ -22,6 +22,9 @@ typedef struct __mavlink_sys_status_t #define MAVLINK_MSG_ID_SYS_STATUS_LEN 31 #define MAVLINK_MSG_ID_1_LEN 31 +#define MAVLINK_MSG_ID_SYS_STATUS_CRC 124 +#define MAVLINK_MSG_ID_1_CRC 124 + #define MAVLINK_MESSAGE_INFO_SYS_STATUS { \ @@ -69,7 +72,7 @@ static inline uint16_t mavlink_msg_sys_status_pack(uint8_t system_id, uint8_t co uint32_t onboard_control_sensors_present, uint32_t onboard_control_sensors_enabled, uint32_t onboard_control_sensors_health, uint16_t load, uint16_t voltage_battery, int16_t current_battery, int8_t battery_remaining, uint16_t drop_rate_comm, uint16_t errors_comm, uint16_t errors_count1, uint16_t errors_count2, uint16_t errors_count3, uint16_t errors_count4) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[31]; + char buf[MAVLINK_MSG_ID_SYS_STATUS_LEN]; _mav_put_uint32_t(buf, 0, onboard_control_sensors_present); _mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled); _mav_put_uint32_t(buf, 8, onboard_control_sensors_health); @@ -84,7 +87,7 @@ static inline uint16_t mavlink_msg_sys_status_pack(uint8_t system_id, uint8_t co _mav_put_uint16_t(buf, 28, errors_count4); _mav_put_int8_t(buf, 30, battery_remaining); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 31); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SYS_STATUS_LEN); #else mavlink_sys_status_t packet; packet.onboard_control_sensors_present = onboard_control_sensors_present; @@ -101,11 +104,15 @@ static inline uint16_t mavlink_msg_sys_status_pack(uint8_t system_id, uint8_t co packet.errors_count4 = errors_count4; packet.battery_remaining = battery_remaining; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 31); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SYS_STATUS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SYS_STATUS; - return mavlink_finalize_message(msg, system_id, component_id, 31, 124); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SYS_STATUS_LEN); +#endif } /** @@ -134,7 +141,7 @@ static inline uint16_t mavlink_msg_sys_status_pack_chan(uint8_t system_id, uint8 uint32_t onboard_control_sensors_present,uint32_t onboard_control_sensors_enabled,uint32_t onboard_control_sensors_health,uint16_t load,uint16_t voltage_battery,int16_t current_battery,int8_t battery_remaining,uint16_t drop_rate_comm,uint16_t errors_comm,uint16_t errors_count1,uint16_t errors_count2,uint16_t errors_count3,uint16_t errors_count4) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[31]; + char buf[MAVLINK_MSG_ID_SYS_STATUS_LEN]; _mav_put_uint32_t(buf, 0, onboard_control_sensors_present); _mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled); _mav_put_uint32_t(buf, 8, onboard_control_sensors_health); @@ -149,7 +156,7 @@ static inline uint16_t mavlink_msg_sys_status_pack_chan(uint8_t system_id, uint8 _mav_put_uint16_t(buf, 28, errors_count4); _mav_put_int8_t(buf, 30, battery_remaining); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 31); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SYS_STATUS_LEN); #else mavlink_sys_status_t packet; packet.onboard_control_sensors_present = onboard_control_sensors_present; @@ -166,11 +173,15 @@ static inline uint16_t mavlink_msg_sys_status_pack_chan(uint8_t system_id, uint8 packet.errors_count4 = errors_count4; packet.battery_remaining = battery_remaining; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 31); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SYS_STATUS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SYS_STATUS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 31, 124); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SYS_STATUS_LEN); +#endif } /** @@ -209,7 +220,7 @@ static inline uint16_t mavlink_msg_sys_status_encode(uint8_t system_id, uint8_t static inline void mavlink_msg_sys_status_send(mavlink_channel_t chan, uint32_t onboard_control_sensors_present, uint32_t onboard_control_sensors_enabled, uint32_t onboard_control_sensors_health, uint16_t load, uint16_t voltage_battery, int16_t current_battery, int8_t battery_remaining, uint16_t drop_rate_comm, uint16_t errors_comm, uint16_t errors_count1, uint16_t errors_count2, uint16_t errors_count3, uint16_t errors_count4) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[31]; + char buf[MAVLINK_MSG_ID_SYS_STATUS_LEN]; _mav_put_uint32_t(buf, 0, onboard_control_sensors_present); _mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled); _mav_put_uint32_t(buf, 8, onboard_control_sensors_health); @@ -224,7 +235,11 @@ static inline void mavlink_msg_sys_status_send(mavlink_channel_t chan, uint32_t _mav_put_uint16_t(buf, 28, errors_count4); _mav_put_int8_t(buf, 30, battery_remaining); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, buf, 31, 124); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, buf, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, buf, MAVLINK_MSG_ID_SYS_STATUS_LEN); +#endif #else mavlink_sys_status_t packet; packet.onboard_control_sensors_present = onboard_control_sensors_present; @@ -241,7 +256,11 @@ static inline void mavlink_msg_sys_status_send(mavlink_channel_t chan, uint32_t packet.errors_count4 = errors_count4; packet.battery_remaining = battery_remaining; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, (const char *)&packet, 31, 124); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_SYS_STATUS_LEN); +#endif #endif } @@ -403,6 +422,6 @@ static inline void mavlink_msg_sys_status_decode(const mavlink_message_t* msg, m sys_status->errors_count4 = mavlink_msg_sys_status_get_errors_count4(msg); sys_status->battery_remaining = mavlink_msg_sys_status_get_battery_remaining(msg); #else - memcpy(sys_status, _MAV_PAYLOAD(msg), 31); + memcpy(sys_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SYS_STATUS_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_system_time.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_system_time.h index c24808d1a..b235fe205 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_system_time.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_system_time.h @@ -11,6 +11,9 @@ typedef struct __mavlink_system_time_t #define MAVLINK_MSG_ID_SYSTEM_TIME_LEN 12 #define MAVLINK_MSG_ID_2_LEN 12 +#define MAVLINK_MSG_ID_SYSTEM_TIME_CRC 137 +#define MAVLINK_MSG_ID_2_CRC 137 + #define MAVLINK_MESSAGE_INFO_SYSTEM_TIME { \ @@ -36,21 +39,25 @@ static inline uint16_t mavlink_msg_system_time_pack(uint8_t system_id, uint8_t c uint64_t time_unix_usec, uint32_t time_boot_ms) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; + char buf[MAVLINK_MSG_ID_SYSTEM_TIME_LEN]; _mav_put_uint64_t(buf, 0, time_unix_usec); _mav_put_uint32_t(buf, 8, time_boot_ms); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); #else mavlink_system_time_t packet; packet.time_unix_usec = time_unix_usec; packet.time_boot_ms = time_boot_ms; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME; - return mavlink_finalize_message(msg, system_id, component_id, 12, 137); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); +#endif } /** @@ -68,21 +75,25 @@ static inline uint16_t mavlink_msg_system_time_pack_chan(uint8_t system_id, uint uint64_t time_unix_usec,uint32_t time_boot_ms) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; + char buf[MAVLINK_MSG_ID_SYSTEM_TIME_LEN]; _mav_put_uint64_t(buf, 0, time_unix_usec); _mav_put_uint32_t(buf, 8, time_boot_ms); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); #else mavlink_system_time_t packet; packet.time_unix_usec = time_unix_usec; packet.time_boot_ms = time_boot_ms; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 137); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); +#endif } /** @@ -110,17 +121,25 @@ static inline uint16_t mavlink_msg_system_time_encode(uint8_t system_id, uint8_t static inline void mavlink_msg_system_time_send(mavlink_channel_t chan, uint64_t time_unix_usec, uint32_t time_boot_ms) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; + char buf[MAVLINK_MSG_ID_SYSTEM_TIME_LEN]; _mav_put_uint64_t(buf, 0, time_unix_usec); _mav_put_uint32_t(buf, 8, time_boot_ms); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, buf, 12, 137); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); +#endif #else mavlink_system_time_t packet; packet.time_unix_usec = time_unix_usec; packet.time_boot_ms = time_boot_ms; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (const char *)&packet, 12, 137); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (const char *)&packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (const char *)&packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); +#endif #endif } @@ -161,6 +180,6 @@ static inline void mavlink_msg_system_time_decode(const mavlink_message_t* msg, system_time->time_unix_usec = mavlink_msg_system_time_get_time_unix_usec(msg); system_time->time_boot_ms = mavlink_msg_system_time_get_time_boot_ms(msg); #else - memcpy(system_time, _MAV_PAYLOAD(msg), 12); + memcpy(system_time, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SYSTEM_TIME_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_vfr_hud.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_vfr_hud.h index d7c1afe41..9d459921f 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_vfr_hud.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_vfr_hud.h @@ -15,6 +15,9 @@ typedef struct __mavlink_vfr_hud_t #define MAVLINK_MSG_ID_VFR_HUD_LEN 20 #define MAVLINK_MSG_ID_74_LEN 20 +#define MAVLINK_MSG_ID_VFR_HUD_CRC 20 +#define MAVLINK_MSG_ID_74_CRC 20 + #define MAVLINK_MESSAGE_INFO_VFR_HUD { \ @@ -48,7 +51,7 @@ static inline uint16_t mavlink_msg_vfr_hud_pack(uint8_t system_id, uint8_t compo float airspeed, float groundspeed, int16_t heading, uint16_t throttle, float alt, float climb) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_VFR_HUD_LEN]; _mav_put_float(buf, 0, airspeed); _mav_put_float(buf, 4, groundspeed); _mav_put_float(buf, 8, alt); @@ -56,7 +59,7 @@ static inline uint16_t mavlink_msg_vfr_hud_pack(uint8_t system_id, uint8_t compo _mav_put_int16_t(buf, 16, heading); _mav_put_uint16_t(buf, 18, throttle); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VFR_HUD_LEN); #else mavlink_vfr_hud_t packet; packet.airspeed = airspeed; @@ -66,11 +69,15 @@ static inline uint16_t mavlink_msg_vfr_hud_pack(uint8_t system_id, uint8_t compo packet.heading = heading; packet.throttle = throttle; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VFR_HUD_LEN); #endif msg->msgid = MAVLINK_MSG_ID_VFR_HUD; - return mavlink_finalize_message(msg, system_id, component_id, 20, 20); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VFR_HUD_LEN); +#endif } /** @@ -92,7 +99,7 @@ static inline uint16_t mavlink_msg_vfr_hud_pack_chan(uint8_t system_id, uint8_t float airspeed,float groundspeed,int16_t heading,uint16_t throttle,float alt,float climb) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_VFR_HUD_LEN]; _mav_put_float(buf, 0, airspeed); _mav_put_float(buf, 4, groundspeed); _mav_put_float(buf, 8, alt); @@ -100,7 +107,7 @@ static inline uint16_t mavlink_msg_vfr_hud_pack_chan(uint8_t system_id, uint8_t _mav_put_int16_t(buf, 16, heading); _mav_put_uint16_t(buf, 18, throttle); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VFR_HUD_LEN); #else mavlink_vfr_hud_t packet; packet.airspeed = airspeed; @@ -110,11 +117,15 @@ static inline uint16_t mavlink_msg_vfr_hud_pack_chan(uint8_t system_id, uint8_t packet.heading = heading; packet.throttle = throttle; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VFR_HUD_LEN); #endif msg->msgid = MAVLINK_MSG_ID_VFR_HUD; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 20, 20); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VFR_HUD_LEN); +#endif } /** @@ -146,7 +157,7 @@ static inline uint16_t mavlink_msg_vfr_hud_encode(uint8_t system_id, uint8_t com static inline void mavlink_msg_vfr_hud_send(mavlink_channel_t chan, float airspeed, float groundspeed, int16_t heading, uint16_t throttle, float alt, float climb) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_VFR_HUD_LEN]; _mav_put_float(buf, 0, airspeed); _mav_put_float(buf, 4, groundspeed); _mav_put_float(buf, 8, alt); @@ -154,7 +165,11 @@ static inline void mavlink_msg_vfr_hud_send(mavlink_channel_t chan, float airspe _mav_put_int16_t(buf, 16, heading); _mav_put_uint16_t(buf, 18, throttle); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, buf, 20, 20); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, buf, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, buf, MAVLINK_MSG_ID_VFR_HUD_LEN); +#endif #else mavlink_vfr_hud_t packet; packet.airspeed = airspeed; @@ -164,7 +179,11 @@ static inline void mavlink_msg_vfr_hud_send(mavlink_channel_t chan, float airspe packet.heading = heading; packet.throttle = throttle; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, (const char *)&packet, 20, 20); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, (const char *)&packet, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, (const char *)&packet, MAVLINK_MSG_ID_VFR_HUD_LEN); +#endif #endif } @@ -249,6 +268,6 @@ static inline void mavlink_msg_vfr_hud_decode(const mavlink_message_t* msg, mavl vfr_hud->heading = mavlink_msg_vfr_hud_get_heading(msg); vfr_hud->throttle = mavlink_msg_vfr_hud_get_throttle(msg); #else - memcpy(vfr_hud, _MAV_PAYLOAD(msg), 20); + memcpy(vfr_hud, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_VFR_HUD_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_vicon_position_estimate.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_vicon_position_estimate.h index 93ad097f9..75e4b5b7a 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_vicon_position_estimate.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_vicon_position_estimate.h @@ -16,6 +16,9 @@ typedef struct __mavlink_vicon_position_estimate_t #define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN 32 #define MAVLINK_MSG_ID_104_LEN 32 +#define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC 56 +#define MAVLINK_MSG_ID_104_CRC 56 + #define MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE { \ @@ -51,7 +54,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_i uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; + char buf[MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN]; _mav_put_uint64_t(buf, 0, usec); _mav_put_float(buf, 8, x); _mav_put_float(buf, 12, y); @@ -60,7 +63,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_i _mav_put_float(buf, 24, pitch); _mav_put_float(buf, 28, yaw); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); #else mavlink_vicon_position_estimate_t packet; packet.usec = usec; @@ -71,11 +74,15 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_i packet.pitch = pitch; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE; - return mavlink_finalize_message(msg, system_id, component_id, 32, 56); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); +#endif } /** @@ -98,7 +105,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack_chan(uint8_t sys uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; + char buf[MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN]; _mav_put_uint64_t(buf, 0, usec); _mav_put_float(buf, 8, x); _mav_put_float(buf, 12, y); @@ -107,7 +114,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack_chan(uint8_t sys _mav_put_float(buf, 24, pitch); _mav_put_float(buf, 28, yaw); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); #else mavlink_vicon_position_estimate_t packet; packet.usec = usec; @@ -118,11 +125,15 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack_chan(uint8_t sys packet.pitch = pitch; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 56); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); +#endif } /** @@ -155,7 +166,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_encode(uint8_t system static inline void mavlink_msg_vicon_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; + char buf[MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN]; _mav_put_uint64_t(buf, 0, usec); _mav_put_float(buf, 8, x); _mav_put_float(buf, 12, y); @@ -164,7 +175,11 @@ static inline void mavlink_msg_vicon_position_estimate_send(mavlink_channel_t ch _mav_put_float(buf, 24, pitch); _mav_put_float(buf, 28, yaw); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, buf, 32, 56); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); +#endif #else mavlink_vicon_position_estimate_t packet; packet.usec = usec; @@ -175,7 +190,11 @@ static inline void mavlink_msg_vicon_position_estimate_send(mavlink_channel_t ch packet.pitch = pitch; packet.yaw = yaw; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)&packet, 32, 56); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); +#endif #endif } @@ -271,6 +290,6 @@ static inline void mavlink_msg_vicon_position_estimate_decode(const mavlink_mess vicon_position_estimate->pitch = mavlink_msg_vicon_position_estimate_get_pitch(msg); vicon_position_estimate->yaw = mavlink_msg_vicon_position_estimate_get_yaw(msg); #else - memcpy(vicon_position_estimate, _MAV_PAYLOAD(msg), 32); + memcpy(vicon_position_estimate, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_vision_position_estimate.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_vision_position_estimate.h index ca567c119..47ccb11ec 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_vision_position_estimate.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_vision_position_estimate.h @@ -16,6 +16,9 @@ typedef struct __mavlink_vision_position_estimate_t #define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN 32 #define MAVLINK_MSG_ID_102_LEN 32 +#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC 158 +#define MAVLINK_MSG_ID_102_CRC 158 + #define MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE { \ @@ -51,7 +54,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_ uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; + char buf[MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN]; _mav_put_uint64_t(buf, 0, usec); _mav_put_float(buf, 8, x); _mav_put_float(buf, 12, y); @@ -60,7 +63,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_ _mav_put_float(buf, 24, pitch); _mav_put_float(buf, 28, yaw); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); #else mavlink_vision_position_estimate_t packet; packet.usec = usec; @@ -71,11 +74,15 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_ packet.pitch = pitch; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE; - return mavlink_finalize_message(msg, system_id, component_id, 32, 158); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); +#endif } /** @@ -98,7 +105,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack_chan(uint8_t sy uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; + char buf[MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN]; _mav_put_uint64_t(buf, 0, usec); _mav_put_float(buf, 8, x); _mav_put_float(buf, 12, y); @@ -107,7 +114,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack_chan(uint8_t sy _mav_put_float(buf, 24, pitch); _mav_put_float(buf, 28, yaw); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); #else mavlink_vision_position_estimate_t packet; packet.usec = usec; @@ -118,11 +125,15 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack_chan(uint8_t sy packet.pitch = pitch; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 158); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); +#endif } /** @@ -155,7 +166,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_encode(uint8_t syste static inline void mavlink_msg_vision_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; + char buf[MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN]; _mav_put_uint64_t(buf, 0, usec); _mav_put_float(buf, 8, x); _mav_put_float(buf, 12, y); @@ -164,7 +175,11 @@ static inline void mavlink_msg_vision_position_estimate_send(mavlink_channel_t c _mav_put_float(buf, 24, pitch); _mav_put_float(buf, 28, yaw); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, buf, 32, 158); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); +#endif #else mavlink_vision_position_estimate_t packet; packet.usec = usec; @@ -175,7 +190,11 @@ static inline void mavlink_msg_vision_position_estimate_send(mavlink_channel_t c packet.pitch = pitch; packet.yaw = yaw; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, (const char *)&packet, 32, 158); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); +#endif #endif } @@ -271,6 +290,6 @@ static inline void mavlink_msg_vision_position_estimate_decode(const mavlink_mes vision_position_estimate->pitch = mavlink_msg_vision_position_estimate_get_pitch(msg); vision_position_estimate->yaw = mavlink_msg_vision_position_estimate_get_yaw(msg); #else - memcpy(vision_position_estimate, _MAV_PAYLOAD(msg), 32); + memcpy(vision_position_estimate, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_vision_speed_estimate.h b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_vision_speed_estimate.h index 10ec1026c..c38eee62c 100644 --- a/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_vision_speed_estimate.h +++ b/src/GCS_MAVLink/include_v1.0/common/mavlink_msg_vision_speed_estimate.h @@ -13,6 +13,9 @@ typedef struct __mavlink_vision_speed_estimate_t #define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN 20 #define MAVLINK_MSG_ID_103_LEN 20 +#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC 208 +#define MAVLINK_MSG_ID_103_CRC 208 + #define MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE { \ @@ -42,13 +45,13 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id, uint64_t usec, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN]; _mav_put_uint64_t(buf, 0, usec); _mav_put_float(buf, 8, x); _mav_put_float(buf, 12, y); _mav_put_float(buf, 16, z); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); #else mavlink_vision_speed_estimate_t packet; packet.usec = usec; @@ -56,11 +59,15 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id, packet.y = y; packet.z = z; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE; - return mavlink_finalize_message(msg, system_id, component_id, 20, 208); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); +#endif } /** @@ -80,13 +87,13 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint8_t syste uint64_t usec,float x,float y,float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN]; _mav_put_uint64_t(buf, 0, usec); _mav_put_float(buf, 8, x); _mav_put_float(buf, 12, y); _mav_put_float(buf, 16, z); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); #else mavlink_vision_speed_estimate_t packet; packet.usec = usec; @@ -94,11 +101,15 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint8_t syste packet.y = y; packet.z = z; - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 20, 208); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); +#endif } /** @@ -128,13 +139,17 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_encode(uint8_t system_i static inline void mavlink_msg_vision_speed_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; + char buf[MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN]; _mav_put_uint64_t(buf, 0, usec); _mav_put_float(buf, 8, x); _mav_put_float(buf, 12, y); _mav_put_float(buf, 16, z); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, buf, 20, 208); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); +#endif #else mavlink_vision_speed_estimate_t packet; packet.usec = usec; @@ -142,7 +157,11 @@ static inline void mavlink_msg_vision_speed_estimate_send(mavlink_channel_t chan packet.y = y; packet.z = z; - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)&packet, 20, 208); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); +#endif #endif } @@ -205,6 +224,6 @@ static inline void mavlink_msg_vision_speed_estimate_decode(const mavlink_messag vision_speed_estimate->y = mavlink_msg_vision_speed_estimate_get_y(msg); vision_speed_estimate->z = mavlink_msg_vision_speed_estimate_get_z(msg); #else - memcpy(vision_speed_estimate, _MAV_PAYLOAD(msg), 20); + memcpy(vision_speed_estimate, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); #endif } diff --git a/src/GCS_MAVLink/include_v1.0/common/version.h b/src/GCS_MAVLink/include_v1.0/common/version.h index f5dfa5b3f..81ac98ed8 100644 --- a/src/GCS_MAVLink/include_v1.0/common/version.h +++ b/src/GCS_MAVLink/include_v1.0/common/version.h @@ -5,7 +5,7 @@ #ifndef MAVLINK_VERSION_H #define MAVLINK_VERSION_H -#define MAVLINK_BUILD_DATE "Thu Apr 4 18:57:14 2013" +#define MAVLINK_BUILD_DATE "Mon May 20 23:07:04 2013" #define MAVLINK_WIRE_PROTOCOL_VERSION "1.0" #define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 254 diff --git a/src/GCS_MAVLink/include_v1.0/mavlink_helpers.h b/src/GCS_MAVLink/include_v1.0/mavlink_helpers.h index f41b36883..f3e49e88a 100644 --- a/src/GCS_MAVLink/include_v1.0/mavlink_helpers.h +++ b/src/GCS_MAVLink/include_v1.0/mavlink_helpers.h @@ -550,7 +550,7 @@ MAVLINK_HELPER void _mavlink_send_uart(mavlink_channel_t chan, const char *buf, #ifdef MAVLINK_SEND_UART_BYTES /* this is the more efficient approach, if the platform defines it */ - MAVLINK_SEND_UART_BYTES(chan, (uint8_t *)buf, len); + MAVLINK_SEND_UART_BYTES(chan, (const uint8_t *)buf, len); #else /* fallback to one byte at a time */ uint16_t i; diff --git a/src/GCS_MAVLink/include_v1.0/mavlink_types.h b/src/GCS_MAVLink/include_v1.0/mavlink_types.h index 5fbde97f7..6724e49f1 100644 --- a/src/GCS_MAVLink/include_v1.0/mavlink_types.h +++ b/src/GCS_MAVLink/include_v1.0/mavlink_types.h @@ -33,6 +33,9 @@ typedef struct param_union { float param_float; int32_t param_int32; uint32_t param_uint32; + int16_t param_int16; + uint16_t param_uint16; + int8_t param_int8; uint8_t param_uint8; uint8_t bytes[4]; }; diff --git a/src/GCS_MAVLink/include_v1.0/protocol.h b/src/GCS_MAVLink/include_v1.0/protocol.h index 64dc22229..ddacae59c 100644 --- a/src/GCS_MAVLink/include_v1.0/protocol.h +++ b/src/GCS_MAVLink/include_v1.0/protocol.h @@ -60,7 +60,9 @@ MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t* msg, ui uint8_t chan, uint8_t length); MAVLINK_HELPER uint16_t mavlink_finalize_message(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, uint8_t length); +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS MAVLINK_HELPER void _mav_finalize_message_chan_send(mavlink_channel_t chan, uint8_t msgid, const char *packet, uint8_t length); +#endif #endif // MAVLINK_CRC_EXTRA MAVLINK_HELPER uint16_t mavlink_msg_to_send_buffer(uint8_t *buffer, const mavlink_message_t *msg); MAVLINK_HELPER void mavlink_start_checksum(mavlink_message_t* msg); diff --git a/src/GCS_MAVLink/message_definitions/ardupilotmega.xml b/src/GCS_MAVLink/message_definitions/ardupilotmega.xml deleted file mode 100644 index 3a71c6c7c..000000000 --- a/src/GCS_MAVLink/message_definitions/ardupilotmega.xml +++ /dev/null @@ -1,229 +0,0 @@ - - - common.xml - - - - - - - Enumeration of possible mount operation modes - Load and keep safe position (Roll,Pitch,Yaw) from EEPROM and stop stabilization - Load and keep neutral position (Roll,Pitch,Yaw) from EEPROM. - Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization - Load neutral position and start RC Roll,Pitch,Yaw control with stabilization - Load neutral position and start to point to Lat,Lon,Alt - - - - - - Mission command to configure an on-board camera controller system. - Modes: P, TV, AV, M, Etc - Shutter speed: Divisor number for one second - Aperture: F stop number - ISO number e.g. 80, 100, 200, Etc - Exposure type enumerator - Command Identity - Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) - - - - Mission command to control an on-board camera controller system. - Session control e.g. show/hide lens - Zoom's absolute position - Zooming step value to offset zoom from the current position - Focus Locking, Unlocking or Re-locking - Shooting Command - Command Identity - Empty - - - - - Mission command to configure a camera or antenna mount - Mount operation mode (see MAV_MOUNT_MODE enum) - stabilize roll? (1 = yes, 0 = no) - stabilize pitch? (1 = yes, 0 = no) - stabilize yaw? (1 = yes, 0 = no) - Empty - Empty - Empty - - - - Mission command to control a camera or antenna mount - pitch(deg*100) or lat, depending on mount mode. - roll(deg*100) or lon depending on mount mode - yaw(deg*100) or alt (in cm) depending on mount mode - Empty - Empty - Empty - Empty - - - - - - - Disable fenced mode - - - Switched to guided mode to return point (fence point 0) - - - - - - No last fence breach - - - Breached minimum altitude - - - Breached minimum altitude - - - Breached fence boundary - - - - - - - Offsets and calibrations values for hardware - sensors. This makes it easier to debug the calibration process. - magnetometer X offset - magnetometer Y offset - magnetometer Z offset - magnetic declination (radians) - raw pressure from barometer - raw temperature from barometer - gyro X calibration - gyro Y calibration - gyro Z calibration - accel X calibration - accel Y calibration - accel Z calibration - - - - set the magnetometer offsets - System ID - Component ID - magnetometer X offset - magnetometer Y offset - magnetometer Z offset - - - - state of APM memory - heap top - free memory - - - - raw ADC output - ADC output 1 - ADC output 2 - ADC output 3 - ADC output 4 - ADC output 5 - ADC output 6 - - - - - Configure on-board Camera Control System. - System ID - Component ID - Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) - Divisor number //e.g. 1000 means 1/1000 (0 means ignore) - F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) - ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) - Exposure type enumeration from 1 to N (0 means ignore) - Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once - Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) - Extra parameters enumeration (0 means ignore) - Correspondent value to given extra_param - - - - Control on-board Camera Control System to take shots. - System ID - Component ID - 0: stop, 1: start or keep it up //Session control e.g. show/hide lens - 1 to N //Zoom's absolute position (0 means ignore) - -100 to 100 //Zooming step value to offset zoom from the current position - 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus - 0: ignore, 1: shot or start filming - Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once - Extra parameters enumeration (0 means ignore) - Correspondent value to given extra_param - - - - - Message to configure a camera mount, directional antenna, etc. - System ID - Component ID - mount operating mode (see MAV_MOUNT_MODE enum) - (1 = yes, 0 = no) - (1 = yes, 0 = no) - (1 = yes, 0 = no) - - - - Message to control a camera mount, directional antenna, etc. - System ID - Component ID - pitch(deg*100) or lat, depending on mount mode - roll(deg*100) or lon depending on mount mode - yaw(deg*100) or alt (in cm) depending on mount mode - if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) - - - - Message with some status from APM to GCS about camera or antenna mount - System ID - Component ID - pitch(deg*100) or lat, depending on mount mode - roll(deg*100) or lon depending on mount mode - yaw(deg*100) or alt (in cm) depending on mount mode - - - - - A fence point. Used to set a point when from - GCS -> MAV. Also used to return a point from MAV -> GCS - System ID - Component ID - point index (first point is 1, 0 is for return point) - total number of points (for sanity checking) - Latitude of point - Longitude of point - - - - Request a current fence point from MAV - System ID - Component ID - point index (first point is 1, 0 is for return point) - - - - Status of geo-fencing. Sent in extended - status stream when fencing enabled - 0 if currently inside fence, 1 if outside - number of fence breaches - last breach type (see FENCE_BREACH_* enum) - time of last breach in milliseconds since boot - - - diff --git a/src/GCS_MAVLink/message_definitions/common.xml b/src/GCS_MAVLink/message_definitions/common.xml deleted file mode 100644 index dd4ea8443..000000000 --- a/src/GCS_MAVLink/message_definitions/common.xml +++ /dev/null @@ -1,941 +0,0 @@ - - - 2 - - - Commands to be executed by the MAV. They can be executed on user request, - or as part of a mission script. If the action is used in a mission, the parameter mapping - to the waypoint/mission message is as follows: - Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what - ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. - - Navigate to waypoint. - Hold time in decimal seconds. (ignored by fixed wing, time to stay at waypoint for rotary wing) - Acceptance radius in meters (if the sphere with this radius is hit, the waypoint counts as reached) - 0 to pass through the WP, if > 0 radius in meters to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control. - Desired yaw angle at waypoint (rotary wing) - Latitude - Longitude - Altitude - - - Loiter around this waypoint an unlimited amount of time - Empty - Empty - Radius around waypoint, in meters. If positive loiter clockwise, else counter-clockwise - Desired yaw angle. - Latitude - Longitude - Altitude - - - Loiter around this waypoint for X turns - Turns - Empty - Radius around waypoint, in meters. If positive loiter clockwise, else counter-clockwise - Desired yaw angle. - Latitude - Longitude - Altitude - - - Loiter around this waypoint for X seconds - Seconds (decimal) - Empty - Radius around waypoint, in meters. If positive loiter clockwise, else counter-clockwise - Desired yaw angle. - Latitude - Longitude - Altitude - - - Return to launch location - Empty - Empty - Empty - Empty - Empty - Empty - Empty - - - Land at location - Empty - Empty - Empty - Desired yaw angle. - Latitude - Longitude - Altitude - - - Takeoff from ground / hand - Minimum pitch (if airspeed sensor present), desired pitch without sensor - Empty - Empty - Yaw angle (if magnetometer present), ignored without magnetometer - Latitude - Longitude - Altitude - - - Sets the region of interest (ROI) for a sensor set or the - vehicle itself. This can then be used by the vehicles control - system to control the vehicle attitude and the attitude of various - sensors such as cameras. - Region of intereset mode. (see MAV_ROI enum) - Waypoint index/ target ID. (see MAV_ROI enum) - ROI index (allows a vehicle to manage multiple ROI's) - Empty - x the location of the fixed ROI (see MAV_FRAME) - y - z - - - Control autonomous path planning on the MAV. - 0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning - 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid - Empty - Yaw angle at goal, in compass degrees, [0..360] - Latitude/X of goal - Longitude/Y of goal - Altitude/Z of goal - - - NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration - Empty - Empty - Empty - Empty - Empty - Empty - Empty - - - Delay mission state machine. - Delay in seconds (decimal) - Empty - Empty - Empty - Empty - Empty - Empty - - - Ascend/descend at rate. Delay mission state machine until desired altitude reached. - Descent / Ascend rate (m/s) - Empty - Empty - Empty - Empty - Empty - Finish Altitude - - - Delay mission state machine until within desired distance of next NAV point. - Distance (meters) - Empty - Empty - Empty - Empty - Empty - Empty - - - Reach a certain target angle. - target angle: [0-360], 0 is north - speed during yaw change:[deg per second] - direction: negative: counter clockwise, positive: clockwise [-1,1] - relative offset or absolute angle: [ 1,0] - Empty - Empty - Empty - - - NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration - Empty - Empty - Empty - Empty - Empty - Empty - Empty - - - Set system mode. - Mode, as defined by ENUM MAV_MODE - Empty - Empty - Empty - Empty - Empty - Empty - - - Jump to the desired command in the mission list. Repeat this action only the specified number of times - Sequence number - Repeat count - Empty - Empty - Empty - Empty - Empty - - - Change speed and/or throttle set points. - Speed type (0=Airspeed, 1=Ground Speed) - Speed (m/s, -1 indicates no change) - Throttle ( Percent, -1 indicates no change) - Empty - Empty - Empty - Empty - - - Changes the home location either to the current location or a specified location. - Use current (1=use current location, 0=use specified location) - Empty - Empty - Empty - Latitude - Longitude - Altitude - - - Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. - Parameter number - Parameter value - Empty - Empty - Empty - Empty - Empty - - - Set a relay to a condition. - Relay number - Setting (1=on, 0=off, others possible depending on system hardware) - Empty - Empty - Empty - Empty - Empty - - - Cycle a relay on and off for a desired number of cyles with a desired period. - Relay number - Cycle count - Cycle time (seconds, decimal) - Empty - Empty - Empty - Empty - - - Set a servo to a desired PWM value. - Servo number - PWM (microseconds, 1000 to 2000 typical) - Empty - Empty - Empty - Empty - Empty - - - Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. - Servo number - PWM (microseconds, 1000 to 2000 typical) - Cycle count - Cycle time (seconds) - Empty - Empty - Empty - - - Control onboard camera capturing. - Camera ID (-1 for all) - Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw - Transmission mode: 0: video stream, >0: single images every n seconds (decimal) - Recording: 0: disabled, 1: enabled compressed, 2: enabled raw - Empty - Empty - Empty - - - Sets the region of interest (ROI) for a sensor set or the - vehicle itself. This can then be used by the vehicles control - system to control the vehicle attitude and the attitude of various - devices such as cameras. - - Region of interest mode. (see MAV_ROI enum) - Waypoint index/ target ID. (see MAV_ROI enum) - ROI index (allows a vehicle to manage multiple cameras etc.) - Empty - x the location of the fixed ROI (see MAV_FRAME) - y - z - - - NOP - This command is only used to mark the upper limit of the DO commands in the enumeration - Empty - Empty - Empty - Empty - Empty - Empty - Empty - - - Trigger calibration. This command will be only accepted if in pre-flight mode. - Gyro calibration: 0: no, 1: yes - Magnetometer calibration: 0: no, 1: yes - Ground pressure: 0: no, 1: yes - Radio calibration: 0: no, 1: yes - Empty - Empty - Empty - - - Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. - Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM - Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM - Reserved - Reserved - Empty - Empty - Empty - - - - Data stream IDs. A data stream is not a fixed set of messages, but rather a - recommendation to the autopilot software. Individual autopilots may or may not obey - the recommended messages. - - - Enable all data streams - - - Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. - - - Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS - - - Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW - - - Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT. - - - Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages. - - - Dependent on the autopilot - - - Dependent on the autopilot - - - Dependent on the autopilot - - - - The ROI (region of interest) for the vehicle. This can be - be used by the vehicle for camera/vehicle attitude alignment (see - MAV_CMD_NAV_ROI). - - - No region of interest. - - - Point toward next waypoint. - - - Point toward given waypoint. - - - Point toward fixed location. - - - Point toward of given id. - - - - - - The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot). - Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM - MAVLink version - - - The boot message indicates that a system is starting. The onboard software version allows to keep track of onboard soft/firmware revisions. - The onboard software version - - - The system time is the time of the master clock, typically the computer clock of the main onboard computer. - Timestamp of the master clock in microseconds since UNIX epoch. - - - A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. - PING sequence - 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system - 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system - Unix timestamp in microseconds - - - UTC date and time from GPS module - GPS UTC date ddmmyy - GPS UTC time hhmmss - - - Request to control this MAV - System the GCS requests control for - 0: request control of this MAV, 1: Release control of this MAV - 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. - Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" - - - Accept / deny control of this MAV - ID of the GCS this message - 0: request control of this MAV, 1: Release control of this MAV - 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control - - - Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety. - key - - - This message acknowledges an action. IMPORTANT: The acknowledgement can be also negative, e.g. the MAV rejects a reset message because it is in-flight. The action ids are defined in ENUM MAV_ACTION in mavlink/include/mavlink_types.h - The action id - 0: Action DENIED, 1: Action executed - - - An action message allows to execute a certain onboard action. These include liftoff, land, storing parameters too EEPROM, shutddown, etc. The action ids are defined in ENUM MAV_ACTION in mavlink/include/mavlink_types.h - The system executing the action - The component executing the action - The action id - - - Set the system mode, as defined by enum MAV_MODE in mavlink/include/mavlink_types.h. There is no target component id as the mode is by definition for the overall aircraft, not only for one component. - The system setting the mode - The new mode - - - Set the system navigation mode, as defined by enum MAV_NAV_MODE in mavlink/include/mavlink_types.h. The navigation mode applies to the whole aircraft and thus all components. - The system setting the mode - The new navigation mode - - - Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] -> value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also http://qgroundcontrol.org/parameter_interface for a full documentation of QGroundControl and IMU code. - System ID - Component ID - Onboard parameter id - Parameter index. Send -1 to use the param ID field as identifier - - - Request all parameters of this component. After his request, all parameters are emitted. - System ID - Component ID - - - Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. - Onboard parameter id - Onboard parameter value - Total number of onboard parameters - Index of this onboard parameter - - - Set a parameter value TEMPORARILY to RAM. It will be reset to default on system reboot. Send the ACTION MAV_ACTION_STORAGE_WRITE to PERMANENTLY write the RAM contents to EEPROM. IMPORTANT: The receiving component should acknowledge the new parameter value by sending a param_value message to all communication partners. This will also ensure that multiple GCS all have an up-to-date list of all parameters. If the sending GCS did not receive a PARAM_VALUE message within its timeout time, it should re-send the PARAM_SET message. - System ID - Component ID - Onboard parameter id - Onboard parameter value - - - The global position, as returned by the Global Positioning System (GPS). This is -NOT the global position estimate of the sytem, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. Coordinate frame is right-handed, Z-axis up (GPS frame) - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - Latitude in 1E7 degrees - Longitude in 1E7 degrees - Altitude in 1E3 meters (millimeters) - GPS HDOP - GPS VDOP - GPS ground speed (m/s) - Compass heading in degrees, 0..360 degrees - - - The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - X acceleration (mg) - Y acceleration (mg) - Z acceleration (mg) - Angular speed around X axis (millirad /sec) - Angular speed around Y axis (millirad /sec) - Angular speed around Z axis (millirad /sec) - X Magnetic field (milli tesla) - Y Magnetic field (milli tesla) - Z Magnetic field (milli tesla) - - - The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION for the global position estimate. This message can contain information for up to 20 satellites. - Number of satellites visible - Global satellite ID - 0: Satellite not used, 1: used for localization - Elevation (0: right on top of receiver, 90: on the horizon) of satellite - Direction of satellite, 0: 0 deg, 255: 360 deg. - Signal to noise ratio of satellite - - - The RAW IMU readings for the usual 9DOF sensor setup. This message should always contain the true raw values without any scaling to allow data capture and system debugging. - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - X acceleration (raw) - Y acceleration (raw) - Z acceleration (raw) - Angular speed around X axis (raw) - Angular speed around Y axis (raw) - Angular speed around Z axis (raw) - X Magnetic field (raw) - Y Magnetic field (raw) - Z Magnetic field (raw) - - - The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values. - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - Absolute pressure (raw) - Differential pressure 1 (raw) - Differential pressure 2 (raw) - Raw Temperature measurement (raw) - - - The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field. - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - Absolute pressure (hectopascal) - Differential pressure 1 (hectopascal) - Temperature measurement (0.01 degrees celsius) - - - The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right). - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - Roll angle (rad) - Pitch angle (rad) - Yaw angle (rad) - Roll angular speed (rad/s) - Pitch angular speed (rad/s) - Yaw angular speed (rad/s) - - - The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame) - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - X Position - Y Position - Z Position - X Speed - Y Speed - Z Speed - - - The filtered global position (e.g. fused GPS and accelerometers). Coordinate frame is right-handed, Z-axis up (GPS frame) - Timestamp (microseconds since unix epoch) - Latitude, in degrees - Longitude, in degrees - Absolute altitude, in meters - X Speed (in Latitude direction, positive: going north) - Y Speed (in Longitude direction, positive: going east) - Z Speed (in Altitude direction, positive: going up) - - - The global position, as returned by the Global Positioning System (GPS). This is -NOT the global position estimate of the sytem, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. Coordinate frame is right-handed, Z-axis up (GPS frame) - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - Latitude in degrees - Longitude in degrees - Altitude in meters - GPS HDOP - GPS VDOP - GPS ground speed - Compass heading in degrees, 0..360 degrees - - - The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows wether the system is currently active or not and if an emergency occured. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occured it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout. - System mode, see MAV_MODE ENUM in mavlink/include/mavlink_types.h - Navigation mode, see MAV_NAV_MODE ENUM - System status flag, see MAV_STATUS ENUM - Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 - Battery voltage, in millivolts (1 = 1 millivolt) - Remaining battery energy: (0%: 0, 100%: 1000) - Dropped packets (packets that were corrupted on reception on the MAV) - - - The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. - RC channel 1 value, in microseconds - RC channel 2 value, in microseconds - RC channel 3 value, in microseconds - RC channel 4 value, in microseconds - RC channel 5 value, in microseconds - RC channel 6 value, in microseconds - RC channel 7 value, in microseconds - RC channel 8 value, in microseconds - Receive signal strength indicator, 0: 0%, 255: 100% - - - The scaled values of the RC channels received. (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - Receive signal strength indicator, 0: 0%, 255: 100% - - - The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. - Servo output 1 value, in microseconds - Servo output 2 value, in microseconds - Servo output 3 value, in microseconds - Servo output 4 value, in microseconds - Servo output 5 value, in microseconds - Servo output 6 value, in microseconds - Servo output 7 value, in microseconds - Servo output 8 value, in microseconds - - - Message encoding a waypoint. This message is emitted to announce - the presence of a waypoint and to set a waypoint on the system. The waypoint can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed, global frame is Z-up, right handed - System ID - Component ID - Sequence - The coordinate system of the waypoint. see MAV_FRAME in mavlink_types.h - The scheduled action for the waypoint. see MAV_COMMAND in common.xml MAVLink specs - false:0, true:1 - autocontinue to next wp - PARAM1 / For NAV command waypoints: Radius in which the waypoint is accepted as reached, in meters - PARAM2 / For NAV command waypoints: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds - PARAM3 / For LOITER command waypoints: Orbit to circle around the waypoint, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise. - PARAM4 / For NAV and LOITER command waypoints: Yaw orientation in degrees, [0..360] 0 = NORTH - PARAM5 / local: x position, global: latitude - PARAM6 / y position: global: longitude - PARAM7 / z position: global: altitude - - - Request the information of the waypoint with the sequence number seq. The response of the system to this message should be a WAYPOINT message. - System ID - Component ID - Sequence - - - Set the waypoint with sequence number seq as current waypoint. This means that the MAV will continue to this waypoint on the shortest path (not following the waypoints in-between). - System ID - Component ID - Sequence - - - Message that announces the sequence number of the current active waypoint. The MAV will fly towards this waypoint. - Sequence - - - Request the overall list of waypoints from the system/component. - System ID - Component ID - - - This message is emitted as response to WAYPOINT_REQUEST_LIST by the MAV. The GCS can then request the individual waypoints based on the knowledge of the total number of waypoints. - System ID - Component ID - Number of Waypoints in the Sequence - - - Delete all waypoints at once. - System ID - Component ID - - - A certain waypoint has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint. - Sequence - - - Ack message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero). - System ID - Component ID - 0: OK, 1: Error - - - As local waypoints exist, the global waypoint reference allows to transform between the local coordinate frame and the global (GPS) coordinate frame. This can be necessary when e.g. in- and outdoor settings are connected and the MAV should move from in- to outdoor. - System ID - Component ID - global position * 1E7 - global position * 1E7 - global position * 1000 - - - Once the MAV sets a new GPS-Local correspondence, this message announces the origin (0,0,0) position - Latitude (WGS84), expressed as * 1E7 - Longitude (WGS84), expressed as * 1E7 - Altitude(WGS84), expressed as * 1000 - - - Set the setpoint for a local position controller. This is the position in local coordinates the MAV should fly to. This message is sent by the path/waypoint planner to the onboard position controller. As some MAVs have a degree of freedom in yaw (e.g. all helicopters/quadrotors), the desired yaw angle is part of the message. - System ID - Component ID - x position - y position - z position - Desired yaw angle - - - Transmit the current local setpoint of the controller to other MAVs (collision avoidance) and to the GCS. - x position - y position - z position - Desired yaw angle - - - Position fix: 0: lost, 2: 2D position fix, 3: 3D position fix - Vision position fix: 0: lost, 1: 2D local position hold, 2: 2D global position fix, 3: 3D global position fix - GPS position fix: 0: no reception, 1: Minimum 1 satellite, but no position fix, 2: 2D position fix, 3: 3D position fix - Attitude estimation health: 0: poor, 255: excellent - 0: Attitude control disabled, 1: enabled - 0: X, Y position control disabled, 1: enabled - 0: Z position control disabled, 1: enabled - 0: Yaw angle control disabled, 1: enabled - - - Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations. - System ID - Component ID - Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - x position 1 / Latitude 1 - y position 1 / Longitude 1 - z position 1 / Altitude 1 - x position 2 / Latitude 2 - y position 2 / Longitude 2 - z position 2 / Altitude 2 - - - Read out the safety zone the MAV currently assumes. - Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - x position 1 / Latitude 1 - y position 1 / Longitude 1 - z position 1 / Altitude 1 - x position 2 / Latitude 2 - y position 2 / Longitude 2 - z position 2 / Altitude 2 - - - Set roll, pitch and yaw. - System ID - Component ID - Desired roll angle in radians - Desired pitch angle in radians - Desired yaw angle in radians - Collective thrust, normalized to 0 .. 1 - - - Set roll, pitch and yaw. - System ID - Component ID - Desired roll angular speed in rad/s - Desired pitch angular speed in rad/s - Desired yaw angular speed in rad/s - Collective thrust, normalized to 0 .. 1 - - - Setpoint in roll, pitch, yaw currently active on the system. - Timestamp in micro seconds since unix epoch - Desired roll angle in radians - Desired pitch angle in radians - Desired yaw angle in radians - Collective thrust, normalized to 0 .. 1 - - - Setpoint in rollspeed, pitchspeed, yawspeed currently active on the system. - Timestamp in micro seconds since unix epoch - Desired roll angular speed in rad/s - Desired pitch angular speed in rad/s - Desired yaw angular speed in rad/s - Collective thrust, normalized to 0 .. 1 - - - Outputs of the APM navigation controller. The primary use of this message is to check the response and signs -of the controller before actual flight and to assist with tuning controller parameters - Current desired roll in degrees - Current desired pitch in degrees - Current desired heading in degrees - Bearing to current waypoint/target in degrees - Distance to active waypoint in meters - Current altitude error in meters - Current airspeed error in meters/second - Current crosstrack error on x-y plane in meters - - - The goal position of the system. This position is the input to any navigation or path planning algorithm and does NOT represent the current controller setpoint. - x position - y position - z position - yaw orientation in radians, 0 = NORTH - - - Corrects the systems state by adding an error correction term to the position and velocity, and by rotating the attitude by a correction angle. - x position error - y position error - z position error - roll error (radians) - pitch error (radians) - yaw error (radians) - x velocity - y velocity - z velocity - - - The system setting the altitude - The new altitude in meters - - - The target requested to send the message stream. - The target requested to send the message stream. - The ID of the requested message type - Update rate in Hertz - 1 to start sending, 0 to stop sending. - - - This packet is useful for high throughput - applications such as hardware in the loop simulations. - - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - Roll angle (rad) - Pitch angle (rad) - Yaw angle (rad) - Roll angular speed (rad/s) - Pitch angular speed (rad/s) - Yaw angular speed (rad/s) - Latitude, expressed as * 1E7 - Longitude, expressed as * 1E7 - Altitude in meters, expressed as * 1000 (millimeters) - Ground X Speed (Latitude), expressed as m/s * 100 - Ground Y Speed (Longitude), expressed as m/s * 100 - Ground Z Speed (Altitude), expressed as m/s * 100 - X acceleration (mg) - Y acceleration (mg) - Z acceleration (mg) - - - Hardware in the loop control outputs - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - Control output -3 .. 1 - Control output -1 .. 1 - Control output -1 .. 1 - Throttle 0 .. 1 - System mode (MAV_MODE) - Navigation mode (MAV_NAV_MODE) - - - The system to be controlled - roll - pitch - yaw - thrust - roll control enabled auto:0, manual:1 - pitch auto:0, manual:1 - yaw auto:0, manual:1 - thrust auto:0, manual:1 - - - The RAW values of the RC channels sent to the MAV to override info received from the RC radio. A value of -1 means no change to that channel. A value of 0 means control of that channel should be released back to the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. - System ID - Component ID - RC channel 1 value, in microseconds - RC channel 2 value, in microseconds - RC channel 3 value, in microseconds - RC channel 4 value, in microseconds - RC channel 5 value, in microseconds - RC channel 6 value, in microseconds - RC channel 7 value, in microseconds - RC channel 8 value, in microseconds - - - The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up) - Latitude, expressed as * 1E7 - Longitude, expressed as * 1E7 - Altitude in meters, expressed as * 1000 (millimeters) - Ground X Speed (Latitude), expressed as m/s * 100 - Ground Y Speed (Longitude), expressed as m/s * 100 - Ground Z Speed (Altitude), expressed as m/s * 100 - - - Metrics typically displayed on a HUD for fixed wing aircraft - Current airspeed in m/s - Current ground speed in m/s - Current heading in degrees, in compass units (0..360, 0=north) - Current throttle setting in integer percent, 0 to 100 - Current altitude (MSL), in meters - Current climb rate in meters/second - - - Send a command with up to four parameters to the MAV - System which should execute the command - Component which should execute the command, 0 for all components - Command ID, as defined by MAV_CMD enum. - 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) - Parameter 1, as defined by MAV_CMD enum. - Parameter 2, as defined by MAV_CMD enum. - Parameter 3, as defined by MAV_CMD enum. - Parameter 4, as defined by MAV_CMD enum. - - - Report status of a command. Includes feedback wether the command was executed - Current airspeed in m/s - 1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION - - - Optical flow from a flow sensor (e.g. optical mouse sensor) - Timestamp (UNIX) - Sensor ID - Flow in pixels in x-sensor direction - Flow in pixels in y-sensor direction - Optical flow quality / confidence. 0: bad, 255: maximum quality - Ground distance in meters - - - Object has been detected - Timestamp in milliseconds since system boot - Object ID - Object type: 0: image, 1: letter, 2: ground vehicle, 3: air vehicle, 4: surface vehicle, 5: sub-surface vehicle, 6: human, 7: animal - Name of the object as defined by the detector - Detection quality / confidence. 0: bad, 255: maximum confidence - Angle of the object with respect to the body frame in NED coordinates in radians. 0: front - Ground distance in meters - - - - Name - Timestamp - x - y - z - - - Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. - Name of the debug variable - Floating point value - - - Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. - Name of the debug variable - Signed integer value - - - Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz). - Severity of status, 0 = info message, 255 = critical fault - Status text message, without null termination character - - - Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N. - index of debug variable - DEBUG value - - - diff --git a/src/GCS_MAVLink/message_definitions/common_slugs.xml b/src/GCS_MAVLink/message_definitions/common_slugs.xml deleted file mode 100644 index 3ff7b5cab..000000000 --- a/src/GCS_MAVLink/message_definitions/common_slugs.xml +++ /dev/null @@ -1,227 +0,0 @@ - - - - - The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot). - Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM - - - - The boot message indicates that a system is starting. The onboard software version allows to keep track of onboard soft/firmware revisions. - The onboard software version - - - - The system time is the time of the master clock, typically the computer clock of the main onboard computer. - Timestamp of the master clock in microseconds since UNIX epoch. - - - - A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. - PING sequence - 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system - 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system - Unix timestamp in microseconds - - - - An action message allows to execute a certain onboard action. These include liftoff, land, storing parameters too EEPROM, shutddown, etc. The action ids are defined in ENUM MAV_ACTION in mavlink/include/mavlink_types.h - The system executing the action - The component executing the action - The action id - - - - This message acknowledges an action. IMPORTANT: The acknowledgement can be also negative, e.g. the MAV rejects a reset message because it is in-flight. The action ids are defined in ENUM MAV_ACTION in mavlink/include/mavlink_types.h - The action id - 0: Action DENIED, 1: Action executed - - - - Set the system mode, as defined by enum MAV_MODE in mavlink/include/mavlink_types.h. There is no target component id as the mode is by definition for the overall aircraft, not only for one component. - The system setting the mode - The new mode - - - - Set the system navigation mode, as defined by enum MAV_NAV_MODE in mavlink/include/mavlink_types.h. The navigation mode applies to the whole aircraft and thus all components. - The system setting the mode - The new navigation mode - - - - The RAW IMU readings for the usual 9DOF sensor setup. This message should always contain the true raw values without any scaling to allow data capture and system debugging. - Timestamp (microseconds since UNIX epoch) - X acceleration (mg raw) - Y acceleration (mg raw) - Z acceleration (mg raw) - Angular speed around X axis (adc units) - Angular speed around Y axis (adc units) - Angular speed around Z axis (adc units) - X Magnetic field (milli tesla) - Y Magnetic field (milli tesla) - Z Magnetic field (milli tesla) - - - - The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, unscaled ADC values. - Timestamp (microseconds since UNIX epoch) - Absolute pressure (hectopascal) - Differential pressure 1 (hectopascal) - Differential pressure 2 (hectopascal) - Raw Temperature measurement - - - - The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right). - Timestamp (microseconds) - Roll angle (rad) - Pitch angle (rad) - Yaw angle (rad) - Roll angular speed (rad/s) - Pitch angular speed (rad/s) - Yaw angular speed (rad/s) - - - - The filtered local position (e.g. fused computer vision and accelerometers). - Timestamp (microseconds since unix epoch) - X Position - Y Position - Z Position - X Speed - Y Speed - Z Speed - - - - The global position, as returned by the Global Positioning System (GPS). This is -NOT the global position estimate of the sytem, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. - Timestamp (microseconds since unix epoch) - 0-1: no fix, 2: 2D fix, 3: 3D fix - X Position - Y Position - Z Position in meters - Uncertainty in meters of latitude - Uncertainty in meters of longitude - Overall speed - Heading, in FIXME - - - - The global position, as returned by the Global Positioning System (GPS). This is -NOT the global position estimate of the sytem, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. This message can contain information for up to 20 satellites. - Number of satellites visible - Global satellite ID - 0: Satellite not used, 1: used for localization - Elevation (0: right on top of receiver, 90: on the horizon) of satellite - Direction of satellite, 0: 0 deg, 255: 360 deg. - Signal to noise ratio of satellite - - - - The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows wether the system is currently active or not and if an emergency occured. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occured it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout. - System mode, see MAV_MODE ENUM in mavlink/include/mavlink_types.h - Navigation mode, see MAV_NAV_MODE ENUM - System status flag, see MAV_STATUS ENUM - Battery voltage, in millivolts (1 = 1 millivolt) - Motor block status flag, 0: Motors can be switched on (and could be either off or on), 1: Mechanical motor block switch is on, motors cannot be switched on (and are definitely off) - Dropped packets (packets that were corrupted on reception on the MAV) - - - - Message encoding a waypoint. This message is emitted to announce - the presence of a waypoint. It cannot be used to set a waypoint, use WAYPOINT_SET for this purpose. The waypoint can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon. The global and body frame are related as: positive Z-down, positive X(front looking north, positive Y(body:right) looking east. Therefore y encodes in global mode the latitude, whereas x encodes the longitude and z the GPS altitude (WGS84). - System ID - Component ID - Sequence - 0: global (GPS), 1: local, 2: global orbit, 3: local orbit - Orbit to circle around the waypoint, in meters. Set to 0 to fly straight through the waypoint - Direction of the orbit circling: 0: clockwise, 1: counter-clockwise - For waypoints of type 0 and 1: Radius in which the waypoint is accepted as reached, in meters - For waypoints of type 0 and 1: Time that the MAV should stay inside the orbit before advancing, in milliseconds - false:0, true:1 - local: x position, global: longitude - y position: global: latitude - z position: global: altitude - yaw orientation in radians, 0 = NORTH - autocontinue to next wp - - - - Request the information of the waypoint with the sequence number seq. The response of the system to this message should be a WAYPOINT message. - System ID - Component ID - Sequence - - - - Set the waypoint with sequence number seq as current waypoint. This means that the MAV will continue to this waypoint on the shortest path (not following the waypoints in-between). - System ID - Component ID - Sequence - - - - Message that announces the sequence number of the current active waypoint. The MAV will fly towards this waypoint. - Sequence - - - - This message is emitted as response to WAYPOINT_REQUEST_LIST by the MAV. The GCS can then request the individual waypoints based on the knowledge of the total number of waypoints. - System ID - Component ID - Number of Waypoints in the Sequence - - - - Delete all waypoints at once. - System ID - Component ID - - - - A certain waypoint has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint. - Sequence - - - - Ack message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero). - System ID - Component ID - 0: OK, 1: Error - - - - As local waypoints exist, the global waypoint reference allows to transform between the local coordinate frame and the global (GPS) coordinate frame. This can be necessary when e.g. in- and outdoor settings are connected and the MAV should move from in- to outdoor. - System ID - Component ID - global x position - global y position - global z position - global yaw orientation in radians, 0 = NORTH - local x position that matches the global x position - local y position that matches the global y position - local z position that matches the global z position - local yaw that matches the global yaw orientation - - - - - - - Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz). - Severity of status, 0 = info message, 255 = critical fault - Status text message, without null termination character - - - - - Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N. - index of debug variable - DEBUG value - - - - diff --git a/src/GCS_MAVLink/message_definitions/mavlink_standard_proposal.xml b/src/GCS_MAVLink/message_definitions/mavlink_standard_proposal.xml deleted file mode 100644 index 43f0a0435..000000000 --- a/src/GCS_MAVLink/message_definitions/mavlink_standard_proposal.xml +++ /dev/null @@ -1,275 +0,0 @@ - - - - - The heartbeat message just shows that a system is present. - Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM - - - - A ping message either requesting or responding to a ping. - PING sequence - 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system - 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system - Unix timestamp in microseconds - The onboard software version - - - - - System mode, see MAV_MODE ENUM in mavlink/include/mavlink_types.h - Navigation mode, see MAV_NAV_MODE ENUM - System status flag, see MAV_STATUS ENUM - Failure code description, see MAV_FAILURE ENUM - Motor block status flag - Dropped packets - - - - Set the system mode, as defined by enum MAV_MODE in mavlink/include/mavlink_types.h - The system setting the mode - The new mode - - - - Set the system navigation mode, as defined by enum MAV_NAV_MODE in mavlink/include/mavlink_types.h - The system setting the mode - The new navigation mode - - - - Set a parameter value TEMPORARILY to RAM. It will be reset to default on system reboot. - System ID - Component ID - Onboard parameter id - Onboard parameter value - - - - Set the current parameter value (currently active in RAM) PERMANTLY to EEPROM/HDD. It will be the new default value. - System ID - Component ID - Onboard parameter id - - - - Set PID values. - System ID - Component ID - PID ID - P - I - D - - - - Trim values to scale the RAW RC channel values. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. - System ID - Component ID - RC channel id - RC channel 1 min value, in microseconds - RC channel 1 zero value, in microseconds - RC channel 1 max value, in microseconds - - - - Mapping defining which functions each RC channel has. - System ID - Component ID - RC channel id - RC channel function, as defined in ENUM MAVLINK_RC_CHAN_MAPPING in mavlink/include/mavlink_types.h - - - - Message setting a waypoint. The waypoint can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon. The global and body frame are related as: positive Z-down, positive X(front looking north, positive Y(body:right) looking east. Therefore x encodes in global mode the latitude, whereas y encodes the longitude and z the altitude over ground. - System ID - Component ID - Waypoint ID - 0: global (GPS), 1: local, 2: global orbit, 3: local orbit - Orbit to circle around the waypoint, in meters - Time that the MAV should stay inside the orbit before advancing, in milliseconds - 0: No orbit, 1: Right Orbit, 2: Left Orbit - false:0, true:1 - local: x position, global: longitude - y position: global: latitude - z position: global: altitude - autocontinue to next wp - - - - System ID - Component ID - Waypoint ID - - - - System ID - Component ID - - - - The system executing the action - Component ID - The action id - - - - The system executing the action - Component ID - The id of the action being successfully executed and acknowledged - - - - Request to read the onboard parameters. - System ID - Component ID - Onboard parameter id - - - - Emit the value of a onboard parameter. - Onboard parameter id - Onboard parameter value - - - - Request all parameters of this component. - System ID - Component ID - 0: All parameters, else report a subset of parameters as defined in MAVLIN_SUBSET_PARAM enum - - - - Report PID controller values. - PID ID - P - I - D - - - - Report trim values to scale the RAW RC channel values. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. - RC channel id - RC channel 1 min value, in microseconds - RC channel 1 zero value, in microseconds - RC channel 1 max value, in microseconds - - - - Report the mapping defining which functions each RC channel has. - RC channel id - RC channel function, as defined in ENUM MAVLINK_RC_CHAN_MAPPING in mavlink/include/mavlink_types.h - - - - Message encoding a waypoint. This message is emitted to announce - the presence of a waypoint. It cannot be used to set a waypoint, use WAYPOINT_SET for this purpose. The waypoint can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon. The global and body frame are related as: positive Z-down, positive X(front looking north, positive Y(body:right) looking east. Therefore x encodes in global mode the latitude, whereas y encodes the longitude and z the altitude over ground. - Waypoint ID - 0: global (GPS), 1: local, 2: global orbit, 3: local orbit - Orbit to circle around the waypoint, in meters - Time that the MAV should stay inside the orbit before advancing, in milliseconds - 0: No orbit, 1: Right Orbit, 2: Left Orbit - false:0, true:1 - local: x position, global: longitude - y position: global: latitude - z position: global: altitude - autocontinue to next wp - - - - Message emmited by a system to anounce eit - Waypoint ID - Waypoint status: 0: Ok, 1: Reached, 2: Orbit time expired, 254: Error - - - - X acceleration (mg raw) - Y acceleration (mg raw) - Z acceleration (mg raw) - Angular speed around X axis (adc units) - Angular speed around Y axis (adc units) - Angular speed around Z axis (adc units) - X Magnetic field (milli tesla) - Y Magnetic field (milli tesla) - Z Magnetic field (milli tesla) - - - - Timestamp (microseconds since UNIX epoch) - Absolute pressure (hectopascal) - Differential pressure 1 (hectopascal) - Differential pressure 2 (hectopascal) - - - - The global position, as returned by the Global Positioning System (GPS). This is -NOT the global position estimate of the sytem, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. - 0-1: no fix, 2: 2D fix, 3: 3D fix - X Position - Y Position - Z Position in meters - Uncertainty in meters of latitude - Uncertainty in meters of longitude - Overall speed - Heading, in FIXME - - - - The global position, as returned by the Global Positioning System (GPS). This is -NOT the global position estimate of the sytem, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. - Number of satellites visible - Global satellite ID - 0: Satellite not used, 1: used for localization - Elevation (0: right on top of receiver, 90: on the horizon) of satellite - Direction of satellite, 0: 0 deg, 255: 360 deg. - Signal to noise ratio of satellite - - - - The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right). - Timestamp (microseconds) - Roll angle (rad) - Pitch angle (rad) - Yaw angle (rad) - Roll angular speed (rad/s) - Pitch angular speed (rad/s) - Yaw angular speed (rad/s) - - - - The filtered local position (e.g. fused computer vision and accelerometers). - Position type: 0: Local, 1: Global - X (long) Position - Y (lat) Position - Z (alt) Position - Vx - Vy - Vz - - - - The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. - RC channel 1 value, in microseconds - RC channel 2 value, in microseconds - RC channel 3 value, in microseconds - RC channel 3 value, in microseconds - RC channel 3 value, in microseconds - - - - - - - Severity of status, 0 = info message, 255 = critical fault - Status text message, without null termination character - - - - - index of debug variable - DEBUG value - - - - \ No newline at end of file diff --git a/src/GCS_MAVLink/message_definitions/minimal.xml b/src/GCS_MAVLink/message_definitions/minimal.xml deleted file mode 100644 index 5b41a4909..000000000 --- a/src/GCS_MAVLink/message_definitions/minimal.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - 2 - - - - The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot). - Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM - MAVLink version - - - diff --git a/src/GCS_MAVLink/message_definitions/pixhawk.xml b/src/GCS_MAVLink/message_definitions/pixhawk.xml deleted file mode 100644 index a9a51d698..000000000 --- a/src/GCS_MAVLink/message_definitions/pixhawk.xml +++ /dev/null @@ -1,227 +0,0 @@ - - - common.xml - - - Content Types for data transmission handshake - - - - - - - - Camera id - Camera mode: 0 = auto, 1 = manual - Trigger pin, 0-3 for PtGrey FireFly - Shutter interval, in microseconds - Exposure time, in microseconds - Camera gain - - - Timestamp - IMU seq - Roll angle in rad - Pitch angle in rad - Yaw angle in rad - Local frame Z coordinate (height over ground) - GPS X coordinate - GPS Y coordinate - Global frame altitude - Ground truth X - Ground truth Y - Ground truth Z - - - 0 to disable, 1 to enable - - - Camera id - Camera # (starts with 0) - Timestamp - Until which timestamp this buffer will stay valid - The image sequence number - Position of the image in the buffer, starts with 0 - Image width - Image height - Image depth - Image channels - Shared memory area key - Exposure time, in microseconds - Camera gain - Roll angle in rad - Pitch angle in rad - Yaw angle in rad - Local frame Z coordinate (height over ground) - GPS X coordinate - GPS Y coordinate - Global frame altitude - Ground truth X - Ground truth Y - Ground truth Z - - - Timestamp (milliseconds) - Global X position - Global Y position - Global Z position - Roll angle in rad - Pitch angle in rad - Yaw angle in rad - - - Timestamp (milliseconds) - Global X position - Global Y position - Global Z position - Roll angle in rad - Pitch angle in rad - Yaw angle in rad - - - Timestamp (milliseconds) - Global X speed - Global Y speed - Global Z speed - - - Message sent to the MAV to set a new position as reference for the controller - System ID - Component ID - ID of waypoint, 0 for plain position - x position - y position - z position - yaw orientation in radians, 0 = NORTH - - - Message sent to the MAV to set a new offset from the currently controlled position - System ID - Component ID - x position offset - y position offset - z position offset - yaw orientation offset in radians, 0 = NORTH - - - - ID of waypoint, 0 for plain position - x position - y position - z position - yaw orientation in radians, 0 = NORTH - - - ID - x position - y position - z position - roll orientation - pitch orientation - yaw orientation - - - ADC1 (J405 ADC3, LPC2148 AD0.6) - ADC2 (J405 ADC5, LPC2148 AD0.2) - ADC3 (J405 ADC6, LPC2148 AD0.1) - ADC4 (J405 ADC7, LPC2148 AD1.3) - Battery voltage - Temperature (degrees celcius) - Barometric pressure (hecto Pascal) - - - Watchdog ID - Number of processes - - - Watchdog ID - Process ID - Process name - Process arguments - Timeout (seconds) - - - Watchdog ID - Process ID - Is running / finished / suspended / crashed - Is muted - PID - Number of crashes - - - Target system ID - Watchdog ID - Process ID - Command ID - - - 0: Pattern, 1: Letter - Confidence of detection - Pattern file name - Accepted as true detection, 0 no, 1 yes - - - Notifies the operator about a point of interest (POI). This can be anything detected by the - system. This generic message is intented to help interfacing to generic visualizations and to display - the POI on a map. - - 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug - 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta - 0: global, 1:local - 0: no timeout, >1: timeout in seconds - X Position - Y Position - Z Position - POI name - - - Notifies the operator about the connection of two point of interests (POI). This can be anything detected by the - system. This generic message is intented to help interfacing to generic visualizations and to display - the POI on a map. - - 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug - 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta - 0: global, 1:local - 0: no timeout, >1: timeout in seconds - X1 Position - Y1 Position - Z1 Position - X2 Position - Y2 Position - Z2 Position - POI connection name - - - type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h) - total data size in bytes (set on ACK only) - number of packets beeing sent (set on ACK only) - payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only) - JPEG quality out of [1,100] - - - sequence number (starting with 0 on every transmission) - image data bytes - - - x position in m - y position in m - z position in m - Orientation assignment 0: false, 1:true - Size in pixels - Orientation - Descriptor - Harris operator response at this location - - - The system to be controlled - roll - pitch - yaw - thrust - roll control enabled auto:0, manual:1 - pitch auto:0, manual:1 - yaw auto:0, manual:1 - thrust auto:0, manual:1 - - - diff --git a/src/GCS_MAVLink/message_definitions/slugs.xml b/src/GCS_MAVLink/message_definitions/slugs.xml deleted file mode 100644 index f8644c5c4..000000000 --- a/src/GCS_MAVLink/message_definitions/slugs.xml +++ /dev/null @@ -1,144 +0,0 @@ - - - common.xml - - - - - - - Sensor and DSC control loads. - Sensor DSC Load - Control DSC Load - Battery Voltage in millivolts - - - - Air data for altitude and airspeed computation. - Dynamic pressure (Pa) - Static pressure (Pa) - Board temperature - - - - Accelerometer and gyro biases. - Accelerometer X bias (m/s) - Accelerometer Y bias (m/s) - Accelerometer Z bias (m/s) - Gyro X bias (rad/s) - Gyro Y bias (rad/s) - Gyro Z bias (rad/s) - - - - Configurable diagnostic messages. - Diagnostic float 1 - Diagnostic float 2 - Diagnostic float 3 - Diagnostic short 1 - Diagnostic short 2 - Diagnostic short 3 - - - - Data used in the navigation algorithm. - Measured Airspeed prior to the Nav Filter - Commanded Roll - Commanded Pitch - Commanded Turn rate - Y component of the body acceleration - Total Distance to Run on this leg of Navigation - Remaining distance to Run on this leg of Navigation - Origin WP - Destination WP - - - - Configurable data log probes to be used inside Simulink - Log value 1 - Log value 2 - Log value 3 - Log value 4 - Log value 5 - Log value 6 - - - - Pilot console PWM messges. - Year reported by Gps - Month reported by Gps - Day reported by Gps - Hour reported by Gps - Min reported by Gps - Sec reported by Gps - Visible sattelites reported by Gps - - - - Mid Level commands sent from the GS to the autopilot. These are only sent when being opperated in mid-level commands mode from the ground; for periodic report of these commands generated from the autopilot see message XXXX. - The system setting the commands - Commanded Airspeed - Log value 2 - Log value 3 - - - - - This message configures the Selective Passthrough mode. it allows to select which control surfaces the Pilot can control from his console. It is implemented as a bitfield as follows: - Position Bit Code - ================================= - 15-8 Reserved - 7 dt_pass 128 - 6 dla_pass 64 - 5 dra_pass 32 - 4 dr_pass 16 - 3 dle_pass 8 - 2 dre_pass 4 - 1 dlf_pass 2 - 0 drf_pass 1 - Where Bit 15 is the MSb. 0 = AP has control of the surface; 1 = Pilot Console has control of the surface. - The system setting the commands - Bitfield containing the PT configuration - - - - - - Action messages focused on the SLUGS AP. - The system reporting the action - Action ID. See apDefinitions.h in the SLUGS /clib directory for the ID names - Value associated with the action - - - - diff --git a/src/GCS_MAVLink/message_definitions/slugs_ap.xml b/src/GCS_MAVLink/message_definitions/slugs_ap.xml deleted file mode 100644 index 6b51a9f83..000000000 --- a/src/GCS_MAVLink/message_definitions/slugs_ap.xml +++ /dev/null @@ -1,152 +0,0 @@ - - -common_slugs.xml - - - Sensor and DSC control loads. - Sensor DSC Load - Control DSC Load - Battery Voltage in millivolts - - - - Air data for altitude and airspeed computation. - Dynamic pressure (Pa) - Static pressure (Pa) - Board temperature - - - - Accelerometer and gyro biases. - Accelerometer X bias (m/s) - Accelerometer Y bias (m/s) - Accelerometer Z bias (m/s) - Gyro X bias (rad/s) - Gyro Y bias (rad/s) - Gyro Z bias (rad/s) - - - - Configurable diagnostic messages. - Diagnostic float 1 - Diagnostic float 2 - Diagnostic float 3 - Diagnostic short 1 - Diagnostic short 2 - Diagnostic short 3 - - - - Pilot console PWM messges. - Pilot's console throttle command - Pilot's console left aileron command - Pilot's console right aileron command - Pilot's console rudder command - Pilot's console elevator command - - - - PWM Commands from the AP to the control surfaces. - AutoPilot's throttle command - AutoPilot's left aileron command - AutoPilot's right aileron command - AutoPilot's rudder command - AutoPilot's left elevator command - AutoPilot's right elevator command - AutoPilot's left flap command - AutoPilot's right flap command - AutoPilot's aux1 command - AutoPilot's aux2 command - - - - Data used in the navigation algorithm. - Measured Airspeed prior to the Nav Filter - Commanded Roll - Commanded Pitch - Commanded Turn rate - Y component of the body acceleration - Total Distance to Run on this leg of Navigation - Remaining distance to Run on this leg of Navigation - Origin WP - Destination WP - - - - Configurable data log probes to be used inside Simulink - Log value 1 - Log value 2 - Log value 3 - Log value 4 - Log value 5 - Log value 6 - - - - Measured value from the IMU in units after sensor calibration and temperature compensation. Note that this IS NOT the output of the attitude filter, for that see messages 30 and 33. - Accelerometer X value (m/s^2) - Accelerometer Y value (m/s^2) - Accelerometer Z value (m/s^2) - Gyro X value (rad/s) - Gyro Y value (rad/s) - Gyro Z value (rad/s) - Magnetometer X (normalized to 1) - Magnetometer Y (normalized to 1) - Magnetometer Z (normalized to 1) - - - - Pilot console PWM messges. - Year reported by Gps - Month reported by Gps - Day reported by Gps - Hour reported by Gps - Min reported by Gps - Sec reported by Gps - Visible sattelites reported by Gps - - - - Mid Level commands sent from the GS to the autopilot. These are only sent when being opperated in mid-level commands mode from the ground; for periodic report of these commands generated from the autopilot see message XXXX. - The system setting the commands - Commanded Airspeed - Log value 2 - Log value 3 - - - -This message configures the Selective Passthrough mode. it allows to select which control surfaces the Pilot can control from his console. It is implemented as a bitfield as follows: - Position Bit Code - ================================= - 15-8 Reserved - 7 dt_pass 128 - 6 dla_pass 64 - 5 dra_pass 32 - 4 dr_pass 16 - 3 dle_pass 8 - 2 dre_pass 4 - 1 dlf_pass 2 - 0 drf_pass 1 - Where Bit 15 is the MSb. 0 = AP has control of the surface; 1 = Pilot Console has control of the surface. - The system setting the commands - Bitfield containing the PT configuration - - - - Configure a PID loop. - The system setting the PID values - Proportional gain - Integral gain - Derivative gain - PID loop index - - - - Action messages focused on the SLUGS AP. - The system reporting the action - Action ID. See apDefinitions.h in the SLUGS /clib directory for the ID names - Value associated with the action - - - - \ No newline at end of file diff --git a/src/GCS_MAVLink/message_definitions/test.xml b/src/GCS_MAVLink/message_definitions/test.xml deleted file mode 100644 index 43a11e3d1..000000000 --- a/src/GCS_MAVLink/message_definitions/test.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - 3 - - - Test all field types - char - string - uint8_t - uint16_t - uint32_t - uint64_t - int8_t - int16_t - int32_t - int64_t - float - double - uint8_t_array - uint16_t_array - uint32_t_array - uint64_t_array - int8_t_array - int16_t_array - int32_t_array - int64_t_array - float_array - double_array - - - diff --git a/src/GCS_MAVLink/message_definitions/ualberta.xml b/src/GCS_MAVLink/message_definitions/ualberta.xml deleted file mode 100644 index 5e53e141e..000000000 --- a/src/GCS_MAVLink/message_definitions/ualberta.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - common.xml - - - Available autopilot modes for ualberta uav - Raw input pulse widts sent to output - Inputs are normalized using calibration, the converted back to raw pulse widths for output - dfsdfs - dfsfds - dfsdfsdfs - - - Navigation filter mode - - AHRS mode - INS/GPS initialization mode - INS/GPS mode - - - Mode currently commanded by pilot - sdf - dfs - Rotomotion mode - - - - - Accelerometer and Gyro biases from the navigation filter - Timestamp (microseconds) - b_f[0] - b_f[1] - b_f[2] - b_f[0] - b_f[1] - b_f[2] - - - Complete set of calibration parameters for the radio - Aileron setpoints: left, center, right - Elevator setpoints: nose down, center, nose up - Rudder setpoints: nose left, center, nose right - Tail gyro mode/gain setpoints: heading hold, rate mode - Pitch curve setpoints (every 25%) - Throttle curve setpoints (every 25%) - - - System status specific to ualberta uav - System mode, see UALBERTA_AUTOPILOT_MODE ENUM - Navigation mode, see UALBERTA_NAV_MODE ENUM - Pilot mode, see UALBERTA_PILOT_MODE - - - diff --git a/src/GCS_MAVLink/message_definitions_v1.0/autoquad.xml b/src/GCS_MAVLink/message_definitions_v1.0/autoquad.xml new file mode 100644 index 000000000..02616dbb0 --- /dev/null +++ b/src/GCS_MAVLink/message_definitions_v1.0/autoquad.xml @@ -0,0 +1,103 @@ + + + common.xml + 3 + + + + Start/stop AutoQuad telemetry values stream. + Start or stop (1 or 0) + Stream frequency in us + Empty + Empty + Empty + Empty + Empty + + + Command AutoQuad to go to a particular place at a set speed. + Latitude + Lontitude + Altitude + Speed + Empty + Empty + Empty + + + Request AutoQuad firmware version number. + Empty + Empty + Empty + Empty + Empty + Empty + Empty + + + + + + Sends up to 20 raw float values. + Index of message + value1 + value2 + value3 + value4 + value5 + value6 + value7 + value8 + value9 + value10 + value11 + value12 + value13 + value14 + value15 + value16 + value17 + value18 + value19 + value20 + + + + diff --git a/src/GCS_MAVLink/message_definitions_v1.0/common.xml b/src/GCS_MAVLink/message_definitions_v1.0/common.xml index e1f5dd40a..525222cd6 100644 --- a/src/GCS_MAVLink/message_definitions_v1.0/common.xml +++ b/src/GCS_MAVLink/message_definitions_v1.0/common.xml @@ -46,6 +46,9 @@ SMACCMPilot - http://smaccmpilot.org + + AutoQuad -- http://autoquad.org + @@ -979,9 +982,9 @@ NOT the global position estimate of the sytem, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. Coordinate frame is right-handed, Z-axis up (GPS frame). Timestamp (microseconds since UNIX epoch or microseconds since system boot) 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - Latitude in 1E7 degrees - Longitude in 1E7 degrees - Altitude in 1E3 meters (millimeters) above MSL + Latitude (WGS84), in degrees * 1E7 + Longitude (WGS84), in degrees * 1E7 + Altitude (WGS84), in meters * 1000 (positive for up) GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 GPS VDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 GPS ground speed (m/s * 100). If unknown, set to: 65535 @@ -1200,15 +1203,15 @@ As local waypoints exist, the global MISSION reference allows to transform between the local coordinate frame and the global (GPS) coordinate frame. This can be necessary when e.g. in- and outdoor settings are connected and the MAV should move from in- to outdoor. System ID - global position * 1E7 - global position * 1E7 - global position * 1000 + Latitude (WGS84), in degrees * 1E7 + Longitude (WGS84, in degrees * 1E7 + Altitude (WGS84), in meters * 1000 (positive for up) Once the MAV sets a new GPS-Local correspondence, this message announces the origin (0,0,0) position - Latitude (WGS84), expressed as * 1E7 - Longitude (WGS84), expressed as * 1E7 - Altitude(WGS84), expressed as * 1000 + Latitude (WGS84), in degrees * 1E7 + Longitude (WGS84), in degrees * 1E7 + Altitude (WGS84), in meters * 1000 (positive for up) Set the setpoint for a local position controller. This is the position in local coordinates the MAV should fly to. This message is sent by the path/MISSION planner to the onboard position controller. As some MAVs have a degree of freedom in yaw (e.g. all helicopters/quadrotors), the desired yaw angle is part of the message. @@ -1231,17 +1234,17 @@ Transmit the current local setpoint of the controller to other MAVs (collision avoidance) and to the GCS. Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT - WGS84 Latitude position in degrees * 1E7 - WGS84 Longitude position in degrees * 1E7 - WGS84 Altitude in meters * 1000 (positive for up) + Latitude (WGS84), in degrees * 1E7 + Longitude (WGS84), in degrees * 1E7 + Altitude (WGS84), in meters * 1000 (positive for up) Desired yaw angle in degrees * 100 Set the current global position setpoint. Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT - WGS84 Latitude position in degrees * 1E7 - WGS84 Longitude position in degrees * 1E7 - WGS84 Altitude in meters * 1000 (positive for up) + Latitude (WGS84), in degrees * 1E7 + Longitude (WGS84), in degrees * 1E7 + Altitude (WGS84), in meters * 1000 (positive for up) Desired yaw angle in degrees * 100 diff --git a/src/gui/view_mavlink.cpp b/src/gui/view_mavlink.cpp index f3119aadd..826c7946b 100644 --- a/src/gui/view_mavlink.cpp +++ b/src/gui/view_mavlink.cpp @@ -82,20 +82,25 @@ void menuTelemetryMavlink(uint8_t event) { switch (MAVLINK_menu) { case MENU_INFO: - menuTelemetryMavlinkInfos(); - break; + menuTelemetryMavlinkInfos(); + break; + case MENU_MODE: + menuTelemetryMavlinkFlightMode(); + break; + case MENU_BATT: + menuTelemetryMavlinkBattery(); + break; case MENU_GPS: - menuTelemetryMavlinkGPS(); - break; + menuTelemetryMavlinkGPS(); + break; #ifdef DUMP_RX_TX case MENU_DUMP_TX: case MENU_DUMP_RX: - menuTelemetryMavlinkDump(event); - break; + menuTelemetryMavlinkDump(event); + break; #endif - default: - break; + break; } } @@ -164,7 +169,9 @@ void mav_title(const pm_char * s, uint8_t index) lcd_putsAtt(0, 0, PSTR("MAVLINK"), INVERS); lcd_puts(10 * FW, 0, s); displayScreenIndex(index, MAX_MAVLINK_MENU, INVERS); - lcd_putc(8 * FW, 0, (mav_heartbeat > 0) ? '*' : ' '); + lcd_putc(7 * FW, 0, (mav_heartbeat > 0) ? '*' : ' '); + if (telemetry_data.active) + lcd_putcAtt(8 * FW, 0, 'A', BLINK); } /*! \brief Global info menu @@ -198,7 +205,8 @@ void menuTelemetryMavlinkInfos(void) { if (telemetry_data.status) { lcd_putsnAtt(x1, y, PSTR("MODE"), 4, 0); - if (telemetry_data.mode & MAV_MODE_FLAG_SAFETY_ARMED) + if (telemetry_data.active) + //if (telemetry_data.mode & MAV_MODE_FLAG_SAFETY_ARMED) lcd_putsnAtt(x2, y, PSTR("A"), 1, 0); lcd_outdezAtt(xnum, y, telemetry_data.mode, 0); @@ -213,6 +221,124 @@ void menuTelemetryMavlinkInfos(void) { } } +/*! \brief Flight mode menu + * \details Clear display of current flight mode. + * \todo Add functionality to change flight mode. + */ +void menuTelemetryMavlinkFlightMode(void) { + + mav_title(PSTR("MODE"), MAVLINK_menu); + + const char * mode_text_p; + switch(telemetry_data.custom_mode) { + case AP_STABILIZE: + mode_text_p = PSTR("Stabilize"); + break; + case AP_ACRO: + mode_text_p = PSTR("Acro"); + break; + case AP_ALT_HOLD: + mode_text_p = PSTR("Alt Hold"); + break; + case AP_AUTO: + mode_text_p = PSTR("Auto"); + break; + case AP_GUIDED: + mode_text_p = PSTR("Guided"); + break; + case AP_LOITER: + mode_text_p = PSTR("Loiter"); + break; + case AP_RTL: + mode_text_p = PSTR("RTL"); + break; + case AP_CIRCLE: + mode_text_p = PSTR("Circle"); + break; + case AP_POSITION: + mode_text_p = PSTR("Pos Hold"); + break; + case AP_LAND: + mode_text_p = PSTR("Land"); + break; + case AP_OF_LOITER: + mode_text_p = PSTR("OF Loiter"); + break; + case AP_TOY_A: + mode_text_p = PSTR("Toy A"); + break; + case AP_TOY_M: + mode_text_p = PSTR("Toy M"); + break; + default: + mode_text_p = PSTR("INVALID"); + break; + } + + uint8_t x, y; + x = 0; + y = FH; + + lcd_puts (x, y, PSTR("Current Mode")); + y += FH; + lcd_putsAtt (FW, y, mode_text_p, DBLSIZE); + y += 2 * FH; + + char * ptr = mav_statustext; + for (uint8_t j = 0; j < LEN_STATUSTEXT; j++) { + if (*ptr == 0) { + lcd_putc(x, y, ' '); + } else { + lcd_putc(x, y, *ptr++); + } + x += FW; + } + y += FH; + x = 0; + + if (telemetry_data.active) + lcd_putsAtt (FW, y, PSTR("Armed"), DBLSIZE); +} + +/*! \brief Batterystatus dislplay + * \details Shows flight batery status. + */ +void menuTelemetryMavlinkBattery(void) { + + mav_title(PSTR("BAT RSSI"), MAVLINK_menu); + + uint8_t x, y, ynum; + x = 7 * FWNUM; +// x = xnum + 0 * FW; + ynum = 2 * FH; + y = 3 * FH; + + lcd_puts(0, 1*FH, PSTR("Flight Batery status")); + + lcd_outdezAtt(x, ynum, telemetry_data.vbat, (DBLSIZE | PREC1 | UNSIGN)); + lcd_puts(x, y, PSTR("V")); + x += 4 * (2 * FWNUM); + lcd_outdezAtt(x, ynum, telemetry_data.ibat, (DBLSIZE | PREC1 | UNSIGN)); + lcd_puts(x, y, PSTR("A")); + x += 4 * (2 * FWNUM); + lcd_outdezAtt(x, ynum, telemetry_data.rem_bat, (DBLSIZE | UNSIGN)); + lcd_puts(x, y, PSTR("%")); + y += FH; + ynum += 3 * FH; + + x = 0; + lcd_puts (x, y, PSTR("RC RSSI")); + lcd_outdezAtt(x + 7 * FWNUM, ynum, telemetry_data.rc_rssi, (DBLSIZE | UNSIGN)); + lcd_puts(x + 7 * FWNUM, ynum + FH, PSTR("%")); + x += 8 * (2 * FWNUM); + lcd_puts(x, y, PSTR("PC RSSI")); + lcd_outdezAtt(x + 7 * FWNUM, ynum, telemetry_data.pc_rssi, (DBLSIZE | UNSIGN)); + lcd_puts(x + 7 * FWNUM, ynum + FH, PSTR("%")); + +} + + + /*! \brief GPS information menu * \details Menu gives a lot of info from the gps like fix type, position, * attitude, heading and velocity. Text is small and the user must focus to diff --git a/src/gui/view_mavlink.h b/src/gui/view_mavlink.h index 742be4e2c..1491ead91 100644 --- a/src/gui/view_mavlink.h +++ b/src/gui/view_mavlink.h @@ -47,11 +47,15 @@ #include "telemetry/mavlink.h" #include "gui/menus.h" +#define APSIZE (BSS | DBLSIZE) + void menuTelemetryMavlink(uint8_t event); void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr); void lcd_outdezFloat(uint8_t x, uint8_t y, float val, uint8_t precis, uint8_t mode = 0); void mav_title(const pm_char * s, uint8_t index); void menuTelemetryMavlinkInfos(void); +void menuTelemetryMavlinkFlightMode(void); +void menuTelemetryMavlinkBattery(void); void menuTelemetryMavlinkGPS(void); #ifdef DUMP_RX_TX void lcd_outhex2(uint8_t x, uint8_t y, uint8_t val); @@ -64,6 +68,8 @@ void menuTelemetryMavlinkDump(uint8_t event); */ enum mavlink_menu_ { MENU_INFO = 0, // + MENU_MODE, + MENU_BATT, MENU_GPS, // #ifdef DUMP_RX_TX MENU_DUMP_RX, // diff --git a/src/serial.cpp b/src/serial.cpp index 7d3365738..baf5a538e 100644 --- a/src/serial.cpp +++ b/src/serial.cpp @@ -113,7 +113,7 @@ void SERIAL_end_uart_send() { serialTxState = TX_STATE_READY; } -void SERIAL_send_uart_bytes(uint8_t * buf, uint16_t len) { +void SERIAL_send_uart_bytes(const uint8_t * buf, uint16_t len) { while (len--) { *ptrTxISR++ = *buf++; serialTxBufferCount++; diff --git a/src/telemetry/mavlink.cpp b/src/telemetry/mavlink.cpp index 94e190489..f38bd6895 100644 --- a/src/telemetry/mavlink.cpp +++ b/src/telemetry/mavlink.cpp @@ -14,6 +14,7 @@ * - Michal Hlavinka * - Pat Mackenzie * - Philip Moss + * - Rienk de Jong * - Rob Thomson * - Romolo Manfredini * - Thomas Husterer @@ -56,7 +57,7 @@ mavlink_system_t mavlink_system = { 7, MAV_COMP_ID_MISSIONPLANNER, 0, 0, 0, 0 }; // Mavlink message decoded Status Text #define PARAM_NB_REPEAT 10 -#define LEN_STATUSTEXT 15 +#define LEN_STATUSTEXT 20 static char mav_statustext[LEN_STATUSTEXT]; static int8_t mav_heartbeat = 0; static int8_t mav_heartbeat_recv = 0; @@ -144,6 +145,7 @@ void MAVLINK_Init(void) { * characters are used. To get the full message you can use the commented * funtion below. */ + static inline void REC_MAVLINK_MSG_ID_STATUSTEXT(const mavlink_message_t* msg) { uint8_t temp = mavlink_msg_statustext_get_severity(msg); _MAV_RETURN_char_array(msg, mav_statustext, LEN_STATUSTEXT, 1); @@ -158,26 +160,46 @@ static inline void REC_MAVLINK_MSG_ID_STATUSTEXT(const mavlink_message_t* msg) { * \todo Add battery remaining variable in telemetry_data struct for estimated * remaining battery. Decoding funtion allready in place. */ + static inline void REC_MAVLINK_MSG_ID_SYS_STATUS(const mavlink_message_t* msg) { // mavlink_sys_status_t sys_status; // mavlink_msg_sys_status_decode(msg, &sys_status); telemetry_data.vbat = mavlink_msg_sys_status_get_voltage_battery(msg) / 100; // Voltage * 10 - int8_t temp = mavlink_msg_sys_status_get_battery_remaining(msg); + telemetry_data.ibat = mavlink_msg_sys_status_get_current_battery(msg) / 10; + telemetry_data.rem_bat = mavlink_msg_sys_status_get_battery_remaining(msg); #ifdef MAVLINK_PARAMS telemetry_data.vbat_low = (getMavlinParamsValue(BATT_MONITOR) > 0) && (((float) telemetry_data.vbat / 10.0) < getMavlinParamsValue(LOW_VOLT)) && (telemetry_data.vbat > 50); +#else + telemetry_data.vbat_low = (telemetry_data.rem_bat < 10); #endif } +/*! \brief Recive rc channels + * + */ +static inline void REC_MAVLINK_MSG_ID_RC_CHANNELS_RAW(const mavlink_message_t* msg) { + telemetry_data.rc_rssi = (mavlink_msg_rc_channels_raw_get_rssi(msg) * 100) / 255; +} + +/*! \brief Arducopter specific radio message + * + */ +static inline void REC_MAVLINK_MSG_ID_RADIO(const mavlink_message_t* msg) { + telemetry_data.pc_rssi = (mavlink_msg_radio_get_rssi(msg) * 100) / 255; +// telemetry_data.pc_rssi = mavlink_msg_radio_get_rssi(msg); +} + + /*! \brief Hardbeat message - * \todo Fix hartbeat * on display title see \link telemetryWakeup telemetryWakeup \endlink - * and \link mav_title mav_title \endlink. */ static inline void REC_MAVLINK_MSG_ID_HEARTBEAT(const mavlink_message_t* msg) { telemetry_data.mode = mavlink_msg_heartbeat_get_base_mode(msg); + telemetry_data.custom_mode = mavlink_msg_heartbeat_get_custom_mode(msg); telemetry_data.status = mavlink_msg_heartbeat_get_system_status(msg); + telemetry_data.active = (telemetry_data.mode & MAV_MODE_FLAG_SAFETY_ARMED) ? true : false; mav_heartbeat = 3; // 450ms display '*' mav_heartbeat_recv = 1; } @@ -362,6 +384,11 @@ static inline void handleMessage(mavlink_message_t* p_rxmsg) { REC_MAVLINK_MSG_ID_SYS_STATUS(p_rxmsg); watch_mav_req_start_data_stream = 20; break; + case MAVLINK_MSG_ID_RC_CHANNELS_RAW: + REC_MAVLINK_MSG_ID_RC_CHANNELS_RAW(p_rxmsg); + break; + case MAVLINK_MSG_ID_RADIO: + REC_MAVLINK_MSG_ID_RADIO(p_rxmsg); case MAVLINK_MSG_ID_HIL_CONTROLS: REC_MAVLINK_MSG_ID_HIL_CONTROLS(p_rxmsg); break; diff --git a/src/telemetry/mavlink.h b/src/telemetry/mavlink.h index 7ab1ae071..366f3334b 100644 --- a/src/telemetry/mavlink.h +++ b/src/telemetry/mavlink.h @@ -1,5 +1,23 @@ /* - * Authors - Gerard Valade + * Authors (alphabetical order) + * - Andre Bernet + * - Andreas Weitl + * - Bertrand Songis + * - Bryan J. Rentoul (Gruvin) + * - Cameron Weeks + * - Erez Raviv + * - Gabriel Birkus + * - Gerard Valade + * - Jean-Pierre Parisy + * - Karl Szmutny + * - Michael Blandford + * - Michal Hlavinka + * - Pat Mackenzie + * - Philip Moss + * - Rienk de Jong + * - Rob Thomson + * - Romolo Manfredini + * - Thomas Husterer * * Adapted from mavlink for ardupilot * @@ -30,7 +48,7 @@ extern mavlink_system_t mavlink_system; extern void SERIAL_start_uart_send(); extern void SERIAL_end_uart_send(); -extern void SERIAL_send_uart_bytes(uint8_t * buf, uint16_t len); +extern void SERIAL_send_uart_bytes(const uint8_t * buf, uint16_t len); #define MAVLINK_START_UART_SEND(chan,len) SERIAL_start_uart_send() #define MAVLINK_END_UART_SEND(chan,len) SERIAL_end_uart_send() @@ -44,6 +62,24 @@ extern void SERIAL_send_uart_bytes(uint8_t * buf, uint16_t len); #define ERROR_MAV_ACTION_NB 99 +// Auto Pilot modes +// ---------------- +#define AP_STABILIZE 0 // hold level position +#define AP_ACRO 1 // rate control +#define AP_ALT_HOLD 2 // AUTO control +#define AP_AUTO 3 // AUTO control +#define AP_GUIDED 4 // AUTO control +#define AP_LOITER 5 // Hold a single location +#define AP_RTL 6 // AUTO control +#define AP_CIRCLE 7 // AUTO control +#define AP_POSITION 8 // AUTO control +#define AP_LAND 9 // AUTO control +#define AP_OF_LOITER 10 // Hold a single location using optical flow + // sensor +#define AP_TOY_A 11 // THOR Enum for Toy mode +#define AP_TOY_M 12 // THOR Enum for Toy mode +#define AP_NUM_MODES 13 + /* * Type definitions */ @@ -103,11 +139,18 @@ typedef struct Telemetry_Data_ { uint8_t status; ///< System status flag, see MAV_STATUS ENUM uint16_t packet_drop; uint8_t mode; + uint32_t custom_mode; + bool active; uint8_t nav_mode; uint8_t rcv_control_mode; ///< System mode, see MAV_MODE ENUM in mavlink/include/mavlink_types.h uint16_t load; ///< Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 uint8_t vbat; ///< Battery voltage, in millivolts (1 = 1 millivolt) - uint8_t vbat_low; + uint8_t ibat; ///< Battery voltage, in millivolts (1 = 1 millivolt) + uint8_t rem_bat; ///< Battery voltage, in millivolts (1 = 1 millivolt) + bool vbat_low; + + uint8_t rc_rssi; + uint8_t pc_rssi; uint8_t debug;