3 #include "AP_Frsky_MAVlite_Message.h"
4 #include "AP_Frsky_SPort.h"
8 #if HAL_WITH_FRSKY_TELEM_BIDIRECTIONAL
10 * An instance of this class decodes a stream of SPort packets into a
11 * MAVlite message (see AP_Frsky_MAVlite_Message.h). It is expected
12 * that the same rxmsg is passed into process() multiple times, each
13 * time with a new sport packet. If a packet is successfully decodes
14 * then process() will return true and rxmsg can be used as a MAVlite
17 * See AP_Frsky_MAVlite.h for a description of the encoding of a
18 * MAVlite message in SPort packets.
20 class AP_Frsky_MAVlite_SPortToMAVlite
{
23 bool process(AP_Frsky_MAVlite_Message
&rxmsg
,
24 const AP_Frsky_SPort::sport_packet_t
&packet
) WARN_IF_UNUSED
;
31 uint8_t payload_next_byte
;
33 enum class State
: uint8_t {
42 State parse_state
= State::IDLE
;
44 AP_Frsky_MAVlite_Message _rxmsg
;
45 void parse(const uint8_t byte
);
47 int16_t checksum
; // sent at end of packet
48 void update_checksum(const uint8_t c
);