ESPHome  2024.11.1
Data Structures | Typedefs | Enumerations | Functions | Variables
esphome::sml Namespace Reference

Data Structures

class  DataTrigger
 
class  ObisInfo
 
class  Sml
 
class  SmlFile
 
class  SmlListener
 
class  SmlNode
 
class  SmlSensor
 
class  SmlTextSensor
 

Typedefs

using bytes = std::vector< uint8_t >
 

Enumerations

enum  SmlType : uint8_t {
  SML_OCTET = 0, SML_BOOL = 4, SML_INT = 5, SML_UINT = 6,
  SML_LIST = 7, SML_HEX = 10, SML_UNDEFINED = 255
}
 
enum  SmlMessageType : uint16_t { SML_PUBLIC_OPEN_RES = 0x0101, SML_GET_LIST_RES = 0x701 }
 

Functions

bool check_sml_data (const bytes &buffer)
 
uint8_t get_code (uint8_t byte)
 
std::string bytes_repr (const bytes &buffer)
 
uint64_t bytes_to_uint (const bytes &buffer)
 
int64_t bytes_to_int (const bytes &buffer)
 
std::string bytes_to_string (const bytes &buffer)
 

Variables

const uint16_t START_MASK = 0x55aa
 
const uint16_t END_MASK = 0x0157
 
const std::vector< uint8_t > START_SEQ = {0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01}
 
const char START_BYTES_DETECTED = 1
 
const char END_BYTES_DETECTED = 2
 

Typedef Documentation

◆ bytes

using esphome::sml::bytes = typedef std::vector<uint8_t>

Definition at line 12 of file sml_parser.h.

Enumeration Type Documentation

◆ SmlMessageType

Enumerator
SML_PUBLIC_OPEN_RES 
SML_GET_LIST_RES 

Definition at line 18 of file constants.h.

◆ SmlType

enum esphome::sml::SmlType : uint8_t
Enumerator
SML_OCTET 
SML_BOOL 
SML_INT 
SML_UINT 
SML_LIST 
SML_HEX 
SML_UNDEFINED 

Definition at line 8 of file constants.h.

Function Documentation

◆ bytes_repr()

std::string esphome::sml::bytes_repr ( const bytes buffer)

Definition at line 106 of file sml_parser.cpp.

◆ bytes_to_int()

int64_t esphome::sml::bytes_to_int ( const bytes buffer)

Definition at line 122 of file sml_parser.cpp.

◆ bytes_to_string()

std::string esphome::sml::bytes_to_string ( const bytes buffer)

Definition at line 138 of file sml_parser.cpp.

◆ bytes_to_uint()

uint64_t esphome::sml::bytes_to_uint ( const bytes buffer)

Definition at line 114 of file sml_parser.cpp.

◆ check_sml_data()

bool esphome::sml::check_sml_data ( const bytes buffer)

Definition at line 108 of file sml.cpp.

◆ get_code()

uint8_t esphome::sml::get_code ( uint8_t  byte)

Definition at line 132 of file sml.cpp.

Variable Documentation

◆ END_BYTES_DETECTED

const char esphome::sml::END_BYTES_DETECTED = 2

Definition at line 12 of file sml.cpp.

◆ END_MASK

const uint16_t esphome::sml::END_MASK = 0x0157

Definition at line 22 of file constants.h.

◆ START_BYTES_DETECTED

const char esphome::sml::START_BYTES_DETECTED = 1

Definition at line 11 of file sml.cpp.

◆ START_MASK

const uint16_t esphome::sml::START_MASK = 0x55aa

Definition at line 21 of file constants.h.

◆ START_SEQ

const std::vector<uint8_t> esphome::sml::START_SEQ = {0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01}

Definition at line 24 of file constants.h.