Class used to add, remove, update, and retrieve values.
More...
#include <rodbus.hpp>
Class used to add, remove, update, and retrieve values.
◆ Database()
rodbus::Database::Database |
( |
Database && |
other | ) |
|
|
inlinenoexcept |
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
- Note
- the moved class will now throw an exception if any method is called
- Parameters
-
other | Class from which ownership will be transfer to this instance |
◆ add_coil()
bool rodbus::Database::add_coil |
( |
uint16_t |
index, |
|
|
bool |
value |
|
) |
| |
Add a new coil to the database.
- Parameters
-
index | Address of the coil |
value | Initial value of the coil |
- Returns
- true if the value is new, false otherwise
◆ add_discrete_input()
bool rodbus::Database::add_discrete_input |
( |
uint16_t |
index, |
|
|
bool |
value |
|
) |
| |
Add a new discrete input to the database.
- Parameters
-
index | Address of the discrete input |
value | Initial value of the discrete input |
- Returns
- true if the value is new, false otherwise
◆ add_holding_register()
bool rodbus::Database::add_holding_register |
( |
uint16_t |
index, |
|
|
uint16_t |
value |
|
) |
| |
Add a new holding register to the database.
- Parameters
-
index | Address of the holding register |
value | Initial value of the holding register |
- Returns
- true if the value is new, false otherwise
◆ add_input_register()
bool rodbus::Database::add_input_register |
( |
uint16_t |
index, |
|
|
uint16_t |
value |
|
) |
| |
Add a new input register to the database.
- Parameters
-
index | Address of the input register |
value | Initial value of the input register |
- Returns
- true if the value is new, false otherwise
◆ delete_coil()
bool rodbus::Database::delete_coil |
( |
uint16_t |
index | ) |
|
Remove a coil address from the database.
- Parameters
-
- Returns
- true if the value is new, false otherwise
◆ delete_discrete_input()
bool rodbus::Database::delete_discrete_input |
( |
uint16_t |
index | ) |
|
Remove a discrete input address from the database.
- Parameters
-
index | Address of the discrete input |
- Returns
- true if the value is new, false otherwise
◆ delete_holding_register()
bool rodbus::Database::delete_holding_register |
( |
uint16_t |
index | ) |
|
Remove a holding register address from the database.
- Parameters
-
index | Address of the holding register |
- Returns
- true if the value is new, false otherwise
◆ delete_input_register()
bool rodbus::Database::delete_input_register |
( |
uint16_t |
index | ) |
|
Remove a input register address from the database.
- Parameters
-
index | Address of the input register |
- Returns
- true if the value is new, false otherwise
◆ get_coil()
bool rodbus::Database::get_coil |
( |
uint16_t |
index | ) |
|
Get the current coil value of the database.
- Parameters
-
- Returns
- Current value of the point
- Exceptions
-
◆ get_discrete_input()
bool rodbus::Database::get_discrete_input |
( |
uint16_t |
index | ) |
|
Get the current discrete input value of the database.
- Parameters
-
index | Address of the discrete input |
- Returns
- Current value of the point
- Exceptions
-
◆ get_holding_register()
uint16_t rodbus::Database::get_holding_register |
( |
uint16_t |
index | ) |
|
Get the current holding register value of the database.
- Parameters
-
index | Address of the holding register |
- Returns
- Current value of the point
- Exceptions
-
◆ get_input_register()
uint16_t rodbus::Database::get_input_register |
( |
uint16_t |
index | ) |
|
Get the current input register value of the database.
- Parameters
-
index | Address of the input register |
- Returns
- Current value of the point
- Exceptions
-
◆ update_coil()
bool rodbus::Database::update_coil |
( |
uint16_t |
index, |
|
|
bool |
value |
|
) |
| |
Update the current value of a coil in the database.
- Parameters
-
index | Address of the coil |
value | New value of the coil |
- Returns
- true if the address is defined, false otherwise
◆ update_discrete_input()
bool rodbus::Database::update_discrete_input |
( |
uint16_t |
index, |
|
|
bool |
value |
|
) |
| |
Update the current value of a discrete input in the database.
- Parameters
-
index | Address of the discrete input |
value | New value of the discrete input |
- Returns
- true if the address is defined, false otherwise
◆ update_holding_register()
bool rodbus::Database::update_holding_register |
( |
uint16_t |
index, |
|
|
uint16_t |
value |
|
) |
| |
Update the current value of a holding register in the database.
- Parameters
-
index | Address of the holding register |
value | New value of the holding register |
- Returns
- true if the address is defined, false otherwise
◆ update_input_register()
bool rodbus::Database::update_input_register |
( |
uint16_t |
index, |
|
|
uint16_t |
value |
|
) |
| |
Update the current value of a input register in the database.
- Parameters
-
index | Address of the input register |
value | New value of the input register |
- Returns
- true if the address is defined, false otherwise
The documentation for this class was generated from the following file: