liblightmodbus 3.0
A lightweight, header-only, hardware-agnostic Modbus RTU/TCP library
Loading...
Searching...
No Matches
llm::Master Class Reference

Represents a Modbus master device. More...

#include <lightmodbus.hpp>

+ Collaboration diagram for llm::Master:

Public Member Functions

 Master (ModbusDataCallback dataCallback, ModbusMasterExceptionCallback exceptionCallback=nullptr, ModbusAllocator allocator=modbusDefaultAllocator, ModbusMasterFunctionHandler *functions=modbusMasterDefaultFunctions, uint16_t functionCount=modbusMasterDefaultFunctionCount)
 
 ~Master ()
 
 Master (const Master &)=delete
 
 Master (Master &&)=delete
 
Masteroperator= (const Master &)=delete
 
Masteroperator= (Master &&)=delete
 
void parseResponsePDU (uint8_t address, const uint8_t *request, uint8_t requestLength, const uint8_t *response, uint8_t responseLength)
 
void parseResponseRTU (const uint8_t *request, uint8_t requestLength, const uint8_t *response, uint8_t responseLength)
 
void parseResponseTCP (const uint8_t *request, uint8_t requestLength, const uint8_t *response, uint8_t responseLength)
 
void buildRequest01PDU (uint16_t index, uint16_t count)
 
void buildRequest02PDU (uint16_t index, uint16_t count)
 
void buildRequest03PDU (uint16_t index, uint16_t count)
 
void buildRequest04PDU (uint16_t index, uint16_t count)
 
void buildRequest05PDU (uint16_t index, uint16_t count)
 
void buildRequest06PDU (uint16_t index, uint16_t count)
 
void buildRequest15PDU (uint16_t index, uint16_t count, const uint8_t *values)
 
void buildRequest16PDU (uint16_t index, uint16_t count, const uint16_t *values)
 
void buildRequest22PDU (uint16_t index, uint16_t andmask, uint16_t ormask)
 
void buildRequest01RTU (uint8_t address, uint16_t index, uint16_t count)
 
void buildRequest02RTU (uint8_t address, uint16_t index, uint16_t count)
 
void buildRequest03RTU (uint8_t address, uint16_t index, uint16_t count)
 
void buildRequest04RTU (uint8_t address, uint16_t index, uint16_t count)
 
void buildRequest05RTU (uint8_t address, uint16_t index, uint16_t count)
 
void buildRequest06RTU (uint8_t address, uint16_t index, uint16_t count)
 
void buildRequest15RTU (uint8_t address, uint16_t index, uint16_t count, const uint8_t *values)
 
void buildRequest16RTU (uint8_t address, uint16_t index, uint16_t count, const uint16_t *values)
 
void buildRequest22RTU (uint8_t address, uint16_t index, uint16_t andmask, uint16_t ormask)
 
void buildRequest01TCP (uint16_t transactionID, uint8_t unitID, uint16_t index, uint16_t count)
 
void buildRequest02TCP (uint16_t transactionID, uint8_t unitID, uint16_t index, uint16_t count)
 
void buildRequest03TCP (uint16_t transactionID, uint8_t unitID, uint16_t index, uint16_t count)
 
void buildRequest04TCP (uint16_t transactionID, uint8_t unitID, uint16_t index, uint16_t count)
 
void buildRequest05TCP (uint16_t transactionID, uint8_t unitID, uint16_t index, uint16_t count)
 
void buildRequest06TCP (uint16_t transactionID, uint8_t unitID, uint16_t index, uint16_t count)
 
void buildRequest15TCP (uint16_t transactionID, uint8_t unitID, uint16_t index, uint16_t count, const uint8_t *values)
 
void buildRequest16TCP (uint16_t transactionID, uint8_t unitID, uint16_t index, uint16_t count, const uint16_t *values)
 
void buildRequest22TCP (uint16_t transactionID, uint8_t unitID, uint16_t index, uint16_t andmask, uint16_t ormask)
 
const uint8_t * getRequest () const
 
uint16_t getRequestLength () const
 
void freeRequest ()
 
void setUserPointer (void *ptr)
 
void * getUserPointer () const
 

Protected Attributes

ModbusMaster m_master
 
bool m_ok = false
 

Detailed Description

Represents a Modbus master device.

Constructor & Destructor Documentation

◆ Master() [1/3]

llm::Master::Master ( ModbusDataCallback  dataCallback,
ModbusMasterExceptionCallback  exceptionCallback = nullptr,
ModbusAllocator  allocator = modbusDefaultAllocator,
ModbusMasterFunctionHandler functions = modbusMasterDefaultFunctions,
uint16_t  functionCount = modbusMasterDefaultFunctionCount 
)
inline
+ Here is the call graph for this function:

◆ ~Master()

llm::Master::~Master ( )
inline
+ Here is the call graph for this function:

◆ Master() [2/3]

llm::Master::Master ( const Master )
delete

◆ Master() [3/3]

llm::Master::Master ( Master &&  )
delete

Member Function Documentation

◆ buildRequest01PDU()

