GaIA BIOS Library
Loading...
Searching...
No Matches
mb_data_handlers_t Struct Reference

This structure contains pointers to data handlers. More...

#include <modbus.h>

Data Fields

uint16_t(* InputRead )(uint16_t idx, uint16_t len, mb_pdu_t *resp_pdu)
 A pointer to a function that reads discrete inputs corresponding to the given index.
uint16_t(* CoilRead )(uint16_t idx, uint16_t len, mb_pdu_t *resp_pdu)
 A pointer to a function that reads coils corresponding to the given index.
uint16_t(* CoilWrite )(uint16_t idx, uint16_t len, uint8_t *val)
 A pointer to a function that writes a coil corresponding to the given address.
uint16_t(* InRegRead )(uint16_t idx, uint16_t len, mb_pdu_t *resp_pdu)
 A pointer to a function that reads input registers corresponding to the given address.
uint16_t(* HRegRead )(uint16_t idx, uint16_t len, mb_pdu_t *resp_pdu)
 A pointer to a function that reads a holding register corresponding to the given address.
uint16_t(* HRegWrite )(uint16_t idx, uint16_t len, uint8_t *val)
 A pointer to a function that writes a holding register corresponding to the given address.

Detailed Description

This structure contains pointers to data handlers.

Field Documentation

◆ CoilRead

uint16_t(* mb_data_handlers_t::CoilRead) (uint16_t idx, uint16_t len, mb_pdu_t *resp_pdu)

A pointer to a function that reads coils corresponding to the given index.

Parameters
[in]idxindex of the first coil to read.
[in]lennumber of coils to read.
[out]datadata that has been read.
Returns
0 if all was ok, a different value otherwise.

◆ CoilWrite

uint16_t(* mb_data_handlers_t::CoilWrite) (uint16_t idx, uint16_t len, uint8_t *val)

A pointer to a function that writes a coil corresponding to the given address.

Parameters
[in]idxindex of the first coil to write.
[in]lennumber of coils to write.
[in]valcoil values to write.
Returns
0 if all was ok, a different value otherwise.

◆ HRegRead

uint16_t(* mb_data_handlers_t::HRegRead) (uint16_t idx, uint16_t len, mb_pdu_t *resp_pdu)

A pointer to a function that reads a holding register corresponding to the given address.

Parameters
[in]idxindex of the first holding register to read.
[out]datavalue that has been read.
Returns
0 if all was ok, a different value otherwise.

◆ HRegWrite

uint16_t(* mb_data_handlers_t::HRegWrite) (uint16_t idx, uint16_t len, uint8_t *val)

A pointer to a function that writes a holding register corresponding to the given address.

Parameters
[in]idxindex of the first holding register to write.
[in]lennumber of register values to write.
[in]valregister values to write.
Returns
0 if all was ok, a different value otherwise.

◆ InputRead

uint16_t(* mb_data_handlers_t::InputRead) (uint16_t idx, uint16_t len, mb_pdu_t *resp_pdu)

A pointer to a function that reads discrete inputs corresponding to the given index.

Parameters
[in]idxindex of the first discrete input to read.
[in]lennumber of discrete inputs to read.
[out]datadata that has been read.
Returns
0 if all was ok, a different value otherwise.

◆ InRegRead

uint16_t(* mb_data_handlers_t::InRegRead) (uint16_t idx, uint16_t len, mb_pdu_t *resp_pdu)

A pointer to a function that reads input registers corresponding to the given address.

Parameters
[in]idxindex of the first input register to read.
[in]lennumber of input registers to read.
[out]datadata that has been read.
Returns
0 if all was ok, a different value otherwise.

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