QOpcUaErrorState Class

QOpcUaErrorState allows investigation and interaction with error state from backends. 更多...

头: #include <QOpcUaErrorState>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua
Since: QtOpcUa 5.13

公共类型

enum class ConnectionStep { Unknown, CertificateValidation, OpenSecureChannel, CreateSession, ActivateSession }

公共函数

QOpcUaErrorState ()
QOpcUaErrorState (const QOpcUaErrorState & other )
QOpcUaErrorState::ConnectionStep connectionStep () const
QOpcUa::UaStatusCode errorCode () const
bool ignoreError () const
bool isClientSideError () const
void setClientSideError (bool clientSideError )
void setConnectionStep (QOpcUaErrorState::ConnectionStep step )
void setErrorCode (QOpcUa::UaStatusCode error )
void setIgnoreError (bool ignore = true)
QOpcUaErrorState & operator= (const QOpcUaErrorState & rhs )

详细描述

There is not need to instantiate this class in your code. A client will emit an error state via QOpcUaClient::connectError in case an error has happened while establishing a connection.

The error can be caused by the backend itself or by the server rejecting the connection. If case of errors issued by the local backend, they can be ignored by calling the function setIgnoreError ().

成员类型文档编制

enum class QOpcUaErrorState:: ConnectionStep

Specifies at which step during the connection establishment the error occurred.

常量 描述
QOpcUaErrorState::ConnectionStep::Unknown 0x00 The connection step is unknown.
QOpcUaErrorState::ConnectionStep::CertificateValidation 0x1 Error happened in the certificate validation step.
QOpcUaErrorState::ConnectionStep::OpenSecureChannel 0x2 Error happened when opening the secure channel.
QOpcUaErrorState::ConnectionStep::CreateSession 0x3 Error happened when creating the session.
QOpcUaErrorState::ConnectionStep::ActivateSession 0x4 Error happened during session acivation.

成员函数文档编制

QOpcUaErrorState:: QOpcUaErrorState ()

Default constructs an error state with no parameters set.

QOpcUaErrorState:: QOpcUaErrorState (const QOpcUaErrorState & other )

Constructs an error state from other .

QOpcUaErrorState::ConnectionStep QOpcUaErrorState:: connectionStep () const

Returns the connection step in which the error occurred.

另请参阅 setConnectionStep ().

QOpcUa::UaStatusCode QOpcUaErrorState:: errorCode () const

Returns the OPC UA status code of the error occurred.

另请参阅 setErrorCode ().

bool QOpcUaErrorState:: ignoreError () const

Returns if this client side error should be ignored.

另请参阅 setIgnoreError ().

bool QOpcUaErrorState:: isClientSideError () const

Returns if the occurred error is a client side error.

void QOpcUaErrorState:: setClientSideError ( bool clientSideError )

Sets if the occurred error is a client side error to clientSideError .

另请参阅 isClientSideError ().

void QOpcUaErrorState:: setConnectionStep ( QOpcUaErrorState::ConnectionStep step )

Sets the connection step in which the error occurred to step .

另请参阅 connectionStep ().

void QOpcUaErrorState:: setErrorCode ( QOpcUa::UaStatusCode error )

Sets the OPC UA status code of the error occurred to error .

另请参阅 errorCode ().

void QOpcUaErrorState:: setIgnoreError ( bool ignore = true)

Sets if this client side error should be ignored to ignore .

Setting this flag does only work if the error is actually a client side error.

另请参阅 ignoreError ().

QOpcUaErrorState &QOpcUaErrorState:: operator= (const QOpcUaErrorState & rhs )

Sets the values of rhs in this error state.