liblightmodbus 3.0
A lightweight, header-only, hardware-agnostic Modbus RTU/TCP library
Loading...
Searching...
No Matches
slave_func.impl.h File Reference

Slave's functions for parsing requests (implementation) More...

#include "slave_func.h"
#include "slave.h"
+ Include dependency graph for slave_func.impl.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 ModbusErrorInfomodbusParseRequest01020304 (ModbusSlave *status, uint8_t function, const uint8_t *requestPDU, uint8_t requestLength)
 Handles requests 01, 02, 03 and 04 (Read Multiple XX) and generates response.
 
 ModbusErrorInfomodbusParseRequest0506 (ModbusSlave *status, uint8_t function, const uint8_t *requestPDU, uint8_t requestLength)
 Handles requests 05 and 06 (Write Single XX) and generates response.
 
 ModbusErrorInfomodbusParseRequest1516 (ModbusSlave *status, uint8_t function, const uint8_t *requestPDU, uint8_t requestLength)
 Handles requests 15 and 16 (Write Multiple XX) and generates response.
 
 ModbusErrorInfomodbusParseRequest22 (ModbusSlave *status, uint8_t function, const uint8_t *requestPDU, uint8_t requestLength)
 Handles request 22 (Mask Write Register) and generates response.
 

Detailed Description

Slave's functions for parsing requests (implementation)

Function Documentation

◆ ModbusErrorInfomodbusParseRequest01020304()

ModbusErrorInfomodbusParseRequest01020304 ( ModbusSlave * status,
uint8_t function,
const uint8_t * requestPDU,
uint8_t requestLength )

Handles requests 01, 02, 03 and 04 (Read Multiple XX) and generates response.

Parameters
functionfunction code
requestPDUpointer to the PDU section of the request
requestLengthlength of the PDU section in bytes
Returns
MODBUS_GENERAL_ERROR(ALLOC) on memory allocation error
MODBUS_GENERAL_ERROR(FUNCTION) if function is not 1, 2, 3 or 4
MODBUS_NO_ERROR() on success
+ Here is the call graph for this function:

◆ ModbusErrorInfomodbusParseRequest0506()

ModbusErrorInfomodbusParseRequest0506 ( ModbusSlave * status,
uint8_t function,
const uint8_t * requestPDU,
uint8_t requestLength )

Handles requests 05 and 06 (Write Single XX) and generates response.

Parameters
functionfunction code
requestPDUpointer to the PDU section of the request
requestLengthlength of the PDU section in bytes
Returns
MODBUS_GENERAL_ERROR(ALLOC) on memory allocation error
MODBUS_NO_ERROR() on success
+ Here is the call graph for this function:

◆ ModbusErrorInfomodbusParseRequest1516()

ModbusErrorInfomodbusParseRequest1516 ( ModbusSlave * status,
uint8_t function,
const uint8_t * requestPDU,
uint8_t requestLength )

Handles requests 15 and 16 (Write Multiple XX) and generates response.

Parameters
functionfunction code
requestPDUpointer to the PDU section of the request
requestLengthlength of the PDU section in bytes
Returns
MODBUS_GENERAL_ERROR(ALLOC) on memory allocation error
MODBUS_NO_ERROR() on success
+ Here is the call graph for this function:

◆ ModbusErrorInfomodbusParseRequest22()

ModbusErrorInfomodbusParseRequest22 ( ModbusSlave * status,
uint8_t function,
const uint8_t * requestPDU,
uint8_t requestLength )

Handles request 22 (Mask Write Register) and generates response.

Parameters
functionfunction code
requestPDUpointer to the PDU section of the request
requestLengthlength of the PDU section in bytes
Returns
MODBUS_GENERAL_ERROR(ALLOC) on memory allocation error
MODBUS_NO_ERROR() on success
+ Here is the call graph for this function: