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

Functions

static const agile_modbus_slave_util_map_tget_map_by_addr (const agile_modbus_slave_util_map_t *maps, int nb_maps, int address)
 Get the mapping object from the mapping object array according to the register address. More...
 
static int read_registers (agile_modbus_t *ctx, struct agile_modbus_slave_info *slave_info, const agile_modbus_slave_util_t *slave_util)
 read register More...
 
static int write_registers (agile_modbus_t *ctx, struct agile_modbus_slave_info *slave_info, const agile_modbus_slave_util_t *slave_util)
 write register More...
 
static int mask_write_register (agile_modbus_t *ctx, struct agile_modbus_slave_info *slave_info, const agile_modbus_slave_util_t *slave_util)
 mask write register More...
 
static int write_read_registers (agile_modbus_t *ctx, struct agile_modbus_slave_info *slave_info, const agile_modbus_slave_util_t *slave_util)
 Write and read registers. More...
 

Detailed Description

Function Documentation

◆ get_map_by_addr()

static const agile_modbus_slave_util_map_t* get_map_by_addr ( const agile_modbus_slave_util_map_t maps,
int  nb_maps,
int  address 
)
static

Get the mapping object from the mapping object array according to the register address.

Parameters
mapsmapping object array
nb_mapsnumber of arrays
addressregister address
Returns
!=NULL: mapping object; =NULL: failure

Definition at line 37 of file agile_modbus_slave_util.c.

Here is the caller graph for this function:

◆ read_registers()

static int read_registers ( agile_modbus_t ctx,
struct agile_modbus_slave_info slave_info,
const agile_modbus_slave_util_t slave_util 
)
static

read register

Parameters
ctxmodbus handle
slave_infoslave information body
slave_utilslave function structure
Returns
=0: normal; <0: Abnormal (-AGILE_MODBUS_EXCEPTION_UNKNOW(-255): Unknown exception, the slave will not package the response data) (Other negative exception codes: package exception response data from the opportunity)

Definition at line 58 of file agile_modbus_slave_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_registers()

static int write_registers ( agile_modbus_t ctx,
struct agile_modbus_slave_info slave_info,
const agile_modbus_slave_util_t slave_util 
)
static

write register

Parameters
ctxmodbus handle
slave_infoslave information body
slave_utilslave function structure
Returns
=0: normal; <0: Abnormal (-AGILE_MODBUS_EXCEPTION_UNKNOW(-255): Unknown exception, the slave will not package the response data) (Other negative exception codes: package exception response data from the opportunity)

Definition at line 141 of file agile_modbus_slave_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mask_write_register()

static int mask_write_register ( agile_modbus_t ctx,
struct agile_modbus_slave_info slave_info,
const agile_modbus_slave_util_t slave_util 
)
static

mask write register

Parameters
ctxmodbus handle
slave_infoslave information body
slave_utilslave function structure
Returns
=0: normal; <0: Abnormal (-AGILE_MODBUS_EXCEPTION_UNKNOW(-255): Unknown exception, the slave will not package the response data) (Other negative exception codes: package exception response data from the opportunity)

Definition at line 244 of file agile_modbus_slave_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_read_registers()

static int write_read_registers ( agile_modbus_t ctx,
struct agile_modbus_slave_info slave_info,
const agile_modbus_slave_util_t slave_util 
)
static

Write and read registers.

Parameters
ctxmodbus handle
slave_infoslave information body
slave_utilslave function structure
Returns
=0: normal; <0: Abnormal (-AGILE_MODBUS_EXCEPTION_UNKNOW(-255): Unknown exception, the slave will not package the response data) (Other negative exception codes: package exception response data from the opportunity)

Definition at line 291 of file agile_modbus_slave_util.c.

Here is the call graph for this function:
Here is the caller graph for this function: