Agile Modbus  1.1.4
Lightweight modbus protocol stack.
TCP Private Functions
Collaboration diagram for TCP Private Functions:

Functions

static int agile_modbus_tcp_set_slave (agile_modbus_t *ctx, int slave)
 TCP set address interface. More...
 
static int agile_modbus_tcp_build_request_basis (agile_modbus_t *ctx, int function, int addr, int nb, uint8_t *req)
 TCP builds the basic request message interface (header message) More...
 
static int agile_modbus_tcp_build_response_basis (agile_modbus_sft_t *sft, uint8_t *rsp)
 TCP builds a basic response message interface (header message) More...
 
static int agile_modbus_tcp_prepare_response_tid (const uint8_t *req, int *req_length)
 TCP ready response interface. More...
 
static int agile_modbus_tcp_send_msg_pre (uint8_t *req, int req_length)
 TCP pre-send data interface (calculate the value of the length field and store it) More...
 
static int agile_modbus_tcp_check_integrity (agile_modbus_t *ctx, uint8_t *msg, const int msg_length)
 TCP check receiving data integrity interface. More...
 
static int agile_modbus_tcp_pre_check_confirmation (agile_modbus_t *ctx, const uint8_t *req, const uint8_t *rsp, int rsp_length)
 TCP pre-check confirmation interface (compare transaction identifier and protocol identifier) More...
 

Detailed Description

Function Documentation

◆ agile_modbus_tcp_set_slave()

static int agile_modbus_tcp_set_slave ( agile_modbus_t ctx,
int  slave 
)
static

TCP set address interface.

Parameters
ctxmodbus handle
slaveslave address
Returns
0: success

Definition at line 34 of file agile_modbus_tcp.c.

◆ agile_modbus_tcp_build_request_basis()

static int agile_modbus_tcp_build_request_basis ( agile_modbus_t ctx,
int  function,
int  addr,
int  nb,
uint8_t *  req 
)
static

TCP builds the basic request message interface (header message)

Parameters
ctxmodbus handle
functionfunction code
addrregister address
nbnumber of registers
reqdata storage pointer
Returns
data length

Definition at line 49 of file agile_modbus_tcp.c.

◆ agile_modbus_tcp_build_response_basis()

static int agile_modbus_tcp_build_response_basis ( agile_modbus_sft_t sft,
uint8_t *  rsp 
)
static

TCP builds a basic response message interface (header message)

Parameters
sftmodbus header parameter structure pointer
rspdata storage pointer
Returns
data length

Definition at line 86 of file agile_modbus_tcp.c.

◆ agile_modbus_tcp_prepare_response_tid()

static int agile_modbus_tcp_prepare_response_tid ( const uint8_t *  req,
int *  req_length 
)
static

TCP ready response interface.

Parameters
reqrequest data pointer
req_lengthrequest data length
Returns
transaction identifier

Definition at line 114 of file agile_modbus_tcp.c.

◆ agile_modbus_tcp_send_msg_pre()

static int agile_modbus_tcp_send_msg_pre ( uint8_t *  req,
int  req_length 
)
static

TCP pre-send data interface (calculate the value of the length field and store it)

Parameters
reqdata storage pointer
req_lengthexisting data length
Returns
data length

Definition at line 126 of file agile_modbus_tcp.c.

◆ agile_modbus_tcp_check_integrity()

static int agile_modbus_tcp_check_integrity ( agile_modbus_t ctx,
uint8_t *  msg,
const int  msg_length 
)
static

TCP check receiving data integrity interface.

Parameters
ctxmodbus handle
msgReceive data pointer
msg_lengthvalid data length
Returns
valid data length

Definition at line 144 of file agile_modbus_tcp.c.

◆ agile_modbus_tcp_pre_check_confirmation()

static int agile_modbus_tcp_pre_check_confirmation ( agile_modbus_t ctx,
const uint8_t *  req,
const uint8_t *  rsp,
int  rsp_length 
)
static

TCP pre-check confirmation interface (compare transaction identifier and protocol identifier)

Parameters
ctxmodbus handle
reqrequest data pointer
rspresponse data pointer
rsp_lengthresponse data length
Returns
0: success; others: exception

Definition at line 159 of file agile_modbus_tcp.c.