Classes | Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | List of all members
TelegramParser Class Reference

#include <TelegramS300.h>

Classes

union  TELEGRAM_COMMON1
 
union  TELEGRAM_COMMON2
 
union  TELEGRAM_COMMON3
 
union  TELEGRAM_DISTANCE
 
union  TELEGRAM_S300_DIST_2B
 
union  TELEGRAM_TAIL
 

Public Member Functions

int getCompletePacketSize () const
 
int getField () const
 
bool isDist () const
 
bool parseHeader (const unsigned char *buffer, const size_t max_size, const uint8_t DEVICE_ADDR, const bool debug)
 
void readDistRaw (const unsigned char *buffer, std::vector< int > &res, bool debug) const
 
 TelegramParser ()
 

Private Types

enum  TELEGRAM_COMMON_HS { JUNK_SIZE =4 }
 
enum  TELEGRAM_COMMON_TYPES { IO =0xAAAA, DISTANCE =0xBBBB, REFLEXION =0xCCCC }
 
enum  TELEGRAM_DIST_SECTOR {
  _1 =0x1111, _2 =0x2222, _3 =0x3333, _4 =0x4444,
  _5 =0x5555
}
 

Static Private Member Functions

static bool check (const TELEGRAM_COMMON1 &tc, const uint8_t DEVICE_ADDR)
 
static unsigned int createCRC (uint8_t *ptrData, int Size)
 
static void ntoh (TELEGRAM_COMMON1 &tc)
 
static void ntoh (TELEGRAM_COMMON2 &tc)
 
static void ntoh (TELEGRAM_COMMON3 &tc)
 
static void ntoh (TELEGRAM_DISTANCE &tc)
 
static void ntoh (TELEGRAM_TAIL &tc)
 
static void print (const TELEGRAM_COMMON1 &tc)
 
static void print (const TELEGRAM_COMMON2 &tc)
 
static void print (const TELEGRAM_COMMON3 &tc)
 
static void print (const TELEGRAM_DISTANCE &tc)
 
static void print (const TELEGRAM_TAIL &tc)
 

Private Attributes

int crc_bytes_in_size_
 
int size_field_start_byte_
 
TELEGRAM_COMMON1 tc1_
 
TELEGRAM_COMMON2 tc2_
 
TELEGRAM_COMMON3 tc3_
 
TELEGRAM_DISTANCE td_
 
int user_data_size_
 

Detailed Description

Definition at line 44 of file TelegramS300.h.

Member Enumeration Documentation

Enumerator
JUNK_SIZE 

Definition at line 100 of file TelegramS300.h.

Enumerator
IO 
DISTANCE 
REFLEXION 

Definition at line 101 of file TelegramS300.h.

Enumerator
_1 
_2 
_3 
_4 
_5 

Definition at line 102 of file TelegramS300.h.

Constructor & Destructor Documentation

TelegramParser::TelegramParser ( )
inline

Definition at line 203 of file TelegramS300.h.

Member Function Documentation

static bool TelegramParser::check ( const TELEGRAM_COMMON1 tc,
const uint8_t  DEVICE_ADDR 
)
inlinestaticprivate

Definition at line 182 of file TelegramS300.h.

unsigned int TelegramParser::createCRC ( uint8_t *  ptrData,
int  Size 
)
staticprivate

Definition at line 65 of file ScannerSickS300.cpp.

int TelegramParser::getCompletePacketSize ( ) const
inline

Definition at line 339 of file TelegramS300.h.

int TelegramParser::getField ( ) const
inline

Definition at line 328 of file TelegramS300.h.

bool TelegramParser::isDist ( ) const
inline

Definition at line 327 of file TelegramS300.h.

static void TelegramParser::ntoh ( TELEGRAM_COMMON1 tc)
inlinestaticprivate

Definition at line 105 of file TelegramS300.h.

static void TelegramParser::ntoh ( TELEGRAM_COMMON2 tc)
inlinestaticprivate

Definition at line 111 of file TelegramS300.h.

static void TelegramParser::ntoh ( TELEGRAM_COMMON3 tc)
inlinestaticprivate

Definition at line 118 of file TelegramS300.h.

static void TelegramParser::ntoh ( TELEGRAM_DISTANCE tc)
inlinestaticprivate

Definition at line 122 of file TelegramS300.h.

static void TelegramParser::ntoh ( TELEGRAM_TAIL tc)
inlinestaticprivate

Definition at line 126 of file TelegramS300.h.

bool TelegramParser::parseHeader ( const unsigned char *  buffer,
const size_t  max_size,
const uint8_t  DEVICE_ADDR,
const bool  debug 
)
inline

Definition at line 209 of file TelegramS300.h.

static void TelegramParser::print ( const TELEGRAM_COMMON1 tc)
inlinestaticprivate

Definition at line 131 of file TelegramS300.h.

static void TelegramParser::print ( const TELEGRAM_COMMON2 tc)
inlinestaticprivate

Definition at line 140 of file TelegramS300.h.

static void TelegramParser::print ( const TELEGRAM_COMMON3 tc)
inlinestaticprivate

Definition at line 147 of file TelegramS300.h.

static void TelegramParser::print ( const TELEGRAM_DISTANCE tc)
inlinestaticprivate

Definition at line 158 of file TelegramS300.h.

static void TelegramParser::print ( const TELEGRAM_TAIL tc)
inlinestaticprivate

Definition at line 172 of file TelegramS300.h.

void TelegramParser::readDistRaw ( const unsigned char *  buffer,
std::vector< int > &  res,
bool  debug 
) const
inline

Definition at line 343 of file TelegramS300.h.

Member Data Documentation

int TelegramParser::crc_bytes_in_size_
private

Definition at line 200 of file TelegramS300.h.

int TelegramParser::size_field_start_byte_
private

Definition at line 200 of file TelegramS300.h.

TELEGRAM_COMMON1 TelegramParser::tc1_
private

Definition at line 196 of file TelegramS300.h.

TELEGRAM_COMMON2 TelegramParser::tc2_
private

Definition at line 197 of file TelegramS300.h.

TELEGRAM_COMMON3 TelegramParser::tc3_
private

Definition at line 198 of file TelegramS300.h.

TELEGRAM_DISTANCE TelegramParser::td_
private

Definition at line 199 of file TelegramS300.h.

int TelegramParser::user_data_size_
private

Definition at line 200 of file TelegramS300.h.


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


cob_sick_s300
Author(s): Florian Weisshardt
autogenerated on Wed Apr 7 2021 02:11:50