Skyward boardcore
Loading...
Searching...
No Matches
MavlinkStatus.h
Go to the documentation of this file.
1/* Copyright (c) 2019 Skyward Experimental Rocketry
2 * Author: Alvise de'Faveri Tron
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22
23#pragma once
24
25#include <logger/Logger.h>
26#include <mavlink_lib/mavlink_types.h>
27
28#include <ostream>
29#include <reflect.hpp>
30#include <string>
31#include <type_traits>
32
33namespace Boardcore
34{
35
36/* uint8_t msg_received; ///< Number of received messages
37 uint8_t buffer_overrun; ///< Number of buffer overruns
38 uint8_t parse_error; ///< Number of parse errors
39 mavlink_parse_state_t parse_state; ///< Parsing state machine
40 uint8_t packet_idx; ///< Index in current packet
41 uint8_t current_rx_seq; ///< Sequence number of last packet received
42 uint8_t current_tx_seq; ///< Sequence number of last packet sent
43 uint16_t packet_rx_success_count; ///< Received packets
44 uint16_t packet_rx_drop_count; ///< Number of packet drops */
45
47{
48 uint64_t timestamp;
49 uint16_t nSendQueue;
50 uint16_t maxSendQueue;
51 uint16_t nSendErrors;
52 uint16_t nDroppedPackets;
53 mavlink_status_t mavStats;
54
55 static constexpr auto reflect()
56 {
57 return STRUCT_DEF(
59 FIELD_DEF(timestamp) FIELD_DEF(nSendQueue) FIELD_DEF(maxSendQueue)
60 FIELD_DEF(nSendErrors) FIELD_DEF(nDroppedPackets) FIELD_DEF2(
61 mavStats, msg_received) FIELD_DEF2(mavStats, buffer_overrun)
62 FIELD_DEF2(mavStats, parse_error) FIELD_DEF2(
63 mavStats, parse_state) FIELD_DEF2(mavStats, packet_idx)
64 FIELD_DEF2(mavStats, current_rx_seq)
65 FIELD_DEF2(mavStats, current_tx_seq)
66 FIELD_DEF2(mavStats, packet_rx_success_count)
67 FIELD_DEF2(mavStats, packet_rx_drop_count));
68 }
69};
70
71} // namespace Boardcore
Driver for the VN100S IMU.