Public Member Functions | Private Member Functions | Private Attributes | List of all members
livox_ros::CommProtocol Class Reference

#include <comm_protocol.h>

Public Member Functions

 CommProtocol (ProtocolConfig &config)
 
uint8_tFetchCacheFreeSpace (uint32_t *o_len)
 
uint16_t GetAndUpdateSeqNum ()
 
int32_t Pack (uint8_t *o_buf, uint32_t o_buf_size, uint32_t *o_len, const CommPacket &i_packet)
 
int32_t ParseCommStream (CommPacket *o_pack)
 
void ResetParser ()
 
int32_t UpdateCacheWrIdx (uint32_t used_size)
 
 ~CommProtocol ()
 

Private Member Functions

int32_t FsmFindPacketLength ()
 
int32_t FsmGetPacketData (CommPacket *o_pack)
 
void FsmParserStateTransfer (uint32_t new_state)
 
int32_t FsmSearchPacketPreamble ()
 
uint8_tGetCacheReadPos ()
 
uint32_t GetCacheTailSize ()
 
uint32_t GetValidDataSize ()
 
bool IsLengthKnown ()
 
void ResetCache ()
 
void UpdateCache (void)
 

Private Attributes

CommCache cache_
 
ProtocolConfig config_
 
volatile uint32_t fsm_parse_step_
 
bool is_length_known
 
volatile uint32_t offset_to_read_index_
 
uint32_t packet_length_
 
Protocolprotocol_
 
uint16_t seq_num_
 

Detailed Description

Definition at line 52 of file comm_protocol.h.

Constructor & Destructor Documentation

livox_ros::CommProtocol::CommProtocol ( ProtocolConfig config)

Definition at line 32 of file comm_protocol.cpp.

livox_ros::CommProtocol::~CommProtocol ( )

Definition at line 48 of file comm_protocol.cpp.

Member Function Documentation

uint8_t * livox_ros::CommProtocol::FetchCacheFreeSpace ( uint32_t o_len)

Definition at line 54 of file comm_protocol.cpp.

int32_t livox_ros::CommProtocol::FsmFindPacketLength ( )
private

Definition at line 175 of file comm_protocol.cpp.

int32_t livox_ros::CommProtocol::FsmGetPacketData ( CommPacket o_pack)
private

Definition at line 194 of file comm_protocol.cpp.

void livox_ros::CommProtocol::FsmParserStateTransfer ( uint32_t  new_state)
inlineprivate

Definition at line 95 of file comm_protocol.h.

int32_t livox_ros::CommProtocol::FsmSearchPacketPreamble ( )
private

Definition at line 149 of file comm_protocol.cpp.

uint16_t livox_ros::CommProtocol::GetAndUpdateSeqNum ( )

Definition at line 141 of file comm_protocol.cpp.

uint8_t* livox_ros::CommProtocol::GetCacheReadPos ( )
inlineprivate

Definition at line 74 of file comm_protocol.h.

uint32_t livox_ros::CommProtocol::GetCacheTailSize ( )
private

Definition at line 75 of file comm_protocol.cpp.

uint32_t livox_ros::CommProtocol::GetValidDataSize ( )
private

Definition at line 83 of file comm_protocol.cpp.

bool livox_ros::CommProtocol::IsLengthKnown ( )
inlineprivate

Definition at line 87 of file comm_protocol.h.

int32_t livox_ros::CommProtocol::Pack ( uint8_t o_buf,
uint32_t  o_buf_size,
uint32_t o_len,
const CommPacket i_packet 
)

Definition at line 107 of file comm_protocol.cpp.

int32_t livox_ros::CommProtocol::ParseCommStream ( CommPacket o_pack)

Definition at line 114 of file comm_protocol.cpp.

void livox_ros::CommProtocol::ResetCache ( )
inlineprivate

Definition at line 75 of file comm_protocol.h.

void livox_ros::CommProtocol::ResetParser ( )

Definition at line 112 of file comm_protocol.cpp.

void livox_ros::CommProtocol::UpdateCache ( void  )
private

Definition at line 91 of file comm_protocol.cpp.

int32_t livox_ros::CommProtocol::UpdateCacheWrIdx ( uint32_t  used_size)

Definition at line 66 of file comm_protocol.cpp.

Member Data Documentation

CommCache livox_ros::CommProtocol::cache_
private

Definition at line 83 of file comm_protocol.h.

ProtocolConfig livox_ros::CommProtocol::config_
private

Definition at line 81 of file comm_protocol.h.

volatile uint32_t livox_ros::CommProtocol::fsm_parse_step_
private

Definition at line 91 of file comm_protocol.h.

bool livox_ros::CommProtocol::is_length_known
private

Definition at line 86 of file comm_protocol.h.

volatile uint32_t livox_ros::CommProtocol::offset_to_read_index_
private

Definition at line 89 of file comm_protocol.h.

uint32_t livox_ros::CommProtocol::packet_length_
private

Definition at line 90 of file comm_protocol.h.

Protocol* livox_ros::CommProtocol::protocol_
private

Definition at line 82 of file comm_protocol.h.

uint16_t livox_ros::CommProtocol::seq_num_
private

Definition at line 84 of file comm_protocol.h.


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


livox_ros_driver
Author(s): Livox Dev Team
autogenerated on Mon Mar 15 2021 02:40:46