Client
-
class Client : public std::enable_shared_from_this<Client>
service model for IEC60870-5-104 communication as client
Public Functions
-
~Client()
Close and destroy all connections of this connection handler.
-
void start()
start reconnect thread
-
void stop()
stop reconnect thread
-
bool isRunning()
test if client is currently active
- Returns:
information on active state of client
-
void setOriginatorAddress(std::uint_fast8_t address)
Sets the originator address of all client connections to the new value if not changed per connection.
- Parameters:
address – originator address of a client message
-
std::uint_fast8_t getOriginatorAddress() const
Getter for originatorAddress: who is the originator of a client message.
- Returns:
originator address of a client message
-
std::shared_ptr<Remote::Connection> addConnection(const std::string &ip, std::uint_fast16_t port = IEC_60870_5_104_DEFAULT_PORT, ConnectionInit init = INIT_ALL)
add a new remote server connection to this client and return the new connection object
- Parameters:
ip – remote terminal units ip address
port – remote terminal units port
init – communication initiation commands
- Throws:
std::invalid_argument – if ip or port invalid
- Returns:
owning pointer to new created Connection instance
-
std::shared_ptr<Remote::Connection> getConnectionFromCommonAddress(uint_fast16_t commonAddress)
Get Connection object for a certain commonAddress.
- Parameters:
commonAddress – common address that should be reached via remote connection
- Returns:
Connection
-
void reconnectAll()
reestablish lost connections
-
void disconnectAll()
close all connections to remote servers
- Returns:
information on operation success
-
void setOnNewStationCallback(py::object &callable)
set python callback that will be executed on incoming message from unknown station
- Throws:
std::invalid_argument – if callable signature does not match
-
void setOnNewPointCallback(py::object &callable)
set python callback that will be executed on incoming message from unknown point
- Throws:
std::invalid_argument – if callable signature does not match
-
~Client()