ESPHome  2024.12.2
Public Member Functions | Protected Attributes
esphome::modbus::ModbusDevice Class Referenceabstract

#include <modbus.h>

Inheritance diagram for esphome::modbus::ModbusDevice:
esphome::growatt_solar::GrowattSolar esphome::havells_solar::HavellsSolar esphome::kuntze::Kuntze esphome::modbus_controller::ModbusController esphome::pzemac::PZEMAC esphome::pzemdc::PZEMDC esphome::sdm_meter::SDMMeter esphome::selec_meter::SelecMeter

Public Member Functions

void set_parent (Modbus *parent)
 
void set_address (uint8_t address)
 
virtual void on_modbus_data (const std::vector< uint8_t > &data)=0
 
virtual void on_modbus_error (uint8_t function_code, uint8_t exception_code)
 
virtual void on_modbus_read_registers (uint8_t function_code, uint16_t start_address, uint16_t number_of_registers)
 
void send (uint8_t function, uint16_t start_address, uint16_t number_of_entities, uint8_t payload_len=0, const uint8_t *payload=nullptr)
 
void send_raw (const std::vector< uint8_t > &payload)
 
bool waiting_for_response ()
 

Protected Attributes

friend Modbus
 
Modbusparent_
 
uint8_t address_
 

Detailed Description

Definition at line 55 of file modbus.h.

Member Function Documentation

◆ on_modbus_data()

virtual void esphome::modbus::ModbusDevice::on_modbus_data ( const std::vector< uint8_t > &  data)
pure virtual

◆ on_modbus_error()

virtual void esphome::modbus::ModbusDevice::on_modbus_error ( uint8_t  function_code,
uint8_t  exception_code 
)
inlinevirtual

Reimplemented in esphome::modbus_controller::ModbusController.

Definition at line 60 of file modbus.h.

◆ on_modbus_read_registers()

virtual void esphome::modbus::ModbusDevice::on_modbus_read_registers ( uint8_t  function_code,
uint16_t  start_address,
uint16_t  number_of_registers 
)
inlinevirtual

Reimplemented in esphome::modbus_controller::ModbusController.

Definition at line 61 of file modbus.h.

◆ send()

void esphome::modbus::ModbusDevice::send ( uint8_t  function,
uint16_t  start_address,
uint16_t  number_of_entities,
uint8_t  payload_len = 0,
const uint8_t *  payload = nullptr 
)
inline

Definition at line 62 of file modbus.h.

◆ send_raw()

void esphome::modbus::ModbusDevice::send_raw ( const std::vector< uint8_t > &  payload)
inline

Definition at line 66 of file modbus.h.

◆ set_address()

void esphome::modbus::ModbusDevice::set_address ( uint8_t  address)
inline

Definition at line 58 of file modbus.h.

◆ set_parent()

void esphome::modbus::ModbusDevice::set_parent ( Modbus parent)
inline

Definition at line 57 of file modbus.h.

◆ waiting_for_response()

bool esphome::modbus::ModbusDevice::waiting_for_response ( )
inline

Definition at line 68 of file modbus.h.

Field Documentation

◆ address_

uint8_t esphome::modbus::ModbusDevice::address_
protected

Definition at line 74 of file modbus.h.

◆ Modbus

friend esphome::modbus::ModbusDevice::Modbus
protected

Definition at line 71 of file modbus.h.

◆ parent_

Modbus* esphome::modbus::ModbusDevice::parent_
protected

Definition at line 73 of file modbus.h.


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