![]() |
GaIA BIOS Library
|
Modbus/TCP slave common utility functions. More...
Functions | |
| bool | mb_is_secure_addr (mb_tcp_config_t *conf, const ip_addr_t *ip_addr) |
| Checks if an address is marked as secure. | |
| mb_tcp_connection_t * | mb_get_connection_by_socket (mb_tcp_config_t *conf, uintptr_t socket) |
| Returns the connection corresponding to the given socket. | |
| mb_tcp_connection_t * | mb_get_new_connection (mb_tcp_config_t *conf, ip_addr_t *ip_addr) |
| Returns a new connection with the given IP address. | |
| void | mb_release_connection_slot (mb_tcp_config_t *conf, uintptr_t socket) |
| Releases a connection slot. | |
| int | mb_prepare_transaction (mb_tcp_config_t *config, mb_tcp_transaction_t *trans, uintptr_t socket, const uint8_t *buf, uint32_t len) |
| Validates the received Modus/TCP ADU and starts a transaction. | |
Modbus/TCP slave common utility functions.
| mb_tcp_connection_t * mb_get_connection_by_socket | ( | mb_tcp_config_t * | conf, |
| uintptr_t | socket ) |
Returns the connection corresponding to the given socket.
| conf | the slave configuration. |
| socket | socket to search for. |
| mb_tcp_connection_t * mb_get_new_connection | ( | mb_tcp_config_t * | conf, |
| ip_addr_t * | ip_addr ) |
Returns a new connection with the given IP address.
| conf | the slave configuration. |
| ip_addr | remote IP address. |
| bool mb_is_secure_addr | ( | mb_tcp_config_t * | conf, |
| const ip_addr_t * | ip_addr ) |
Checks if an address is marked as secure.
If no secure address was specified, every address is secure.
| conf | Modbus/TCP slave configuration. |
| ip_addr | IP address to be checked. |
| int mb_prepare_transaction | ( | mb_tcp_config_t * | config, |
| mb_tcp_transaction_t * | trans, | ||
| uintptr_t | socket, | ||
| const uint8_t * | buf, | ||
| uint32_t | len ) |
Validates the received Modus/TCP ADU and starts a transaction.
| config | the slave configuration. |
| trans | the transaction to be used. |
| socket | the socket on which the data has been received. |
| buf | the data received. |
| len | number of bytes received. |
| void mb_release_connection_slot | ( | mb_tcp_config_t * | conf, |
| uintptr_t | socket ) |
Releases a connection slot.
| conf | the slave configuration. |
| socket | the socket corresponding to the connection to be released. |