void llm::Master::buildRequest01PDU ( uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest01RTU()

void llm::Master::buildRequest01RTU ( uint8_t  address,
uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest01TCP()

void llm::Master::buildRequest01TCP ( uint16_t  transactionID,
uint8_t  unitID,
uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest02PDU()

void llm::Master::buildRequest02PDU ( uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest02RTU()

void llm::Master::buildRequest02RTU ( uint8_t  address,
uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest02TCP()

void llm::Master::buildRequest02TCP ( uint16_t  transactionID,
uint8_t  unitID,
uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest03PDU()

void llm::Master::buildRequest03PDU ( uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest03RTU()

void llm::Master::buildRequest03RTU ( uint8_t  address,
uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest03TCP()

void llm::Master::buildRequest03TCP ( uint16_t  transactionID,
uint8_t  unitID,
uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest04PDU()

void llm::Master::buildRequest04PDU ( uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest04RTU()

void llm::Master::buildRequest04RTU ( uint8_t  address,
uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest04TCP()

void llm::Master::buildRequest04TCP ( uint16_t  transactionID,
uint8_t  unitID,
uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest05PDU()

void llm::Master::buildRequest05PDU ( uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest05RTU()

void llm::Master::buildRequest05RTU ( uint8_t  address,
uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest05TCP()

void llm::Master::buildRequest05TCP ( uint16_t  transactionID,
uint8_t  unitID,
uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest06PDU()

void llm::Master::buildRequest06PDU ( uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest06RTU()

void llm::Master::buildRequest06RTU ( uint8_t  address,
uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest06TCP()

void llm::Master::buildRequest06TCP ( uint16_t  transactionID,
uint8_t  unitID,
uint16_t  index,
uint16_t  count 
)
inline

◆ buildRequest15PDU()

void llm::Master::buildRequest15PDU ( uint16_t  index,
uint16_t  count,
const uint8_t *  values 
)
inline

◆ buildRequest15RTU()

void llm::Master::buildRequest15RTU ( uint8_t  address,
uint16_t  index,
uint16_t  count,
const uint8_t *  values 
)
inline

◆ buildRequest15TCP()

void llm::Master::buildRequest15TCP ( uint16_t  transactionID,
uint8_t  unitID,
uint16_t  index,
uint16_t  count,
const uint8_t *  values 
)
inline

◆ buildRequest16PDU()

void llm::Master::buildRequest16PDU ( uint16_t  index,
uint16_t  count,
const uint16_t *  values 
)
inline

◆ buildRequest16RTU()

void llm::Master::buildRequest16RTU ( uint8_t  address,
uint16_t  index,
uint16_t  count,
const uint16_t *  values 
)
inline

◆ buildRequest16TCP()

void llm::Master::buildRequest16TCP ( uint16_t  transactionID,
uint8_t  unitID,
uint16_t  index,
uint16_t  count,
const uint16_t *  values 
)
inline

◆ buildRequest22PDU()

void llm::Master::buildRequest22PDU ( uint16_t  index,
uint16_t  andmask,
uint16_t  ormask 
)
inline

◆ buildRequest22RTU()

void llm::Master::buildRequest22RTU ( uint8_t  address,
uint16_t  index,
uint16_t  andmask,
uint16_t  ormask 
)
inline

◆ buildRequest22TCP()

void llm::Master::buildRequest22TCP ( uint16_t  transactionID,
uint8_t  unitID,
uint16_t  index,
uint16_t  andmask,
uint16_t  ormask 
)
inline

◆ freeRequest()

void llm::Master::freeRequest ( )
inline
+ Here is the call graph for this function:

◆ getRequest()

const uint8_t * llm::Master::getRequest ( ) const
inline
+ Here is the call graph for this function:

◆ getRequestLength()

uint16_t llm::Master::getRequestLength ( ) const
inline
+ Here is the call graph for this function:

◆ getUserPointer()

void * llm::Master::getUserPointer ( ) const
inline
+ Here is the call graph for this function:

◆ operator=() [1/2]

Master & llm::Master::operator= ( const Master )
delete

◆ operator=() [2/2]

Master & llm::Master::operator= ( Master &&  )
delete

◆ parseResponsePDU()

void llm::Master::parseResponsePDU ( uint8_t  address,
const uint8_t *  request,
uint8_t  requestLength,
const uint8_t *  response,
uint8_t  responseLength 
)
inline
+ Here is the call graph for this function:

◆ parseResponseRTU()

void llm::Master::parseResponseRTU ( const uint8_t *  request,
uint8_t  requestLength,
const uint8_t *  response,
uint8_t  responseLength 
)
inline
+ Here is the call graph for this function:

◆ parseResponseTCP()

void llm::Master::parseResponseTCP ( const uint8_t *  request,
uint8_t  requestLength,
const uint8_t *  response,
uint8_t  responseLength 
)
inline
+ Here is the call graph for this function:

◆ setUserPointer()

void llm::Master::setUserPointer ( void *  ptr)
inline
+ Here is the call graph for this function:

Field Documentation

◆ m_master

ModbusMaster llm::Master::m_master
protected

◆ m_ok

bool llm::Master::m_ok = false
protected

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