ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
esphome::ld600x::FrameParser Class Referencefinal

#include <ld600x_frame.h>

Public Member Functions

void init (uint8_t *buffer, uint16_t capacity)
 
bool feed (uint8_t byte)
 
uint16_t type () const
 
uint16_t id () const
 
uint16_t length () const
 
const uint8_t * data () const
 
uint16_t capacity () const
 
void reset ()
 

Protected Types

enum class  ParseState : uint8_t {
  PARSE_STATE_SOF , PARSE_STATE_HEADER , PARSE_STATE_HCK , PARSE_STATE_DATA ,
  PARSE_STATE_DCK , PARSE_STATE_DISCARD
}
 

Protected Member Functions

void start_header_ ()
 

Protected Attributes

uint8_t * data_buf_ {nullptr}
 
uint16_t data_len_ {0}
 
uint16_t frame_type_ {0}
 
uint16_t frame_id_ {0}
 
uint16_t pos_ {0}
 
uint16_t max_data_len_ {0}
 
ParseState parse_state_ {ParseState::PARSE_STATE_SOF}
 
uint8_t xor_ {0}
 

Detailed Description

Definition at line 22 of file ld600x_frame.h.

Member Enumeration Documentation

◆ ParseState

enum class esphome::ld600x::FrameParser::ParseState : uint8_t
strongprotected
Enumerator
PARSE_STATE_SOF 
PARSE_STATE_HEADER 
PARSE_STATE_HCK 
PARSE_STATE_DATA 
PARSE_STATE_DCK 
PARSE_STATE_DISCARD 

Definition at line 35 of file ld600x_frame.h.

Member Function Documentation

◆ capacity()

uint16_t esphome::ld600x::FrameParser::capacity ( ) const
inline

Definition at line 31 of file ld600x_frame.h.

◆ data()

const uint8_t * esphome::ld600x::FrameParser::data ( ) const
inline

Definition at line 30 of file ld600x_frame.h.

◆ feed()

bool esphome::ld600x::FrameParser::feed ( uint8_t byte)

Definition at line 23 of file ld600x_frame.cpp.

◆ id()

uint16_t esphome::ld600x::FrameParser::id ( ) const
inline

Definition at line 28 of file ld600x_frame.h.

◆ init()

void esphome::ld600x::FrameParser::init ( uint8_t * buffer,
uint16_t capacity )

Definition at line 11 of file ld600x_frame.cpp.

◆ length()

uint16_t esphome::ld600x::FrameParser::length ( ) const
inline

Definition at line 29 of file ld600x_frame.h.

◆ reset()

void esphome::ld600x::FrameParser::reset ( )
inline

Definition at line 32 of file ld600x_frame.h.

◆ start_header_()

void esphome::ld600x::FrameParser::start_header_ ( )
protected

Definition at line 17 of file ld600x_frame.cpp.

◆ type()

uint16_t esphome::ld600x::FrameParser::type ( ) const
inline

Definition at line 27 of file ld600x_frame.h.

Field Documentation

◆ data_buf_

uint8_t* esphome::ld600x::FrameParser::data_buf_ {nullptr}
protected

Definition at line 46 of file ld600x_frame.h.

◆ data_len_

uint16_t esphome::ld600x::FrameParser::data_len_ {0}
protected

Definition at line 47 of file ld600x_frame.h.

◆ frame_id_

uint16_t esphome::ld600x::FrameParser::frame_id_ {0}
protected

Definition at line 49 of file ld600x_frame.h.

◆ frame_type_

uint16_t esphome::ld600x::FrameParser::frame_type_ {0}
protected

Definition at line 48 of file ld600x_frame.h.

◆ max_data_len_

uint16_t esphome::ld600x::FrameParser::max_data_len_ {0}
protected

Definition at line 52 of file ld600x_frame.h.

◆ parse_state_

ParseState esphome::ld600x::FrameParser::parse_state_ {ParseState::PARSE_STATE_SOF}
protected

Definition at line 53 of file ld600x_frame.h.

◆ pos_

uint16_t esphome::ld600x::FrameParser::pos_ {0}
protected

Definition at line 51 of file ld600x_frame.h.

◆ xor_

uint8_t esphome::ld600x::FrameParser::xor_ {0}
protected

Definition at line 54 of file ld600x_frame.h.


The documentation for this class was generated from the following files: