rodbus (C++ API) 1.3.1
Loading...
Searching...
No Matches
rodbus::Database Class Reference

Class used to add, remove, update, and retrieve values. More...

#include <rodbus.hpp>

Public Member Functions

 Database (Database &&other) noexcept
 Transfer ownership of the underlying C-type to this instance and invalidate the other instance. More...
 
bool add_coil (uint16_t index, bool value)
 Add a new coil to the database. More...
 
bool add_discrete_input (uint16_t index, bool value)
 Add a new discrete input to the database. More...
 
bool add_holding_register (uint16_t index, uint16_t value)
 Add a new holding register to the database. More...
 
bool add_input_register (uint16_t index, uint16_t value)
 Add a new input register to the database. More...
 
bool get_coil (uint16_t index)
 Get the current coil value of the database. More...
 
bool get_discrete_input (uint16_t index)
 Get the current discrete input value of the database. More...
 
uint16_t get_holding_register (uint16_t index)
 Get the current holding register value of the database. More...
 
uint16_t get_input_register (uint16_t index)
 Get the current input register value of the database. More...
 
bool update_coil (uint16_t index, bool value)
 Update the current value of a coil in the database. More...
 
bool update_discrete_input (uint16_t index, bool value)
 Update the current value of a discrete input in the database. More...
 
bool update_holding_register (uint16_t index, uint16_t value)
 Update the current value of a holding register in the database. More...
 
bool update_input_register (uint16_t index, uint16_t value)
 Update the current value of a input register in the database. More...
 
bool delete_coil (uint16_t index)
 Remove a coil address from the database. More...
 
bool delete_discrete_input (uint16_t index)
 Remove a discrete input address from the database. More...
 
bool delete_holding_register (uint16_t index)
 Remove a holding register address from the database. More...
 
bool delete_input_register (uint16_t index)
 Remove a input register address from the database. More...
 

Friends

class CppDatabaseFriend
 

Detailed Description

Class used to add, remove, update, and retrieve values.

Constructor & Destructor Documentation

◆ 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
otherClass from which ownership will be transfer to this instance

Member Function Documentation

◆ add_coil()

bool rodbus::Database::add_coil ( uint16_t  index,
bool  value 
)

Add a new coil to the database.

Parameters
indexAddress of the coil
valueInitial 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
indexAddress of the discrete input
valueInitial 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
indexAddress of the holding register
valueInitial 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
indexAddress of the input register
valueInitial 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
indexAddress of the coil
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
indexAddress 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
indexAddress 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
indexAddress 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
indexAddress of the coil
Returns
Current value of the point
Exceptions
ParamException

◆ get_discrete_input()

bool rodbus::Database::get_discrete_input ( uint16_t  index)

Get the current discrete input value of the database.

Parameters
indexAddress of the discrete input
Returns
Current value of the point
Exceptions
ParamException

◆ get_holding_register()

uint16_t rodbus::Database::get_holding_register ( uint16_t  index)

Get the current holding register value of the database.

Parameters
indexAddress of the holding register
Returns
Current value of the point
Exceptions
ParamException

◆ get_input_register()

uint16_t rodbus::Database::get_input_register ( uint16_t  index)

Get the current input register value of the database.

Parameters
indexAddress of the input register
Returns
Current value of the point
Exceptions
ParamException

◆ update_coil()

bool rodbus::Database::update_coil ( uint16_t  index,
bool  value 
)

Update the current value of a coil in the database.

Parameters
indexAddress of the coil
valueNew 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
indexAddress of the discrete input
valueNew 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
indexAddress of the holding register
valueNew 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
indexAddress of the input register
valueNew 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: