ModbusSMA  v1.0.0
modbusSMA::MBConnectionIP_PI Class Reference

Class for an IP based modbus connection. More...

#include <MBConnectionIP_PI.hpp>

Inheritance diagram for modbusSMA::MBConnectionIP_PI:
[legend]
Collaboration diagram for modbusSMA::MBConnectionIP_PI:
[legend]

Public Member Functions

 MBConnectionIP_PI (std::string _node, std::string _service)
 This constructor only initializes the IP and the port.
 
 MBConnectionIP_PI (MBConnectionIP_PI const &)=delete
 
void operator= (MBConnectionIP_PI const &)=delete
 
std::string getNode () const
 Returns the Node used. More...
 
std::string getService () const
 Returns the service used. More...
 
ConnectionType type () override
 Returns the modbus connection type. More...
 
std::string description () override
 Textual description of the connection. More...
 
- Public Member Functions inherited from modbusSMA::MBConnectionBase
virtual ~MBConnectionBase ()
 Disconnects the modbus connection if neccessary.
 
 MBConnectionBase (MBConnectionBase const &)=delete
 
void operator= (MBConnectionBase const &)=delete
 
ErrorCode connect ()
 Creates the modbus connection based on the backend context implementation. More...
 
ErrorCode setSlaveID (int _id)
 Sets the slave/uinit ID of the modbus connection. More...
 
void disconnect ()
 Disconnects an active modbus connnection (if present, else does nothing).
 
bool isConnected () const
 Returns whether a valid conection exists. More...
 
std::vector< uint16_t > readRegisters (uint32_t _reg, uint32_t _num)
 read _num registers from the device More...
 
modbus_t * getConnection ()
 Returns the raw connection. More...
 

Protected Member Functions

modbus_t * createModbusContext () override
 Creates the modbus IP context. More...
 

Detailed Description

Class for an IP based modbus connection.

Definition at line 29 of file MBConnectionIP_PI.hpp.

Member Function Documentation

◆ createModbusContext()

modbus_t * MBConnectionIP_PI::createModbusContext ( )
overrideprotectedvirtual

Creates the modbus IP context.

Returns nullptr on error.

Implements modbusSMA::MBConnectionBase.

Definition at line 34 of file MBConnectionIP_PI.cpp.

◆ description()

string MBConnectionIP_PI::description ( )
overridevirtual

Textual description of the connection.

Implements modbusSMA::MBConnectionBase.

Definition at line 47 of file MBConnectionIP_PI.cpp.

◆ getNode()

std::string modbusSMA::MBConnectionIP_PI::getNode ( ) const
inline

Returns the Node used.

Definition at line 44 of file MBConnectionIP_PI.hpp.

◆ getService()

std::string modbusSMA::MBConnectionIP_PI::getService ( ) const
inline

Returns the service used.

Definition at line 45 of file MBConnectionIP_PI.hpp.

◆ type()

ConnectionType modbusSMA::MBConnectionIP_PI::type ( )
inlineoverridevirtual

Returns the modbus connection type.

Implements modbusSMA::MBConnectionBase.

Definition at line 47 of file MBConnectionIP_PI.hpp.


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