Public Member Functions | Private Attributes | List of all members
prbt_hardware_support::LibModbusClient Class Reference

Wrapper around libmodbus, see https://libmodbus.org/. More...

#include <libmodbus_client.h>

Inheritance diagram for prbt_hardware_support::LibModbusClient:
Inheritance graph
[legend]

Public Member Functions

void close ()
 Close connection with server. More...
 
unsigned long getResponseTimeoutInMs () override
 See base class. More...
 
bool init (const char *ip, unsigned int port) override
 See base class. More...
 
RegCont readHoldingRegister (int addr, int nb) override
 See base class. More...
 
void setResponseTimeoutInMs (unsigned long timeout_ms) override
 See base class. More...
 
RegCont writeReadHoldingRegister (const int write_addr, const RegCont &write_reg, const int read_addr, const int read_nb) override
 See base class. More...
 
virtual ~LibModbusClient () override
 See base class. More...
 
- Public Member Functions inherited from prbt_hardware_support::ModbusClient
virtual ~ModbusClient ()=default
 

Private Attributes

modbus_t * modbus_connection_ { nullptr }
 

Detailed Description

Wrapper around libmodbus, see https://libmodbus.org/.

Used by PilzModbusClient to access a modbus server

Definition at line 34 of file libmodbus_client.h.

Constructor & Destructor Documentation

◆ ~LibModbusClient()

prbt_hardware_support::LibModbusClient::~LibModbusClient ( )
overridevirtual

See base class.

Definition at line 31 of file libmodbus_client.cpp.

Member Function Documentation

◆ close()

void prbt_hardware_support::LibModbusClient::close ( )

Close connection with server.

Definition at line 145 of file libmodbus_client.cpp.

◆ getResponseTimeoutInMs()

unsigned long prbt_hardware_support::LibModbusClient::getResponseTimeoutInMs ( )
overridevirtual

See base class.

Implements prbt_hardware_support::ModbusClient.

Definition at line 77 of file libmodbus_client.cpp.

◆ init()

bool prbt_hardware_support::LibModbusClient::init ( const char *  ip,
unsigned int  port 
)
overridevirtual

See base class.

Implements prbt_hardware_support::ModbusClient.

Definition at line 36 of file libmodbus_client.cpp.

◆ readHoldingRegister()

RegCont prbt_hardware_support::LibModbusClient::readHoldingRegister ( int  addr,
int  nb 
)
overridevirtual

See base class.

Implements prbt_hardware_support::ModbusClient.

Definition at line 84 of file libmodbus_client.cpp.

◆ setResponseTimeoutInMs()

void prbt_hardware_support::LibModbusClient::setResponseTimeoutInMs ( unsigned long  timeout_ms)
overridevirtual

See base class.

Implements prbt_hardware_support::ModbusClient.

Definition at line 69 of file libmodbus_client.cpp.

◆ writeReadHoldingRegister()

RegCont prbt_hardware_support::LibModbusClient::writeReadHoldingRegister ( const int  write_addr,
const RegCont write_reg,
const int  read_addr,
const int  read_nb 
)
overridevirtual

See base class.

Implements prbt_hardware_support::ModbusClient.

Definition at line 109 of file libmodbus_client.cpp.

Member Data Documentation

◆ modbus_connection_

modbus_t* prbt_hardware_support::LibModbusClient::modbus_connection_ { nullptr }
private

Definition at line 62 of file libmodbus_client.h.


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


prbt_hardware_support
Author(s):
autogenerated on Mon Oct 19 2020 03:15:58