Station
-
class Station : public std::enable_shared_from_this<Station>
Public Functions
-
~Station()
Remove station and cleanup all related DataPoints.
-
std::uint_fast16_t getCommonAddress() const
getter for commonAddress
- Returns:
unique common address of this station
-
std::shared_ptr<Server> getServer()
getter for server
- Returns:
shared pointer to the owning server instance, optional
-
std::shared_ptr<Remote::Connection> getConnection()
getter for connection
- Returns:
shared pointer to the owning connection instance, optional
-
bool hasPoints() const
Test if DataPoints exists at this NetworkStation.
- Returns:
information on availability of child DataPoint objects
-
DataPointVector getPoints() const
Get a list of all DataPoints.
- Returns:
vector with object pointer
-
std::shared_ptr<DataPoint> getPoint(std::uint_fast32_t informationObjectAddress)
Get a DataPoint that exists at this NetworkStation and is identified via information object address.
- Returns:
Pointer to DataPoint or nullptr
-
std::shared_ptr<DataPoint> addPoint(std::uint_fast32_t informationObjectAddress, IEC60870_5_TypeID type, std::uint_fast16_t reportInterval_ms = 0, std::optional<std::uint_fast32_t> relatedInformationObjectAddress = std::nullopt, bool relatedInformationObjectAutoReturn = false, CommandTransmissionMode commandMode = DIRECT_COMMAND)
Add a DataPoint to this Station.
- Parameters:
informationObjectAddress – information object address
type – iec60870-5-104 information type
reportInterval_ms – auto reporting interval
relatedInformationObjectAddress – related information object address, if any
relatedInformationObjectAutoReturn – auto transmit related point on command
commandMode – command transmission mode (direct or select-and-execute)
- Throws:
std::invalid_argument – if type is invalid
-
bool removePoint(std::uint_fast32_t informationObjectAddress)
Removes an existing DataPoint from this Station.
- Parameters:
informationObjectAddress – The address of the information object to be removed.
- Returns:
True if the DataPoint was successfully found and removed, otherwise false.
-
bool isLocal()
test if this station belongs to a server instance and not a connection (client)
- Returns:
if it has a server
-
void sendEndOfInitialization(CS101_CauseOfInitialization cause)
Sends the end of initialization signal with the specified cause.
- Parameters:
cause – The reason for the initialization end, as defined in CS101_CauseOfInitialization.
- Throws:
std::runtime_error – if the station is not a server.
-
void detach()
Remove reference to station, do not call this method, this is called by Station::removePoint.
Public Static Functions
Creates a new Station instance with the specified parameters.
This static method creates a Station object with the provided common address and optional server or remote connection references. The constructor is private, so this method must be used to instantiate a Station.
- Parameters:
st_commonAddress – The unique common address of the station.
st_server – A shared pointer to the owning server, if applicable. Default is nullptr.
st_connection – A shared pointer to the remote connection, if applicable. Default is nullptr.
- Returns:
A shared pointer to the newly created Station instance.
-
~Station()