ESPHome  2024.5.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)
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
uint8_t address_

Detailed Description

Definition at line 47 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 

Reimplemented in esphome::modbus_controller::ModbusController.

Definition at line 52 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 

Definition at line 53 of file modbus.h.

◆ send_raw()

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

Definition at line 57 of file modbus.h.

◆ set_address()

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

Definition at line 50 of file modbus.h.

◆ set_parent()

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

Definition at line 49 of file modbus.h.

◆ waiting_for_response()

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

Definition at line 59 of file modbus.h.

Field Documentation

◆ address_

uint8_t esphome::modbus::ModbusDevice::address_

Definition at line 65 of file modbus.h.

◆ Modbus

friend esphome::modbus::ModbusDevice::Modbus

Definition at line 62 of file modbus.h.

◆ parent_

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

Definition at line 64 of file modbus.h.

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