#include <navcom_msg.H>
Public Member Functions | |
| msg_t () | |
| unsigned | decode (unsigned size_, unsigned char const *data_) |
| bool | valid () const |
| unsigned | size () const |
| unsigned char const * | data () const |
| u8_t | stx () const |
| u8_t | preamble1 () const |
| u8_t | preamble2 () const |
| u8_t | command () const |
| u16_t | length () const |
| u8_t | cksum () const |
| u8_t | etx () const |
Static Public Attributes | |
| static unsigned const | MAX_SIZE = 65543 |
| static u8_t const | STX = 0x02 |
| static u8_t const | PREAMBLE1 = 0x99 |
| static u8_t const | PREAMBLE2 = 0x66 |
| static u8_t const | ETX = 0x03 |
Static Protected Member Functions | |
| static unsigned | skip_to_stx (unsigned size_, unsigned char const *data_) |
Protected Attributes | |
| bool | m_valid |
| unsigned | m_size |
| u8_t const * | m_data |
Static Protected Attributes | |
| static unsigned const | STX_OFFSET = 0 |
| static unsigned const | PREAMBLE1_OFFSET = 1 |
| static unsigned const | PREAMBLE2_OFFSET = 2 |
| static unsigned const | COMMAND_OFFSET = 3 |
| static unsigned const | LENGTH_OFFSET = 4 |
| static unsigned const | ENVELOPE_SIZE = 4 |
| static unsigned const | MIN_SIZE = 8 |
| navcom::msg_t::msg_t | ( | ) | [inline] |
| u8_t navcom::msg_t::command | ( | ) | const [inline] |
References COMMAND_OFFSET, and m_data.
| unsigned char const* navcom::msg_t::data | ( | ) | const [inline] |
References m_data.
| unsigned msg_t::decode | ( | unsigned | size_, | |
| unsigned char const * | data_ | |||
| ) |
References cksum(), COMMAND_OFFSET, ENVELOPE_SIZE, ETX, etx(), LENGTH_OFFSET, m_data, m_size, m_valid, MIN_SIZE, PREAMBLE1, PREAMBLE1_OFFSET, PREAMBLE2, PREAMBLE2_OFFSET, skip_to_stx(), STX, and STX_OFFSET.
Referenced by main().
| u16_t navcom::msg_t::length | ( | ) | const [inline] |
References LENGTH_OFFSET, and m_data.
| u8_t navcom::msg_t::preamble1 | ( | ) | const [inline] |
References m_data, and PREAMBLE1_OFFSET.
| u8_t navcom::msg_t::preamble2 | ( | ) | const [inline] |
References m_data, and PREAMBLE2_OFFSET.
| unsigned navcom::msg_t::size | ( | ) | const [inline] |
References m_size.
| unsigned msg_t::skip_to_stx | ( | unsigned | size_, | |
| unsigned char const * | data_ | |||
| ) | [static, protected] |
| u8_t navcom::msg_t::stx | ( | ) | const [inline] |
References m_data, and STX_OFFSET.
Referenced by skip_to_stx().
unsigned const navcom::msg_t::COMMAND_OFFSET = 3 [static, protected] |
unsigned const navcom::msg_t::ENVELOPE_SIZE = 4 [static, protected] |
Referenced by decode().
u8_t const navcom::msg_t::ETX = 0x03 [static] |
Referenced by decode().
unsigned const navcom::msg_t::LENGTH_OFFSET = 4 [static, protected] |
u8_t const* navcom::msg_t::m_data [protected] |
Referenced by cksum(), command(), data(), decode(), etx(), length(), preamble1(), preamble2(), and stx().
unsigned navcom::msg_t::m_size [protected] |
bool navcom::msg_t::m_valid [protected] |
unsigned const navcom::msg_t::MAX_SIZE = 65543 [static] |
unsigned const navcom::msg_t::MIN_SIZE = 8 [static, protected] |
Referenced by decode().
u8_t const navcom::msg_t::PREAMBLE1 = 0x99 [static] |
Referenced by decode().
unsigned const navcom::msg_t::PREAMBLE1_OFFSET = 1 [static, protected] |
Referenced by decode(), and preamble1().
u8_t const navcom::msg_t::PREAMBLE2 = 0x66 [static] |
Referenced by decode().
unsigned const navcom::msg_t::PREAMBLE2_OFFSET = 2 [static, protected] |
Referenced by decode(), and preamble2().
u8_t const navcom::msg_t::STX = 0x02 [static] |
Referenced by decode(), and skip_to_stx().
unsigned const navcom::msg_t::STX_OFFSET = 0 [static, protected] |
1.6.1