GaIA BIOS Library
Loading...
Searching...
No Matches
modbus_tcp_master_platform.h File Reference

Modbus/TCP platform-dependent function prototypes. More...

#include <stdint.h>
#include <modbus_tcp/modbus_tcp.h>
#include <modbus_tcp/modbus_tcp_master.h>

Functions

mb_tcp_transaction_tmb_begin_transaction (mb_tcp_master_ch_t *ch)
 Opens a Modbus/TCP master transaction.
void mb_end_transaction (mb_tcp_master_ch_t *ch, mb_tcp_transaction_t *trans)
 Closes a Modbus/TCP master transaction.
uint16_t mb_generate_trans_id (struct mb_trans_info *trans_info)
 Generates a transaction id.

Detailed Description

Modbus/TCP platform-dependent function prototypes.

These functions normally have different implementations for a specific RTOS and TCP/IP library.

Author
Tecnologix, 2021

Function Documentation

◆ mb_begin_transaction()

mb_tcp_transaction_t * mb_begin_transaction ( mb_tcp_master_ch_t * ch)

Opens a Modbus/TCP master transaction.

Parameters
chthe Modbus/TCP master channel.
Returns
the opened transaction or NULL in case of error.

◆ mb_end_transaction()

void mb_end_transaction ( mb_tcp_master_ch_t * ch,
mb_tcp_transaction_t * trans )

Closes a Modbus/TCP master transaction.

Parameters
chthe Modbus/TCP master channel.
transthe opened transaction to be closed.

◆ mb_generate_trans_id()

uint16_t mb_generate_trans_id ( struct mb_trans_info * trans_info)

Generates a transaction id.

Parameters
trans_infoinfo structure normally used to store locks.
Returns
the newly generated transaction id.